@Override public STypeIR caseACharBasicType(ACharBasicType node, IRInfo question) throws AnalysisException { return new ACharBasicTypeIR(); }
/** * Called by the {@link ACharBasicTypeIR} node from {@link ACharBasicTypeIR#apply(IAnalysis)}. * @param node the calling {@link ACharBasicTypeIR} node */ public void caseACharBasicTypeIR(ACharBasicTypeIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inACharBasicTypeIR(node, question); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { node.getNamedInvType().apply(this, question); } outACharBasicTypeIR(node, question); }
/** * 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) ); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof ACharBasicTypeIR) { return toString().equals(o.toString()); } return false; }
@Override public void caseACharPatternIR(ACharPatternIR node, STypeIR question) throws AnalysisException { storeType(node, new ACharBasicTypeIR()); }
/** * 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; }
/** * Called by the {@link ACharBasicTypeIR} node from {@link ACharBasicTypeIR#apply(IIsaAnalysis)}. * @param node the calling {@link ACharBasicTypeIR} node */ public void caseACharBasicTypeIR(ACharBasicTypeIR node) throws AnalysisException { _visitedNodes.add(node); inACharBasicTypeIR(node); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { node.getNamedInvType().apply(this); } outACharBasicTypeIR(node); }
public ACharLiteralExpIR consCharLiteral(char value) { ACharLiteralExpIR charLiteral = new ACharLiteralExpIR(); charLiteral.setType(new ACharBasicTypeIR()); charLiteral.setValue(value); return charLiteral; }
/** * Called by the {@link ACharBasicTypeIR} node from {@link ACharBasicTypeIR#apply(IAnalysis)}. * @param node the calling {@link ACharBasicTypeIR} node */ public void caseACharBasicTypeIR(ACharBasicTypeIR node) throws AnalysisException { _visitedNodes.add(node); inACharBasicTypeIR(node); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { node.getNamedInvType().apply(this); } outACharBasicTypeIR(node); }
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 ACharBasicTypeIR} node from {@link ACharBasicTypeIR#apply(IAnalysis)}. * @param node the calling {@link ACharBasicTypeIR} node */ public A caseACharBasicTypeIR(ACharBasicTypeIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inACharBasicTypeIR(node)); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { mergeReturns(retVal,node.getNamedInvType().apply(this)); } mergeReturns(retVal,outACharBasicTypeIR(node)); return retVal; }
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()); } }
/** * Called by the {@link ACharBasicTypeIR} node from {@link ACharBasicTypeIR#apply(IAnalysis)}. * @param node the calling {@link ACharBasicTypeIR} node */ public A caseACharBasicTypeIR(ACharBasicTypeIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inACharBasicTypeIR(node, question)); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { mergeReturns(retVal,node.getNamedInvType().apply(this, question)); } mergeReturns(retVal,outACharBasicTypeIR(node, question)); return retVal; }
@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());