@Override public String caseAOptionalType(AOptionalType type) throws AnalysisException { return "[" + type.getType() + "]"; }
@Override public Boolean caseAOptionalType(AOptionalType type) throws AnalysisException { return type.getType().apply(THIS); }
@Override public SNumericBasicType caseAOptionalType(AOptionalType type) throws AnalysisException { return type.getType().apply(THIS); }
@Override public PType caseAOptionalType(AOptionalType type, String typename) throws AnalysisException { return type.getType().apply(THIS, typename); }
@Override public Boolean caseAOptionalType(AOptionalType node) throws AnalysisException { return node.getType().apply(THIS); }
@Override public PTypeList caseAOptionalType(AOptionalType node) throws AnalysisException { return node.getType().apply(THIS); }
@Override public AProductType caseAOptionalType(AOptionalType node) throws AnalysisException { return node.getType().apply(THIS); }
@Override public Boolean caseAOptionalType(AOptionalType node) throws AnalysisException { return node.getType().apply(THIS); } }
@Override public AProductType caseAOptionalType(AOptionalType type, Integer size) throws AnalysisException { return type.getType().apply(THIS, size); }
@Override public AFunctionType caseAOptionalType(AOptionalType type) throws AnalysisException { return type.getType().apply(THIS); }
@Override public Boolean caseAOptionalType(AOptionalType type, Class<? extends PType> typeclass) throws AnalysisException { if (typeclass.equals(AVoidType.class)) { return false; // Optionals are never void } return type.getType().apply(THIS, typeclass); }
@Override public String caseAOptionalType(AOptionalType node, PrettyPrinterEnv question) throws AnalysisException { return "" + "[" + node.getType().apply(this, question) + "]"; }
@Override public Integer caseAOptionalType(AOptionalType type) throws AnalysisException { return type.getType().apply(THIS); }
@Override public LexNameSet caseAOptionalType(AOptionalType node, FreeVarInfo info) throws AnalysisException { return node.getType().apply(this, info); }
@Override public STypeIR caseAOptionalType(AOptionalType node, IRInfo question) throws AnalysisException { STypeIR typeCg = node.getType().apply(question.getTypeVisitor(), question); if (typeCg != null) { typeCg.setOptional(true); } return typeCg; }
@Override public PType caseAOptionalType(AOptionalType type, Context ctxt) throws AnalysisException { return AstFactory.newAOptionalType(type.getLocation(), type.getType().apply(this, ctxt)); }
public static AOptionalType newAOptionalType(ILexLocation location, PType type) { AOptionalType result = new AOptionalType(); initType(result, location); while (type instanceof AOptionalType) { type = ((AOptionalType) type).getType(); } result.setType(type); return result; }
@Override public ValueList caseAOptionalType(AOptionalType type, Context ctxt) throws AnalysisException { ValueList list = type.getType().apply(THIS, ctxt); list.add(new NilValue()); return list; }
@Override public PType caseAOptionalType(AOptionalType type, Newquestion question) throws AnalysisException { return AstFactory.newAOptionalType(type.getLocation(), af.createPTypeAssistant().polymorph(type.getType(), question.pname, question.actualType)); }