@Override public SOperationDefinitionBase caseAApplyExp(AApplyExp node) throws AnalysisException { return node.getRoot().apply(this); }
@Override public List<PExp> caseAApplyExp(AApplyExp exp) throws AnalysisException { List<PExp> subs = new Vector<PExp>(); subs.addAll(exp.getRoot().apply(THIS)); subs.add(exp); return subs; }
@Override public LexNameSet caseAApplyExp(AApplyExp node, FreeVarInfo info) throws AnalysisException { LexNameSet names = new LexNameSet(); if (node.getRoot() instanceof AVariableExp && node.getRoot().getType() != null && af.createPTypeAssistant().isFunction(node.getRoot().getType())) { // If this is a global call, then we depend on the function AVariableExp v = (AVariableExp)node.getRoot(); if (info.globals.findName(v.getName(), NameScope.NAMESANDSTATE) != null) { names.add(v.getName()); } } for (PExp exp: node.getArgs()) { names.addAll(exp.apply(this, info)); } return names; }
@Override public void caseAFuncInstatiationExp(AFuncInstatiationExp node) throws AnalysisException { if(!(node.parent() instanceof AApplyExp && ((AApplyExp) node.parent()).getRoot() == node)) { info.addUnsupportedNode(node, "Function must be applied at the time of instantiation"); } super.caseAFuncInstatiationExp(node); }
@Override public ValueList caseAApplyExp(AApplyExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = af.createPExpAssistant().getValues(exp.getArgs(), ctxt); list.addAll(exp.getRoot().apply(THIS, ctxt)); return list; }
@Override public PExp caseAApplyExp(AApplyExp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } found = exp.getRoot().apply(THIS, lineno);// PExpAssistantInterpreter.findExpression(exp.getRoot(), lineno); if (found != null) { return found; } return af.createPExpAssistant().findExpression(exp.getArgs(), lineno); }
public LexNameList caseAApplyExp(AApplyExp expression) throws org.overture.ast.analysis.AnalysisException { LexNameList list = af.createPExpAssistant().getOldNames(expression.getArgs()); list.addAll(af.createPExpAssistant().getOldNames(expression.getRoot())); return list; }
@Override public SExpIR caseAApplyExp(AApplyExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); PExp root = node.getRoot(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); SExpIR rootCg = root.apply(question.getExpVisitor(), question); AApplyExpIR applyExp = new AApplyExpIR(); applyExp.setType(typeCg); applyExp.setRoot(rootCg); for (PExp arg : node.getArgs()) { SExpIR argCg = arg.apply(question.getExpVisitor(), question); if (argCg != null) { applyExp.getArgs().add(argCg); } else { return null; } } return applyExp; }
PExp root = node.getRoot();
PExp root = node.getRoot();
PExp root = apply.getRoot().clone();
private PExp makeInvApplyExp(AAtomicStm atom) { AStateDefinition stateDef = atom.getAssignments().get(0).getStateDefinition(); if (stateDef == null) { return extractInv(atom); } String stateName = getStateName(stateDef); List<PExp> arglist = new Vector<PExp>(); for (AFieldField f : stateDef.getFields()) { arglist.add(getVarExp(f.getTagname().clone(), stateDef.clone(),f.getType())); } PExp mkExp = AstExpressionFactory.newAMkTypeExp(new LexNameToken("", stateName, null), stateDef.getRecordType().clone(), arglist); AApplyExp invApplyExp = getApplyExp(getVarExp(stateDef.getInvdef().getName().clone(), stateDef.getInvdef().clone(), stateDef.getInvdef().getType().clone()), new ABooleanBasicType(), mkExp); invApplyExp.getRoot().setType(stateDef.getInvdef().getType().clone()); return invApplyExp; }
Value object = node.getRoot().apply(VdmRuntime.getExpressionEvaluator(), ctxt).deref();