Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5505

JavaCC warns about missing LOOKAHEAD directives in Parser.jj

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.32.0
    • 1.34.0
    • core
    • None

    Description

      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:

      > 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.

      We are probably missing one or two LOOKAHEAD directives in the parser.

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              asolimando Alessandro Solimando
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: