public ACharLiteralExpIR consCharLiteral(char value) { ACharLiteralExpIR charLiteral = new ACharLiteralExpIR(); charLiteral.setType(new ACharBasicTypeIR()); charLiteral.setValue(value); return charLiteral; }
/** * Returns a deep clone of this {@link ACharLiteralExpIR} node. * @return a deep clone of this {@link ACharLiteralExpIR} node */ public ACharLiteralExpIR clone() { return new ACharLiteralExpIR( _sourceNode, _tag, _metaData, cloneNode(_type), _value ); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof ACharLiteralExpIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link ACharLiteralExpIR} node from {@link ACharLiteralExpIR#apply(IAnalysis)}. * @param node the calling {@link ACharLiteralExpIR} node */ public void caseACharLiteralExpIR(ACharLiteralExpIR node) throws AnalysisException { _visitedNodes.add(node); inACharLiteralExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outACharLiteralExpIR(node); }
/** * Creates a new tree field only constructor {@code ACharLiteralExpIR TAG=char} 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 Character} node for the {@code value} child of this {@link ACharLiteralExpIR} node */ public ACharLiteralExpIR(STypeIR type_, Character value_) { super(null,null,null,type_); this.setValue(value_); }
/** * Called by the {@link ACharLiteralExpIR} node from {@link ACharLiteralExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link ACharLiteralExpIR} node */ public void caseACharLiteralExpIR(ACharLiteralExpIR node) throws AnalysisException { _visitedNodes.add(node); inACharLiteralExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outACharLiteralExpIR(node); }
/** * Creates a new complete constructor {@code ACharLiteralExpIR} 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 Character} node for the {@code value} child of this {@link ACharLiteralExpIR} node */ public ACharLiteralExpIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, STypeIR type_, Character value_) { super(sourceNode_,tag_,metaData_,type_); this.setValue(value_); }
public SExpIR consCharSequence(STypeIR seqType, String value) { AEnumSeqExpIR enumSeq = new AEnumSeqExpIR(); enumSeq.setType(seqType); for (int i = 0; i < value.length(); i++) { char currentChar = value.charAt(i); ACharLiteralExpIR charLit = new ACharLiteralExpIR(); charLit.setType(new ACharBasicTypeIR()); charLit.setValue(currentChar); enumSeq.getMembers().add(charLit); } return enumSeq; }
/** * Called by the {@link ACharLiteralExpIR} node from {@link ACharLiteralExpIR#apply(IAnalysis)}. * @param node the calling {@link ACharLiteralExpIR} node */ public void caseACharLiteralExpIR(ACharLiteralExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inACharLiteralExpIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } outACharLiteralExpIR(node, question); }
/** * Creates a deep clone of this {@link ACharLiteralExpIR} 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 ACharLiteralExpIR} node */ public ACharLiteralExpIR clone(Map<INode,INode> oldToNewMap) { ACharLiteralExpIR node = new ACharLiteralExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), _value ); oldToNewMap.put(this, node); return node; }
@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; }
/** * Called by the {@link ACharLiteralExpIR} node from {@link ACharLiteralExpIR#apply(IAnalysis)}. * @param node the calling {@link ACharLiteralExpIR} node */ public A caseACharLiteralExpIR(ACharLiteralExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inACharLiteralExpIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } mergeReturns(retVal,outACharLiteralExpIR(node)); return retVal; }
/** * Called by the {@link ACharLiteralExpIR} node from {@link ACharLiteralExpIR#apply(IAnalysis)}. * @param node the calling {@link ACharLiteralExpIR} node */ public A caseACharLiteralExpIR(ACharLiteralExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inACharLiteralExpIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } mergeReturns(retVal,outACharLiteralExpIR(node, question)); return retVal; }