/** * Creates a new tree field only constructor {@code ARecordInvariantType TAG=record} 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 name_ the {@link ILexNameToken} node for the {@code name} child of this {@link ARecordInvariantType} node */ public ARecordInvariantType(ILexLocation location_, Boolean resolved_, Boolean inNarrower_, ILexNameToken name_) { super(location_,resolved_,null,inNarrower_,false,null,null,null); this.setName(name_); this.setInfinite(false); this.setComposed(false); }
/** * Creates a new complete constructor {@code ARecordInvariantType} 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 name_ the {@link ILexNameToken} node for the {@code name} child of this {@link ARecordInvariantType} node * @param fields_ the {@link GraphNodeList} <b>graph</a> node for the {@code fields} child of this {@link ARecordInvariantType} node. * <i>The parent of this {@code fields } will not be changed by adding it to this node.</i> * @param infinite_ the {@link Boolean} <b>graph</a> node for the {@code infinite} child of this {@link ARecordInvariantType} node. * <i>The parent of this {@code infinite } will not be changed by adding it to this node.</i> * @param composed_ the {@link Boolean} <b>graph</a> node for the {@code composed} child of this {@link ARecordInvariantType} node. * <i>The parent of this {@code composed } will not be changed by adding it to this node.</i> */ public ARecordInvariantType(ILexLocation location_, Boolean resolved_, List<? extends PDefinition> definitions_, Boolean inNarrower_, Boolean opaque_, AExplicitFunctionDefinition invDef_, AExplicitFunctionDefinition eqDef_, AExplicitFunctionDefinition ordDef_, ILexNameToken name_, List<? extends AFieldField> fields_, Boolean infinite_, Boolean composed_) { super(location_,resolved_,definitions_,inNarrower_,opaque_,invDef_,eqDef_,ordDef_); this.setName(name_); this.setFields(fields_); this.setInfinite(infinite_); this.setComposed(composed_); }
public static ARecordInvariantType newARecordInvariantType( ILexNameToken name, List<AFieldField> fields) { ARecordInvariantType result = new ARecordInvariantType(); initType(result, name.getLocation()); initInvariantType(result); result.setName(name); result.setFields(fields); result.setComposed(false); return result; }
private PType readComposeType() throws ParserException, LexException { PType type = null; if (lastToken().is(VDMToken.COMPOSE)) { nextToken(); LexIdentifierToken id = readIdToken("Compose not followed by record identifier"); checkFor(VDMToken.OF, 2249, "Missing 'of' in compose type"); ARecordInvariantType rtype = AstFactory.newARecordInvariantType(idToName(id), readFieldList()); rtype.setComposed(true); checkFor(VDMToken.END, 2250, "Missing 'end' in compose type"); type = rtype; } else { type = readMapType(); } return type; }