示例#1
0
        public GGLiteral ParseInt()
        {
            var literal = new GGLiteral(int.Parse(reader.GetTokenText(reader.Token), CultureInfo.InvariantCulture));

            reader.Next();
            return(literal);
        }
示例#2
0
        public GGLiteral ParseString()
        {
            var text    = reader.GetTokenText(reader.Token);
            var literal = new GGLiteral(text.Substring(1, text.Length - 2));

            reader.Next();
            return(literal);
        }
示例#3
0
        private GGValue ParseNumber()
        {
            var text = reader.GetTokenText(reader.Token);

            if (int.TryParse(text, NumberStyles.Integer, CultureInfo.InvariantCulture, out int value))
            {
                var literal = new GGLiteral(value);
                reader.Next();
                return(literal);
            }
            return(ParseDouble());
        }