Beispiel #1
0
        public static IParsingResultExtended Parse(ParsingContext context)
        {
            IParsingResultExtended type = BuiltinType.Parse(context);

            if (type != null)
            {
                return(type);
            }

            type = ClassEnumType.Parse(context);
            if (type != null)
            {
                return(AddToSubstitutionTable(context, type));
            }

            RewindState rewind = context.RewindState;

            type = Substitution.Parse(context);
            if (type != null)
            {
                if (context.Parser.Peek != 'I')
                {
                    return(type);
                }

                context.Rewind(rewind);
            }

            type = FunctionType.Parse(context) ?? ArrayType.Parse(context) ?? PointerToMemberType.Parse(context);
            if (type != null)
            {
                return(AddToSubstitutionTable(context, type));
            }

            type = TemplateParam.Parse(context);
            if (type != null)
            {
                if (context.Parser.Peek != 'I')
                {
                    return(AddToSubstitutionTable(context, type));
                }

                context.Rewind(rewind);
            }

            type = TemplateTemplateParam.Parse(context);
            if (type != null)
            {
                TemplateArgs arguments = TemplateArgs.Parse(context);

                if (arguments == null)
                {
                    context.Rewind(rewind);
                    return(null);
                }

                return(AddToSubstitutionTable(context, new TemplateTemplate(type, arguments)));
            }

            type = Decltype.Parse(context);
            if (type != null)
            {
                return(type);
            }

            CvQualifiers qualifiers = CvQualifiers.Parse(context);

            if (qualifiers != null)
            {
                type = Parse(context);
                if (type == null)
                {
                    context.Rewind(rewind);
                    return(null);
                }

                if (type is BuiltinType)
                {
                    return(new QualifiedBuiltin(qualifiers, type));
                }
                return(AddToSubstitutionTable(context, new Qualified(qualifiers, type)));
            }

            if (context.Parser.VerifyString("P"))
            {
                type = Parse(context);
                if (type == null)
                {
                    context.Rewind(rewind);
                    return(null);
                }
                return(AddToSubstitutionTable(context, new PointerTo(type)));
            }

            if (context.Parser.VerifyString("R"))
            {
                type = Parse(context);
                if (type == null)
                {
                    context.Rewind(rewind);
                    return(null);
                }
                return(AddToSubstitutionTable(context, new LvalueRef(type)));
            }

            if (context.Parser.VerifyString("O"))
            {
                type = Parse(context);
                if (type == null)
                {
                    context.Rewind(rewind);
                    return(null);
                }
                return(AddToSubstitutionTable(context, new RvalueRef(type)));
            }

            if (context.Parser.VerifyString("C"))
            {
                type = Parse(context);
                if (type == null)
                {
                    context.Rewind(rewind);
                    return(null);
                }
                return(AddToSubstitutionTable(context, new Complex(type)));
            }

            if (context.Parser.VerifyString("G"))
            {
                type = Parse(context);
                if (type == null)
                {
                    context.Rewind(rewind);
                    return(null);
                }
                return(AddToSubstitutionTable(context, new Imaginary(type)));
            }

            if (context.Parser.VerifyString("U"))
            {
                IParsingResult name = SourceName.Parse(context);

                if (name == null)
                {
                    context.Rewind(rewind);
                    return(null);
                }

                TemplateArgs arguments = TemplateArgs.Parse(context);

                type = Parse(context);
                return(AddToSubstitutionTable(context, new VendorExtension(name, arguments, type)));
            }

            if (context.Parser.VerifyString("Dp"))
            {
                type = Parse(context);
                if (type == null)
                {
                    context.Rewind(rewind);
                    return(null);
                }
                return(AddToSubstitutionTable(context, new PackExtension(type)));
            }

            return(null);
        }
Beispiel #2
0
 public TrophyDataBase()
 {
     thisClassEnum = ClassEnumType.TropyData;
 }
Beispiel #3
0
 public UserDataBase()
 {
     thisClassEnum = ClassEnumType.UserData;
 }