private static void initUnionType(AUnionType result) { result.setSetDone(false); result.setSeqDone(false); result.setMapDone(false); result.setRecDone(false); result.setNumDone(false); result.setFuncDone(false); result.setOpDone(false); result.setClassDone(false); result.setProdCard(-1); result.setExpanded(false); }
/** * Creates a new tree field only constructor {@code AUnionType TAG=union} 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 infinite_ the {@link Boolean} node for the {@code infinite} child of this {@link AUnionType} node * @param expanded_ the {@link Boolean} node for the {@code expanded} child of this {@link AUnionType} node */ public AUnionType(ILexLocation location_, Boolean resolved_, Boolean infinite_, Boolean expanded_) { super(location_,resolved_,null); this.setInfinite(infinite_); this.setExpanded(expanded_); this.setSeqDone(false); this.setSetDone(false); this.setMapDone(false); this.setProdCard(0); this.setFuncDone(false); this.setOpDone(false); this.setNumDone(false); this.setRecDone(false); this.setClassDone(false); }
@Override public SMapType caseAUnionType(AUnionType type) throws AnalysisException { ILexLocation location = type.getLocation(); if (!type.getMapDone()) { type.setMapDone(true); // Mark early to avoid recursion. // type.setMapType(PTypeAssistantTC.getMap(AstFactory.newAUnknownType(location))); // Rewritten in an none static form. type.setMapType(af.createPTypeAssistant().getMap(AstFactory.newAUnknownType(location))); PTypeSet from = new PTypeSet(af); PTypeSet to = new PTypeSet(af); for (PType t : type.getTypes()) { if (af.createPTypeAssistant().isMap(t)) { // from.add(PTypeAssistantTC.getMap(t).getFrom()); //Original Code from.add(t.apply(THIS).getFrom()); // My change George. // to.add(PTypeAssistantTC.getMap(t).getTo());//Original code. to.add(t.apply(THIS).getTo());// My change George. } } type.setMapType(from.isEmpty() ? null : AstFactory.newAMapMapType(location, from.getType(location), to.getType(location))); } return type.getMapType(); }
this.setSetDone(setDone_); this.setSetType(setType_); this.setMapDone(mapDone_); this.setMapType(mapType_); this.setProdCard(prodCard_);