/** * Called by the {@link ARecordModifier} node from {@link ARecordModifier#apply(IAnalysis)}. * @param node the calling {@link ARecordModifier} node */ public void caseARecordModifier(ARecordModifier node, Q question) throws AnalysisException { _visitedNodes.add(node); inARecordModifier(node, question); if(node.getTag() != null ) { node.getTag().apply(this, question); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { node.getValue().apply(this, question); } outARecordModifier(node, question); }
public static ARecordModifier newARecordModifier(LexIdentifierToken tag, PExp value) { ARecordModifier result = new ARecordModifier(); result.setTag(tag); result.setValue(value); return result; }
/** * Returns a deep clone of this {@link ARecordModifier} node. * @return a deep clone of this {@link ARecordModifier} node */ public ARecordModifier clone() { return new ARecordModifier( cloneNode(_tag), cloneNode(_value) ); }
/** * Creates a new complete constructor {@code ARecordModifier} 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 tag_ the {@link ILexIdentifierToken} node for the {@code tag} child of this {@link ARecordModifier} node * @param value_ the {@link PExp} node for the {@code value} child of this {@link ARecordModifier} node */ public ARecordModifier(ILexIdentifierToken tag_, PExp value_) { super(); this.setTag(tag_); this.setValue(value_); }
public LexNameList caseAMuExp(AMuExp expression) throws org.overture.ast.analysis.AnalysisException { LexNameList list = af.createPExpAssistant().getOldNames(expression.getRecord()); for (ARecordModifier rm : expression.getModifiers()) { list.addAll(rm.apply(this)); } return list; }
/** * This is not an expression */ @Override public LexNameList caseARecordModifier(ARecordModifier rm) throws AnalysisException { return af.createPExpAssistant().getOldNames(rm.getValue()); }
e.apply(this, question);
@Override public LexNameSet caseAMuExp(AMuExp node, FreeVarInfo info) throws AnalysisException { LexNameSet names = node.getRecord().apply(this, info); for (ARecordModifier rm: node.getModifiers()) { names.addAll(rm.getValue().apply(this, info)); } return names; }
/** * Called by the {@link ARecordModifier} node from {@link ARecordModifier#apply(IAnalysis)}. * @param node the calling {@link ARecordModifier} node */ public void caseARecordModifier(ARecordModifier node) throws AnalysisException { _visitedNodes.add(node); inARecordModifier(node); if(node.getTag() != null ) { node.getTag().apply(this); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { node.getValue().apply(this); } outARecordModifier(node); }
e.apply(this);
@Override public ValueList caseAMuExp(AMuExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = exp.getRecord().apply(THIS, ctxt); for (ARecordModifier rm : exp.getModifiers()) { list.addAll(rm.getValue().apply(THIS, ctxt)); } return list; }
/** * Creates a deep clone of this {@link ARecordModifier} 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 ARecordModifier} node */ public ARecordModifier clone(Map<INode,INode> oldToNewMap) { ARecordModifier node = new ARecordModifier( cloneNode(_tag, oldToNewMap), cloneNode(_value, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ARecordModifier} node from {@link ARecordModifier#apply(IPOFAnalysis)}. * @param node the calling {@link ARecordModifier} node */ public void caseARecordModifier(ARecordModifier node) throws AnalysisException { _visitedNodes.add(node); inARecordModifier(node); if(node.getTag() != null ) { node.getTag().apply(this); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { node.getValue().apply(this); } outARecordModifier(node); }
e.apply(this);
/** * Called by the {@link ARecordModifier} node from {@link ARecordModifier#apply(IAnalysis)}. * @param node the calling {@link ARecordModifier} node */ public A caseARecordModifier(ARecordModifier node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inARecordModifier(node, question)); if(node.getTag() != null ) { mergeReturns(retVal,node.getTag().apply(this, question)); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { mergeReturns(retVal,node.getValue().apply(this, question)); } mergeReturns(retVal,outARecordModifier(node, question)); return retVal; }
mergeReturns(retVal,e.apply(this));
/** * Called by the {@link ARecordModifier} node from {@link ARecordModifier#apply(IAnalysis)}. * @param node the calling {@link ARecordModifier} node */ public A caseARecordModifier(ARecordModifier node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inARecordModifier(node)); if(node.getTag() != null ) { mergeReturns(retVal,node.getTag().apply(this)); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { mergeReturns(retVal,node.getValue().apply(this)); } mergeReturns(retVal,outARecordModifier(node)); return retVal; }
mergeReturns(retVal,e.apply(this, question));
@Override public SModifierIR caseARecordModifier(ARecordModifier node, IRInfo question) throws AnalysisException { ILexIdentifierToken tag = node.getTag(); PExp value = node.getValue(); String name = tag.getName(); SExpIR recCg = value.apply(question.getExpVisitor(), question); ARecordModifierIR recModifier = new ARecordModifierIR(); recModifier.setName(name); recModifier.setValue(recCg); return recModifier; }
SModifierIR modifier = m.apply(question.getModifierVisitor(), question);