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

Open up AntrlParserPlugin for extension

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6-rc-2
    • 1.6-rc-1, 1.5.8, 1.7-beta-1
    • Compiler
    • None

    Description

      While an error recovery parser is a good idea it is currently not supported by the groovy grammar. The Groovy Eclipse team has come up with a solution of patching the grammar and adding their own AntrlParserPlugin implementation that is a subclass of the original AntrlParserPlugin. But the current implementation of AntrlParserPlugin makes coding subclasses rather cumbersome, specifically because the ast field is private and that the error recovery code must be injected in the middle of the execution of parseCST()

      This feature proposes opening up AntrlParserPlugin for extension, by initially modifying the accessibility of the ast field (or provide protected mutator) by subclasses and refactoring parseCST() to a template method.

      I'll provide a patch shortly and would love to have it merged before 1.6 ships, as this patch would not only help the Groovy Eclipse plugin but also other specialized tools (like SwingPad) that can reapt the benefits of an error recovery parser.

      Attachments

        1. AntlrParserPlugin.patch
          2 kB
          Andres Almiray

        Activity

          People

            guillaume Guillaume Sauthier
            aalmiray Andres Almiray
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: