public static IType Parse(this CSharpParser.Simple_typeContext context) { if (context.numeric_type() != null) { return(context.numeric_type().Parse()); } else if (context.BOOL() != null) { return(new InbuiltType(InbuiltType.Types.Boolean)); } else { throw new NotSupportedException("Unknown simple type " + context.GetText()); } }
public override void EnterSimple_type(CSharpParser.Simple_typeContext context) { if (context.BOOL() != null) { TypeName = PrimitiveTypeName.Boolean; } else if (context.numeric_type() != null) { var numericTypeListener = new NumericTypeListener(); context.numeric_type().EnterRule(numericTypeListener); TypeName = numericTypeListener.TypeName; } }