Ejemplo n.º 1
0
 public static EsperEPL2GrammarLexer NewLexer(ICharStream input)
 {
     var lex = new EsperEPL2GrammarLexer(input);
     lex.RemoveErrorListeners();
     lex.AddErrorListener(Antlr4ErrorListener<int>.INSTANCE);
     return lex;
 }
Ejemplo n.º 2
0
        private static string GetTokenText(EsperEPL2GrammarParser parser, int tokenIndex)
        {
            var expected = END_OF_INPUT_TEXT;

            if ((tokenIndex >= 0) && (tokenIndex < parser.TokenNames.Length))
            {
                expected = parser.TokenNames[tokenIndex];
            }
            var lexerTokenParaphrases = EsperEPL2GrammarLexer.GetLexerTokenParaphrases();

            if (lexerTokenParaphrases.Get(tokenIndex) != null)
            {
                expected = lexerTokenParaphrases.Get(tokenIndex);
            }
            var parserTokenParaphrases = EsperEPL2GrammarParser.GetParserTokenParaphrases();

            if (parserTokenParaphrases.Get(tokenIndex) != null)
            {
                expected = parserTokenParaphrases.Get(tokenIndex);
            }
            return(expected);
        }
Ejemplo n.º 3
0
        private static string GetTokenText(EsperEPL2GrammarParser parser, int tokenIndex)
        {
            var expected = END_OF_INPUT_TEXT;

            Vocabulary vocabulary = (Vocabulary)parser.Vocabulary;

            if ((tokenIndex >= 0) && (tokenIndex <= vocabulary.getMaxTokenType()))
            {
                expected = parser.Vocabulary.GetSymbolicName(tokenIndex);
            }
            var lexerTokenParaphrases = EsperEPL2GrammarLexer.GetLexerTokenParaphrases();

            if (lexerTokenParaphrases.Get(tokenIndex) != null)
            {
                expected = lexerTokenParaphrases.Get(tokenIndex);
            }
            var parserTokenParaphrases = EsperEPL2GrammarParser.GetParserTokenParaphrases();

            if (parserTokenParaphrases.Get(tokenIndex) != null)
            {
                expected = parserTokenParaphrases.Get(tokenIndex);
            }
            return(expected);
        }