@Override public STypeIR caseACharBasicType(ACharBasicType node, IRInfo question) throws AnalysisException { return new ACharBasicTypeIR(); }
@Override public void caseACharPatternIR(ACharPatternIR node, STypeIR question) throws AnalysisException { storeType(node, new ACharBasicTypeIR()); }
/** * Returns a deep clone of this {@link ACharBasicTypeIR} node. * @return a deep clone of this {@link ACharBasicTypeIR} node */ public ACharBasicTypeIR clone() { return new ACharBasicTypeIR( _sourceNode, _tag, _metaData, _optional, cloneNode(_namedInvType) ); }
/** * Creates a deep clone of this {@link ACharBasicTypeIR} 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 ACharBasicTypeIR} node */ public ACharBasicTypeIR clone(Map<INode,INode> oldToNewMap) { ACharBasicTypeIR node = new ACharBasicTypeIR( _sourceNode, _tag, _metaData, _optional, cloneNode(_namedInvType, oldToNewMap) ); 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; }
public String formatElementType(STypeIR type) throws AnalysisException { if (type instanceof SSetTypeIR) { SSetTypeIR setType = (SSetTypeIR) type; return format(setType.getSetOf()); } else if (type instanceof SSeqTypeIR) { SSeqTypeIR seqType = (SSeqTypeIR) type; return format(seqType.getSeqOf()); } else if (type instanceof AStringTypeIR) { return format(new ACharBasicTypeIR()); } else { String vdmNodeInfo = info.getLocationAssistant().consVdmNodeInfoStr(type); log.error("Expected set, seq or string type when trying to format element type. Got: " + type + ". " + vdmNodeInfo); return format(new AUnknownTypeIR()); } }
@Override public void caseAForAllStmIR(AForAllStmIR node) throws AnalysisException { if (node.getExp().getType() instanceof AStringTypeIR) { ASeqSeqTypeIR seqType = new ASeqSeqTypeIR(); seqType.setEmpty(false); seqType.setSeq1(false); seqType.setOptional(false); seqType.setSeqOf(new ACharBasicTypeIR()); correctExpToSeq(node.getExp(), seqType); } node.getBody().apply(this); }
} else if (pat instanceof ACharPatternIR) return new ACharBasicTypeIR(); } else if (pat instanceof AIntPatternIR) seqType.setSeqOf(new ACharBasicTypeIR());
seqTypeCg.setSeqOf(new ACharBasicTypeIR()); strType = seqTypeCg;
seqType.setSeqOf(new ACharBasicTypeIR());