vaulttec / veloedit

Eclipse editor for the Velocity Template Language (VTL)
Eclipse Public License 1.0
41 stars 4 forks source link

Add deep error recovery support to Velocity parser #3

Open tjuerge opened 8 years ago

tjuerge commented 8 years ago

The current JavaCC-generated Velocity parser doesn't support error recovery support - the parser stops after it founds the first error. For the Velocity editor it would be helpful to find only the first error but all potential errors in a template.

By adding deep error recovery to the Velocity parser JavaCC grammar (as explained here) the Velocity editor could annotate more than only the first error. And the editors outline could rendered partially despite of parser errors.

For generating the Java sources from the JavaCC grammar we can leverage the javacc-maven-plugin. Because we're only interested in the generated Parser class we we use the maven-clean-pluginto delete all generated classes but the Parser one.

To keep us from side-effects due to overloading the original Parser class with our own modified version we're deleting the original Parser class from the Velocity jar file which is shipped with the core plugin.