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

Difference between revisions of "Grammar2Ecore"

(Overview)
Line 1: Line 1:
 
== How to use Grammar to Ecore Generator  ==
 
== How to use Grammar to Ecore Generator  ==
  
Under construction
+
This article describes the steps involved in the generation of .genmodel, .ecore and Java from a grammar file using [[Gymnast]], [[Emfatic]] and [[Grammar2Ecore]] frameworks.
  
== Overview ==
+
== 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  [https://bugs.eclipse.org/bugs/show_bug.cgi?id=233805 "Bugzilla entry 233805"]
 +
<table border="0" cellpadding="8">
 +
<tr>
 +
<td>[[Image:Grammar2Ecore1.jpg]]</td>
 +
</tr>
 +
<caption align="bottom"><b>Figure 1 </b> Project structure </caption>
 +
</table>
 +
* 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.
 +
<table border="0" cellpadding="8">
 +
<tr>
 +
<td>[[Image:Grammar2Ecore2.jpg]]</td>
 +
</tr>
 +
<caption align="bottom"><b>Figure 2 </b> Context menu for grammar file </caption>
 +
</table>

Revision as of 07:38, 25 May 2008

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