/** * Returns a deep clone of this {@link TStatic} node. * @return a deep clone of this {@link TStatic} node */ public TStatic clone() { return new TStatic( getText()); }
/** * 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; }
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; }
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; }
access.setStatic(new TStatic()); def.setAccess(access); } else
access.setStatic(new TStatic()); PDefinition def = readValueDefinition(NameScope.GLOBAL);
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; }