inACallObjectStm(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this, question); if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) node.getDesignator().apply(this, question); if(node.getClassname() != null ) node.getClassname().apply(this, question); if(node.getFieldname() != null ) node.getFieldname().apply(this, question); if(node.getField() != null ) node.getField().apply(this, question); List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
/** * Creates a new complete constructor {@code ACallObjectStm} 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 designator_ the {@link PObjectDesignator} node for the {@code designator} child of this {@link ACallObjectStm} node * @param classname_ the {@link ILexNameToken} node for the {@code classname} child of this {@link ACallObjectStm} node * @param fieldname_ the {@link ILexIdentifierToken} node for the {@code fieldname} child of this {@link ACallObjectStm} node * @param field_ the {@link ILexNameToken} node for the {@code field} child of this {@link ACallObjectStm} node * @param args_ the {@link NodeList} node for the {@code args} child of this {@link ACallObjectStm} node * @param explicit_ the {@link Boolean} node for the {@code explicit} child of this {@link ACallObjectStm} node */ public ACallObjectStm(ILexLocation location_, PType type_, PObjectDesignator designator_, ILexNameToken classname_, ILexIdentifierToken fieldname_, ILexNameToken field_, List<? extends PExp> args_, Boolean explicit_) { super(location_,type_); this.setDesignator(designator_); this.setClassname(classname_); this.setFieldname(fieldname_); this.setField(field_); this.setArgs(args_); this.setExplicit(explicit_); }
@Override public PTypeSet caseACallObjectStm(ACallObjectStm statement) throws AnalysisException { // TODO We don't know what an operation call will raise return new PTypeSet(AstFactory.newAUnknownType(statement.getLocation()), af); }
PType dtype = node.getDesignator().apply(THIS, question); TypeCheckerErrors.report(3207, "Object designator is not an object type", node.getLocation(), node); node.setType(AstFactory.newAUnknownType(node.getLocation())); return node.getType(); if (node.getClassname() == null) node.setField(new LexNameToken(ctype.getName().getName(), node.getFieldname().getName(), node.getFieldname().getLocation())); } else node.setField(node.getClassname()); node.getField().getLocation().executable(true); List<PType> atypes = getArgTypes(node.getArgs(), THIS, question); node.getField().setTypeQualifier(atypes); PDefinition fdef = classenv.findName(node.getField(), question.scope); TypeCheckerErrors.report(3337, "Cannot call a constructor from here", node.getLocation(), node); node.setType(AstFactory.newAUnknownType(node.getLocation())); return node.getType(); && node.getField().getModule().equals("CPU") && node.getField().getName().equals("deploy")) TypeCheckerErrors.report(3280, "Argument to deploy must be an object", node.getArgs().get(0).getLocation(), node.getArgs().get(0)); node.setType(AstFactory.newAVoidType(node.getLocation())); return node.getType();
args = stmt.getArgs(); ACallObjectStm newCallStatement; if (stmt.getClassname() != null) newCallStatement = AstFactory.newACallObjectStm(stmt.getDesignator().clone(), stmt.getClassname().clone(), newargs); } else newCallStatement = AstFactory.newACallObjectStm(stmt.getDesignator().clone(), (LexIdentifierToken) stmt.getFieldname().clone(), newargs); if(stmt.getField() != null) newCallStatement.setField(stmt.getField().clone());
throws AnalysisException PType type = node.getType(); PObjectDesignator objectDesignator = node.getDesignator(); ILexNameToken field = node.getField(); LinkedList<PExp> args = node.getArgs(); if (node.getExplicit()) SClassDefinition enclosingClass = node.getAncestor(SClassDefinition.class);
breakpoint.check(node.getLocation(), ctxt); node.getField().getLocation().hit(); boolean endstop = breakpoint.catchReturn(ctxt); node.getLocation().setHits(node.getLocation().getHits() - 1); for (PExp arg: node.getArgs()) int arg = 0; for (PType argType: node.getField().getTypeQualifier()) if (argTypes.size() != node.getField().getTypeQualifier().size()) VdmRuntimeError.abort(node.getField().getLocation(), 4168, "Arguments do not match parameters: " + node.getField(), ctxt); ILexNameToken adjfield = node.getField().getModifiedName(argTypes); ObjectValue obj = node.getDesignator().apply(VdmRuntime.getStatementEvaluator(), ctxt).objectValue(ctxt); Value v = obj.get(adjfield, node.getExplicit()); VdmRuntimeError.abort(node.getField().getLocation(), 4035, "Object has no field: " + adjfield.getName(), ctxt); Value rv = op.eval(node.getLocation(), argValues, ctxt); Value rv = fn.eval(node.getLocation(), argValues, ctxt); return VdmRuntimeError.abort(node.getLocation(), e);
@Override public PExp caseACallObjectStm(ACallObjectStm stm, Integer lineno) throws AnalysisException { return af.createPExpAssistant().findExpression(stm.getArgs(), lineno); }
sb.append(cs.getFieldname()); sep = "; ";
@Override public LexNameSet caseACallObjectStm(ACallObjectStm node, FreeVarInfo info) throws AnalysisException { LexNameSet names = new LexNameSet(); for (PExp arg: node.getArgs()) { names.addAll(arg.apply(this, info)); } return names; }
inACallObjectStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) node.getDesignator().apply(this); if(node.getClassname() != null ) node.getClassname().apply(this); if(node.getFieldname() != null ) node.getFieldname().apply(this); if(node.getField() != null ) node.getField().apply(this); List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
/** * Creates a new tree field only constructor {@code ACallObjectStm TAG=callObject} 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 designator_ the {@link PObjectDesignator} node for the {@code designator} child of this {@link ACallObjectStm} node * @param classname_ the {@link ILexNameToken} node for the {@code classname} child of this {@link ACallObjectStm} node * @param fieldname_ the {@link ILexIdentifierToken} node for the {@code fieldname} child of this {@link ACallObjectStm} node * @param field_ the {@link ILexNameToken} node for the {@code field} child of this {@link ACallObjectStm} node * @param args_ the {@link NodeList} node for the {@code args} child of this {@link ACallObjectStm} node * @param explicit_ the {@link Boolean} node for the {@code explicit} child of this {@link ACallObjectStm} node */ public ACallObjectStm(ILexLocation location_, PObjectDesignator designator_, ILexNameToken classname_, ILexIdentifierToken fieldname_, ILexNameToken field_, List<? extends PExp> args_, Boolean explicit_) { super(location_,null); this.setDesignator(designator_); this.setClassname(classname_); this.setFieldname(fieldname_); this.setField(field_); this.setArgs(args_); this.setExplicit(explicit_); }
@Override public IProofObligationList caseACallObjectStm(ACallObjectStm node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = new ProofObligationList(); for (PExp exp : node.getArgs()) { obligations.addAll(exp.apply(rootVisitor, question)); } return obligations; } catch (Exception e) { throw new POException(node, e.getMessage()); } }
inACallObjectStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) node.getDesignator().apply(this); if(node.getClassname() != null ) node.getClassname().apply(this); if(node.getFieldname() != null ) node.getFieldname().apply(this); if(node.getField() != null ) node.getField().apply(this); List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
mergeReturns(retVal,inACallObjectStm(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) mergeReturns(retVal,node.getType().apply(this)); if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) mergeReturns(retVal,node.getDesignator().apply(this)); if(node.getClassname() != null ) mergeReturns(retVal,node.getClassname().apply(this)); if(node.getFieldname() != null ) mergeReturns(retVal,node.getFieldname().apply(this)); if(node.getField() != null ) mergeReturns(retVal,node.getField().apply(this)); List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)
mergeReturns(retVal,inACallObjectStm(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) mergeReturns(retVal,node.getType().apply(this, question)); if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) mergeReturns(retVal,node.getDesignator().apply(this, question)); if(node.getClassname() != null ) mergeReturns(retVal,node.getClassname().apply(this, question)); if(node.getFieldname() != null ) mergeReturns(retVal,node.getFieldname().apply(this, question)); if(node.getField() != null ) mergeReturns(retVal,node.getField().apply(this, question)); List<PExp> copy = new ArrayList<PExp>(node.getArgs()); for( PExp e : copy)