Alessandro Solimando created CALCITE-5505:
---------------------------------------------
Summary: JavaCC warns about missing LOOKAHEAD directives in
Parser.jj
Key: CALCITE-5505
URL: https://issues.apache.org/jira/browse/CALCITE-5505
Project: Calcite
Issue Type: Bug
Components: core
Affects Versions: 1.32.0
Reporter: Alessandro Solimando
JavaCC is reporting several warnings for insufficient lookahead for Parser.jj,
an example of log displaying the warnings is here:
[https://ci-builds.apache.org/job/Calcite/job/Calcite-sonar/job/main/18/consoleFull]
Here is the relevant extract from the aforementioned log file:
{noformat}
> Task :core:javaCCMain
Java Compiler Compiler Version 4.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file
/home/jenkins/jenkins-agent/workspace/Calcite_Calcite-sonar_main/core/build/fmpp/fmppMain/javacc/Parser.jj
. . .
Warning: Output directory
"/home/jenkins/jenkins-agent/workspace/Calcite_Calcite-sonar_main/core/build/javacc/javaCCMain/org/apache/calcite/sql/parser/impl"
does not exist. Creating the directory.
Note: UNICODE_INPUT option is specified. Please make sure you create the
parser/lexer using a Reader with the correct character encoding.
Warning: Choice conflict involving two expansions at
line 4930, column 5 and line 4956, column 5 respectively.
A common prefix is: "MICROSECOND"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4931, column 5 and line 4956, column 5 respectively.
A common prefix is: "MILLISECOND"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4936, column 5 and line 4956, column 5 respectively.
A common prefix is: "DOW"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4937, column 5 and line 4956, column 5 respectively.
A common prefix is: "DOY"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4938, column 5 and line 4956, column 5 respectively.
A common prefix is: "ISODOW"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4939, column 5 and line 4956, column 5 respectively.
A common prefix is: "ISOYEAR"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4940, column 5 and line 4956, column 5 respectively.
A common prefix is: "WEEK"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4950, column 5 and line 4956, column 5 respectively.
A common prefix is: "QUARTER"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4952, column 5 and line 4956, column 5 respectively.
A common prefix is: "EPOCH"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4953, column 5 and line 4956, column 5 respectively.
A common prefix is: "DECADE"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4954, column 5 and line 4956, column 5 respectively.
A common prefix is: "CENTURY"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 4955, column 5 and line 4956, column 5 respectively.
A common prefix is: "MILLENNIUM"
Consider using a lookahead of 2 for earlier expansion.
Warning: Choice conflict involving two expansions at
line 6549, column 9 and line 6551, column 9 respectively.
A common prefix is: "WEEK" "("
Consider using a lookahead of 3 or more for earlier 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 "SimpleCharStream.java" does not exist. Will create one.
Parser generated with 0 errors and 14 warnings.{noformat}
We are probably missing one or two LOOKAHEAD directives in the parser.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)