Note that there are some explanatory texts on larger screens.

plurals
  1. POANTLR: rule Tokens has non-LL(*) decision due to recursive rule invocations reachable from alts
    primarykey
    data
    text
    <p>I'm learning about parsing/lexing in a course about Computer Science. For that we are using ANTLR.</p> <p>I'm modifying an XML-language, so it's no longer ambigious, but when I make the changes to the grammer, ANTLR complains. </p> <p>I know this specific question has been asked before, but it didn't really help!</p> <p><a href="https://stackoverflow.com/questions/3249685/antlr-rule-tokens-has-non-ll-decision-due-to-recursive-rule-invocations-reac">ANTLR: rule Tokens has non-LL(*) decision due to recursive rule invocations reachable from alts 1,2</a></p> <p>I have taken a snapshot of the error when I'm running ANTLR from the commando-prompt. <img src="https://i.stack.imgur.com/cYD3s.png" alt="Snapshot of the error"></p> <p>Here is the XML-grammar:</p> <pre><code>grammar XML; options { language = Java; } @lexer::members { boolean inTag = true; } xml_file returns [TaggedElement value] : tagged_element EOF ; tagged_element : start_tag element_body end_tag ; element_body : element | element element_body ; element : data_element | tagged_element ; data_element : PCDATA ; start_tag : OPEN_START_TAG NAME CLOSE_TAG ; end_tag : OPEN_END_TAG NAME CLOSE_TAG ; OPEN_START_TAG : '&lt;' { inTag = true; }; OPEN_END_TAG : '&lt;/' { inTag = true; }; CLOSE_TAG : '&gt;' { inTag = false; }; NAME : {inTag}?=&gt; ('a'..'z'|'A'..'Z')('a'..'z'|'A'..'Z'|'0'..'9')* ; WS : {inTag}?=&gt; (' '|'\t'|'\r'|'\n')+ { $channel = HIDDEN; } ; PCDATA : {!inTag}?=&gt; (~'&lt;')+ { setText($text.trim()); if ($text.length() == 0) $channel = HIDDEN; } ; </code></pre> <p>The problem occurs in</p> <pre><code>element_body </code></pre> <p>which is where i "fixed" the grammer. So my question is -> Whats wring with this grammar, and how can I make it work? Any help is greatly appreciated!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload