@Override public SNumericBasicType caseAUnionType(AUnionType type) throws AnalysisException { if (!type.getNumDone()) { type.setNumDone(true); type.setNumType(AstFactory.newANatNumericBasicType(type.getLocation())); // lightest default boolean found = false; for (PType t : type.getTypes()) { if (af.createPTypeAssistant().isNumeric(t)) { SNumericBasicType nt = af.createPTypeAssistant().getNumeric(t); if (af.createSNumericBasicTypeAssistant().getWeight(nt) > af.createSNumericBasicTypeAssistant().getWeight(type.getNumType())) { type.setNumType(nt); } found = true; } } if (!found) { type.setNumType(null); } } return type.getNumType(); }
public SNumericBasicType getNumeric(AUnionType type) { if (!type.getNumDone()) { type.setNumDone(true); type.setNumType(AstFactory.newANatNumericBasicType(type.getLocation())); // lightest default boolean found = false; for (PType t : type.getTypes()) { if (af.createPTypeAssistant().isNumeric(t)) { SNumericBasicType nt = af.createPTypeAssistant().getNumeric(t); if (af.createSNumericBasicTypeAssistant().getWeight(nt) > af.createSNumericBasicTypeAssistant().getWeight(type.getNumType())) { type.setNumType(nt); } found = true; } } if (!found) { type.setNumType(null); } } return type.getNumType(); }
this.setOpType(opType_); this.setNumDone(numDone_); this.setNumType(numType_); this.setRecDone(recDone_); this.setRecType(recType_);