@Override public void caseANewExp(ANewExp node) throws AnalysisException { super.caseANewExp(node); instantiatedClasses.add(node.getClassName().getName()); } });
if(node.getClassName() != null ) node.getClassName().apply(this);
if(node.getClassName() != null ) node.getClassName().apply(this, question);
if(node.getClassName() != null ) node.getClassName().apply(this);
if(node.getClassName() != null ) mergeReturns(retVal,node.getClassName().apply(this, question));
if(node.getClassName() != null ) mergeReturns(retVal,node.getClassName().apply(this));
@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); } }
@Override public PType caseANewExp(ANewExp node, TypeCheckInfo question) throws AnalysisException PDefinition cdef = question.env.findType(node.getClassName().getClassName(), null); TypeCheckerErrors.report(3133, "Class name " + node.getClassName() + " not in scope", node.getLocation(), node); node.setType(AstFactory.newAUnknownType(node.getLocation()));