/** * Creates a new complete constructor {@code ANamedInvariantType} 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} <b>graph</a> node for the {@code name} child of this {@link ANamedInvariantType} node. * <i>The parent of this {@code name } will not be changed by adding it to this node.</i> * @param type_ the {@link PType} <b>graph</a> node for the {@code type} child of this {@link ANamedInvariantType} node. * <i>The parent of this {@code type } will not be changed by adding it to this node.</i> */ public ANamedInvariantType(ILexLocation location_, Boolean resolved_, List<? extends PDefinition> definitions_, Boolean inNarrower_, Boolean opaque_, AExplicitFunctionDefinition invDef_, AExplicitFunctionDefinition eqDef_, AExplicitFunctionDefinition ordDef_, ILexNameToken name_, PType type_) { super(location_,resolved_,definitions_,inNarrower_,opaque_,invDef_,eqDef_,ordDef_); this.setName(name_); this.setType(type_); }
public static ANamedInvariantType newANamedInvariantType( ILexNameToken typeName, PType type) { ANamedInvariantType result = new ANamedInvariantType(); initType(result, typeName.getLocation()); initInvariantType(result); result.setName(typeName); result.setType(type); return result; }
@Override public PType caseANamedInvariantType(ANamedInvariantType type, Newquestion question) throws AnalysisException { if (type.getResolved()) { return type; } else { type.setResolved(true); } try { type.setType(af.createPTypeAssistant().typeResolve(type.getType(), question.root, question.rootVisitor, question.question)); return type; } catch (TypeCheckException e) { af.createPTypeAssistant().unResolve(type); throw e; } }