public LexNameList caseANewExp(ANewExp expression) throws org.overture.ast.analysis.AnalysisException { return af.createPExpAssistant().getOldNames(expression.getArgs()); }
@Override public ValueList caseANewExp(ANewExp exp, ObjectContext ctxt) throws AnalysisException { return af.createPExpAssistant().getValues(exp.getArgs(), ctxt); }
@Override public IProofObligationList caseANewExp(ANewExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = new ProofObligationList(); for (PExp exp : node.getArgs()) { obligations.addAll(exp.apply(mainVisitor, question)); } return obligations; }
@Override public PExp caseANewExp(ANewExp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } return af.createPExpAssistant().findExpression(exp.getArgs(), lineno); }
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
PExp exp = newExp.getArgs().size() > 0 ? newExp.getArgs().get(1) : null; double speed = 0; if (exp instanceof AIntLiteralExp) AIntLiteralExp frequencyExp = (AIntLiteralExp) newExp.getArgs().get(1); speed = frequencyExp.getValue().getValue(); } else if (exp instanceof ARealLiteralExp) ARealLiteralExp frequencyExp = (ARealLiteralExp) newExp.getArgs().get(1); speed = frequencyExp.getValue().getValue();
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
@Override public SExpIR caseANewExp(ANewExp node, IRInfo question) throws AnalysisException { String className = node.getClassdef().getName().getName(); ATypeNameIR typeName = new ATypeNameIR(); typeName.setDefiningClass(null); typeName.setName(className); PType type = node.getType(); LinkedList<PExp> nodeArgs = node.getArgs(); ANewExpIR newExp = new ANewExpIR(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); newExp.setType(typeCg); newExp.setName(typeName); LinkedList<SExpIR> newExpArgs = newExp.getArgs(); for (PExp arg : nodeArgs) { SExpIR argCg = arg.apply(question.getExpVisitor(), question); if (argCg != null) { newExpArgs.add(argCg); } else { return null; } } return newExp; }
@Override public Value caseANewExp(ANewExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); node.getClassName().getLocation().hit(); try { ValueList argvals = new ValueList(); for (PExp arg : node.getArgs()) { argvals.add(arg.apply(VdmRuntime.getExpressionEvaluator(), ctxt)); } ObjectValue objval = ctxt.assistantFactory.createSClassDefinitionAssistant().newInstance(node.getClassdef(), node.getCtorDefinition(), argvals, ctxt); if (objval.invlistener != null) { // Check the initial values of the object's fields objval.invlistener.doInvariantChecks = true; objval.invlistener.changedValue(node.getLocation(), objval, ctxt); } return objval; } catch (ValueException e) { return VdmRuntimeError.abort(node.getLocation(), e); } }