Beispiel #1
0
        internal static PrimitiveTypeValueAst ReadDefaultValue(ParserStream stream, IdentifierToken returnType)
        {
            switch (returnType.GetNormalizedName())
            {
            case Keywords.DT_UINT8:
            case Keywords.DT_UINT16:
            case Keywords.DT_UINT32:
            case Keywords.DT_UINT64:
            case Keywords.DT_SINT8:
            case Keywords.DT_SINT16:
            case Keywords.DT_SINT32:
            case Keywords.DT_SINT64:
            case Keywords.DT_REAL32:
            case Keywords.DT_REAL64:
            case Keywords.DT_STRING:
            case Keywords.DT_DATETIME:
            case Keywords.DT_BOOLEAN:
            case Keywords.DT_OCTECTSTRING:
                // primitiveType
                return(PrimitiveTypeValueAst.Parse(stream));

            default:
                /// structureOrClassName
                /// enumName
                /// classReference
                var peek = stream.Peek();
                if (peek is NullLiteralToken)
                {
                    return(NullValueAst.Parse(stream));
                }
                throw new UnsupportedTokenException(stream.Peek());
            }
        }