@Override public PType caseACharLiteralExp(ACharLiteralExp node, TypeCheckInfo question) { node.setType(AstFactory.newACharBasicType(node.getLocation())); return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }
public static ACharLiteralExp newACharLiteralExp(LexCharacterToken value) { ACharLiteralExp result = new ACharLiteralExp(); initExpression(result, value.location); result.setValue(value); return result; }
/** * Returns a deep clone of this {@link ACharLiteralExp} node. * @return a deep clone of this {@link ACharLiteralExp} node */ public ACharLiteralExp clone() { return new ACharLiteralExp( _type, _location, cloneNode(_value) ); }
/** * Called by the {@link ACharLiteralExp} node from {@link ACharLiteralExp#apply(IPOFAnalysis)}. * @param node the calling {@link ACharLiteralExp} node */ public void caseACharLiteralExp(ACharLiteralExp node) throws AnalysisException { _visitedNodes.add(node); inACharLiteralExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getValue() != null ) { node.getValue().apply(this); } outACharLiteralExp(node); }
@Override public Value caseACharLiteralExp(ACharLiteralExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); return new CharacterValue(node.getValue().getValue()); }
/** * Creates a new complete constructor {@code ACharLiteralExp} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param value_ the {@link ILexCharacterToken} node for the {@code value} child of this {@link ACharLiteralExp} node */ public ACharLiteralExp(PType type_, ILexLocation location_, ILexCharacterToken value_) { super(type_,location_); this.setValue(value_); }
/** * Called by the {@link ACharLiteralExp} node from {@link ACharLiteralExp#apply(IAnalysis)}. * @param node the calling {@link ACharLiteralExp} node */ public void caseACharLiteralExp(ACharLiteralExp node) throws AnalysisException { _visitedNodes.add(node); inACharLiteralExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getValue() != null ) { node.getValue().apply(this); } outACharLiteralExp(node); }
/** * Creates a new tree field only constructor {@code ACharLiteralExp TAG=charLiteral} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param value_ the {@link ILexCharacterToken} node for the {@code value} child of this {@link ACharLiteralExp} node */ public ACharLiteralExp(ILexLocation location_, ILexCharacterToken value_) { super(null,location_); this.setValue(value_); }
/** * Called by the {@link ACharLiteralExp} node from {@link ACharLiteralExp#apply(IAnalysis)}. * @param node the calling {@link ACharLiteralExp} node */ public void caseACharLiteralExp(ACharLiteralExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inACharLiteralExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getValue() != null ) { node.getValue().apply(this, question); } outACharLiteralExp(node, question); }
public PExp caseACharacterPattern(ACharacterPattern node) throws AnalysisException { ACharLiteralExp ch = new ACharLiteralExp(); ch.setValue(node.getValue().clone()); addPossibleType(ch, node); return ch; }
/** * Creates a deep clone of this {@link ACharLiteralExp} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link ACharLiteralExp} node */ public ACharLiteralExp clone(Map<INode,INode> oldToNewMap) { ACharLiteralExp node = new ACharLiteralExp( _type, _location, cloneNode(_value, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ACharLiteralExp} node from {@link ACharLiteralExp#apply(IAnalysis)}. * @param node the calling {@link ACharLiteralExp} node */ public A caseACharLiteralExp(ACharLiteralExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inACharLiteralExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getValue() != null ) { mergeReturns(retVal,node.getValue().apply(this)); } mergeReturns(retVal,outACharLiteralExp(node)); return retVal; }
/** * Called by the {@link ACharLiteralExp} node from {@link ACharLiteralExp#apply(IAnalysis)}. * @param node the calling {@link ACharLiteralExp} node */ public A caseACharLiteralExp(ACharLiteralExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inACharLiteralExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getValue() != null ) { mergeReturns(retVal,node.getValue().apply(this, question)); } mergeReturns(retVal,outACharLiteralExp(node, question)); return retVal; }
@Override public SExpIR caseACharLiteralExp(ACharLiteralExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); char value = node.getValue().getValue(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); ACharLiteralExpIR charLitCg = new ACharLiteralExpIR(); charLitCg.setType(typeCg); charLitCg.setValue(value); return charLitCg; }