[antlr-interest] ANTLR could not analyze...

Steve Bennett stevagewp at gmail.com
Sat Feb 16 06:22:27 PST 2008


[01:19:04] warning(205): mediawiki11intransit.g:302:4: ANTLR could not
analyze this decision in rule table_line; often this is because of
recursive rule references visible from the left edge of alternatives.
ANTLR will re-analyze the decision with a fixed lookahead of k=1.
Consider using "options {k=1;}" for that decision and possibly adding
a syntactic predicate.

What does this warning mean? What can I do about it?

table_line
 options { k= 1; }
:
   (
   (PIPE PLUS) => table_caption
   | (PIPE HYPHEN) => table_row_separator
   | (EXCLAMATION) => table_header_cells
   | (PIPE ~RIGHT_BRACE) => table_data_cells
   );


As you can see, I'm using options k=1, and no shortage of syntactic
predicates - what else can I do?

Aside question: What exactly is the scope of options? Does setting an
option on a rule carry through to rules referred to in that rule?

Steve


More information about the antlr-interest mailing list