Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9232

Failed to create parser from .g4 files using official ANTLR4.7.2

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.0-beta-3
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None

      Description

      I was trying to generate a parser from GroovyLexer.g4 and GroovyParser.g4 using the official distribution of ANTLR4 (4.7.2). However, the following error was thrown:

      > antlr -Dlanguage=Go -o parser groovy/GroovyParser.g4
       
      warning(83): groovy/GroovyParser.g4:342:10: unsupported option baseContext
      warning(83): groovy/GroovyParser.g4:374:10: unsupported option baseContext
      warning(83): groovy/GroovyParser.g4:379:10: unsupported option baseContext
      warning(83): groovy/GroovyParser.g4:479:10: unsupported option baseContext
      warning(83): groovy/GroovyParser.g4:489:10: unsupported option baseContext
      error(123): groovy/GroovyParser.g4:788:93: rule alt label castExprAlt redefined in rule expression, originally in rule castOperandExpression
      error(123): groovy/GroovyParser.g4:789:93: rule alt label postfixExprAlt redefined in rule expression, originally in rule castOperandExpression
      error(123): groovy/GroovyParser.g4:792:93: rule alt label unaryNotExprAlt redefined in rule expression, originally in rule castOperandExpression
      error(123): groovy/GroovyParser.g4:798:93: rule alt label unaryAddExprAlt redefined in rule expression, originally in rule castOperandExpression
      warning(83): groovy/GroovyParser.g4:883:10: unsupported option baseContext
      warning(83): groovy/GroovyParser.g4:1118:10: unsupported option baseContext
      warning(83): groovy/GroovyParser.g4:1133:10: unsupported option baseContext

       

        Attachments

          Activity

            People

            • Assignee:
              daniel_sun Daniel Sun
              Reporter:
              zhanyl Yuli Zhan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: