/** * 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_); }
/** * 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_); }
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; }