/** * 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 ); }
/** * 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; }
public ACharLiteralExpIR consCharLiteral(char value) { ACharLiteralExpIR charLiteral = new ACharLiteralExpIR(); charLiteral.setType(new ACharBasicTypeIR()); charLiteral.setValue(value); return charLiteral; }
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; }
@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; }