/** * Sets the {@code _static} child of this {@link AAccessSpecifierAccessSpecifier} node. * @param value the new {@code _static} child of this {@link AAccessSpecifierAccessSpecifier} node */ public void setStatic(TStatic value) { if (this._static != null) { this._static.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._static = value; }
/** * Creates a new complete constructor {@code TStatic} 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 text_ the {@link String} node for the {@code text} child of this {@link TStatic} node */ public TStatic(String text_) { super(); this.setText(text_); }
public static AAccessSpecifierAccessSpecifier newAAccessSpecifierAccessSpecifier( PAccess access, boolean isStatic, boolean isAsync, boolean isPure) { AAccessSpecifierAccessSpecifier result = new AAccessSpecifierAccessSpecifier(); result.setAccess(access); result.setStatic(isStatic ? new TStatic() : null); result.setAsync(isAsync ? new TAsync() : null); result.setPure(isPure); return result; }
/** * Called by the {@link AAccessSpecifierAccessSpecifier} node from {@link AAccessSpecifierAccessSpecifier#apply(IAnalysis)}. * @param node the calling {@link AAccessSpecifierAccessSpecifier} node */ public void caseAAccessSpecifierAccessSpecifier(AAccessSpecifierAccessSpecifier node, Q question) throws AnalysisException { _visitedNodes.add(node); inAAccessSpecifierAccessSpecifier(node, question); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) { node.getAccess().apply(this, question); } if(node.getStatic() != null && !_visitedNodes.contains(node.getStatic())) { node.getStatic().apply(this, question); } if(node.getAsync() != null && !_visitedNodes.contains(node.getAsync())) { node.getAsync().apply(this, question); } outAAccessSpecifierAccessSpecifier(node, question); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof TStatic) { return toString().equals(o.toString()); } return false; }
private List<PDefinition> readTypes() throws LexException, ParserException { checkFor(VDMToken.TYPES, 2013, "Expected 'types'"); List<PDefinition> list = new Vector<PDefinition>(); while (!newSection()) { try { AAccessSpecifierAccessSpecifier access = readAccessSpecifier(false, false); access.setStatic(new TStatic()); ATypeDefinition def = readTypeDefinition(); // Force all type defs (invs) to be static def.setAccess(access); list.add(def); if (!newSection()) { checkFor(VDMToken.SEMICOLON, 2078, "Missing ';' after type definition"); } } catch (LocatedException e) { report(e, afterArray, sectionArray); } } return list; }
/** * Called by the {@link AAccessSpecifierAccessSpecifier} node from {@link AAccessSpecifierAccessSpecifier#apply(IPOFAnalysis)}. * @param node the calling {@link AAccessSpecifierAccessSpecifier} node */ public void caseAAccessSpecifierAccessSpecifier(AAccessSpecifierAccessSpecifier node) throws AnalysisException { _visitedNodes.add(node); inAAccessSpecifierAccessSpecifier(node); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) { node.getAccess().apply(this); } if(node.getStatic() != null && !_visitedNodes.contains(node.getStatic())) { node.getStatic().apply(this); } if(node.getAsync() != null && !_visitedNodes.contains(node.getAsync())) { node.getAsync().apply(this); } outAAccessSpecifierAccessSpecifier(node); }
access.setStatic(new TStatic()); def.setAccess(access); } else
/** * Called by the {@link AAccessSpecifierAccessSpecifier} node from {@link AAccessSpecifierAccessSpecifier#apply(IAnalysis)}. * @param node the calling {@link AAccessSpecifierAccessSpecifier} node */ public void caseAAccessSpecifierAccessSpecifier(AAccessSpecifierAccessSpecifier node) throws AnalysisException { _visitedNodes.add(node); inAAccessSpecifierAccessSpecifier(node); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) { node.getAccess().apply(this); } if(node.getStatic() != null && !_visitedNodes.contains(node.getStatic())) { node.getStatic().apply(this); } if(node.getAsync() != null && !_visitedNodes.contains(node.getAsync())) { node.getAsync().apply(this); } outAAccessSpecifierAccessSpecifier(node); }
/** * Creates a deep clone of this {@link TStatic} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link TStatic} node */ public TStatic clone(Map<INode,INode> oldToNewMap) { TStatic token = new TStatic( getText()); oldToNewMap.put(this, token); return token; }
access.setStatic(new TStatic()); PDefinition def = readValueDefinition(NameScope.GLOBAL);
/** * Called by the {@link AAccessSpecifierAccessSpecifier} node from {@link AAccessSpecifierAccessSpecifier#apply(IAnalysis)}. * @param node the calling {@link AAccessSpecifierAccessSpecifier} node */ public A caseAAccessSpecifierAccessSpecifier(AAccessSpecifierAccessSpecifier node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAAccessSpecifierAccessSpecifier(node)); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) { mergeReturns(retVal,node.getAccess().apply(this)); } if(node.getStatic() != null && !_visitedNodes.contains(node.getStatic())) { mergeReturns(retVal,node.getStatic().apply(this)); } if(node.getAsync() != null && !_visitedNodes.contains(node.getAsync())) { mergeReturns(retVal,node.getAsync().apply(this)); } mergeReturns(retVal,outAAccessSpecifierAccessSpecifier(node)); return retVal; }
public static ATypeDefinition newATypeDefinition(ILexNameToken name, SInvariantType type, PPattern invPattern, PExp invExpression, AEqRelation eqRelation, AOrdRelation ordRelation) { ATypeDefinition result = new ATypeDefinition(); initDefinition(result, Pass.TYPES, name.getLocation(), name, NameScope.TYPENAME); // Force all type defs (invs) to be static. There is no guarantee that // this will say here but is should result.getAccess().setStatic(new TStatic()); result.setInvType(type); result.setInvPattern(invPattern); result.setInvExpression(invExpression); result.setEqRelation(eqRelation); result.setOrdRelation(ordRelation); result.setType(type); if (type != null) { if (type.getDefinitions() == null) { type.setDefinitions(new LinkedList<PDefinition>()); } type.getDefinitions().add(result); } return result; }
/** * Called by the {@link AAccessSpecifierAccessSpecifier} node from {@link AAccessSpecifierAccessSpecifier#apply(IAnalysis)}. * @param node the calling {@link AAccessSpecifierAccessSpecifier} node */ public A caseAAccessSpecifierAccessSpecifier(AAccessSpecifierAccessSpecifier node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAAccessSpecifierAccessSpecifier(node, question)); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) { mergeReturns(retVal,node.getAccess().apply(this, question)); } if(node.getStatic() != null && !_visitedNodes.contains(node.getStatic())) { mergeReturns(retVal,node.getStatic().apply(this, question)); } if(node.getAsync() != null && !_visitedNodes.contains(node.getAsync())) { mergeReturns(retVal,node.getAsync().apply(this, question)); } mergeReturns(retVal,outAAccessSpecifierAccessSpecifier(node, question)); return retVal; }