Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Grammar2Ecore

How to use Grammar to Ecore Generator

This article describes the steps involved in the generation of .genmodel, .ecore and Java from a grammar file using Gymnast, Emfatic and Grammar2Ecore frameworks.

Initial conditions

  • Eclipse plug-in project with a sample grammar file (in this example, SVG.ast) exists as shown in Figure 1.
  • JavaCC or Antlr can be used as Parser Generators.
  • srcGymnast (in Figure 1) is the source folder to which Gymnast runtime core plug-in is added manually. Please refer "Bugzilla entry 233805"
Grammar2Ecore1.jpg
Figure 1 Project structure
  • 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.
Grammar2Ecore2.jpg
Figure 2 Context menu for grammar file

Back to the top