probleme with getExpectedTokensWithinCurrentRule in java

23 views
Skip to first unread message

Exemple Thales

unread,
Oct 12, 2016, 7:10:32 AM10/12/16
to antlr-discussion
hello i try to find a sample for using getExpectedTokensWithinCurrentRule in antlr4

i have this source code
final ANTLRInputStream input = new ANTLRInputStream("AA + BB");
final CalcLexer lexer = new CalcLexer(input);

final CommonTokenStream tokens = new CommonTokenStream(lexer);
final CalcParser parser = new CalcParser(tokens);

final IntervalSet interval = parser.getExpectedTokensWithinCurrentRule();

but i have always an error : Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1

have you some sample for this

Reply all
Reply to author
Forward
0 new messages