Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Grmr2JavaReport"
Line 31: | Line 31: | ||
</table> | </table> | ||
− | Workaround is to manually | + | Workaround for this issue is to manually remove the additional word "public" that causes the parser error in the Javacc file. |
==== A smaller subsection ==== | ==== A smaller subsection ==== | ||
==== A smaller subsection ==== | ==== A smaller subsection ==== | ||
==== A smaller subsection ==== | ==== A smaller subsection ==== |
Revision as of 11:32, 24 May 2008
Contents
Generation of Java from Grammar file
This article describes the issues faced, while working on the generation of Java code from a grammar file using Gymnast, Emfatic and Grammar2Ecore frameworks.
Initial conditions
- Eclipse plug-in project with a grammar file (SVG5.ast) is open as shown in Figure 1. Grammar file has a value for parserGenerator option as javacc.
- srcGymnast (in Figure 1) is the source folder to which Gymnast runtime core plug-in is added manually. Please refer "Bugzilla entry 233805"
- Dependent Plug-ins are added in the MANIFEST.MF file. Hence right clicking on the grammar file shows options like 'Generate .genmodel and Java', 'Generate .genmodel' etc. Refer Figure 2.
Issues
This section describes the issues faced and the workaround for the same.
Parser error in Gymnast generated Javacc file
After checking the well-formedness for the grammar file, click on 'Generate AST' from the context menu. Gymnast generates AST and Parser packages in the 'src' folder (refer Figure 3). Open the Gymnast generated Javacc file (in this case, file svg.jj in the parser package). The Outline view in eclipse shows parser error. This is because Gymnast additionally adds the word "public" in the generated JavaCC file.
Workaround for this issue is to manually remove the additional word "public" that causes the parser error in the Javacc file.