Hi,

I'm trying to play with master.jj. But the grammar script somethings
prints warning messages. The behavior is strange. In order to simplify
my question, I'd like to take the following example:

In QuadsNotTriples(), line 691 in master.jj, in the "master" branch:
----
<GRAPH>
----
If I change it to "optional" (which is required in future
implementations, for the new grammar):
----
(<GRAPH>)?
----
the grammar script goes like this:

$ ./grammar
---- Process grammar -- sparql_11.jj
Java Compiler Compiler Version 5.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file sparql_11.jj . . .
Warning: Choice conflict in [...] construct at line 464, column 4.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: <VAR1>
         Consider using a lookahead of 2 or more for nested expansion.
Warning: Choice conflict in [...] construct at line 468, column 6.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: <VAR1>
         Consider using a lookahead of 2 or more for nested expansion.
Warning: Choice conflict in [...] construct at line 484, column 12.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: <VAR1>
         Consider using a lookahead of 2 or more for nested expansion.
Warning: Choice conflict in [...] construct at line 759, column 3.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: <VAR1>
         Consider using a lookahead of 2 or more for nested expansion.
Warning: Choice conflict in [...] construct at line 767, column 5.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: <VAR1>
         Consider using a lookahead of 2 or more for nested expansion.
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "JavaCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 5 warnings.
---- Create text form
Java Compiler Compiler Version 5.0 (Documentation Generator Version 0.1.4)
(type "jjdoc" with no arguments for help)
Reading from file sparql_11.jj . . .
Grammar documentation generated successfully in sparql_11.txt
---- Fixing Java warnings in TokenManager ...
---- Fixing Java warnings in Token ...
---- Fixing Java warnings in TokenMgrError ...
---- Fixing Java warnings in SPARQLParser11 ...
---- Done
---- Process grammar -- arq.jj
Java Compiler Compiler Version 5.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file arq.jj . . .
Warning: Choice conflict in [...] construct at line 486, column 4.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: <VAR1>
         Consider using a lookahead of 2 or more for nested expansion.
Warning: Choice conflict in [...] construct at line 490, column 6.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: <VAR1>
         Consider using a lookahead of 2 or more for nested expansion.
Warning: Choice conflict in [...] construct at line 811, column 3.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: <VAR1>
         Consider using a lookahead of 2 or more for nested expansion.
Warning: Choice conflict in [...] construct at line 819, column 5.
         Expansion nested within construct and expansion following construct
         have common prefixes, one of which is: <VAR1>
         Consider using a lookahead of 2 or more for nested expansion.
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "JavaCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 4 warnings.
---- Create text form
Java Compiler Compiler Version 5.0 (Documentation Generator Version 0.1.4)
(type "jjdoc" with no arguments for help)
Reading from file arq.jj . . .
Grammar documentation generated successfully in arq.txt
---- Fixing Java warnings in TokenManager ...
---- Fixing Java warnings in Token ...
---- Fixing Java warnings in TokenMgrError ...
---- Fixing Java warnings in ARQParser ...
---- Done

But I can see "(<WHERE>)?" at line 339 without any trouble. Could you
please tell me why?

regards,
Qihong

Reply via email to