Пример #1
0
 antlr.IToken CreateToken(antlr.IToken prototype, int newTokenType, string newTokenText)
 {
     return(new BooToken(newTokenType, newTokenText,
                         prototype.getFilename(),
                         prototype.getLine(),
                         prototype.getColumn() + SafeGetLength(prototype.getText())));
 }
Пример #2
0
        antlr.IToken BufferUntilNextNonWhiteSpaceToken()
        {
            antlr.IToken token = null;
            while (true)
            {
                token = _istream.nextToken();

                int ttype = token.Type;
                if (antlr.Token.SKIP == ttype)
                {
                    continue;
                }

                if (_wsTokenType == ttype)
                {
                    _buffer.Append(token.getText());
                    continue;
                }

                break;
            }
            return(token);
        }
Пример #3
0
 public static int ParseInt(antlr.IToken token)
 {
     return((int)ParseIntegerLiteralExpression(token, token.getText(), false).Value);
 }