/** * Called by the {@link AExternalClause} node from {@link AExternalClause#apply(IAnalysis)}. * @param node the calling {@link AExternalClause} node */ public void caseAExternalClause(AExternalClause node, Q question) throws AnalysisException { _visitedNodes.add(node); inAExternalClause(node, question); if(node.getMode() != null ) { node.getMode().apply(this, question); } { List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getIdentifiers()); for( ILexNameToken e : copy) { e.apply(this, question); } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } outAExternalClause(node, question); }
if (token.is(VDMToken.IS)) checkFor(VDMToken.YET, 2125, "Expecting 'is not yet specified'"); checkFor(VDMToken.SPECIFIED, 2126, "Expecting 'is not yet specified'"); return AstFactory.newANotYetSpecifiedExp(token.getLocation()); return AstFactory.newASubclassResponsibilityExp(token.getLocation());
/** * Sets the {@code _op} child of this {@link SBinaryExpBase} node. * @param value the new {@code _op} child of this {@link SBinaryExpBase} node */ public void setOp(ILexToken value) { if (this._op != null) { this._op.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._op = value; }
private AForAllExp getChangedVarsExp(AExplicitFunctionDefinition postDef, SOperationDefinitionBase calledOp) { AForAllExp r = new AForAllExp(); List<PMultipleBind> binds = new LinkedList<PMultipleBind>(); if (calledOp instanceof AExplicitOperationDefinition) { refreshAllState(calledOp, binds); } if (calledOp instanceof AImplicitOperationDefinition) { AImplicitOperationDefinition implicitOp = (AImplicitOperationDefinition) calledOp; if (implicitOp.getExternals().size() > 0) { for (AExternalClause external : implicitOp.getExternals()) { if (external.getMode().getType().equals(VDMToken.WRITE)) { binds.addAll(introduceFreshVars(external.getIdentifiers(), getStateVars(calledOp))); } } } else { refreshAllState(calledOp, binds); } } r.setBindList(binds); return r; }
/** * Raise a {@link ParserException} at the location of the token passed in. * * @param number * The error number. * @param message * The error message. * @param token * The location of the error. * @throws ParserException */ protected void throwMessage(int number, String message, ILexToken token) throws ParserException { throw new ParserException(number, message, token.getLocation(), reader.getTokensRead()); }
public static AExternalDefinition newAExternalDefinition(PDefinition state, ILexToken mode) { AExternalDefinition result = new AExternalDefinition(); initDefinition(result, Pass.DEFS, state.getLocation(), state.getName(), NameScope.STATE); result.setState(state); result.setReadOnly(mode.is(VDMToken.READ)); result.setOldname(result.getReadOnly() ? null : state.getName().getOldName()); return result; }
if (clause.getMode().getType() == VDMToken.WRITE && sdef instanceof AInstanceVariableDefinition && node.getName().getName().equals(node.getClassDefinition().getName().getName()))
static void initExpressionBinary(SBinaryExp result, PExp left, ILexToken op, PExp right) { initExpression(result, op.getLocation()); result.setLeft(left); result.setOp(op); result.setRight(right); }
/** * Called by the {@link AHistoryExp} node from {@link AHistoryExp#apply(IAnalysis)}. * @param node the calling {@link AHistoryExp} node */ public void caseAHistoryExp(AHistoryExp node) throws AnalysisException { _visitedNodes.add(node); inAHistoryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getHop() != null ) { node.getHop().apply(this); } { List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getOpnames()); for( ILexNameToken e : copy) { e.apply(this); } } outAHistoryExp(node); }
if (token.is(VDMToken.IS)) checkFor(VDMToken.YET, 2187, "Expecting 'is not yet specified"); checkFor(VDMToken.SPECIFIED, 2188, "Expecting 'is not yet specified"); return AstFactory.newANotYetSpecifiedStm(token.getLocation()); return AstFactory.newASubclassResponsibilityStm(token.getLocation());
switch (node.getHop().getType())
/** * Sets the {@code _hop} child of this {@link AHistoryExp} node. * @param value the new {@code _hop} child of this {@link AHistoryExp} node */ public void setHop(ILexToken value) { if (this._hop != null) { this._hop.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._hop = value; }
/** * Called by the {@link AHistoryExp} node from {@link AHistoryExp#apply(IAnalysis)}. * @param node the calling {@link AHistoryExp} node */ public void caseAHistoryExp(AHistoryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAHistoryExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getHop() != null ) { node.getHop().apply(this, question); } { List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getOpnames()); for( ILexNameToken e : copy) { e.apply(this, question); } } outAHistoryExp(node, question); }
/** * Sets the {@code _mode} child of this {@link AExternalClause} node. * @param value the new {@code _mode} child of this {@link AExternalClause} node */ public void setMode(ILexToken value) { if (this._mode != null) { this._mode.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._mode = value; }
/** * Called by the {@link AHistoryExp} node from {@link AHistoryExp#apply(IPOFAnalysis)}. * @param node the calling {@link AHistoryExp} node */ public void caseAHistoryExp(AHistoryExp node) throws AnalysisException { _visitedNodes.add(node); inAHistoryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getHop() != null ) { node.getHop().apply(this); } { List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getOpnames()); for( ILexNameToken e : copy) { e.apply(this); } } outAHistoryExp(node); }
/** * Called by the {@link AExternalClause} node from {@link AExternalClause#apply(IAnalysis)}. * @param node the calling {@link AExternalClause} node */ public void caseAExternalClause(AExternalClause node) throws AnalysisException { _visitedNodes.add(node); inAExternalClause(node); if(node.getMode() != null ) { node.getMode().apply(this); } { List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getIdentifiers()); for( ILexNameToken e : copy) { e.apply(this); } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outAExternalClause(node); }
/** * Called by the {@link AExternalClause} node from {@link AExternalClause#apply(IPOFAnalysis)}. * @param node the calling {@link AExternalClause} node */ public void caseAExternalClause(AExternalClause node) throws AnalysisException { _visitedNodes.add(node); inAExternalClause(node); if(node.getMode() != null ) { node.getMode().apply(this); } { List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getIdentifiers()); for( ILexNameToken e : copy) { e.apply(this); } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outAExternalClause(node); }
/** * Called by the {@link ACompBinaryExp} node from {@link ACompBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ACompBinaryExp} node */ public void caseACompBinaryExp(ACompBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inACompBinaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getOp() != null ) { node.getOp().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outACompBinaryExp(node); }
/** * Called by the {@link AMapUnionBinaryExp} node from {@link AMapUnionBinaryExp#apply(IAnalysis)}. * @param node the calling {@link AMapUnionBinaryExp} node */ public void caseAMapUnionBinaryExp(AMapUnionBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inAMapUnionBinaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getOp() != null ) { node.getOp().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outAMapUnionBinaryExp(node); }
/** * Called by the {@link ASubsetBinaryExp} node from {@link ASubsetBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ASubsetBinaryExp} node */ public void caseASubsetBinaryExp(ASubsetBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inASubsetBinaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getOp() != null ) { node.getOp().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outASubsetBinaryExp(node); }