/** * Creates a new complete constructor {@code AOperationType} 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 parameters_ the {@link GraphNodeList} <b>graph</a> node for the {@code parameters} child of this {@link AOperationType} node. * <i>The parent of this {@code parameters } will not be changed by adding it to this node.</i> * @param result_ the {@link PType} <b>graph</a> node for the {@code result} child of this {@link AOperationType} node. * <i>The parent of this {@code result } will not be changed by adding it to this node.</i> * @param pure_ the {@link Boolean} <b>graph</a> node for the {@code pure} child of this {@link AOperationType} node. * <i>The parent of this {@code pure } will not be changed by adding it to this node.</i> */ public AOperationType(ILexLocation location_, Boolean resolved_, List<? extends PDefinition> definitions_, List<? extends PType> parameters_, PType result_, Boolean pure_) { super(location_,resolved_,definitions_); this.setParameters(parameters_); this.setResult(result_); this.setPure(pure_); }
public static AOperationType newAOperationType(ILexLocation location) { AOperationType result = new AOperationType(); initType(result, location); result.setParameters(new Vector<PType>()); result.setResult(AstFactory.newAVoidType(location)); result.setPure(false); return result; }
public static AOperationType newAOperationType(ILexLocation location, List<PType> parameters, PType resultType) { AOperationType result = new AOperationType(); initType(result, location); result.setParameters(parameters); result.setResult(resultType); result.setPure(false); // Set explicitly where needed return result; }
private AExplicitOperationDefinition getInvDefinition(SClassDefinition d) { List<PDefinition> invdefs = getInvDefs(d); if (invdefs.isEmpty()) { return null; } // Location of last local invariant ILexLocation invloc = invdefs.get(invdefs.size() - 1).getLocation(); AOperationType type = AstFactory.newAOperationType(invloc, new Vector<PType>(), AstFactory.newABooleanBasicType(invloc)); type.setPure(true); LexNameToken invname = new LexNameToken(d.getName().getName(), "inv_" + d.getName().getName(), invloc); PStm body = AstFactory.newAClassInvariantStm(invname, invdefs); return AstFactory.newAExplicitOperationDefinition(invname, type, new Vector<PPattern>(), null, null, body); }
PDefinition def = readOperationDefinition(); def.setAccess(access); ((AOperationType)def.getType()).setPure(access.getPure()); list.add(def);
optype.setPure(access.get(synthname).getPure()); ptype = optype; newname = synthname.getModifiedName(optype.getParameters());