initial check-in after successful completion of ipzilla bug 1842
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/.classpath b/doc/org.eclipse.emf.emfatic.doc.user/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/.project b/doc/org.eclipse.emf.emfatic.doc.user/.project
new file mode 100644
index 0000000..7882e2c
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.emfatic.doc.user</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/META-INF/MANIFEST.MF b/doc/org.eclipse.emf.emfatic.doc.user/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..6e1a7ee
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Emfatic Online Documentation (Incubation)
+Bundle-SymbolicName: org.eclipse.emf.emfatic.doc.user; singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Vendor: Eclipse.org
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/build.properties b/doc/org.eclipse.emf.emfatic.doc.user/build.properties
new file mode 100644
index 0000000..fc53675
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ html/,\
+ *.xml
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/about.html b/doc/org.eclipse.emf.emfatic.doc.user/html/about.html
new file mode 100644
index 0000000..953f45c
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/about.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link rel="STYLESHEET" href="book.css" charset="ISO-8859-1" type="text/css">
+ <title>About this Content</title>
+</head>
+
+<body>
+<h1>About This Content</h1>
+<h3>Notices</h3>
+<p>
+The material in this guide is Copyright (c) IBM Corporation and others 2004, 2007.
+</p>
+
+<h3>License</h3>
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/book.css b/doc/org.eclipse.emf.emfatic.doc.user/html/book.css
new file mode 100644
index 0000000..84c1c77
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/book.css
@@ -0,0 +1,108 @@
+P.Code {
+ display: block;
+ text-align: left;
+ text-indent: 0.00pt;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 15pt;
+ font-size: 10.000000pt;
+ font-weight: medium;
+ font-style: Regular;
+ color: #4444CC;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Courier New";
+}
+H6.CaptionFigColumn {
+ display: block;
+ text-align: left;
+ text-indent: 0.000000pt;
+ margin-top: 3.000000pt;
+ margin-bottom: 11.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 0.000000pt;
+ font-size: 9.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+P.Note {
+ display: block;
+ text-align: left;
+ text-indent: 0pt;
+ margin-top: 19.500000pt;
+ margin-bottom: 19.500000pt;
+ margin-right: 0.000000pt;
+ margin-left: 30pt;
+ font-size: 11.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+EM.UILabel {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+}
+EM.CodeName {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family:"Courier New";
+}
+
+img {
+ margin-bottom: 20.000000pt;
+}
+
+
+/* following font face declarations need to be removed for DBCS */
+
+body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-family: Arial, Helvetica, sans-serif; color: #000000}
+pre { font-family: Courier, monospace}
+
+/* end font face declarations */
+
+/* following font size declarations should be OK for DBCS */
+body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-size: 10pt; }
+pre { font-size: 10pt}
+
+/* end font size declarations */
+
+body { background: #FFFFFF}
+h1 { font-size: 18pt; margin-top: 5; margin-bottom: 1 }
+h2 { font-size: 14pt; margin-top: 25; margin-bottom: 3 }
+h3 { font-size: 11pt; margin-top: 20; margin-bottom: 3 }
+h4 { font-size: 10pt; margin-top: 20; margin-bottom: 3; font-style: italic }
+p { margin-top: 10px; margin-bottom: 10px }
+pre { margin-left: 6; font-size: 9pt }
+a:link { color: #0000FF }
+a:hover { color: #000080 }
+a:visited { text-decoration: underline }
+ul { margin-top: 0; margin-bottom: 10 }
+li { margin-top: 0; margin-bottom: 0 }
+li p { margin-top: 0; margin-bottom: 0 }
+ol { margin-top: 0; margin-bottom: 10 }
+dl { margin-top: 0; margin-bottom: 10 }
+dt { margin-top: 0; margin-bottom: 0; font-weight: bold }
+dd { margin-top: 0; margin-bottom: 0 }
+strong { font-weight: bold}
+em { font-style: italic}
+var { font-style: italic}
+div.revision { border-left-style: solid; border-left-width: thin;
+ border-left-color: #7B68EE; padding-left:5 }
+th { font-weight: bold }
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/FutureWork.htm b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/FutureWork.htm
new file mode 100644
index 0000000..5c1c057
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/FutureWork.htm
@@ -0,0 +1,37 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css">
+<title>Ideas for future work</title>
+
+</head>
+
+<body lang=EN-US>
+
+<h2>Ideas for future work</h2>
+
+<p>Many extensions are possible. </p>
+
+<p>The Emfatic text editor could be extended with usability features of the kind described in the technical report
+<a href="http://www.sts.tu-harburg.de/~mi.garcia/SoC2007/draftreport.pdf"><i>Generation of Eclipse-based IDEs for Custom DSLs</i></a>. </p>
+
+<p>As another example, hints for diagram layout could be specified along text, with an accompanying visualization (as a second tabbed
+page in <tt>MultiPageEditor</tt>), following the ideas of </p>
+
+<ul>
+
+<li>Diomidis Spinellis. On the declarative specification of models. IEEE Software, 20(2):9496, March/April 2003</li>
+<a href="http://www.spinellis.gr/pubs/jrnl/2003-IEEESW-umlgraph/html/article.html">http://www.spinellis.gr/pubs/jrnl/2003-IEEESW-umlgraph/html/article.html</a>
+<br>
+A tool exemplifying the proposed functionality is UMLGraph: <a href="http://www.spinellis.gr/sw/umlgraph/">http://www.spinellis.gr/sw/umlgraph/</a>
+<li> Martin Fowler on this topic, <a href="http://martinfowler.com/bliki/UmlSketchingTools.html">http://martinfowler.com/bliki/UmlSketchingTools.html</a>
+</li>
+
+<li> Another, layout only tool, with syntax for layout hints: MetaUML <a href="http://metauml.sourceforge.net/">http://metauml.sourceforge.net/</a></li>
+
+</ul>
+
+</body>
+
+</html>
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image001.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image001.gif
new file mode 100644
index 0000000..cbf9836
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image001.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image002.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image002.gif
new file mode 100644
index 0000000..ccf290c
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image002.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image003.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image003.gif
new file mode 100644
index 0000000..896a661
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image003.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image004.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image004.gif
new file mode 100644
index 0000000..a006f30
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image004.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image005.jpg b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image005.jpg
new file mode 100644
index 0000000..566b02f
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image005.jpg
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image006.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image006.gif
new file mode 100644
index 0000000..fded62e
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image006.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image007.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image007.gif
new file mode 100644
index 0000000..3f39d40
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image007.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image008.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image008.gif
new file mode 100644
index 0000000..f883320
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image008.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image009.jpg b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image009.jpg
new file mode 100644
index 0000000..15ecab2
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image009.jpg
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image010.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image010.gif
new file mode 100644
index 0000000..a9cdd95
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image010.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image011.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image011.gif
new file mode 100644
index 0000000..8c8b619
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image011.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image012.jpg b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image012.jpg
new file mode 100644
index 0000000..294b3cd
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image012.jpg
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image013.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image013.gif
new file mode 100644
index 0000000..2eb35cc
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image013.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image014.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image014.gif
new file mode 100644
index 0000000..81c11b6
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image014.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image015.jpg b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image015.jpg
new file mode 100644
index 0000000..ea9cee3
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image015.jpg
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image016.gif b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image016.gif
new file mode 100644
index 0000000..255d4a2
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures-Dateien/image016.gif
Binary files differ
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures.htm b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures.htm
new file mode 100644
index 0000000..5f7ad65
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/GUIFeatures.htm
@@ -0,0 +1,286 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css">
+<title>Usability features of the editor </title>
+
+
+</head>
+
+<body lang=EN-US>
+
+<h1>Usability features of the editor</h1>
+
+
+<h2>Architecture</h2>
+
+<p>The main motivation behind the GUI improvements was adding
+support for EMF Generics to the Feb 2005 release of Emfatic (authored by Christopher J Daly).
+<br>
+The conversion between <tt>.ecore</tt> and <tt>.emf</tt> now understands them, as a consequence Emfatic
+now requires EMF 2.3 or higher. Examples of new productions in the grammar appear
+at the end of this document, the new grammar is backwards compatible. </p>
+
+<p>After each keystroke the document is parsed, a CST is built and
+(if possible) an AST too. A bidirectional multimap keeps the correspondence
+between textual representation (CST nodes) and AST node. The performance impact
+is acceptable. Functionality such as "Mark Occurrences" do not resort to exploring
+the textual document. Instead, the (offset, length) pair is used to get a CST
+node, from which an AST node can be found, making for robust navigation. </p>
+
+<p>The availability of CST, AST and their bridging will likely
+simplify the introduction of new functionality. </p>
+
+<h2>New GUI features</h2>
+
+<table border=1 cellspacing=0 cellpadding=0>
+ <tr style='page-break-inside:avoid'>
+ <td width=311 valign=top style='width:233.1pt;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal><img border=0 width=278 height=269
+ src="GUIFeatures-Dateien/image001.gif"></p>
+ </td>
+ <td width=223 colspan=2 valign=top style='width:167.3pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal>The Outline view now displays the same elements as the
+ Sample Ecore Editor, toolbar actions are available for hiding/showing
+ annotations, attributes, references, operations. </p>
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=311 valign=top style='width:233.1pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal><img border=0 width=319 height=208
+ src="GUIFeatures-Dateien/image002.gif"></p>
+ <p class=MsoNormal> </p>
+ </td>
+ <td width=223 colspan=2 valign=top style='width:167.3pt;border-top:none;
+ border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal>Mark occurrences highlights usages of the same
+ EClassifier, range indication on the vertical bar spans the EClassifier
+ declaration.</p>
+ <p class=MsoNormal> </p>
+ <p class=MsoNormal> </p>
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=311 valign=top style='width:233.1pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal> </p>
+ <p class=MsoNormal><img border=0 width=266 height=103
+ src="GUIFeatures-Dateien/image003.gif"></p>
+ <p class=MsoNormal> </p>
+ <p class=MsoNormal><img border=0 width=310 height=158
+ src="GUIFeatures-Dateien/image004.gif"></p>
+ <p class=MsoNormal> </p>
+ <p class=MsoNormal> </p>
+ <p class=MsoNormal> </p>
+ </td>
+ <td width=223 colspan=2 valign=top style='width:167.3pt;border-top:none;
+ border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p class=MsoNormal>Folding is supported, with an annotation hover for
+ collapsed regions. </p>
+
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+
+ <p>Problem and warning markers (with squigglies) are updated after
+ each keystroke. </p>
+
+ <p class=MsoNormal align=center style='text-align:center'><img border=0
+ width=576 height=304 src="GUIFeatures-Dateien/image005.jpg"></p>
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+
+ <p>Attempting to generate an .emf for an .ecore triggers an
+ EcoreValidation. Errors and warnings are shown in the Problems view, generation
+ is still allowed if there are only warnings. </p>
+ <p class=MsoNormal align=center style='text-align:center'><img border=0
+ width=543 height=370 src="GUIFeatures-Dateien/image006.gif"></p>
+ <p class=MsoNormal align=center style='text-align:center'> </p>
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=432 colspan=2 valign=top style='width:323.75pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+
+
+ <p><img border=0 width=448 height=155
+ src="GUIFeatures-Dateien/image007.gif"></p>
+ </td>
+ <td width=102 valign=top style='width:76.65pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+ <p>The selected outline node follows the cursor position in
+ the text </p>
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+ <p><img border=0 width=447 height=93
+ src="GUIFeatures-Dateien/image008.gif"></p>
+
+ <p>Navigable hyperlinks (from usages of classifiers and type
+ variables to their declarations)</p>
+
+ <p>Hyperlinks are very handy for example to follow an
+ eOpposite to its declaration (alternatively, letting the mouse cursor rest over
+ an eOpposite displays its definition in a text hover, see below)</p>
+
+ <p>Open declaration is also supported, i.e. pressing F3 (or
+ whatever key binding is in effect for it) moves the cursor to the
+ declaration.</p>
+
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+ <p>A <i>File > New > Other
</i> wizard is available,
+ which initializes the just created .emf file to a syntactically correct
+ state: </p>
+ <p><span style='font-size:10.0pt'> </span></p>
+ <p><span style='font-size:10.0pt;font-family:"Courier New";color:black'>@namespace(</span></p>
+ <p style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> uri=</span><b>
+ <span style='font-size:10.0pt;font-family:"Courier New";color:navy'>"http://a.b.c/x/y/Z"</span></b>
+ <span style='font-size:10.0pt;font-family:"Courier New";color:black'>, </span></p>
+ <p class=MsoNormal style='text-autospace:none'><span lang=DE
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> prefix=</span><b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:navy'>"p"</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'>)</span></p>
+ <p style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:navy'>package</span></b><span
+ style='font-size:10.0pt;font-family:"Courier New";color:black'> top;</span></p>
+
+ <p align=center style='text-align:center'><img border=0
+ width=297 height=371 src="GUIFeatures-Dateien/image009.jpg"></p>
+
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+
+ <p>Hovers for usages of classifiers, type parameter
+ variables, and eOpposite references: the definition is shown. </p>
+
+ <p class=MsoNormal align=center style='text-align:center'><img border=0
+ width=495 height=241 src="GUIFeatures-Dateien/image010.gif"></p>
+
+ </td>
+ </tr>
+ <tr height=0>
+ <td width=426 style='border:none'></td>
+ <td width=121 style='border:none'></td>
+ <td width=102 style='border:none'></td>
+ </tr>
+</table>
+
+
+
+<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
+ style='border-collapse:collapse;border:none'>
+ <tr style='page-break-inside:avoid'>
+ <td width=175 valign=top style='width:131.4pt;border:solid windowtext 1.0pt;
+ padding:0cm 5.4pt 0cm 5.4pt'>
+
+ <p><img border=0 width=146 height=82
+ src="GUIFeatures-Dateien/image011.gif"></p>
+ </td>
+ <td width=415 valign=top style='width:311.4pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
+
+ <p>AutoEdits</p>
+
+ <p><b>SmartBrace</b>: typing an opening brace automatically
+ adds its closing brace and leaves the cursor indented on its own line (end
+ result shown left) </p>
+
+ <p>Besides that strategy the usual ones: </p>
+ <p class=MsoNormal style='margin-left:24.0pt;text-indent:-18.0pt'>-<span
+ style='font:7.0pt "Times New Roman"'>
+ </span>DefaultIndentLine</p>
+ <p class=MsoNormal style='margin-left:24.0pt;text-indent:-18.0pt'>-<span
+ style='font:7.0pt "Times New Roman"'>
+ </span>Closing quote for opening quote</p>
+
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=590 colspan=2 valign=top style='width:442.8pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+
+ <p>Preference pages, to control AutoEdits and templates (see
+ example below)</p>
+
+ <p class=MsoNormal align=center style='text-align:center'><img border=0
+ width=466 height=269 src="GUIFeatures-Dateien/image012.jpg"></p>
+
+ </td>
+ </tr>
+ <tr style='page-break-inside:avoid'>
+ <td width=590 colspan=2 valign=top style='width:442.8pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
+
+ <p>A template for each kind of annotation saves typing. In
+ the example, the template definition for adding OCL invariants is shown (the
+ error marker is transient, once the template is inserted it disappears) </p>
+
+ <p class=MsoNormal align=center style='text-align:center'><img border=0
+ width=576 height=155 src="GUIFeatures-Dateien/image013.gif"></p>
+
+ <p>after choosing the template above</p>
+
+ <p align=center style='text-align:center'><img border=0
+ width=438 height=135 src="GUIFeatures-Dateien/image014.gif"></p>
+
+ </td>
+ </tr>
+</table>
+
+
+
+<h2><a name="_Toc159305515">Show in EMF Type Hierarchy</a></h2>
+
+
+
+<p>Show in EMF Type Hierarchy can be activated from the
+editor and from the outline view</p>
+
+<p align=center style='text-align:center'><img border=0
+width=391 height=163 src="GUIFeatures-Dateien/image015.jpg"></p>
+
+
+
+<p>The supertype and subtype relationships can be followed,
+with a list of (inherited) class members displayed on the lower pane.
+Double-clicking on any of these elements navigates in the editor to its
+declaration. </p>
+
+
+
+<p align=center style='text-align:center'><img border=0
+width=365 height=506 src="GUIFeatures-Dateien/image016.gif"></p>
+
+
+
+</div>
+
+</body>
+
+</html>
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/example.html b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/example.html
new file mode 100644
index 0000000..f30753f
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/gettingstarted/example.html
@@ -0,0 +1,112 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+
+<head>
+ <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+ <title>Emfatic Getting Started Guide</title>
+</head>
+<body>
+<h1>Emfatic Getting Started Guide</h1>
+by Chris Daly (cjdaly@us.ibm.com)<br>
+Copyright IBM Corp. 2004<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+Emfatic is a language designed to represent EMF Ecore models in a
+textual form. This document shows the basic steps involved in
+working with Emfatic.<br>
+<br>
+<span style="font-weight: bold;">Please see the </span><span
+ style="font-style: italic; font-weight: bold;">Emfatic Language
+Reference</span><span style="font-weight: bold;"> for a full
+explanation of the syntax and sematics of the Emfatic language.</span><br>
+<br>
+In this document, Emfatic programs are shown in boxes
+as in the example below:<br>
+<br>
+<table
+ style="width: 100%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 255);"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">package test;<br>
+class Foo { }</td>
+ </tr>
+ </tbody>
+</table>
+<br>
+When compiled, the program above will produce a model with an <span
+ style="font-weight: bold;">EPackage</span> named "test" containing a
+single <span style="font-weight: bold;">EClass</span> named "Foo".<br>
+<br>
+Let's go ahead and create an Emfatic file with the above source code:<br>
+<ul>
+ <li>Create a new project or use an existing one for the next step (it
+doesn't matter what kind of project you choose or which Eclipse
+perspective you are in).</li>
+ <li>Create a new file called "test.emf".</li>
+ <li>Enter the two lines from the box above in test.emf.</li>
+ <li>Save test.emf.</li>
+ <li>In the Navigator view (or Package Explorer), right-click on
+test.emf and select <span style="font-weight: bold;">Generate Ecore
+Model</span>.<br>
+ </li>
+</ul>
+Now you should see a new file called "test.ecore" in the Navigator (In
+the same folder as test.emf). Try the following:<br>
+<ul>
+ <li>Open test.ecore (using the default EMF Ecore model editor)</li>
+ <li>Right-click on the EPackage "test" and select <span
+ style="font-weight: bold;">New Child</span> -> <span
+ style="font-weight: bold;">EClass</span>.</li>
+ <li>Select the new EClass, right-click and <span
+ style="font-weight: bold;">Show Properties View</span>.</li>
+ <li>In the Properties view, enter the name "Bar" for the EClass</li>
+ <li>In the Properties view, change the value of the property Abstract
+to true.</li>
+ <li>Save test.ecore.</li>
+ <li>In the Navigator view, right-click on test.ecore and select <span
+ style="font-weight: bold;">Generate Emfatic Source</span>.<br>
+ </li>
+</ul>
+Look at test.emf again. It should now look something like this:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">package test;<br>
+ <br>
+class Foo {<br>
+}<br>
+ <br>
+abstract class Bar {<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+<br>
+You have now seen the basic steps involved in working with
+Emfatic.<br>
+<br>
+Here are a few key points to stress:<br>
+<ul>
+ <li>Emfatic source files use the extension <span
+ style="font-family: monospace;">.emf</span></li>
+ <li>Save your Emfatic and Ecore files before invoking the "Generate"
+actions (Emfatic reads the file from disk rather than looking at the
+contents of the editor)</li>
+ <li>Emfatic will overwrite existing files as you invoke the
+"Generate" actions, so be careful!</li>
+</ul>
+<br>
+<br>
+</body>
+
+
+</html>
\ No newline at end of file
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/reference/Emfatic002Update.html b/doc/org.eclipse.emf.emfatic.doc.user/html/reference/Emfatic002Update.html
new file mode 100644
index 0000000..8e97367
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/reference/Emfatic002Update.html
@@ -0,0 +1,221 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+ <title>Emfatic 0.0.2 Release Note</title>
+</head>
+<body>
+<h1>Emfatic 0.0.2 Release Note</h1>
+by Chris Daly (cjdaly@us.ibm.com)<br>
+Copyright IBM Corp. 2004<br>
+<br>
+<br>
+The 0.0.2 release of Emfatic introduces several small changes in the
+area of annotations and datatypes. The intent of the changes is
+to fix problems with the mapping between Emfatic and Ecore and to
+bring the Emfatic annotation syntax closer in line with that of Java
+1.5 annotations.<br>
+<br>
+<h3>1. Changes to Annotations</h3>
+Following are examples that explain the use of annotations in Emfatic
+0.0.2 and the changes from the 0.0.1 release.<br>
+<br>
+In the example below, the text <span style="font-family: monospace;">ann</span>
+is used as the <span style="font-weight: bold;">source</span> value
+twice in the context of a single element. Previously Emfatic made
+an attempt to combine multiple annotations with the same <span
+ style="font-weight: bold;">source</span> value into a single
+annotation. However Ecore allows multiple annotations of a model
+element to use the same <span style="font-weight: bold;">source</span>
+value. So the Emfatic 0.0.1 mapping failed to allow Ecore models
+with this pattern of annotation use to be created. With 0.0.2,
+the code below will produce two annotations, both with <span
+ style="font-weight: bold;">source</span> set to <span
+ style="font-family: monospace;">ann</span>, for the class in the model.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">package p;</span><br
+ style="font-family: monospace;">
+ <br style="font-family: monospace;">
+ <span style="font-family: monospace;">@ann(k="v")</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">@ann(k="v2")</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">class C { }</span><br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+<br>
+<br>
+Another problem with Emfatic 0.0.1 caused annotation details to be
+written in a different order than their actual order in the Ecore model.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">package p;</span><br
+ style="font-family: monospace;">
+ <br style="font-family: monospace;">
+ <span style="font-family: monospace;">@ann(k1="v1", k2="v2",
+k3="v3")</span><br style="font-family: monospace;">
+ <span style="font-family: monospace;">class C { }</span><br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+The example above shows an annotation with 3 key/value detail
+pairs. Generating Ecore from this and then generating Emfatic
+from the Ecore could result in the annotation details appearing in a
+different order. With Emfatic 0.0.2 you will be able to go from
+Emfatic to Ecore and from Ecore back to Emfatic and the order of
+details in an annotation (as well as the order of annotations on an
+element) will be preserved.<br>
+<br>
+<br>
+<br>
+Finally, Emfatic 0.0.2 allows a form of annotation similar to the Java
+1.5 annotation style where a value is indicated, but the key is not
+named. It should be as simple as omitting the key, like this:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">package p;</span><br
+ style="font-family: monospace;">
+ <br style="font-family: monospace;">
+ <span style="font-family: monospace;">@ann("hello")</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">class C { }</span><br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+However the above code will produce a warning. To properly use
+this syntax you must declare the names of any "implicit" annotation
+keys using the EmfaticAnnotationMap. The EmfaticAnnotationMap was
+introduced for Emfatic 0.0.1 as a way to replace long source URIs with
+short labels in Emfatic code. Now the form of
+EmfaticAnnotationMap usage has been modified slightly to allow implicit
+key names to be defined as well. The example below shows how to
+create a label called "ann" with an implicit key named "key" mapped to
+the source URI "http://ann-uri".<span style="font-family: monospace;"></span><br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">@EmfaticAnnotationMap("ann(key)"="http://ann-uri")</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">package p;</span><br
+ style="font-family: monospace;">
+ <br style="font-family: monospace;">
+ <span style="font-family: monospace;">@ann("hello") // like
+saying @ann(key="hello")</span><br style="font-family: monospace;">
+ <span style="font-family: monospace;">class C { }</span><br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Below is another example that shows how model documentation annotations
+can be simplified by using this style of annotation syntax.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">@EmfaticAnnotationMap("doc(documentation)"="http://www.eclipse.org/emf/2002/GenModel")</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">package p;</span><br
+ style="font-family: monospace;">
+ <br style="font-family: monospace;">
+ <span style="font-family: monospace;">@doc("my model
+documentation")</span><br style="font-family: monospace;">
+ <span style="font-family: monospace;">class C { }</span><br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Here is a final example showing how more than one implicit annotation
+key can be defined:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">@EmfaticAnnotationMap("ann(key)"="http://ann-URI")</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">@EmfaticAnnotationMap("ann(a,b)"="http://ann-URI")</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">package p;</span><br
+ style="font-family: monospace;">
+ <br style="font-family: monospace;">
+ <span style="font-family: monospace;">@ann("hello")</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">@ann("X", "Y")</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">class C { }</span><br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+<br>
+<br>
+<h3>2. Fix for Serializable Datatypes</h3>
+<br>
+The following example shows how the <span
+ style="font-family: monospace;">transient</span> modifier can be used
+to change the value of the <span style="font-weight: bold;">EDataType</span>
+<span style="font-weight: bold;">serializable</span> attribute from the
+default of true to false.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">package p;</span><br
+ style="font-family: monospace;">
+ <br style="font-family: monospace;">
+ <span style="font-family: monospace;">datatype d1 : x;</span><br
+ style="font-family: monospace;">
+ <span style="font-family: monospace;">transient datatype d2 : x;</span><br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+<br>
+In the 0.0.1 release, the default for <span style="font-weight: bold;">serializable</span>
+and the meaning of <span style="font-family: monospace;">transient</span>
+were both incorrect. This has been fix for the 0.0.2 release.<br>
+<br>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/reference/EmfaticGrammar.html b/doc/org.eclipse.emf.emfatic.doc.user/html/reference/EmfaticGrammar.html
new file mode 100644
index 0000000..2403f91
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/reference/EmfaticGrammar.html
@@ -0,0 +1,604 @@
+<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=Generator content="Microsoft Word 10 (filtered)">
+<title>language Emfatic;</title>
+
+<style>
+<!--
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {margin:0cm;
+ margin-bottom:.0001pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";}
+@page Section1
+ {size:612.0pt 792.0pt;
+ margin:70.85pt 70.85pt 2.0cm 70.85pt;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+
+</head>
+
+<body lang=DE>
+
+<div class=Section1>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:blue'>language</span><span style='font-size:
+8.0pt;font-family:"Courier New";color:black'> Emfatic;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:blue'>options</span><span style='font-size:
+8.0pt;font-family:"Courier New";color:black'> { k=3; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> parserPackageName=</span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"org.eclipse.emf.emfatic.core.lang.gen.parser"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'>; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> astPackageName=</span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"org.eclipse.emf.emfatic.core.lang.gen.ast"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'>; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> astBaseClassName=</span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"EmfaticASTNode"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'>;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> }</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> compUnit [entry]
+: packageDecl importStmts topLevelDecls ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> packageDecl : annotations
+</span><b><span style='font-size:8.0pt;font-family:"Courier New";color:navy'>"package"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> name=qualifiedID
+SEMI ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> qualifiedID :
+id1=ID (qidSeparator idn=ID)* ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>token</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> qidSeparator :
+DOT | DOLLAR ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>abstract</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> stringLiteralOrQualifiedID
+: stringLiteralContainer | qualifiedIDContainer ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> stringLiteralContainer
+: STRING_LITERAL ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> qualifiedIDContainer
+: qualifiedID ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> annotations : annotation*
+;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> annotation : AT source=stringLiteralOrQualifiedID
+LPAREN keyEqualsValueList RPAREN ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> keyEqualsValueList
+: kv1=keyEqualsValue (COMMA kvn=keyEqualsValue)* ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> keyEqualsValue :
+key=stringLiteralOrQualifiedID EQUALS value=stringLiteralOrQualifiedID ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> importStmts : importStmt*
+; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> importStmt : </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"import"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> (alias=ID
+EQUALS)? uri=stringLiteralOrQualifiedID SEMI ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> topLevelDecls : topLevelDecl*
+;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>abstract</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> topLevelDecl : (annotations)
+</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> subPackageDecl | classDecl | dataTypeDecl
+| enumDecl | mapEntryDecl ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> subPackageDecl :
+</span><b><span style='font-size:8.0pt;font-family:"Courier New";color:navy'>"package"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> name=ID LCURLY topLevelDecls
+RCURLY ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> classDecl : (abstractModifier)?
+</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> classKind name=ID </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> (typeParamsInfo=typeParamsInfo)?</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> (</span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"extends"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> superTypes=commaListBoundExceptWild)?
+</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> (COLON instClassName=boundExceptWildcard)?
+</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> LCURLY classMemberDecls
+RCURLY ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> commaListBoundExceptWild
+: tb1=boundExceptWildcard (COMMA tbn=boundExceptWildcard)*;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> abstractModifier
+: </span><b><span style='font-size:8.0pt;font-family:"Courier New";color:navy'>"abstract"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>token</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> classKind : </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"class"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> | </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"interface"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> typeParamsInfo :
+LT oneOrMoreTypeParams GT ; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> oneOrMoreTypeParams
+: tp1=typeParam (COMMA tpn=typeParam)* ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> typeParam : typeVarName=ID
+(typeBoundsInfo=typeBoundsInfo)? ; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> typeBoundsInfo :
+</span><b><span style='font-size:8.0pt;font-family:"Courier New";color:navy'>"extends"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> oneOrMoreTypeParamBounds
+; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> oneOrMoreTypeParamBounds
+: tb1=boundExceptWildcard (AMP tbn=boundExceptWildcard)*; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> boundExceptWildcard
+: rawTNameOrTVarOrParamzedTName=qualifiedID (LT oneOrMoreTypeArgs GT)? ; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> oneOrMoreTypeArgs
+: ta1=typeArg (COMMA tan=typeArg)*;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>abstract</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> typeArg : boundExceptWildcard
+| wildcard ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> wildcard : QMARK
+( extendsOrSuper boundExceptWildcard )? ; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>token</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> extendsOrSuper :
+</span><b><span style='font-size:8.0pt;font-family:"Courier New";color:navy'>"extends"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> | </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"super"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> ; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy;background:gray'>// there are no array types
+in EMF</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy;background:gray'>/* dot means package nesting,
+there are no inner classes in EMF */</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> classMemberDecls
+: classMemberDecl* ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>abstract</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> classMemberDecl
+: (annotations modifiers) attribute | reference | operation ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> attribute : </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"attr"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> typeWithMulti name=ID
+(EQUALS defaultValueExpr)? SEMI ; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> typeWithMulti : name=boundExceptWildcard
+(multiplicity)? ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> multiplicity :
+LSQUARE (multiplicityExpr)? RSQUARE ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> multiplicityExpr
+: lowerBound=simpleMultiplicityExpr (DOT_DOT upperBound=simpleMultiplicityExpr)?
+;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>token</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> simpleMultiplicityExpr
+: STAR | PLUS | QMARK | INT_LITERAL ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> reference : referenceKind
+typeWithMulti (HASH oppositeName=ID)? name=ID SEMI ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>token</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> referenceKind : </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"ref"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> | </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"val"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> modifiers : optNegatedModifier*
+;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> optNegatedModifier
+: (BANG)? modifier ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>token</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> modifier</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy;background:gray'>// keyword EMF meaning</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>: </span><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy'>"readonly"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy;background:gray'>//
+EStructuralFeature.changeable = false</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>| </span><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy'>"volatile"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy;background:gray'>//
+EStructuralFeature.volatile = true</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>| </span><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy'>"transient"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy;background:gray'>//
+EStructuralFeature.transient = true</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>| </span><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy'>"unsettable"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy;background:gray'>//
+EStructuralFeature.unsettable = true</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>| </span><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy'>"derived"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy;background:gray'>//
+EStructuralFeature.derived = true</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>| </span><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy'>"unique"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy;background:gray'>//
+*ETypedElement.unique = true -- bag?</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>| </span><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy'>"ordered"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy;background:gray'>//
+*ETypedElement.ordered = true -- random?</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>| </span><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy'>"resolve"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy;background:gray'>//
+*EReference.resolveProxies = true -- local?</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>| </span><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy'>"id"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy;background:gray'>//
+EAttribute.id = true</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'>;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>abstract</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> defaultValueExpr
+: boolExpr | intExpr | stringExpr | charExpr ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> boolExpr : trueOrFalse
+;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>token</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> trueOrFalse : </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"true"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> | </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"false"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> intExpr :
+(MINUS)? INT_LITERAL ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> stringExpr :
+STRING_LITERAL ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> charExpr :
+CHAR_LITERAL ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> operation : </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"op"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> (typeParamsInfo=typeParamsInfo)?
+</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> resType=resultType name=ID LPAREN (params)?
+RPAREN </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New";color:black'> (</span><b><span style='font-size:
+8.0pt;font-family:"Courier New";color:navy'>"throws"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> exceptions=commaListBoundExceptWild)?
+SEMI ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>abstract</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> resultType : typeWithMulti
+| voidContainer ; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> voidContainer : </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"void"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> ; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> params :
+p1=param (COMMA pn=param)*; </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> param : leadingAnnotations=annotations
+modifiers typeWithMulti name=ID trailingAnnotations=annotations ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy;background:gray'>// "transient" means
+!serializable</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> dataTypeDecl : (transientModifier)?
+</span><b><span style='font-size:8.0pt;font-family:"Courier New";color:navy'>"datatype"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> name=ID COLON instClassName=stringLiteralOrQualifiedID
+SEMI ; </span><b><span style='font-size:8.0pt;font-family:"Courier New";
+color:navy;background:gray'>// TODO datatypes should accept type parameters</span></b></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> transientModifier
+: </span><b><span style='font-size:8.0pt;font-family:"Courier New";color:navy'>"transient"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> enumDecl : </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"enum"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> name=ID LCURLY enumLiterals
+RCURLY ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>list</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> enumLiterals : enumLiteral*
+;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> enumLiteral : leadingAnnotations=annotations
+name=ID (EQUALS val=INT_LITERAL)? trailingAnnotations=annotations SEMI ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:red;background:yellow'>sequence</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> mapEntryDecl : </span><b><span
+style='font-size:8.0pt;font-family:"Courier New";color:navy'>"mapentry"</span></b><span
+style='font-size:8.0pt;font-family:"Courier New";color:black'> name=ID COLON key=typeWithMulti
+MINUS_GT value=typeWithMulti SEMI ;</span></p>
+
+<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
+font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:8.0pt;
+font-family:"Courier New";color:navy;background:gray'>// the following tokens were
+added to cater for generics syntax : AMP, LT, GT</span></b><span
+style='font-size:8.0pt;font-family:"Courier New"'> </span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+</div>
+
+</body>
+
+</html>
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/reference/LanguageRef.html b/doc/org.eclipse.emf.emfatic.doc.user/html/reference/LanguageRef.html
new file mode 100644
index 0000000..28d6708
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/reference/LanguageRef.html
@@ -0,0 +1,1387 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+ <title>Emfatic Language Reference</title>
+</head>
+<body>
+<h1>Emfatic Language Reference (draft)<br>
+</h1>
+by Chris Daly (cjdaly@us.ibm.com)<br>
+Copyright IBM Corp. 2004<br>
+<br>
+<span style="font-style: italic;">Note: Emfatic, as described here, is
+in sync with Emfatic version 0.0.1 available from alphaWorks</span>
+(http://w3.alphaworks.ibm.com/techs/overview.jsp?tech=emfatic)<br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+Emfatic is a language designed to represent EMF Ecore models in a
+textual form. This document details the syntax of Emfatic and the
+mapping between Emfatic declarations and the corresponding Ecore
+constructs.<br>
+<br>
+<span style="font-weight: bold;">Please see the </span><span
+ style="font-style: italic; font-weight: bold;">Emfatic Setup Guide</span><span
+ style="font-weight: bold;"> </span><span style="font-weight: bold;">and</span><span
+ style="font-weight: bold;"> the <span style="font-style: italic;">Emfatic
+G</span></span><span style="font-style: italic; font-weight: bold;">etting
+Started Guide</span><span style="font-weight: bold;"> for
+information on how to get, install and use Emfatic in your Eclipse
+environment.</span><br>
+<br>
+<h2>1. Packages</h2>
+In this document, Emfatic programs are shown in boxes
+as in the example below:<br>
+<br>
+<table
+ style="width: 100%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 255);"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">package test;<br>
+class Foo { }</td>
+ </tr>
+ </tbody>
+</table>
+<br>
+When compiled, the program above will produce a model with an <span
+ style="font-weight: bold;">EPackage</span> named "test" containing a
+single <span style="font-weight: bold;">EClass</span> named "Foo".<br>
+<br>
+As is probably clear from the first Emfatic program above, the keyword <span
+ style="font-family: monospace;">package</span> introduces an Ecore <span
+ style="font-weight: bold;">EPackage</span> and the identifier
+following it maps to the <span style="font-weight: bold;">name</span>
+attribute of the generated <span style="font-weight: bold;">EPackage</span>.<br>
+<h3>1.1 Main Package</h3>
+The only thing required in an Emfatic source file is a package
+declaration. This required element is called the main package
+declaration and the <span style="font-weight: bold;">EPackage</span>
+it defines will contain (directly or indirectly) all of the other
+elements of the generated Ecore model. Thus the simplist possible
+Emfatic program would look something like this:<br>
+<br>
+<table
+ style="width: 100%; text-align: left; background-color: rgb(204, 204, 255); font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">package p;<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Specifying values for the <span style="font-weight: bold;">EPackage</span>
+attributes <span style="font-weight: bold;">nsURI</span> and <span
+ style="font-weight: bold;">nsPrefix</span> is done like this:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">@namespace(uri="http://www.eclipse.org/emf/2002/Ecore",
+prefix="ecore")<br>
+package ecore;<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Note that Emfatic is case-sensitive in most contexts (reflecting the
+underlying case-sensitivity of Ecore), however the identifiers <span
+ style="font-family: monospace;">namespace</span>, <span
+ style="font-family: monospace;">uri</span> and <span
+ style="font-family: monospace;">prefix</span> in the text above could
+be written in
+any case. Also note that the order of declaration for <span
+ style="font-family: monospace;">uri</span> and <span
+ style="font-family: monospace;">prefix</span> is not important<span
+ style="font-family: monospace;"></span>. The syntax of the <span
+ style="font-family: monospace;">@namespace</span> declaration is
+actually a special case of the more general syntax for declaring
+EAnnotations, which will be described in full detail in section 5 below.<br>
+<br>
+<h3>1.2 Sub-Packages</h3>
+Ecore allows packages to be nested inside packages. In Emfatic,
+the syntax for nested packages differs from that of the main
+package. Nested package declarations are followed by a
+curly-brace bracketed region which encloses the nested package
+contents. The example below demonstrates package nesting. <br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">package main;<br>
+ <br>
+package sub1 {<br>
+}<br>
+ <br>
+package sub2 {<br>
+ package sub2_1 { }<br>
+ package sub2_2 { }<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+In the Ecore model generated from the above program, the top-level
+package named "main" will contain two packages, "sub1" and "sub2", and
+package sub2 will contain the packages "sub2_1" and "sub2_2".<br>
+<span style="font-style: italic;"></span><br>
+<h3>1.3 Main Package Imports</h3>
+Import statements allow for types defined in external Ecore models to
+be referenced. All import statements must immediately follow the
+main package declaration. The example below demonstrates the
+basic syntax of import statements. The double-quoted string
+literal following the import keyword must contain the URI of an Ecore
+model.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">package main;<br>
+ <br>
+import "platform:/resource/proj1/foo.ecore";<br>
+import "http://www.eclipse.org/emf/2002/Ecore";<br>
+ <br>
+package sub { }<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Note that Ecore.ecore is automatically imported, so the second import
+in the program above is not really necessary.<br>
+<br>
+<h2>2. Classifiers</h2>
+<h3>2.1 Classes</h3>
+The Emfatic syntax for class declarations is very similar to Java,
+however a few quirks are required to allow for all of the possibilities
+of Ecore. The example below containing four simple class
+declarations demonstrates the use of the keywords <span
+ style="font-family: monospace;">class</span>, <span
+ style="font-family: monospace;">interface</span> and <span
+ style="font-family: monospace;">abstract</span> and also introduces
+Emfatic comments (Emfatic allows both styles of Java comments).
+The comments detail the mapping from Emfatic to the <span
+ style="font-weight: bold;">EClass</span> attributes <span
+ style="font-weight: bold;">interface</span> and <span
+ style="font-weight: bold;">abstract</span>.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">package main;<br>
+ <br>
+class C1 {
+}
+// isInterface=false, isAbstract=false<br>
+abstract class C2 { } //
+isInterface=false, isAbstract=true<br>
+interface I1 {
+} //
+isInterface=true, isAbstract=false<br>
+abstract interface I2 { } // isInterface=true,
+isAbstract=true<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Inheritance is specified with the keyword <span
+ style="font-family: monospace;">extends</span>. Unlike Java,
+there is no <span style="font-family: monospace;">implements</span>
+keyword to distinguish inheritance from interface implementation.
+The example below defines an inheritance hierarchy.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">package main;<br>
+ <br>
+class A { }<br>
+class B { }<br>
+class C extends A, B { }<br>
+class D extends C { }<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+If necessary, the value of the <span style="font-weight: bold;">EClassifier</span>
+attribute <span style="font-weight: bold;">instanceClassName</span>
+can be specified. The class <span style="font-weight: bold;">EStringToStringMapEntry</span>
+from Ecore.ecore provides an example of this:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">class EStringToStringMapEntry :
+java.util.Map$Entry {<br>
+ // ... contents omitted ...<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Note that if the class both extends other classes and specifies a value
+for <span style="font-weight: bold;">instanceClassName</span>, the <span
+ style="font-family: monospace;">extends</span> clause must precede the
+<span style="font-weight: bold;">instanceClassName</span> clause.<br>
+<br>
+<h3>2.2 Data Types</h3>
+Declaring an EDataType is fairly simple. Here are some familiar
+examples from Ecore.ecore:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">datatype EInt : int;<br>
+datatype EIntegerObject : java.lang.Integer;<br>
+transient datatype EJavaObject : java.lang.Object;<br>
+ <br>
+datatype EFeatureMapEntry : org.eclipse.emf.ecore.util.FeatureMap$Entry;<br>
+datatype EByteArray : "byte[]"; // Note: [ and ] are not legal
+identifier characters and must be in quotes<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+First note that as with classes, the value of the <span
+ style="font-weight: bold;">EClassifier</span> attribute <span
+ style="font-weight: bold;">instanceClassName</span> follows the colon
+after the name of the datatype. However specifying <span
+ style="font-weight: bold;">instanceClassName</span> is required for
+datatypes (while it is optional for classes).<br>
+<br>
+The keyword <span style="font-family: monospace;">transient</span> in
+the third datatype declaration above indicates that the value of the <span
+ style="font-weight: bold;">EDataType</span> <span
+ style="font-weight: bold;">serializable</span> attribute should be set
+to false. This is a good time to point out that the modifier
+keywords introduced so far (<span style="font-family: monospace;">abstract</span>
+and <span style="font-family: monospace;">interface</span>) are
+applied to reverse the default Ecore attribute values (by default <span
+ style="font-weight: bold;">EClass</span> attributes <span
+ style="font-weight: bold;">abstract</span> and <span
+ style="font-weight: bold;">interface</span> are both false). In
+the case of the <span style="font-weight: bold;">EDataType</span>
+attribute <span style="font-weight: bold;">serializable</span>, the
+default value is true so Emfatic uses a keyword, <span
+ style="font-family: monospace;">transient</span>, that means the
+opposite of serializable.<br>
+<br>
+The last two datatypes illustrate a subtle syntactic point. The
+value specified for the <span style="font-weight: bold;">instanceClassName</span>
+attribute must either be a valid qualified identifier (a dot or
+dollar-sign separated list of identifiers such as <span
+ style="font-family: monospace;">java.lang.Object</span> in the third
+datatype above) or it must be enclosed in double quotes. The
+datatype EFeatureMapEntry contains the character '<span
+ style="font-family: monospace;">$</span>' which, following Java
+syntactic rules, is a legal qualified identifier separator. The
+datatype EByteArray contains the characters '<span
+ style="font-family: monospace;">[</span>' and '<span
+ style="font-family: monospace;">]</span>' which are not legal in a
+qualified identifier.<br>
+<br>
+The overall point to make about qualified identifier versus
+double-quoted syntax for <span style="font-weight: bold;">instanceClassName</span>
+is that the typical datatype declaration can use the former and thus
+should be easier to read and edit, while the latter is available when
+needed and allows for arbitrary string text to be placed in the
+generated Ecore model. There are some other contexts where the
+Emfatic programmar has the option to use either a qualified identifier
+or double-quoted string (see the section on Annotations below for
+another example of this).<br>
+<br>
+<h3>2.3 Enumerated Types</h3>
+The example below demonstrates the Emfatic syntax that maps to <span
+ style="font-weight: bold;">EEnum</span> and <span
+ style="font-weight: bold;">EEnumLiteral</span>. Note that the
+simple assignment expressions specify the <span
+ style="font-weight: bold;">value</span> attribute of each generated <span
+ style="font-weight: bold;">EEnumLiteral</span>.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">enum E {<br>
+ A=1;<br>
+ B=2;<br>
+ C=3;<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+In fact, specifying enumeration literal values is optional and
+Emfatic generates reasonable values when they are left
+unspecified. The code and comments below describe the rules for
+this.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">enum E {<br>
+ A; // = 0 (if not specified, first literal has value 0)<br>
+ B = 3;<br>
+ C; // = 4 (in general, unspecified values are 1 greater
+than previous value)<br>
+ D; // = 5<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+<h3>2.4 Map Entries</h3>
+MapEntry classes (such as <span style="font-weight: bold;">EStringToStringMapEntry</span>
+in Ecore.ecore) can be specified in either of two ways. The
+"longhand" way is to declare a class with features named <span
+ style="font-weight: bold;">key</span> and <span
+ style="font-weight: bold;">value</span> and with <span
+ style="font-family: monospace;">[instanceClass=java.util.Map$Entry]</span>
+as suggested at the end of section 2.1 above. But there is a
+convienent shorthand notation which achieves the same result:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">mapentry EStringToStringMapEntry
+: String -> String;<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+The expression following the colon gives the type of the MapEntry <span
+ style="font-weight: bold;">key</span> structural feature followed by
+the <span style="font-family: monospace;">-></span>
+operator, followed by the type of the <span style="font-weight: bold;">value</span>
+structural feature. Type expressions can
+be more complex than shown in the example above and are detailed fully
+in the next section.<br>
+<br>
+<h2>3. Type Expressions<br>
+</h2>
+The most basic Ecore elements that haven't yet been explored in Emfatic
+are the structural and behavioral class features represented by the
+Ecore classes <span style="font-weight: bold;">EAttribute</span>,
+<span style="font-weight: bold;">EReference</span>, <span
+ style="font-weight: bold;">EOperation</span> and <span
+ style="font-weight: bold;">EParameter</span>. These four Ecore
+classes are all derived from <span style="font-weight: bold;">ETypedElement</span>
+which means that instances of them have some type (which is an <span
+ style="font-weight: bold;">EClassifier</span>) and inherit the other
+characteristics of <span style="font-weight: bold;">ETypedElement</span>,
+like multiplicity. Before we can describe each specific kind of
+class feature, we need to show
+how types are represented syntactically, because that applies (more or
+less) to all of them.<br>
+<br>
+Type expressions have two parts. First is a simple identifier or
+a qualified identifier (a dot-separated list of simple identifiers like
+"a.b.c") that identifies some <span style="font-weight: bold;">EClassifier</span>.
+The <span style="font-weight: bold;">EClassifier</span>
+identified may be defined in the same Emfatic source file as the type
+expression, or it may be in one of the imported Ecore models (specified
+in import statements).<br>
+<br>
+Let's skip ahead a little by looking at some attribute declarations so
+that we can talk about their type expressions:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">package test;<br>
+ <br>
+datatype D1 : int;<br>
+ <br>
+package P {<br>
+ datatype D2 : int;<br>
+}<br>
+ <br>
+class C {<br>
+ attr D1 d1;<br>
+ attr P.D2 d2;<br>
+ attr ecore.EString s1;<br>
+ attr String s2;<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+The class named "C" above declares four attributes with the names "d1",
+"d2", "s1" and "s2". Note that Emfatic follows Java syntactic
+style in placing type expression before the name. However unlike
+Java field declarations, Emfatic uses a keyword - <span
+ style="font-family: monospace;">attr</span> - to introduce an
+attribute. (The keyword <span style="font-family: monospace;">attr</span>
+and similar keywords to introduce references and operations will
+explained in more detail in the following sub-sections).<br>
+<br>
+The type expression for d1 is "D1" which identifies the datatype
+D1. Because C and D1 are in the same package (test), this simple
+expression is fine.<br>
+<br>
+The type expression for d2 is "P.D2". In this case a qualified
+identifier expression is necessary to identify datatype D2 inside
+package P.<br>
+<br>
+The type expression for s1 is "ecore.EString". This identifies
+the datatype EString in package ecore (recall that model Ecore.ecore is
+implicitly imported in all Emfatic programs).<br>
+<br>
+The type expression for s2 is "String". The identifier String is
+actually a special shorthand for ecore.EString, so s1 and s2 have the
+same type.<br>
+<h3>3.1 Basic Types</h3>
+A number of the types defined in Ecore.ecore have shorthand notation in
+Emfatic. The table below lists the Emfatic shorthand and the
+corresponding Ecore.ecore type name for each of these basic types as
+well as the corresponding Java type or class (taken from table 5.1 in
+the EMF book).<br>
+<br>
+<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
+ cellspacing="2">
+ <caption>Table 3.1 - Basic Type Names<br>
+ </caption> <tbody>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">Emfatic
+Keyword<br>
+ </td>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">Ecore
+EClassifier name<br>
+ </td>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">Java
+type name<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">boolean<br>
+ </td>
+ <td style="vertical-align: top;">EBoolean<br>
+ </td>
+ <td style="vertical-align: top;">boolean<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Boolean<br>
+ </td>
+ <td style="vertical-align: top;">EBooleanObject<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Boolean<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">byte<br>
+ </td>
+ <td style="vertical-align: top;">EByte<br>
+ </td>
+ <td style="vertical-align: top;">byte<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Byte<br>
+ </td>
+ <td style="vertical-align: top;">EByteObject<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Byte<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">char<br>
+ </td>
+ <td style="vertical-align: top;">EChar<br>
+ </td>
+ <td style="vertical-align: top;">char<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Character<br>
+ </td>
+ <td style="vertical-align: top;">ECharacterObject<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Character<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">double<br>
+ </td>
+ <td style="vertical-align: top;">EDouble<br>
+ </td>
+ <td style="vertical-align: top;">double<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Double<br>
+ </td>
+ <td style="vertical-align: top;">EDoubleObject<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Double<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">float<br>
+ </td>
+ <td style="vertical-align: top;">EFloat<br>
+ </td>
+ <td style="vertical-align: top;">float<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Float<br>
+ </td>
+ <td style="vertical-align: top;">EFloatObject<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Float<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">int<br>
+ </td>
+ <td style="vertical-align: top;">EInt<br>
+ </td>
+ <td style="vertical-align: top;">int<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Integer<br>
+ </td>
+ <td style="vertical-align: top;">EIntegerObject<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Integer<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">long<br>
+ </td>
+ <td style="vertical-align: top;">ELong<br>
+ </td>
+ <td style="vertical-align: top;">long<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Long<br>
+ </td>
+ <td style="vertical-align: top;">ELongObject<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Long<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">short<br>
+ </td>
+ <td style="vertical-align: top;">EShort<br>
+ </td>
+ <td style="vertical-align: top;">short<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Short<br>
+ </td>
+ <td style="vertical-align: top;">EShortObject<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Short<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Date<br>
+ </td>
+ <td style="vertical-align: top;">EDate<br>
+ </td>
+ <td style="vertical-align: top;">java.util.Date<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">String<br>
+ </td>
+ <td style="vertical-align: top;">EString<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.String<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Object<br>
+ </td>
+ <td style="vertical-align: top;">EJavaObject<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Object<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">Class<br>
+ </td>
+ <td style="vertical-align: top;">EJavaClass<br>
+ </td>
+ <td style="vertical-align: top;">java.lang.Class<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">EObject<br>
+ </td>
+ <td style="vertical-align: top;">EObject</td>
+ <td style="vertical-align: top;">org.eclipse.emf.ecore.EObject</td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">EClass<br>
+ </td>
+ <td style="vertical-align: top;">EClass<br>
+ </td>
+ <td style="vertical-align: top;">org.eclipse.emf.ecore.EClass</td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Remember that you can always reference these types, and the rest of the
+types in Ecore.ecore, by using their fully qualified name which begins
+with the package prefix "ecore". For example <span
+ style="font-family: monospace;">ecore.EOperation</span> and <span
+ style="font-family: monospace;">ecore.EBigInteger</span> are also
+legal references to types in Ecore.ecore.<br>
+<br>
+<h3>3.2 Multiplicity Expressions </h3>
+The second part of a type expression is the multiplicity
+expression. This maps to the <span style="font-weight: bold;">lowerBound</span>
+and <span style="font-weight: bold;">upperBound</span> attributes of <span
+ style="font-weight: bold;">ETypedElement</span>. Multiplicity
+expressions are optional, but when omitted the generated <span
+ style="font-weight: bold;">ETypedElement</span> gets the defaults (<span
+ style="font-weight: bold;">lowerBound</span> = 0 and <span
+ style="font-weight: bold;">upperBound</span> = 1). The example
+below shows some attribute declarations with multiplicity expressions:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">class C {<br>
+ attr String[1] s1;<br>
+ attr String[0..3] s2;<br>
+ attr String[*] s3;<br>
+ attr String[+] s4;<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+The mapping between various multiplicity expressions and the <span
+ style="font-weight: bold;">lowerBound</span> and <span
+ style="font-weight: bold;">upperBound</span> attributes of the
+generated <span style="font-weight: bold;">ETypedElement</span> is
+detailed more fully in the following table.<br>
+<br>
+<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
+ cellspacing="2">
+ <caption>Table 3.2 - Multiplicity Expressions<br>
+ </caption> <tbody>
+ <tr>
+ <td style="background-color: rgb(204, 204, 204);">Emfatic
+multiplicity expression<br>
+ </td>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">ETypedElement
+lowerBound<br>
+ </td>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">ETypedElement
+upperBound<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-style: italic;">none</span><br>
+ </td>
+ <td style="vertical-align: top;">0<br>
+ </td>
+ <td style="vertical-align: top;">1<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-family: monospace;">[?]</span><br>
+ </td>
+ <td style="vertical-align: top;">0<br>
+ </td>
+ <td style="vertical-align: top;">1<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="background-color: rgb(204, 204, 255); vertical-align: top; font-family: monospace;">[]<br>
+ </td>
+ <td style="vertical-align: top;">0<br>
+ </td>
+ <td style="vertical-align: top;">unbounded (-1)</td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-family: monospace;">[*]</span><br>
+ </td>
+ <td style="vertical-align: top;">0<br>
+ </td>
+ <td style="vertical-align: top;">unbounded (-1)<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-family: monospace;">[+]</span><br>
+ </td>
+ <td style="vertical-align: top;">1<br>
+ </td>
+ <td style="vertical-align: top;">unbounded (-1)<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-family: monospace;">[1]</span><br>
+ </td>
+ <td style="vertical-align: top;">1<br>
+ </td>
+ <td style="vertical-align: top;">1<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-family: monospace;">[<span style="font-style: italic;">n</span>]</span><br>
+ </td>
+ <td style="vertical-align: top;"><span style="font-style: italic;">n</span><br>
+ </td>
+ <td style="vertical-align: top;"><span style="font-style: italic;">n</span><br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-family: monospace;">[0..4]</span><br>
+ </td>
+ <td style="vertical-align: top;">0<br>
+ </td>
+ <td style="vertical-align: top;">4<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-family: monospace;">[<span style="font-style: italic;">m</span>..<span
+ style="font-style: italic;">n</span>]</span><br>
+ </td>
+ <td style="vertical-align: top;"><span style="font-style: italic;">m</span><br>
+ </td>
+ <td style="vertical-align: top;"><span style="font-style: italic;">n</span><br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-family: monospace;">[5..*]</span><br>
+ </td>
+ <td style="vertical-align: top;">5<br>
+ </td>
+ <td style="vertical-align: top;">unbounded (-1)</td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255);"><span
+ style="font-family: monospace;">[1..?]</span><br>
+ </td>
+ <td style="vertical-align: top;">1<br>
+ </td>
+ <td style="vertical-align: top;">unspecified (-2)<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+<br>
+<h3>3.3 Escaping Keywords</h3>
+<span style="font-style: italic;">Note: this doesn't really fit here,
+but I can't find a better place for it...</span><br>
+<br>
+Sometimes it's necessary or desirable to use a keyword as the name for
+some model element. This can be acheived by prefixing the name
+identifier with the '<span style="font-family: monospace;">~</span>'
+symbol. This ability was added primarily to make it possible to
+represent Ecore.ecore in Emfatic, so we'll show another example from
+Ecore.ecore here to illustrate:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">class EClass extends EClassifier
+{<br>
+ // ...<br>
+ ~abstract : EBoolean;<br>
+ ~interface : EBoolean;<br>
+ // ...<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Recall that the <span style="font-family: monospace;">abstract</span>
+and <span style="font-family: monospace;">interface</span> keywords
+are used in class declarations. The code above shows how they can
+be used as attribute names. Emfatic removes the '<span
+ style="font-family: monospace;">~</span>' symbol so names in the
+generated Ecore model do not contain it.<br>
+<br>
+<h2>4. Structural and Behavioral Features</h2>
+Now we are ready to show how the Ecore class features <span
+ style="font-weight: bold;">EAttribute</span>,
+<span style="font-weight: bold;">EReference</span>, <span
+ style="font-weight: bold;">EOperation</span> and <span
+ style="font-weight: bold;">EParameter</span> are represented in
+Emfatic. The example below is the class <span
+ style="font-weight: bold;">EPackage</span>
+from Ecore.ecore and it was
+chosen to give a feel for the feature syntax because it contains a
+sample of each kind of class feature. <br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">class EPackage extends
+ENamedElement {<br>
+ op EClassifier getEClassifier(EString name);<br>
+ attr EString nsURI;<br>
+ attr EString nsPrefix;<br>
+ transient !resolve ref EFactory[1]#ePackage eFactoryInstance;<br>
+ val EClassifier[*]#ePackage eClassifiers;<br>
+ val EPackage[*]#eSuperPackage eSubpackages;<br>
+ readonly transient ref EPackage#eSubpackages eSuperPackage;<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+For now we just want to point out that the syntax for class features is
+based on the syntax of Java with one key difference. In Java some
+elements are introduced with special keywords like <span
+ style="font-family: monospace;">class</span> and <span
+ style="font-family: monospace;">interface</span>, but type members
+like fields and methods have no such keywords to introduce them.
+This works for Java because fields and methods can be distinguished by
+looking at other syntactic featues (methods have parenthesis and fields
+do not). However the distinction between what EMF calls
+attributes and references doesn't really exist in Java, so there is no
+distinguishing syntax. Because of this and because class features
+are such an essential element of EMF, a decision was made to use
+keywords to introduce and differentiate attributes, references and
+operations. Thus in Emfatic the basic syntax for a class feature
+looks like this:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-style: italic;">modifiers
+ featureKind typeExpression name</span> ';'<br>
+</div>
+<br>
+Where <span style="font-style: italic;">featureKind</span> is one of
+the four keywords in the following table.<br>
+<br>
+<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
+ cellspacing="2">
+ <caption>Table 4.1 - Class Feature Kind Keywords<br>
+ </caption><tbody>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">Emfatic
+keyword<br>
+ </td>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">introduces<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">attr<br>
+ </td>
+ <td style="vertical-align: top;">EAttribute<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">op<br>
+ </td>
+ <td style="vertical-align: top;">EOperation</td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">ref<br>
+ </td>
+ <td style="vertical-align: top;">normal EReference
+(EReference.containment = false)<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; font-family: monospace; background-color: rgb(204, 204, 255);">val<br>
+ </td>
+ <td style="vertical-align: top;">"by value" EReference
+(EReference.containment = true)<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+<h3>4.1 Modifiers</h3>
+Look again at the Emfatic code above for <span
+ style="font-weight: bold;">EPackage</span> and note in the last class
+feature declaration the keyword <span style="font-family: monospace;">ref</span>
+is preceded by the words <span style="font-family: monospace;">readonly</span>
+and <span style="font-family: monospace;">transient</span>.
+These are modifiers similar in spirit to Java's modifiers such as
+<span style="font-family: monospace;">public</span>, <span
+ style="font-family: monospace;">private</span> and <span
+ style="font-family: monospace;">abstract</span>. However these
+modifiers map to
+boolean attributes on the Ecore classes involved in defining structural
+and behavioral features. These modifiers must appear directly
+before the feature's type expression. The table below describes
+each
+modifier.<br>
+<br>
+<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
+ cellspacing="2">
+ <caption>Table 4.2 - Class Feature Modifiers<br>
+ </caption><tbody>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">modifier<br>
+ </td>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">means<br>
+ </td>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">applies
+to<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255); font-family: monospace;">readonly<br>
+ </td>
+ <td style="vertical-align: top;">EStructuralFeature.changeable =
+false<br>
+ </td>
+ <td style="vertical-align: top;">attribute, reference<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255); font-family: monospace;">volatile<br>
+ </td>
+ <td style="vertical-align: top;">EStructuralFeature.volatile =
+true<br>
+ </td>
+ <td style="vertical-align: top;">attribute, reference</td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255); font-family: monospace;">transient<br>
+ </td>
+ <td style="vertical-align: top;">EStructuralFeature.transient =
+true<br>
+ </td>
+ <td style="vertical-align: top;">attribute, reference</td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255); font-family: monospace;">unsettable<br>
+ </td>
+ <td style="vertical-align: top;">EStructuralFeature.unsettable =
+true<br>
+ </td>
+ <td style="vertical-align: top;">attribute, reference</td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255); font-family: monospace;">derived<br>
+ </td>
+ <td style="vertical-align: top;">EStructuralFeature.derived = true<br>
+ </td>
+ <td style="vertical-align: top;">attribute, reference</td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255); font-family: monospace;">unique<br>
+ </td>
+ <td style="vertical-align: top;">ETypedElement.unique = true<br>
+ </td>
+ <td style="vertical-align: top;">attribute, reference, operation,
+parameter<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255); font-family: monospace;">ordered<br>
+ </td>
+ <td style="vertical-align: top;">ETypedElement.ordered = true<br>
+ </td>
+ <td style="vertical-align: top;">attribute, reference, operation,
+parameter</td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255); font-family: monospace;">resolve<br>
+ </td>
+ <td style="vertical-align: top;">EReference.resolveProxies = true<br>
+ </td>
+ <td style="vertical-align: top;">reference<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 255); font-family: monospace;">id<br>
+ </td>
+ <td style="vertical-align: top;">EAttribute.iD = true<br>
+ </td>
+ <td style="vertical-align: top;">attribute<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Note that the meaning of a modifier may be negated by prefixing the <span
+ style="font-family: monospace;">!</span> operator. The example
+below demonstrates this with an non-ordered attribute:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">class X {<br>
+ !ordered attr String[*] s;<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Normally the only modifiers that you should see negated with <span
+ style="font-family: monospace;">!</span> are <span
+ style="font-family: monospace;">unique</span>, <span
+ style="font-family: monospace;">ordered</span> and <span
+ style="font-family: monospace;">resolve</span>. This is because
+these three are true by default, so reversing the Ecore default means
+using the <span style="font-family: monospace;">!</span>
+operator. Note also that <span style="font-weight: bold;">EStructuralFeature.changeable</span>
+is true by default, but the modifier keyword <span
+ style="font-family: monospace;">readonly</span> means the opposite (<span
+ style="font-weight: bold;">EStructuralFeature.changeable</span> =
+false).<br>
+<br>
+<h3>4.2 Attributes</h3>
+We've now seen attribute naming and type expressions. Attributes
+may also be assigned default value expressions. Below is an
+example showing the various forms of
+attribute syntax.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">class C {<br>
+ attr String s;<br>
+ attr int i = 1;<br>
+ attr ecore.EBoolean b = true;<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Again note that the declaration of attributes is basically identical to
+declaraing fields in Java except for the presence of the <span
+ style="font-family: monospace;">attr</span> keyword.<br>
+<br>
+<h3>4.3 References</h3>
+The type expression syntax for references is slightly complicated by
+the fact that we need some way to identify the opposite of a
+reference. Let's return again to the code for <span
+ style="font-weight: bold;">EPackage</span>, but we'll just look at the
+last two feature declarations:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">class EPackage extends
+ENamedElement {<br>
+ // ...<br>
+ val EPackage[*]#eSuperPackage eSubpackages;<br>
+ readonly transient ref EPackage#eSubpackages eSuperPackage;<br>
+}</td>
+ </tr>
+ </tbody>
+</table>
+<br>
+Notice that the type expressions are followed by a <span
+ style="font-family: monospace;">#</span> symbol and an
+identifer. This identifier names the <span
+ style="font-weight: bold;">EReference</span> which is the <span
+ style="font-weight: bold;">opposite</span> of the reference being
+declared. If a reference doesn't need to specify its opposite
+then that
+part (including the <span style="font-family: monospace;">#</span>
+symbol) is omitted.<br>
+<br>
+<h3>4.4 Operations</h3>
+The declaration syntax for operations is Java-like as described above,
+including use of the keyword <span style="font-family: monospace;">void</span>
+to identify operations which don't return a value. Also a
+Java-like <span style="font-family: monospace;">throws</span> clause
+allows for the declaration of exception types:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">class X {<br>
+ op String getFullName();<br>
+ op void returnsNothing();<br>
+ op int add(int a, int b);<br>
+ op EObject doSomething(int a, ecore.EBoolean b) throws
+ExceptionA, ExceptionB;<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<span style="font-style: italic;"></span><br>
+<br>
+<h2>
+5. Annotations</h2>
+Annotations can be attached to every kind of EMF element, however only
+the <span style="font-weight: bold;">source</span> and <span
+ style="font-weight: bold;">details</span> features of the resulting <span
+ style="font-weight: bold;">EAnnotation</span> can be
+specified in Emfatic. The Emfatic syntax for representing EMF
+annotations was inspired by the
+syntax being introduced for Java annotations in Java 1.5
+("Tiger"). The <span style="font-family: monospace;">@</span>
+symbol is followed by the value of the <span style="font-weight: bold;">EAnnotation</span>
+<span style="font-weight: bold;">source</span>
+attribute. Key/value pairs for the annotation <span
+ style="font-weight: bold;">details</span> may appear in parenthesis
+following the <span style="font-weight: bold;">source</span>
+value. Multiple
+annotations can be attached to each element. Usually the
+annotation appears just before its containing element (parameter and
+enum literal annotations may appear just after the declaration).
+The example below gives some examples of annotations.<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">@"http://source/uri"("key1"="value1",
+"key2"="value2")<br>
+@sourceLabel(key.a="value1", key.b="value2")<br>
+@simpleAttr<br>
+package test;<br>
+ <br>
+@"http://class/annotation"(k="v")<br>
+class C {<br>
+ @"http://attribute/annotation"(k="v")<br>
+ attr int a;<br>
+ <br>
+ op int Op(<br>
+ @before(k=v) int a,<br>
+ int b @after(k=v)<br>
+ );<br>
+}<br>
+ <br>
+enum E {<br>
+ @"http://before"(k=v)<br>
+ A=1;<br>
+ B=2 @"http://after"(k=v);<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+One subtle point
+to note is that double quotes are only required around the string value
+if it is not a valid simple or qualified identifier. So an
+identifier
+like <span style="font-family: monospace;">key</span> or <span
+ style="font-family: monospace;">key.a.b.c</span> need not be quoted,
+but most complex strings (such as urls) will need to be.<br>
+<br>
+<h3>5.1 Annotation Labels<br>
+</h3>
+Emfatic allows for short labels to be defined that map to longer URI
+values for the <span style="font-weight: bold;">source</span>
+attribute of an <span style="font-weight: bold;">EAnnotation</span>.
+The purpose of this feature is to simplify the Emfatic code, making it
+easier to read and edit. Several annotation labels are available
+by default, as shown in the following table:<br>
+<br>
+<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
+ cellspacing="2">
+ <tbody>
+ <tr>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">Emfatic
+annotation label<br>
+ </td>
+ <td
+ style="vertical-align: top; background-color: rgb(204, 204, 204);">maps
+to EAnnotation.source value<br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="background-color: rgb(204, 204, 255); vertical-align: top;"><span
+ style="font-family: monospace;">Ecore</span><br>
+ </td>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">http://www.eclipse.org/emf/2002/Ecore</span><br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="background-color: rgb(204, 204, 255); vertical-align: top;"><span
+ style="font-family: monospace;">GenModel</span><br>
+ </td>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">http://www.eclipse.org/emf/2002/GenModel</span><br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="background-color: rgb(204, 204, 255); vertical-align: top; font-family: monospace;">ExtendedMetaData<br>
+ </td>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">http:///org/eclipse/emf/ecore/util/ExtendedMetaData</span><br>
+ </td>
+ </tr>
+ <tr>
+ <td
+ style="background-color: rgb(204, 204, 255); vertical-align: top;"><span
+ style="font-family: monospace;">EmfaticAnnotationMap</span><br>
+ </td>
+ <td style="vertical-align: top;"><span
+ style="font-family: monospace;">http://www.eclipse.org/emf/2004/EmfaticAnnotationMap</span><br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+The code below shows some examples:<br>
+<br>
+<table
+ style="background-color: rgb(204, 204, 255); width: 100%; text-align: left; font-family: monospace;"
+ border="1" cellpadding="2" cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;">@EmfaticAnnotationMap(myLabel="http://foo/bar")<br>
+@genmodel(documentation="model documentation")<br>
+package test;<br>
+ <br>
+@ecore(constraints="constraintA constraintB")<br>
+@myLabel(key="value")<br>
+class C {<br>
+}<br>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
+There are several details to elaborate on in the example above.
+First note that labels are not case sensitive (so <span
+ style="font-family: monospace;">Ecore</span> and <span
+ style="font-family: monospace;">ecore</span> and <span
+ style="font-family: monospace;">ECORE</span> all work the same way).<br>
+<br>
+Second, note that declaring an annotation using the label <span
+ style="font-family: monospace;">EmfaticAnnotationMap</span> has the
+side effect of creating a new label which can be used later in the
+program. So the second annotation on class "C" will get the <span
+ style="font-weight: bold;">source</span> value of <span
+ style="font-family: monospace;">"http://foo/bar"</span>.<br>
+<br>
+Finally, note that the code above shows how to introduce model
+documentation and constraints in a way that will later flow into
+generated Java code when working with an EMF genmodel.<br>
+<br>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/html/toc.html b/doc/org.eclipse.emf.emfatic.doc.user/html/toc.html
new file mode 100644
index 0000000..d4c6a20
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/html/toc.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link rel="STYLESHEET" href="book.css" charset="ISO-8859-1" type="text/css">
+ <title>Table of Contents</title>
+</head>
+
+<body>
+<h1>Table of Contents</h1>
+
+<ul>
+
+ <li> Getting started:
+ <ul>
+ <li><a href="gettingstarted/example.html">Emfatic Getting Started Guide</a></li>
+ <li><a href="gettingstarted/GUIFeatures.htm">Usability features of the editor</a></li>
+ <li><a href="gettingstarted/FutureWork.htm">Ideas for Future Work</a></li>
+ </ul>
+ </li>
+
+ <li> Reference:
+ <ul>
+ <li><a href="reference/LanguageRef.html">Language Reference</a>
+ (needs to be updated to include examples of usage of Generics)
+ </li>
+ <li><a href="reference/Emfatic002Update.html">Emfatic 0.0.2 Update</a></li>
+ <li><a href="reference/EmfaticGrammar.html">Emfatic Grammar in Gymnast format</a></li>
+ </ul>
+ </li>
+ <li> <a href="about.html">Legal</a></li>
+
+</ul>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/plugin.xml b/doc/org.eclipse.emf.emfatic.doc.user/plugin.xml
new file mode 100644
index 0000000..253417f
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/plugin.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="true">
+ </toc>
+ <toc
+ file="tocgettingstarted.xml">
+ </toc>
+ <toc
+ file="tocreference.xml">
+ </toc>
+ </extension>
+
+</plugin>
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/toc.xml b/doc/org.eclipse.emf.emfatic.doc.user/toc.xml
new file mode 100644
index 0000000..7a9ec3d
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/toc.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="EMFT Emfatic" topic="html/toc.html">
+ <topic label="Getting Started">
+ <anchor id="gettingstarted"/>
+ </topic>
+ <topic label="Reference">
+ <anchor id="reference"/>
+ </topic>
+</toc>
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/tocgettingstarted.xml b/doc/org.eclipse.emf.emfatic.doc.user/tocgettingstarted.xml
new file mode 100644
index 0000000..4b276ae
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/tocgettingstarted.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Getting Started" link_to="toc.xml#gettingstarted">
+
+ <topic label="Emfatic Getting Started Guide"
+ href="html/gettingstarted/example.html">
+ </topic>
+
+ <topic label="Productivity features in the editor"
+ href="html/gettingstarted/GUIFeatures.htm" >
+ </topic>
+
+ <topic label="Possibilities for Future Work"
+ href="html/gettingstarted/FutureWork.htm" >
+ </topic>
+
+</toc>
diff --git a/doc/org.eclipse.emf.emfatic.doc.user/tocreference.xml b/doc/org.eclipse.emf.emfatic.doc.user/tocreference.xml
new file mode 100644
index 0000000..2ee17e1
--- /dev/null
+++ b/doc/org.eclipse.emf.emfatic.doc.user/tocreference.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Reference" link_to="toc.xml#reference">
+ <topic label="Language Reference"
+ href="html/reference/LanguageRef.html">
+ </topic>
+
+ <topic label="Emfatic 0.0.2 Update"
+ href="html/reference/Emfatic002Update.html" >
+ </topic>
+
+ <topic label="Emfatic Grammar in Gymnast format"
+ href="html/reference/EmfaticGrammar.html" >
+ </topic>
+
+ <topic label="Emfatic Railroad Diagrams"
+ href="html/reference/EmfaticRailroadDiagrams.html" >
+ </topic>
+
+</toc>
diff --git a/features/org.eclipse.emf.emfatic-feature/.project b/features/org.eclipse.emf.emfatic-feature/.project
new file mode 100644
index 0000000..94aa7b1
--- /dev/null
+++ b/features/org.eclipse.emf.emfatic-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.emfatic-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/features/org.eclipse.emf.emfatic-feature/build.properties b/features/org.eclipse.emf.emfatic-feature/build.properties
new file mode 100644
index 0000000..64f93a9
--- /dev/null
+++ b/features/org.eclipse.emf.emfatic-feature/build.properties
@@ -0,0 +1 @@
+bin.includes = feature.xml
diff --git a/features/org.eclipse.emf.emfatic-feature/feature.xml b/features/org.eclipse.emf.emfatic-feature/feature.xml
new file mode 100644
index 0000000..40dd697
--- /dev/null
+++ b/features/org.eclipse.emf.emfatic-feature/feature.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.emf.emfatic_feature"
+ label="Emfatic (Incubation)"
+ version="0.3.0.qualifier"
+ provider-name="Eclipse.org">
+
+ <description url="http://wiki.eclipse.org/Emfatic">
+ Emfatic is a text editor supporting navigation, editing, and conversion of Ecore models, using a compact and human-readable syntax similar to Java. The EPLed Emfatic now hosted at EMFT extends the Feb 2005 alphaworks release with support for EMF Generics, folding, "red squigglies", an EMF Type Hierarchy, hyperlinks, AutoEdits, and the possibility to define templates to speed up document creation, among other usability features. The best way to gain hands-on experience with Emfatic is to right-click on any .ecore file and choose Generate Emfatic source, a similar converter works in the opposite direction. Online help is also available.
+
+Emfatic is hosted as an EMFT component with Incubation status.
+ </description>
+
+ <copyright>
+ Copyright (c) 2006 IBM Corporation and others.
+ </copyright>
+
+ <license url="http://www.eclipse.org/legal/epl-v10.html">
+ Eclipse Public License - v 1.0
+ </license>
+
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.emf.common"/>
+ <import plugin="org.eclipse.emf.ecore"/>
+ <import plugin="org.eclipse.emf.ecore.edit"/>
+ <import plugin="org.eclipse.emf.edit.ui"/>
+ <import plugin="org.eclipse.gymnast.runtime.core"/>
+ <import plugin="org.eclipse.ui.workbench.texteditor"/>
+ <import plugin="org.eclipse.jface.text"/>
+ <import plugin="org.eclipse.ui.console"/>
+ <import plugin="org.eclipse.ui.views"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ <import plugin="org.eclipse.ui.editors"/>
+ <import plugin="org.eclipse.jdt.ui"/>
+ <import plugin="org.eclipse.core.expressions"/>
+ <import plugin="org.eclipse.gymnast.runtime.ui"/>
+ <import feature="org.eclipse.gymnast.runtime_feature" version="0.1.0"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.emf.emfatic.core"
+ download-size="0"
+ install-size="0"
+ version="0.3.0.qualifier"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.emfatic.ui"
+ download-size="0"
+ install-size="0"
+ version="0.3.0.qualifier"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.emfatic.doc.user"
+ download-size="0"
+ install-size="0"
+ version="0.3.0.qualifier"
+ unpack="false"/>
+
+</feature>
diff --git a/plugins/org.eclipse.emf.emfatic.core/.classpath b/plugins/org.eclipse.emf.emfatic.core/.classpath
new file mode 100644
index 0000000..065ac06
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.emfatic.core/.cvsignore b/plugins/org.eclipse.emf.emfatic.core/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.emf.emfatic.core/.project b/plugins/org.eclipse.emf.emfatic.core/.project
new file mode 100644
index 0000000..57f9a37
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.emfatic.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.emfatic.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.emfatic.core/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..1172abd
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Plugin.name (Incubation)
+Bundle-SymbolicName: org.eclipse.emf.emfatic.core
+Bundle-Version: 0.3.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.emf.emfatic.core.EmfaticCorePlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Export-Package: org.eclipse.emf.emfatic.core,
+ org.eclipse.emf.emfatic.core.generator.ecore,
+ org.eclipse.emf.emfatic.core.generator.emfatic,
+ org.eclipse.emf.emfatic.core.generics.util,
+ org.eclipse.emf.emfatic.core.lang.gen.ast,
+ org.eclipse.emf.emfatic.core.lang.gen.parser,
+ org.eclipse.emf.emfatic.core.util
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.emf.common,
+ org.eclipse.emf.ecore;bundle-version="2.3.0",
+ org.eclipse.emf.ecore.edit,
+ org.eclipse.emf.edit.ui,
+ org.eclipse.gymnast.runtime.core
+Eclipse-LazyStart: true
diff --git a/plugins/org.eclipse.emf.emfatic.core/build.properties b/plugins/org.eclipse.emf.emfatic.core/build.properties
new file mode 100644
index 0000000..085e81c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ grammar/
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/Emfatic.g b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/Emfatic.g
new file mode 100644
index 0000000..a96ef48
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/Emfatic.g
@@ -0,0 +1,550 @@
+
+header
+{
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.*;
+import org.eclipse.gymnast.runtime.core.parser.*;
+import org.eclipse.gymnast.runtime.core.ast.*;
+}
+
+class EmfaticParser extends Parser;
+
+options {
+ k=3;
+
+}
+{
+ private ParseError createParseError(RecognitionException ex) {
+ return EmfaticParserDriver.createParseError(ex);
+ }
+
+ private TokenInfo createTokenInfo(Token tok) {
+ if (tok == null) return null;
+ else return new TokenInfo(tok.getText(), tok.getColumn(), tok.getType());
+ }
+
+
+ private ParseContext _parseContext;
+ public void setParseContext(ParseContext parseContext) {
+ _parseContext = parseContext;
+ }
+
+ public void reportError(RecognitionException ex) {
+ if (_parseContext != null) {
+ _parseContext.addParseMessage(createParseError(ex));
+ }
+ }
+
+ public void reportError(String s) {
+ if (_parseContext != null) {
+ _parseContext.addParseMessage(new ParseError(s, -1));
+ }
+ }
+
+ public void reportWarning(String s) {
+ if (_parseContext != null) {
+ _parseContext.addParseMessage(new ParseWarning(s, -1));
+ }
+ }
+
+}
+
+compUnit returns [ CompUnit retVal = null ]
+:
+{ PackageDecl packageDecl = null; ImportStmts importStmts = null; TopLevelDecls topLevelDecls = null; }
+ packageDecl=packageDecl importStmts=importStmts topLevelDecls=topLevelDecls EOF
+{ retVal = new CompUnit(packageDecl, importStmts, topLevelDecls); }
+;
+
+packageDecl returns [ PackageDecl retVal = null ]
+:
+{ Annotations annotations = null; QualifiedID name = null; }
+ annotations=annotations package_KW:"package" name=qualifiedID semi:SEMI
+{ retVal = new PackageDecl(annotations, createTokenInfo(package_KW), name, createTokenInfo(semi)); }
+;
+
+qualifiedID returns [ QualifiedID retVal = new QualifiedID() ]
+:
+{ QidSeparator qidSeparator = null; }
+ id1:ID { retVal.addChild(createTokenInfo(id1)); }
+ ( qidSeparator=qidSeparator idn:ID { retVal.addChild(qidSeparator); retVal.addChild(createTokenInfo(idn)); } )*
+;
+
+qidSeparator returns [ QidSeparator retVal = null ]
+{ Token tok = LT(1); }
+: ( DOT
+ | DOLLAR
+ )
+{ retVal = new QidSeparator(createTokenInfo(tok)); }
+;
+
+stringLiteralOrQualifiedID returns [ StringLiteralOrQualifiedID retVal = null ]
+:
+ ( retVal=stringLiteralContainer
+ | retVal=qualifiedIDContainer
+ )
+;
+
+stringLiteralContainer returns [ StringLiteralContainer retVal = null ]
+:
+ string_literal:STRING_LITERAL
+{ retVal = new StringLiteralContainer(createTokenInfo(string_literal)); }
+;
+
+qualifiedIDContainer returns [ QualifiedIDContainer retVal = null ]
+:
+{ QualifiedID qualifiedID = null; }
+ qualifiedID=qualifiedID
+{ retVal = new QualifiedIDContainer(qualifiedID); }
+;
+
+annotations returns [ Annotations retVal = new Annotations() ]
+:
+{ Annotation annotation = null; }
+ ( annotation=annotation { retVal.addChild(annotation); } )*
+;
+
+annotation returns [ Annotation retVal = null ]
+:
+{ StringLiteralOrQualifiedID source = null; KeyEqualsValueList keyEqualsValueList = null; }
+ at:AT source=stringLiteralOrQualifiedID lparen:LPAREN keyEqualsValueList=keyEqualsValueList rparen:RPAREN
+{ retVal = new Annotation(createTokenInfo(at), source, createTokenInfo(lparen), keyEqualsValueList, createTokenInfo(rparen)); }
+;
+
+keyEqualsValueList returns [ KeyEqualsValueList retVal = new KeyEqualsValueList() ]
+:
+{ KeyEqualsValue kv1 = null; KeyEqualsValue kvn = null; }
+ kv1=keyEqualsValue { retVal.addChild(kv1); }
+ ( comma:COMMA kvn=keyEqualsValue { retVal.addChild(createTokenInfo(comma)); retVal.addChild(kvn); } )*
+;
+
+keyEqualsValue returns [ KeyEqualsValue retVal = null ]
+:
+{ StringLiteralOrQualifiedID key = null; StringLiteralOrQualifiedID value = null; }
+ key=stringLiteralOrQualifiedID equals:EQUALS value=stringLiteralOrQualifiedID
+{ retVal = new KeyEqualsValue(key, createTokenInfo(equals), value); }
+;
+
+importStmts returns [ ImportStmts retVal = new ImportStmts() ]
+:
+{ ImportStmt importStmt = null; }
+ ( importStmt=importStmt { retVal.addChild(importStmt); } )*
+;
+
+importStmt returns [ ImportStmt retVal = null ]
+:
+{ StringLiteralOrQualifiedID uri = null; }
+ import_KW:"import" ( alias:ID equals:EQUALS )? uri=stringLiteralOrQualifiedID semi:SEMI
+{ retVal = new ImportStmt(createTokenInfo(import_KW), createTokenInfo(alias), createTokenInfo(equals), uri, createTokenInfo(semi)); }
+;
+
+topLevelDecls returns [ TopLevelDecls retVal = new TopLevelDecls() ]
+:
+{ TopLevelDecl topLevelDecl = null; }
+ ( topLevelDecl=topLevelDecl { retVal.addChild(topLevelDecl); } )*
+;
+
+topLevelDecl returns [ TopLevelDecl retVal = null ]
+:
+{ Annotations annotations = null; }
+annotations=annotations
+ ( retVal=subPackageDecl[annotations]
+ | retVal=classDecl[annotations]
+ | retVal=dataTypeDecl[annotations]
+ | retVal=enumDecl[annotations]
+ | retVal=mapEntryDecl[annotations]
+ )
+;
+
+subPackageDecl [ Annotations annotations ] returns [ SubPackageDecl retVal = null ]
+:
+{ TopLevelDecls topLevelDecls = null; }
+ package_KW:"package" name:ID lcurly:LCURLY topLevelDecls=topLevelDecls rcurly:RCURLY
+{ retVal = new SubPackageDecl(annotations, createTokenInfo(package_KW), createTokenInfo(name), createTokenInfo(lcurly), topLevelDecls, createTokenInfo(rcurly)); }
+;
+
+classDecl [ Annotations annotations ] returns [ ClassDecl retVal = null ]
+:
+{ AbstractModifier abstractModifier = null; ClassKind classKind = null; TypeParamsInfo typeParamsInfo = null; CommaListBoundExceptWild superTypes = null; BoundExceptWildcard instClassName = null; ClassMemberDecls classMemberDecls = null; }
+ ( abstractModifier=abstractModifier )? classKind=classKind name:ID ( typeParamsInfo=typeParamsInfo )? ( extends_KW:"extends" superTypes=commaListBoundExceptWild )? ( colon:COLON instClassName=boundExceptWildcard )? lcurly:LCURLY classMemberDecls=classMemberDecls rcurly:RCURLY
+{ retVal = new ClassDecl(annotations, abstractModifier, classKind, createTokenInfo(name), typeParamsInfo, createTokenInfo(extends_KW), superTypes, createTokenInfo(colon), instClassName, createTokenInfo(lcurly), classMemberDecls, createTokenInfo(rcurly)); }
+;
+
+commaListBoundExceptWild returns [ CommaListBoundExceptWild retVal = new CommaListBoundExceptWild() ]
+:
+{ BoundExceptWildcard tb1 = null; BoundExceptWildcard tbn = null; }
+ tb1=boundExceptWildcard { retVal.addChild(tb1); }
+ ( comma:COMMA tbn=boundExceptWildcard { retVal.addChild(createTokenInfo(comma)); retVal.addChild(tbn); } )*
+;
+
+abstractModifier returns [ AbstractModifier retVal = null ]
+:
+ abstract_KW:"abstract"
+{ retVal = new AbstractModifier(createTokenInfo(abstract_KW)); }
+;
+
+classKind returns [ ClassKind retVal = null ]
+{ Token tok = LT(1); }
+: ( "class"
+ | "interface"
+ )
+{ retVal = new ClassKind(createTokenInfo(tok)); }
+;
+
+typeParamsInfo returns [ TypeParamsInfo retVal = null ]
+:
+{ OneOrMoreTypeParams oneOrMoreTypeParams = null; }
+ lt:LT oneOrMoreTypeParams=oneOrMoreTypeParams gt:GT
+{ retVal = new TypeParamsInfo(createTokenInfo(lt), oneOrMoreTypeParams, createTokenInfo(gt)); }
+;
+
+oneOrMoreTypeParams returns [ OneOrMoreTypeParams retVal = new OneOrMoreTypeParams() ]
+:
+{ TypeParam tp1 = null; TypeParam tpn = null; }
+ tp1=typeParam { retVal.addChild(tp1); }
+ ( comma:COMMA tpn=typeParam { retVal.addChild(createTokenInfo(comma)); retVal.addChild(tpn); } )*
+;
+
+typeParam returns [ TypeParam retVal = null ]
+:
+{ TypeBoundsInfo typeBoundsInfo = null; }
+ typeVarName:ID ( typeBoundsInfo=typeBoundsInfo )?
+{ retVal = new TypeParam(createTokenInfo(typeVarName), typeBoundsInfo); }
+;
+
+typeBoundsInfo returns [ TypeBoundsInfo retVal = null ]
+:
+{ OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds = null; }
+ extends_KW:"extends" oneOrMoreTypeParamBounds=oneOrMoreTypeParamBounds
+{ retVal = new TypeBoundsInfo(createTokenInfo(extends_KW), oneOrMoreTypeParamBounds); }
+;
+
+oneOrMoreTypeParamBounds returns [ OneOrMoreTypeParamBounds retVal = new OneOrMoreTypeParamBounds() ]
+:
+{ BoundExceptWildcard tb1 = null; BoundExceptWildcard tbn = null; }
+ tb1=boundExceptWildcard { retVal.addChild(tb1); }
+ ( amp:AMP tbn=boundExceptWildcard { retVal.addChild(createTokenInfo(amp)); retVal.addChild(tbn); } )*
+;
+
+boundExceptWildcard returns [ BoundExceptWildcard retVal = null ]
+:
+{ QualifiedID rawTNameOrTVarOrParamzedTName = null; OneOrMoreTypeArgs oneOrMoreTypeArgs = null; }
+ rawTNameOrTVarOrParamzedTName=qualifiedID ( lt:LT oneOrMoreTypeArgs=oneOrMoreTypeArgs gt:GT )?
+{ retVal = new BoundExceptWildcard(rawTNameOrTVarOrParamzedTName, createTokenInfo(lt), oneOrMoreTypeArgs, createTokenInfo(gt)); }
+;
+
+oneOrMoreTypeArgs returns [ OneOrMoreTypeArgs retVal = new OneOrMoreTypeArgs() ]
+:
+{ TypeArg ta1 = null; TypeArg tan = null; }
+ ta1=typeArg { retVal.addChild(ta1); }
+ ( comma:COMMA tan=typeArg { retVal.addChild(createTokenInfo(comma)); retVal.addChild(tan); } )*
+;
+
+typeArg returns [ TypeArg retVal = null ]
+:
+ ( retVal=boundExceptWildcard
+ | retVal=wildcard
+ )
+;
+
+wildcard returns [ Wildcard retVal = null ]
+:
+{ ExtendsOrSuper extendsOrSuper = null; BoundExceptWildcard boundExceptWildcard = null; }
+ qmark:QMARK ( extendsOrSuper=extendsOrSuper boundExceptWildcard=boundExceptWildcard )?
+{ retVal = new Wildcard(createTokenInfo(qmark), extendsOrSuper, boundExceptWildcard); }
+;
+
+extendsOrSuper returns [ ExtendsOrSuper retVal = null ]
+{ Token tok = LT(1); }
+: ( "extends"
+ | "super"
+ )
+{ retVal = new ExtendsOrSuper(createTokenInfo(tok)); }
+;
+
+classMemberDecls returns [ ClassMemberDecls retVal = new ClassMemberDecls() ]
+:
+{ ClassMemberDecl classMemberDecl = null; }
+ ( classMemberDecl=classMemberDecl { retVal.addChild(classMemberDecl); } )*
+;
+
+classMemberDecl returns [ ClassMemberDecl retVal = null ]
+:
+{ Annotations annotations = null; Modifiers modifiers = null; }
+annotations=annotations modifiers=modifiers
+ ( retVal=attribute[annotations, modifiers]
+ | retVal=reference[annotations, modifiers]
+ | retVal=operation[annotations, modifiers]
+ )
+;
+
+attribute [ Annotations annotations, Modifiers modifiers ] returns [ Attribute retVal = null ]
+:
+{ TypeWithMulti typeWithMulti = null; DefaultValueExpr defaultValueExpr = null; }
+ attr_KW:"attr" typeWithMulti=typeWithMulti name:ID ( equals:EQUALS defaultValueExpr=defaultValueExpr )? semi:SEMI
+{ retVal = new Attribute(annotations, modifiers, createTokenInfo(attr_KW), typeWithMulti, createTokenInfo(name), createTokenInfo(equals), defaultValueExpr, createTokenInfo(semi)); }
+;
+
+typeWithMulti returns [ TypeWithMulti retVal = null ]
+:
+{ BoundExceptWildcard name = null; Multiplicity multiplicity = null; }
+ name=boundExceptWildcard ( multiplicity=multiplicity )?
+{ retVal = new TypeWithMulti(name, multiplicity); }
+;
+
+multiplicity returns [ Multiplicity retVal = null ]
+:
+{ MultiplicityExpr multiplicityExpr = null; }
+ lsquare:LSQUARE ( multiplicityExpr=multiplicityExpr )? rsquare:RSQUARE
+{ retVal = new Multiplicity(createTokenInfo(lsquare), multiplicityExpr, createTokenInfo(rsquare)); }
+;
+
+multiplicityExpr returns [ MultiplicityExpr retVal = null ]
+:
+{ SimpleMultiplicityExpr lowerBound = null; SimpleMultiplicityExpr upperBound = null; }
+ lowerBound=simpleMultiplicityExpr ( dot_dot:DOT_DOT upperBound=simpleMultiplicityExpr )?
+{ retVal = new MultiplicityExpr(lowerBound, createTokenInfo(dot_dot), upperBound); }
+;
+
+simpleMultiplicityExpr returns [ SimpleMultiplicityExpr retVal = null ]
+{ Token tok = LT(1); }
+: ( STAR
+ | PLUS
+ | QMARK
+ | INT_LITERAL
+ )
+{ retVal = new SimpleMultiplicityExpr(createTokenInfo(tok)); }
+;
+
+reference [ Annotations annotations, Modifiers modifiers ] returns [ Reference retVal = null ]
+:
+{ ReferenceKind referenceKind = null; TypeWithMulti typeWithMulti = null; }
+ referenceKind=referenceKind typeWithMulti=typeWithMulti ( hash:HASH oppositeName:ID )? name:ID semi:SEMI
+{ retVal = new Reference(annotations, modifiers, referenceKind, typeWithMulti, createTokenInfo(hash), createTokenInfo(oppositeName), createTokenInfo(name), createTokenInfo(semi)); }
+;
+
+referenceKind returns [ ReferenceKind retVal = null ]
+{ Token tok = LT(1); }
+: ( "ref"
+ | "val"
+ )
+{ retVal = new ReferenceKind(createTokenInfo(tok)); }
+;
+
+modifiers returns [ Modifiers retVal = new Modifiers() ]
+:
+{ OptNegatedModifier optNegatedModifier = null; }
+ ( optNegatedModifier=optNegatedModifier { retVal.addChild(optNegatedModifier); } )*
+;
+
+optNegatedModifier returns [ OptNegatedModifier retVal = null ]
+:
+{ Modifier modifier = null; }
+ ( bang:BANG )? modifier=modifier
+{ retVal = new OptNegatedModifier(createTokenInfo(bang), modifier); }
+;
+
+modifier returns [ Modifier retVal = null ]
+{ Token tok = LT(1); }
+: ( "readonly"
+ | "volatile"
+ | "transient"
+ | "unsettable"
+ | "derived"
+ | "unique"
+ | "ordered"
+ | "resolve"
+ | "id"
+ )
+{ retVal = new Modifier(createTokenInfo(tok)); }
+;
+
+defaultValueExpr returns [ DefaultValueExpr retVal = null ]
+:
+ ( retVal=boolExpr
+ | retVal=intExpr
+ | retVal=stringExpr
+ | retVal=charExpr
+ )
+;
+
+boolExpr returns [ BoolExpr retVal = null ]
+:
+{ TrueOrFalse trueOrFalse = null; }
+ trueOrFalse=trueOrFalse
+{ retVal = new BoolExpr(trueOrFalse); }
+;
+
+trueOrFalse returns [ TrueOrFalse retVal = null ]
+{ Token tok = LT(1); }
+: ( "true"
+ | "false"
+ )
+{ retVal = new TrueOrFalse(createTokenInfo(tok)); }
+;
+
+intExpr returns [ IntExpr retVal = null ]
+:
+ ( minus:MINUS )? int_literal:INT_LITERAL
+{ retVal = new IntExpr(createTokenInfo(minus), createTokenInfo(int_literal)); }
+;
+
+stringExpr returns [ StringExpr retVal = null ]
+:
+ string_literal:STRING_LITERAL
+{ retVal = new StringExpr(createTokenInfo(string_literal)); }
+;
+
+charExpr returns [ CharExpr retVal = null ]
+:
+ char_literal:CHAR_LITERAL
+{ retVal = new CharExpr(createTokenInfo(char_literal)); }
+;
+
+operation [ Annotations annotations, Modifiers modifiers ] returns [ Operation retVal = null ]
+:
+{ TypeParamsInfo typeParamsInfo = null; ResultType resType = null; Params params = null; CommaListBoundExceptWild exceptions = null; }
+ op_KW:"op" ( typeParamsInfo=typeParamsInfo )? resType=resultType name:ID lparen:LPAREN ( params=params )? rparen:RPAREN ( throws_KW:"throws" exceptions=commaListBoundExceptWild )? semi:SEMI
+{ retVal = new Operation(annotations, modifiers, createTokenInfo(op_KW), typeParamsInfo, resType, createTokenInfo(name), createTokenInfo(lparen), params, createTokenInfo(rparen), createTokenInfo(throws_KW), exceptions, createTokenInfo(semi)); }
+;
+
+resultType returns [ ResultType retVal = null ]
+:
+ ( retVal=typeWithMulti
+ | retVal=voidContainer
+ )
+;
+
+voidContainer returns [ VoidContainer retVal = null ]
+:
+ void_KW:"void"
+{ retVal = new VoidContainer(createTokenInfo(void_KW)); }
+;
+
+params returns [ Params retVal = new Params() ]
+:
+{ Param p1 = null; Param pn = null; }
+ p1=param { retVal.addChild(p1); }
+ ( comma:COMMA pn=param { retVal.addChild(createTokenInfo(comma)); retVal.addChild(pn); } )*
+;
+
+param returns [ Param retVal = null ]
+:
+{ Annotations leadingAnnotations = null; Modifiers modifiers = null; TypeWithMulti typeWithMulti = null; Annotations trailingAnnotations = null; }
+ leadingAnnotations=annotations modifiers=modifiers typeWithMulti=typeWithMulti name:ID trailingAnnotations=annotations
+{ retVal = new Param(leadingAnnotations, modifiers, typeWithMulti, createTokenInfo(name), trailingAnnotations); }
+;
+
+dataTypeDecl [ Annotations annotations ] returns [ DataTypeDecl retVal = null ]
+:
+{ TransientModifier transientModifier = null; StringLiteralOrQualifiedID instClassName = null; }
+ ( transientModifier=transientModifier )? datatype_KW:"datatype" name:ID colon:COLON instClassName=stringLiteralOrQualifiedID semi:SEMI
+{ retVal = new DataTypeDecl(annotations, transientModifier, createTokenInfo(datatype_KW), createTokenInfo(name), createTokenInfo(colon), instClassName, createTokenInfo(semi)); }
+;
+
+transientModifier returns [ TransientModifier retVal = null ]
+:
+ transient_KW:"transient"
+{ retVal = new TransientModifier(createTokenInfo(transient_KW)); }
+;
+
+enumDecl [ Annotations annotations ] returns [ EnumDecl retVal = null ]
+:
+{ EnumLiterals enumLiterals = null; }
+ enum_KW:"enum" name:ID lcurly:LCURLY enumLiterals=enumLiterals rcurly:RCURLY
+{ retVal = new EnumDecl(annotations, createTokenInfo(enum_KW), createTokenInfo(name), createTokenInfo(lcurly), enumLiterals, createTokenInfo(rcurly)); }
+;
+
+enumLiterals returns [ EnumLiterals retVal = new EnumLiterals() ]
+:
+{ EnumLiteral enumLiteral = null; }
+ ( enumLiteral=enumLiteral { retVal.addChild(enumLiteral); } )*
+;
+
+enumLiteral returns [ EnumLiteral retVal = null ]
+:
+{ Annotations leadingAnnotations = null; Annotations trailingAnnotations = null; }
+ leadingAnnotations=annotations name:ID ( equals:EQUALS val:INT_LITERAL )? trailingAnnotations=annotations semi:SEMI
+{ retVal = new EnumLiteral(leadingAnnotations, createTokenInfo(name), createTokenInfo(equals), createTokenInfo(val), trailingAnnotations, createTokenInfo(semi)); }
+;
+
+mapEntryDecl [ Annotations annotations ] returns [ MapEntryDecl retVal = null ]
+:
+{ TypeWithMulti key = null; TypeWithMulti value = null; }
+ mapentry_KW:"mapentry" name:ID colon:COLON key=typeWithMulti minus_gt:MINUS_GT value=typeWithMulti semi:SEMI
+{ retVal = new MapEntryDecl(annotations, createTokenInfo(mapentry_KW), createTokenInfo(name), createTokenInfo(colon), key, createTokenInfo(minus_gt), value, createTokenInfo(semi)); }
+;
+
+
+class EmfaticLexer extends Lexer;
+
+options
+{
+ testLiterals=false;
+ k=3;
+ // charVocabulary='\003'..'\377';
+ charVocabulary='\u0000'..'\uFFFE';
+}
+
+
+LCURLY : '{';
+RCURLY : '}';
+LSQUARE : '[';
+RSQUARE : ']';
+LPAREN : '(';
+RPAREN : ')';
+
+DOT : '.';
+COMMA : ',';
+COLON : ':';
+SEMI : ';';
+
+STAR : '*';
+PLUS : '+';
+MINUS : '-';
+EQUALS : '=';
+
+QMARK : '?';
+BANG : '!';
+DOLLAR : '$';
+HASH : '#';
+AT : '@';
+
+DOT_DOT : "..";
+MINUS_GT : "->";
+GT_LT : "><";
+LT_GT : "<>";
+
+STRING_LITERAL : '"' (ESC | ~'"')* '"' ;
+CHAR_LITERAL : '\'' (ESC | ~'\'') '\'';
+
+// TODO: The (DIGIT DIGIT DIGIT) is cheesy it should be something like
+// ( options { warnWhenFollowAmbig = false; } : (DIGIT)+ )
+// but I don't want to deal with parsing that yet.
+protected ESC :
+'\\' ('t' | 'f' | 'r' | 'n' | '"' | '\'' | '\\' | (DIGIT DIGIT DIGIT) )
+;
+
+ID options { testLiterals=true; }
+: ('~')? ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | DIGIT)* ;
+
+INT_LITERAL : (DIGIT)+ ;
+
+protected DIGIT : '0'..'9';
+
+WS : (' ' | '\t' | '\f' | '\r' | '\n')+
+{ $setType(Token.SKIP); }
+;
+
+SINGLE_LINE_COMMENT : "//" (~('\n'|'\r'))* ('\n'|'\r')?
+{ $setType(Token.SKIP); }
+;
+
+MULTI_LINE_COMMENT : "/*" ("*/" | (~'!' (~'*' | '*' ~'/')* "*/"))
+{ $setType(Token.SKIP); }
+;
+
+AMP: '&';
+LT:'<';
+GT:'>';
+
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticLexer.g b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticLexer.g
new file mode 100644
index 0000000..4a3fec7
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticLexer.g
@@ -0,0 +1,72 @@
+class EmfaticLexer extends Lexer;
+
+options
+{
+ testLiterals=false;
+ k=3;
+ // charVocabulary='\003'..'\377';
+ charVocabulary='\u0000'..'\uFFFE';
+}
+
+
+LCURLY : '{';
+RCURLY : '}';
+LSQUARE : '[';
+RSQUARE : ']';
+LPAREN : '(';
+RPAREN : ')';
+
+DOT : '.';
+COMMA : ',';
+COLON : ':';
+SEMI : ';';
+
+STAR : '*';
+PLUS : '+';
+MINUS : '-';
+EQUALS : '=';
+
+QMARK : '?';
+BANG : '!';
+DOLLAR : '$';
+HASH : '#';
+AT : '@';
+
+DOT_DOT : "..";
+MINUS_GT : "->";
+GT_LT : "><";
+LT_GT : "<>";
+
+STRING_LITERAL : '"' (ESC | ~'"')* '"' ;
+CHAR_LITERAL : '\'' (ESC | ~'\'') '\'';
+
+// TODO: The (DIGIT DIGIT DIGIT) is cheesy it should be something like
+// ( options { warnWhenFollowAmbig = false; } : (DIGIT)+ )
+// but I don't want to deal with parsing that yet.
+protected ESC :
+'\\' ('t' | 'f' | 'r' | 'n' | '"' | '\'' | '\\' | (DIGIT DIGIT DIGIT) )
+;
+
+ID options { testLiterals=true; }
+: ('~')? ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | DIGIT)* ;
+
+INT_LITERAL : (DIGIT)+ ;
+
+protected DIGIT : '0'..'9';
+
+WS : (' ' | '\t' | '\f' | '\r' | '\n')+
+{ $setType(Token.SKIP); }
+;
+
+SINGLE_LINE_COMMENT : "//" (~('\n'|'\r'))* ('\n'|'\r')?
+{ $setType(Token.SKIP); }
+;
+
+MULTI_LINE_COMMENT : "/*" ("*/" | (~'!' (~'*' | '*' ~'/')* "*/"))
+{ $setType(Token.SKIP); }
+;
+
+AMP: '&';
+LT:'<';
+GT:'>';
+
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticLexer.java b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticLexer.java
new file mode 100644
index 0000000..919d206
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticLexer.java
@@ -0,0 +1,1122 @@
+// $ANTLR : "Emfatic.g" -> "EmfaticLexer.java"$
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.*;
+import org.eclipse.gymnast.runtime.core.parser.*;
+import org.eclipse.gymnast.runtime.core.ast.*;
+
+import java.io.InputStream;
+import antlr.TokenStreamException;
+import antlr.TokenStreamIOException;
+import antlr.TokenStreamRecognitionException;
+import antlr.CharStreamException;
+import antlr.CharStreamIOException;
+import antlr.ANTLRException;
+import java.io.Reader;
+import java.util.Hashtable;
+import antlr.CharScanner;
+import antlr.InputBuffer;
+import antlr.ByteBuffer;
+import antlr.CharBuffer;
+import antlr.Token;
+import antlr.CommonToken;
+import antlr.RecognitionException;
+import antlr.NoViableAltForCharException;
+import antlr.MismatchedCharException;
+import antlr.TokenStream;
+import antlr.ANTLRHashString;
+import antlr.LexerSharedInputState;
+import antlr.collections.impl.BitSet;
+import antlr.SemanticException;
+
+public class EmfaticLexer extends antlr.CharScanner implements EmfaticParserTokenTypes, TokenStream
+ {
+public EmfaticLexer(InputStream in) {
+ this(new ByteBuffer(in));
+}
+public EmfaticLexer(Reader in) {
+ this(new CharBuffer(in));
+}
+public EmfaticLexer(InputBuffer ib) {
+ this(new LexerSharedInputState(ib));
+}
+public EmfaticLexer(LexerSharedInputState state) {
+ super(state);
+ caseSensitiveLiterals = true;
+ setCaseSensitive(true);
+ literals = new Hashtable();
+ literals.put(new ANTLRHashString("super", this), new Integer(27));
+ literals.put(new ANTLRHashString("abstract", this), new Integer(20));
+ literals.put(new ANTLRHashString("ref", this), new Integer(36));
+ literals.put(new ANTLRHashString("unsettable", this), new Integer(42));
+ literals.put(new ANTLRHashString("op", this), new Integer(52));
+ literals.put(new ANTLRHashString("datatype", this), new Integer(55));
+ literals.put(new ANTLRHashString("class", this), new Integer(21));
+ literals.put(new ANTLRHashString("val", this), new Integer(37));
+ literals.put(new ANTLRHashString("throws", this), new Integer(53));
+ literals.put(new ANTLRHashString("derived", this), new Integer(43));
+ literals.put(new ANTLRHashString("transient", this), new Integer(41));
+ literals.put(new ANTLRHashString("unique", this), new Integer(44));
+ literals.put(new ANTLRHashString("ordered", this), new Integer(45));
+ literals.put(new ANTLRHashString("enum", this), new Integer(56));
+ literals.put(new ANTLRHashString("extends", this), new Integer(18));
+ literals.put(new ANTLRHashString("attr", this), new Integer(28));
+ literals.put(new ANTLRHashString("void", this), new Integer(54));
+ literals.put(new ANTLRHashString("import", this), new Integer(15));
+ literals.put(new ANTLRHashString("true", this), new Integer(48));
+ literals.put(new ANTLRHashString("interface", this), new Integer(22));
+ literals.put(new ANTLRHashString("id", this), new Integer(47));
+ literals.put(new ANTLRHashString("readonly", this), new Integer(39));
+ literals.put(new ANTLRHashString("package", this), new Integer(4));
+ literals.put(new ANTLRHashString("false", this), new Integer(49));
+ literals.put(new ANTLRHashString("volatile", this), new Integer(40));
+ literals.put(new ANTLRHashString("mapentry", this), new Integer(57));
+ literals.put(new ANTLRHashString("resolve", this), new Integer(46));
+}
+
+public Token nextToken() throws TokenStreamException {
+ Token theRetToken=null;
+tryAgain:
+ for (;;) {
+ Token _token = null;
+ int _ttype = Token.INVALID_TYPE;
+ resetText();
+ try { // for char stream error handling
+ try { // for lexical error handling
+ switch ( LA(1)) {
+ case '{':
+ {
+ mLCURLY(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '}':
+ {
+ mRCURLY(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '[':
+ {
+ mLSQUARE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case ']':
+ {
+ mRSQUARE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '(':
+ {
+ mLPAREN(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case ')':
+ {
+ mRPAREN(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case ',':
+ {
+ mCOMMA(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case ':':
+ {
+ mCOLON(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case ';':
+ {
+ mSEMI(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '*':
+ {
+ mSTAR(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '+':
+ {
+ mPLUS(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '=':
+ {
+ mEQUALS(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '?':
+ {
+ mQMARK(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '!':
+ {
+ mBANG(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '$':
+ {
+ mDOLLAR(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '#':
+ {
+ mHASH(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '@':
+ {
+ mAT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '"':
+ {
+ mSTRING_LITERAL(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '\'':
+ {
+ mCHAR_LITERAL(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z': case '_': case 'a':
+ case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i':
+ case 'j': case 'k': case 'l': case 'm':
+ case 'n': case 'o': case 'p': case 'q':
+ case 'r': case 's': case 't': case 'u':
+ case 'v': case 'w': case 'x': case 'y':
+ case 'z': case '~':
+ {
+ mID(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ mINT_LITERAL(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '\t': case '\n': case '\u000c': case '\r':
+ case ' ':
+ {
+ mWS(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case '&':
+ {
+ mAMP(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ default:
+ if ((LA(1)=='.') && (LA(2)=='.')) {
+ mDOT_DOT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1)=='-') && (LA(2)=='>')) {
+ mMINUS_GT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1)=='>') && (LA(2)=='<')) {
+ mGT_LT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1)=='<') && (LA(2)=='>')) {
+ mLT_GT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1)=='/') && (LA(2)=='/')) {
+ mSINGLE_LINE_COMMENT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1)=='/') && (LA(2)=='*')) {
+ mMULTI_LINE_COMMENT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1)=='.') && (true)) {
+ mDOT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1)=='-') && (true)) {
+ mMINUS(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1)=='<') && (true)) {
+ mLT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1)=='>') && (true)) {
+ mGT(true);
+ theRetToken=_returnToken;
+ }
+ else {
+ if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);}
+ else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ }
+ }
+ if ( _returnToken==null ) continue tryAgain; // found SKIP token
+ _ttype = _returnToken.getType();
+ _returnToken.setType(_ttype);
+ return _returnToken;
+ }
+ catch (RecognitionException e) {
+ throw new TokenStreamRecognitionException(e);
+ }
+ }
+ catch (CharStreamException cse) {
+ if ( cse instanceof CharStreamIOException ) {
+ throw new TokenStreamIOException(((CharStreamIOException)cse).io);
+ }
+ else {
+ throw new TokenStreamException(cse.getMessage());
+ }
+ }
+ }
+}
+
+ public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = LCURLY;
+ int _saveIndex;
+
+ match('{');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = RCURLY;
+ int _saveIndex;
+
+ match('}');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mLSQUARE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = LSQUARE;
+ int _saveIndex;
+
+ match('[');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mRSQUARE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = RSQUARE;
+ int _saveIndex;
+
+ match(']');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = LPAREN;
+ int _saveIndex;
+
+ match('(');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = RPAREN;
+ int _saveIndex;
+
+ match(')');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = DOT;
+ int _saveIndex;
+
+ match('.');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = COMMA;
+ int _saveIndex;
+
+ match(',');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = COLON;
+ int _saveIndex;
+
+ match(':');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = SEMI;
+ int _saveIndex;
+
+ match(';');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = STAR;
+ int _saveIndex;
+
+ match('*');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = PLUS;
+ int _saveIndex;
+
+ match('+');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = MINUS;
+ int _saveIndex;
+
+ match('-');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mEQUALS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = EQUALS;
+ int _saveIndex;
+
+ match('=');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mQMARK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = QMARK;
+ int _saveIndex;
+
+ match('?');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mBANG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = BANG;
+ int _saveIndex;
+
+ match('!');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mDOLLAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = DOLLAR;
+ int _saveIndex;
+
+ match('$');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mHASH(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = HASH;
+ int _saveIndex;
+
+ match('#');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = AT;
+ int _saveIndex;
+
+ match('@');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mDOT_DOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = DOT_DOT;
+ int _saveIndex;
+
+ match("..");
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mMINUS_GT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = MINUS_GT;
+ int _saveIndex;
+
+ match("->");
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mGT_LT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = GT_LT;
+ int _saveIndex;
+
+ match("><");
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mLT_GT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = LT_GT;
+ int _saveIndex;
+
+ match("<>");
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mSTRING_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = STRING_LITERAL;
+ int _saveIndex;
+
+ match('"');
+ {
+ _loop144:
+ do {
+ if ((LA(1)=='\\')) {
+ mESC(false);
+ }
+ else if ((_tokenSet_0.member(LA(1)))) {
+ matchNot('"');
+ }
+ else {
+ break _loop144;
+ }
+
+ } while (true);
+ }
+ match('"');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = ESC;
+ int _saveIndex;
+
+ match('\\');
+ {
+ switch ( LA(1)) {
+ case 't':
+ {
+ match('t');
+ break;
+ }
+ case 'f':
+ {
+ match('f');
+ break;
+ }
+ case 'r':
+ {
+ match('r');
+ break;
+ }
+ case 'n':
+ {
+ match('n');
+ break;
+ }
+ case '"':
+ {
+ match('"');
+ break;
+ }
+ case '\'':
+ {
+ match('\'');
+ break;
+ }
+ case '\\':
+ {
+ match('\\');
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ {
+ mDIGIT(false);
+ mDIGIT(false);
+ mDIGIT(false);
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mCHAR_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = CHAR_LITERAL;
+ int _saveIndex;
+
+ match('\'');
+ {
+ if ((LA(1)=='\\')) {
+ mESC(false);
+ }
+ else if ((_tokenSet_1.member(LA(1)))) {
+ matchNot('\'');
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ }
+ match('\'');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = DIGIT;
+ int _saveIndex;
+
+ matchRange('0','9');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = ID;
+ int _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case '~':
+ {
+ match('~');
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z': case '_': case 'a':
+ case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i':
+ case 'j': case 'k': case 'l': case 'm':
+ case 'n': case 'o': case 'p': case 'q':
+ case 'r': case 's': case 't': case 'u':
+ case 'v': case 'w': case 'x': case 'y':
+ case 'z':
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ {
+ matchRange('A','Z');
+ break;
+ }
+ case '_':
+ {
+ match('_');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ {
+ _loop154:
+ do {
+ switch ( LA(1)) {
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ {
+ matchRange('A','Z');
+ break;
+ }
+ case '_':
+ {
+ match('_');
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ mDIGIT(false);
+ break;
+ }
+ default:
+ {
+ break _loop154;
+ }
+ }
+ } while (true);
+ }
+ _ttype = testLiteralsTable(_ttype);
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mINT_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = INT_LITERAL;
+ int _saveIndex;
+
+ {
+ int _cnt157=0;
+ _loop157:
+ do {
+ if (((LA(1) >= '0' && LA(1) <= '9'))) {
+ mDIGIT(false);
+ }
+ else {
+ if ( _cnt157>=1 ) { break _loop157; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt157++;
+ } while (true);
+ }
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = WS;
+ int _saveIndex;
+
+ {
+ int _cnt161=0;
+ _loop161:
+ do {
+ switch ( LA(1)) {
+ case ' ':
+ {
+ match(' ');
+ break;
+ }
+ case '\t':
+ {
+ match('\t');
+ break;
+ }
+ case '\u000c':
+ {
+ match('\f');
+ break;
+ }
+ case '\r':
+ {
+ match('\r');
+ break;
+ }
+ case '\n':
+ {
+ match('\n');
+ break;
+ }
+ default:
+ {
+ if ( _cnt161>=1 ) { break _loop161; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ }
+ }
+ _cnt161++;
+ } while (true);
+ }
+ _ttype = Token.SKIP;
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mSINGLE_LINE_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = SINGLE_LINE_COMMENT;
+ int _saveIndex;
+
+ match("//");
+ {
+ _loop165:
+ do {
+ if ((_tokenSet_2.member(LA(1)))) {
+ {
+ match(_tokenSet_2);
+ }
+ }
+ else {
+ break _loop165;
+ }
+
+ } while (true);
+ }
+ {
+ switch ( LA(1)) {
+ case '\n':
+ {
+ match('\n');
+ break;
+ }
+ case '\r':
+ {
+ match('\r');
+ break;
+ }
+ default:
+ {
+ }
+ }
+ }
+ _ttype = Token.SKIP;
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mMULTI_LINE_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = MULTI_LINE_COMMENT;
+ int _saveIndex;
+
+ match("/*");
+ {
+ if ((_tokenSet_3.member(LA(1))) && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0000' && LA(3) <= '\ufffe'))) {
+ {
+ matchNot('!');
+ {
+ _loop171:
+ do {
+ if ((LA(1)=='*') && (_tokenSet_4.member(LA(2)))) {
+ match('*');
+ matchNot('/');
+ }
+ else if ((_tokenSet_5.member(LA(1)))) {
+ matchNot('*');
+ }
+ else {
+ break _loop171;
+ }
+
+ } while (true);
+ }
+ match("*/");
+ }
+ }
+ else if ((LA(1)=='*') && (LA(2)=='/') && (true)) {
+ match("*/");
+ }
+ else {
+ throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ }
+ _ttype = Token.SKIP;
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mAMP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = AMP;
+ int _saveIndex;
+
+ match('&');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = LT;
+ int _saveIndex;
+
+ match('<');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+ public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
+ int _ttype; Token _token=null; int _begin=text.length();
+ _ttype = GT;
+ int _saveIndex;
+
+ match('>');
+ if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
+ _token = makeToken(_ttype);
+ _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ }
+
+
+ private static final long[] mk_tokenSet_0() {
+ long[] data = new long[2048];
+ data[0]=-17179869185L;
+ data[1]=-268435457L;
+ for (int i = 2; i<=1022; i++) { data[i]=-1L; }
+ data[1023]=9223372036854775807L;
+ return data;
+ }
+ public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
+ private static final long[] mk_tokenSet_1() {
+ long[] data = new long[2048];
+ data[0]=-549755813889L;
+ data[1]=-268435457L;
+ for (int i = 2; i<=1022; i++) { data[i]=-1L; }
+ data[1023]=9223372036854775807L;
+ return data;
+ }
+ public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
+ private static final long[] mk_tokenSet_2() {
+ long[] data = new long[2048];
+ data[0]=-9217L;
+ for (int i = 1; i<=1022; i++) { data[i]=-1L; }
+ data[1023]=9223372036854775807L;
+ return data;
+ }
+ public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
+ private static final long[] mk_tokenSet_3() {
+ long[] data = new long[2048];
+ data[0]=-8589934593L;
+ for (int i = 1; i<=1022; i++) { data[i]=-1L; }
+ data[1023]=9223372036854775807L;
+ return data;
+ }
+ public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
+ private static final long[] mk_tokenSet_4() {
+ long[] data = new long[2048];
+ data[0]=-140737488355329L;
+ for (int i = 1; i<=1022; i++) { data[i]=-1L; }
+ data[1023]=9223372036854775807L;
+ return data;
+ }
+ public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
+ private static final long[] mk_tokenSet_5() {
+ long[] data = new long[2048];
+ data[0]=-4398046511105L;
+ for (int i = 1; i<=1022; i++) { data[i]=-1L; }
+ data[1023]=9223372036854775807L;
+ return data;
+ }
+ public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
+
+ }
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticLexer.smap b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticLexer.smap
new file mode 100644
index 0000000..b43980f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticLexer.smap
@@ -0,0 +1,649 @@
+SMAP
+EmfaticLexer.java
+G
+*S G
+*F
++ 0 Emfatic.g
+Emfatic.g
+*L
+0:89
+0:95
+0:101
+0:107
+0:113
+0:119
+0:125
+0:131
+0:137
+0:143
+0:149
+0:155
+0:161
+0:167
+0:173
+0:179
+0:185
+0:191
+0:197
+0:216
+0:224
+0:231
+0:237
+0:243
+0:247
+0:251
+0:255
+0:259
+0:263
+0:267
+0:271
+0:275
+0:279
+3:3
+3:4
+3:5
+3:6
+490:307
+490:308
+490:309
+490:310
+490:312
+490:313
+490:314
+490:315
+490:316
+490:317
+490:318
+491:320
+491:321
+491:322
+491:323
+491:325
+491:326
+491:327
+491:328
+491:329
+491:330
+491:331
+492:333
+492:334
+492:335
+492:336
+492:338
+492:339
+492:340
+492:341
+492:342
+492:343
+492:344
+493:346
+493:347
+493:348
+493:349
+493:351
+493:352
+493:353
+493:354
+493:355
+493:356
+493:357
+494:359
+494:360
+494:361
+494:362
+494:364
+494:365
+494:366
+494:367
+494:368
+494:369
+494:370
+495:372
+495:373
+495:374
+495:375
+495:377
+495:378
+495:379
+495:380
+495:381
+495:382
+495:383
+497:385
+497:386
+497:387
+497:388
+497:390
+497:391
+497:392
+497:393
+497:394
+497:395
+497:396
+498:398
+498:399
+498:400
+498:401
+498:403
+498:404
+498:405
+498:406
+498:407
+498:408
+498:409
+499:411
+499:412
+499:413
+499:414
+499:416
+499:417
+499:418
+499:419
+499:420
+499:421
+499:422
+500:424
+500:425
+500:426
+500:427
+500:429
+500:430
+500:431
+500:432
+500:433
+500:434
+500:435
+502:437
+502:438
+502:439
+502:440
+502:442
+502:443
+502:444
+502:445
+502:446
+502:447
+502:448
+503:450
+503:451
+503:452
+503:453
+503:455
+503:456
+503:457
+503:458
+503:459
+503:460
+503:461
+504:463
+504:464
+504:465
+504:466
+504:468
+504:469
+504:470
+504:471
+504:472
+504:473
+504:474
+505:476
+505:477
+505:478
+505:479
+505:481
+505:482
+505:483
+505:484
+505:485
+505:486
+505:487
+507:489
+507:490
+507:491
+507:492
+507:494
+507:495
+507:496
+507:497
+507:498
+507:499
+507:500
+508:502
+508:503
+508:504
+508:505
+508:507
+508:508
+508:509
+508:510
+508:511
+508:512
+508:513
+509:515
+509:516
+509:517
+509:518
+509:520
+509:521
+509:522
+509:523
+509:524
+509:525
+509:526
+510:528
+510:529
+510:530
+510:531
+510:533
+510:534
+510:535
+510:536
+510:537
+510:538
+510:539
+511:541
+511:542
+511:543
+511:544
+511:546
+511:547
+511:548
+511:549
+511:550
+511:551
+511:552
+513:554
+513:555
+513:556
+513:557
+513:559
+513:560
+513:561
+513:562
+513:563
+513:564
+513:565
+514:567
+514:568
+514:569
+514:570
+514:572
+514:573
+514:574
+514:575
+514:576
+514:577
+514:578
+515:580
+515:581
+515:582
+515:583
+515:585
+515:586
+515:587
+515:588
+515:589
+515:590
+515:591
+516:593
+516:594
+516:595
+516:596
+516:598
+516:599
+516:600
+516:601
+516:602
+516:603
+516:604
+518:606
+518:607
+518:608
+518:609
+518:611
+518:612
+518:613
+518:614
+518:615
+518:616
+518:617
+518:618
+518:619
+518:620
+518:621
+518:622
+518:623
+518:625
+518:626
+518:627
+518:628
+518:629
+518:630
+518:631
+518:632
+518:633
+519:702
+519:703
+519:704
+519:705
+519:707
+519:709
+519:710
+519:711
+519:712
+519:713
+519:714
+519:715
+519:716
+519:717
+519:720
+519:721
+519:722
+519:723
+519:724
+519:725
+519:726
+524:635
+524:636
+524:637
+524:638
+524:695
+524:696
+524:697
+524:698
+524:699
+524:700
+525:640
+525:642
+525:643
+525:644
+525:645
+525:648
+525:649
+525:650
+525:653
+525:654
+525:655
+525:658
+525:659
+525:660
+525:663
+525:664
+525:665
+525:668
+525:669
+525:670
+525:673
+525:674
+525:675
+525:678
+525:679
+525:680
+525:681
+525:683
+525:684
+525:685
+525:689
+525:690
+525:691
+525:692
+525:693
+528:741
+528:742
+528:743
+528:744
+528:856
+528:857
+528:858
+528:859
+528:860
+528:861
+528:862
+529:747
+529:748
+529:749
+529:750
+529:770
+529:771
+529:772
+529:773
+529:774
+529:777
+529:778
+529:779
+529:780
+529:781
+529:782
+529:783
+529:784
+529:785
+529:786
+529:789
+529:790
+529:791
+529:792
+529:793
+529:794
+529:795
+529:796
+529:797
+529:800
+529:801
+529:802
+529:805
+529:806
+529:807
+529:808
+529:809
+529:811
+529:812
+529:813
+529:814
+529:815
+529:816
+529:817
+529:818
+529:819
+529:820
+529:821
+529:822
+529:823
+529:826
+529:827
+529:828
+529:829
+529:830
+529:831
+529:832
+529:833
+529:834
+529:837
+529:838
+529:839
+529:842
+529:843
+529:844
+529:845
+529:846
+529:849
+529:850
+529:851
+529:852
+529:853
+529:854
+529:855
+531:864
+531:865
+531:866
+531:867
+531:870
+531:871
+531:872
+531:873
+531:874
+531:875
+531:876
+531:877
+531:878
+531:880
+531:881
+531:882
+531:883
+531:884
+531:885
+531:886
+531:887
+531:888
+533:728
+533:729
+533:730
+533:731
+533:733
+533:734
+533:735
+533:736
+533:737
+533:738
+533:739
+535:890
+535:891
+535:892
+535:893
+535:896
+535:897
+535:898
+535:899
+535:900
+535:901
+535:902
+535:905
+535:906
+535:907
+535:910
+535:911
+535:912
+535:915
+535:916
+535:917
+535:920
+535:921
+535:922
+535:925
+535:926
+535:927
+535:928
+535:929
+535:930
+535:931
+535:932
+535:934
+535:935
+535:936
+535:937
+535:938
+535:939
+536:933
+539:941
+539:942
+539:943
+539:944
+539:946
+539:947
+539:948
+539:949
+539:950
+539:952
+539:954
+539:955
+539:956
+539:957
+539:959
+539:960
+539:962
+539:963
+539:964
+539:965
+539:968
+539:969
+539:970
+539:973
+539:975
+539:976
+539:979
+539:980
+539:981
+539:982
+539:983
+539:984
+540:978
+543:986
+543:987
+543:988
+543:989
+543:991
+543:993
+543:995
+543:996
+543:997
+543:998
+543:999
+543:1000
+543:1001
+543:1002
+543:1003
+543:1004
+543:1005
+543:1006
+543:1007
+543:1008
+543:1010
+543:1011
+543:1012
+543:1014
+543:1015
+543:1016
+543:1017
+543:1018
+543:1019
+543:1020
+543:1024
+543:1025
+543:1026
+543:1027
+543:1028
+543:1029
+544:1023
+547:1031
+547:1032
+547:1033
+547:1034
+547:1036
+547:1037
+547:1038
+547:1039
+547:1040
+547:1041
+547:1042
+548:1044
+548:1045
+548:1046
+548:1047
+548:1049
+548:1050
+548:1051
+548:1052
+548:1053
+548:1054
+548:1055
+549:1057
+549:1058
+549:1059
+549:1060
+549:1062
+549:1063
+549:1064
+549:1065
+549:1066
+549:1067
+549:1068
+*E
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParser.java b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParser.java
new file mode 100644
index 0000000..6d3da29
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParser.java
@@ -0,0 +1,2317 @@
+// $ANTLR : "Emfatic.g" -> "EmfaticParser.java"$
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.*;
+import org.eclipse.gymnast.runtime.core.parser.*;
+import org.eclipse.gymnast.runtime.core.ast.*;
+
+import antlr.TokenBuffer;
+import antlr.TokenStreamException;
+import antlr.TokenStreamIOException;
+import antlr.ANTLRException;
+import antlr.LLkParser;
+import antlr.Token;
+import antlr.TokenStream;
+import antlr.RecognitionException;
+import antlr.NoViableAltException;
+import antlr.MismatchedTokenException;
+import antlr.SemanticException;
+import antlr.ParserSharedInputState;
+import antlr.collections.impl.BitSet;
+
+public class EmfaticParser extends antlr.LLkParser implements EmfaticParserTokenTypes
+ {
+
+ private ParseError createParseError(RecognitionException ex) {
+ return EmfaticParserDriver.createParseError(ex);
+ }
+
+ private TokenInfo createTokenInfo(Token tok) {
+ if (tok == null) return null;
+ else return new TokenInfo(tok.getText(), tok.getColumn(), tok.getType());
+ }
+
+
+ private ParseContext _parseContext;
+ public void setParseContext(ParseContext parseContext) {
+ _parseContext = parseContext;
+ }
+
+ public void reportError(RecognitionException ex) {
+ if (_parseContext != null) {
+ _parseContext.addParseMessage(createParseError(ex));
+ }
+ }
+
+ public void reportError(String s) {
+ if (_parseContext != null) {
+ _parseContext.addParseMessage(new ParseError(s, -1));
+ }
+ }
+
+ public void reportWarning(String s) {
+ if (_parseContext != null) {
+ _parseContext.addParseMessage(new ParseWarning(s, -1));
+ }
+ }
+
+
+protected EmfaticParser(TokenBuffer tokenBuf, int k) {
+ super(tokenBuf,k);
+ tokenNames = _tokenNames;
+}
+
+public EmfaticParser(TokenBuffer tokenBuf) {
+ this(tokenBuf,3);
+}
+
+protected EmfaticParser(TokenStream lexer, int k) {
+ super(lexer,k);
+ tokenNames = _tokenNames;
+}
+
+public EmfaticParser(TokenStream lexer) {
+ this(lexer,3);
+}
+
+public EmfaticParser(ParserSharedInputState state) {
+ super(state,3);
+ tokenNames = _tokenNames;
+}
+
+ public final CompUnit compUnit() throws RecognitionException, TokenStreamException {
+ CompUnit retVal = null ;
+
+
+ try { // for error handling
+ PackageDecl packageDecl = null; ImportStmts importStmts = null; TopLevelDecls topLevelDecls = null;
+ packageDecl=packageDecl();
+ importStmts=importStmts();
+ topLevelDecls=topLevelDecls();
+ match(Token.EOF_TYPE);
+ retVal = new CompUnit(packageDecl, importStmts, topLevelDecls);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_0);
+ }
+ return retVal;
+ }
+
+ public final PackageDecl packageDecl() throws RecognitionException, TokenStreamException {
+ PackageDecl retVal = null ;
+
+ Token package_KW = null;
+ Token semi = null;
+
+ try { // for error handling
+ Annotations annotations = null; QualifiedID name = null;
+ annotations=annotations();
+ package_KW = LT(1);
+ match(LITERAL_package);
+ name=qualifiedID();
+ semi = LT(1);
+ match(SEMI);
+ retVal = new PackageDecl(annotations, createTokenInfo(package_KW), name, createTokenInfo(semi));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_1);
+ }
+ return retVal;
+ }
+
+ public final ImportStmts importStmts() throws RecognitionException, TokenStreamException {
+ ImportStmts retVal = new ImportStmts() ;
+
+
+ try { // for error handling
+ ImportStmt importStmt = null;
+ {
+ _loop22:
+ do {
+ if ((LA(1)==LITERAL_import)) {
+ importStmt=importStmt();
+ retVal.addChild(importStmt);
+ }
+ else {
+ break _loop22;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_2);
+ }
+ return retVal;
+ }
+
+ public final TopLevelDecls topLevelDecls() throws RecognitionException, TokenStreamException {
+ TopLevelDecls retVal = new TopLevelDecls() ;
+
+
+ try { // for error handling
+ TopLevelDecl topLevelDecl = null;
+ {
+ _loop27:
+ do {
+ if ((_tokenSet_3.member(LA(1)))) {
+ topLevelDecl=topLevelDecl();
+ retVal.addChild(topLevelDecl);
+ }
+ else {
+ break _loop27;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_4);
+ }
+ return retVal;
+ }
+
+ public final Annotations annotations() throws RecognitionException, TokenStreamException {
+ Annotations retVal = new Annotations() ;
+
+
+ try { // for error handling
+ Annotation annotation = null;
+ {
+ _loop14:
+ do {
+ if ((LA(1)==AT)) {
+ annotation=annotation();
+ retVal.addChild(annotation);
+ }
+ else {
+ break _loop14;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_5);
+ }
+ return retVal;
+ }
+
+ public final QualifiedID qualifiedID() throws RecognitionException, TokenStreamException {
+ QualifiedID retVal = new QualifiedID() ;
+
+ Token id1 = null;
+ Token idn = null;
+
+ try { // for error handling
+ QidSeparator qidSeparator = null;
+ id1 = LT(1);
+ match(ID);
+ retVal.addChild(createTokenInfo(id1));
+ {
+ _loop5:
+ do {
+ if ((LA(1)==DOT||LA(1)==DOLLAR)) {
+ qidSeparator=qidSeparator();
+ idn = LT(1);
+ match(ID);
+ retVal.addChild(qidSeparator); retVal.addChild(createTokenInfo(idn));
+ }
+ else {
+ break _loop5;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ }
+ return retVal;
+ }
+
+ public final QidSeparator qidSeparator() throws RecognitionException, TokenStreamException {
+ QidSeparator retVal = null ;
+
+ Token tok = LT(1);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case DOT:
+ {
+ match(DOT);
+ break;
+ }
+ case DOLLAR:
+ {
+ match(DOLLAR);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new QidSeparator(createTokenInfo(tok));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_7);
+ }
+ return retVal;
+ }
+
+ public final StringLiteralOrQualifiedID stringLiteralOrQualifiedID() throws RecognitionException, TokenStreamException {
+ StringLiteralOrQualifiedID retVal = null ;
+
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case STRING_LITERAL:
+ {
+ retVal=stringLiteralContainer();
+ break;
+ }
+ case ID:
+ {
+ retVal=qualifiedIDContainer();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_8);
+ }
+ return retVal;
+ }
+
+ public final StringLiteralContainer stringLiteralContainer() throws RecognitionException, TokenStreamException {
+ StringLiteralContainer retVal = null ;
+
+ Token string_literal = null;
+
+ try { // for error handling
+ string_literal = LT(1);
+ match(STRING_LITERAL);
+ retVal = new StringLiteralContainer(createTokenInfo(string_literal));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_8);
+ }
+ return retVal;
+ }
+
+ public final QualifiedIDContainer qualifiedIDContainer() throws RecognitionException, TokenStreamException {
+ QualifiedIDContainer retVal = null ;
+
+
+ try { // for error handling
+ QualifiedID qualifiedID = null;
+ qualifiedID=qualifiedID();
+ retVal = new QualifiedIDContainer(qualifiedID);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_8);
+ }
+ return retVal;
+ }
+
+ public final Annotation annotation() throws RecognitionException, TokenStreamException {
+ Annotation retVal = null ;
+
+ Token at = null;
+ Token lparen = null;
+ Token rparen = null;
+
+ try { // for error handling
+ StringLiteralOrQualifiedID source = null; KeyEqualsValueList keyEqualsValueList = null;
+ at = LT(1);
+ match(AT);
+ source=stringLiteralOrQualifiedID();
+ lparen = LT(1);
+ match(LPAREN);
+ keyEqualsValueList=keyEqualsValueList();
+ rparen = LT(1);
+ match(RPAREN);
+ retVal = new Annotation(createTokenInfo(at), source, createTokenInfo(lparen), keyEqualsValueList, createTokenInfo(rparen));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_9);
+ }
+ return retVal;
+ }
+
+ public final KeyEqualsValueList keyEqualsValueList() throws RecognitionException, TokenStreamException {
+ KeyEqualsValueList retVal = new KeyEqualsValueList() ;
+
+ Token comma = null;
+
+ try { // for error handling
+ KeyEqualsValue kv1 = null; KeyEqualsValue kvn = null;
+ kv1=keyEqualsValue();
+ retVal.addChild(kv1);
+ {
+ _loop18:
+ do {
+ if ((LA(1)==COMMA)) {
+ comma = LT(1);
+ match(COMMA);
+ kvn=keyEqualsValue();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(kvn);
+ }
+ else {
+ break _loop18;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_10);
+ }
+ return retVal;
+ }
+
+ public final KeyEqualsValue keyEqualsValue() throws RecognitionException, TokenStreamException {
+ KeyEqualsValue retVal = null ;
+
+ Token equals = null;
+
+ try { // for error handling
+ StringLiteralOrQualifiedID key = null; StringLiteralOrQualifiedID value = null;
+ key=stringLiteralOrQualifiedID();
+ equals = LT(1);
+ match(EQUALS);
+ value=stringLiteralOrQualifiedID();
+ retVal = new KeyEqualsValue(key, createTokenInfo(equals), value);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_11);
+ }
+ return retVal;
+ }
+
+ public final ImportStmt importStmt() throws RecognitionException, TokenStreamException {
+ ImportStmt retVal = null ;
+
+ Token import_KW = null;
+ Token alias = null;
+ Token equals = null;
+ Token semi = null;
+
+ try { // for error handling
+ StringLiteralOrQualifiedID uri = null;
+ import_KW = LT(1);
+ match(LITERAL_import);
+ {
+ if ((LA(1)==ID) && (LA(2)==EQUALS)) {
+ alias = LT(1);
+ match(ID);
+ equals = LT(1);
+ match(EQUALS);
+ }
+ else if ((LA(1)==ID||LA(1)==STRING_LITERAL) && (LA(2)==SEMI||LA(2)==DOT||LA(2)==DOLLAR)) {
+ }
+ else {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ uri=stringLiteralOrQualifiedID();
+ semi = LT(1);
+ match(SEMI);
+ retVal = new ImportStmt(createTokenInfo(import_KW), createTokenInfo(alias), createTokenInfo(equals), uri, createTokenInfo(semi));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_1);
+ }
+ return retVal;
+ }
+
+ public final TopLevelDecl topLevelDecl() throws RecognitionException, TokenStreamException {
+ TopLevelDecl retVal = null ;
+
+
+ try { // for error handling
+ Annotations annotations = null;
+ annotations=annotations();
+ {
+ switch ( LA(1)) {
+ case LITERAL_package:
+ {
+ retVal=subPackageDecl(annotations);
+ break;
+ }
+ case LITERAL_abstract:
+ case LITERAL_class:
+ case LITERAL_interface:
+ {
+ retVal=classDecl(annotations);
+ break;
+ }
+ case LITERAL_transient:
+ case LITERAL_datatype:
+ {
+ retVal=dataTypeDecl(annotations);
+ break;
+ }
+ case LITERAL_enum:
+ {
+ retVal=enumDecl(annotations);
+ break;
+ }
+ case LITERAL_mapentry:
+ {
+ retVal=mapEntryDecl(annotations);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_12);
+ }
+ return retVal;
+ }
+
+ public final SubPackageDecl subPackageDecl(
+ Annotations annotations
+ ) throws RecognitionException, TokenStreamException {
+ SubPackageDecl retVal = null ;
+
+ Token package_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ Token rcurly = null;
+
+ try { // for error handling
+ TopLevelDecls topLevelDecls = null;
+ package_KW = LT(1);
+ match(LITERAL_package);
+ name = LT(1);
+ match(ID);
+ lcurly = LT(1);
+ match(LCURLY);
+ topLevelDecls=topLevelDecls();
+ rcurly = LT(1);
+ match(RCURLY);
+ retVal = new SubPackageDecl(annotations, createTokenInfo(package_KW), createTokenInfo(name), createTokenInfo(lcurly), topLevelDecls, createTokenInfo(rcurly));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_12);
+ }
+ return retVal;
+ }
+
+ public final ClassDecl classDecl(
+ Annotations annotations
+ ) throws RecognitionException, TokenStreamException {
+ ClassDecl retVal = null ;
+
+ Token name = null;
+ Token extends_KW = null;
+ Token colon = null;
+ Token lcurly = null;
+ Token rcurly = null;
+
+ try { // for error handling
+ AbstractModifier abstractModifier = null; ClassKind classKind = null; TypeParamsInfo typeParamsInfo = null; CommaListBoundExceptWild superTypes = null; BoundExceptWildcard instClassName = null; ClassMemberDecls classMemberDecls = null;
+ {
+ switch ( LA(1)) {
+ case LITERAL_abstract:
+ {
+ abstractModifier=abstractModifier();
+ break;
+ }
+ case LITERAL_class:
+ case LITERAL_interface:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ classKind=classKind();
+ name = LT(1);
+ match(ID);
+ {
+ switch ( LA(1)) {
+ case LT:
+ {
+ typeParamsInfo=typeParamsInfo();
+ break;
+ }
+ case LCURLY:
+ case LITERAL_extends:
+ case COLON:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_extends:
+ {
+ extends_KW = LT(1);
+ match(LITERAL_extends);
+ superTypes=commaListBoundExceptWild();
+ break;
+ }
+ case LCURLY:
+ case COLON:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case COLON:
+ {
+ colon = LT(1);
+ match(COLON);
+ instClassName=boundExceptWildcard();
+ break;
+ }
+ case LCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ lcurly = LT(1);
+ match(LCURLY);
+ classMemberDecls=classMemberDecls();
+ rcurly = LT(1);
+ match(RCURLY);
+ retVal = new ClassDecl(annotations, abstractModifier, classKind, createTokenInfo(name), typeParamsInfo, createTokenInfo(extends_KW), superTypes, createTokenInfo(colon), instClassName, createTokenInfo(lcurly), classMemberDecls, createTokenInfo(rcurly));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_12);
+ }
+ return retVal;
+ }
+
+ public final DataTypeDecl dataTypeDecl(
+ Annotations annotations
+ ) throws RecognitionException, TokenStreamException {
+ DataTypeDecl retVal = null ;
+
+ Token datatype_KW = null;
+ Token name = null;
+ Token colon = null;
+ Token semi = null;
+
+ try { // for error handling
+ TransientModifier transientModifier = null; StringLiteralOrQualifiedID instClassName = null;
+ {
+ switch ( LA(1)) {
+ case LITERAL_transient:
+ {
+ transientModifier=transientModifier();
+ break;
+ }
+ case LITERAL_datatype:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ datatype_KW = LT(1);
+ match(LITERAL_datatype);
+ name = LT(1);
+ match(ID);
+ colon = LT(1);
+ match(COLON);
+ instClassName=stringLiteralOrQualifiedID();
+ semi = LT(1);
+ match(SEMI);
+ retVal = new DataTypeDecl(annotations, transientModifier, createTokenInfo(datatype_KW), createTokenInfo(name), createTokenInfo(colon), instClassName, createTokenInfo(semi));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_12);
+ }
+ return retVal;
+ }
+
+ public final EnumDecl enumDecl(
+ Annotations annotations
+ ) throws RecognitionException, TokenStreamException {
+ EnumDecl retVal = null ;
+
+ Token enum_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ Token rcurly = null;
+
+ try { // for error handling
+ EnumLiterals enumLiterals = null;
+ enum_KW = LT(1);
+ match(LITERAL_enum);
+ name = LT(1);
+ match(ID);
+ lcurly = LT(1);
+ match(LCURLY);
+ enumLiterals=enumLiterals();
+ rcurly = LT(1);
+ match(RCURLY);
+ retVal = new EnumDecl(annotations, createTokenInfo(enum_KW), createTokenInfo(name), createTokenInfo(lcurly), enumLiterals, createTokenInfo(rcurly));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_12);
+ }
+ return retVal;
+ }
+
+ public final MapEntryDecl mapEntryDecl(
+ Annotations annotations
+ ) throws RecognitionException, TokenStreamException {
+ MapEntryDecl retVal = null ;
+
+ Token mapentry_KW = null;
+ Token name = null;
+ Token colon = null;
+ Token minus_gt = null;
+ Token semi = null;
+
+ try { // for error handling
+ TypeWithMulti key = null; TypeWithMulti value = null;
+ mapentry_KW = LT(1);
+ match(LITERAL_mapentry);
+ name = LT(1);
+ match(ID);
+ colon = LT(1);
+ match(COLON);
+ key=typeWithMulti();
+ minus_gt = LT(1);
+ match(MINUS_GT);
+ value=typeWithMulti();
+ semi = LT(1);
+ match(SEMI);
+ retVal = new MapEntryDecl(annotations, createTokenInfo(mapentry_KW), createTokenInfo(name), createTokenInfo(colon), key, createTokenInfo(minus_gt), value, createTokenInfo(semi));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_12);
+ }
+ return retVal;
+ }
+
+ public final AbstractModifier abstractModifier() throws RecognitionException, TokenStreamException {
+ AbstractModifier retVal = null ;
+
+ Token abstract_KW = null;
+
+ try { // for error handling
+ abstract_KW = LT(1);
+ match(LITERAL_abstract);
+ retVal = new AbstractModifier(createTokenInfo(abstract_KW));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_13);
+ }
+ return retVal;
+ }
+
+ public final ClassKind classKind() throws RecognitionException, TokenStreamException {
+ ClassKind retVal = null ;
+
+ Token tok = LT(1);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_class:
+ {
+ match(LITERAL_class);
+ break;
+ }
+ case LITERAL_interface:
+ {
+ match(LITERAL_interface);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new ClassKind(createTokenInfo(tok));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_7);
+ }
+ return retVal;
+ }
+
+ public final TypeParamsInfo typeParamsInfo() throws RecognitionException, TokenStreamException {
+ TypeParamsInfo retVal = null ;
+
+ Token lt = null;
+ Token gt = null;
+
+ try { // for error handling
+ OneOrMoreTypeParams oneOrMoreTypeParams = null;
+ lt = LT(1);
+ match(LT);
+ oneOrMoreTypeParams=oneOrMoreTypeParams();
+ gt = LT(1);
+ match(GT);
+ retVal = new TypeParamsInfo(createTokenInfo(lt), oneOrMoreTypeParams, createTokenInfo(gt));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_14);
+ }
+ return retVal;
+ }
+
+ public final CommaListBoundExceptWild commaListBoundExceptWild() throws RecognitionException, TokenStreamException {
+ CommaListBoundExceptWild retVal = new CommaListBoundExceptWild() ;
+
+ Token comma = null;
+
+ try { // for error handling
+ BoundExceptWildcard tb1 = null; BoundExceptWildcard tbn = null;
+ tb1=boundExceptWildcard();
+ retVal.addChild(tb1);
+ {
+ _loop38:
+ do {
+ if ((LA(1)==COMMA)) {
+ comma = LT(1);
+ match(COMMA);
+ tbn=boundExceptWildcard();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(tbn);
+ }
+ else {
+ break _loop38;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_15);
+ }
+ return retVal;
+ }
+
+ public final BoundExceptWildcard boundExceptWildcard() throws RecognitionException, TokenStreamException {
+ BoundExceptWildcard retVal = null ;
+
+ Token lt = null;
+ Token gt = null;
+
+ try { // for error handling
+ QualifiedID rawTNameOrTVarOrParamzedTName = null; OneOrMoreTypeArgs oneOrMoreTypeArgs = null;
+ rawTNameOrTVarOrParamzedTName=qualifiedID();
+ {
+ switch ( LA(1)) {
+ case LT:
+ {
+ lt = LT(1);
+ match(LT);
+ oneOrMoreTypeArgs=oneOrMoreTypeArgs();
+ gt = LT(1);
+ match(GT);
+ break;
+ }
+ case SEMI:
+ case ID:
+ case COMMA:
+ case LCURLY:
+ case COLON:
+ case GT:
+ case AMP:
+ case LSQUARE:
+ case HASH:
+ case MINUS_GT:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new BoundExceptWildcard(rawTNameOrTVarOrParamzedTName, createTokenInfo(lt), oneOrMoreTypeArgs, createTokenInfo(gt));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ }
+ return retVal;
+ }
+
+ public final ClassMemberDecls classMemberDecls() throws RecognitionException, TokenStreamException {
+ ClassMemberDecls retVal = new ClassMemberDecls() ;
+
+
+ try { // for error handling
+ ClassMemberDecl classMemberDecl = null;
+ {
+ _loop65:
+ do {
+ if ((_tokenSet_17.member(LA(1)))) {
+ classMemberDecl=classMemberDecl();
+ retVal.addChild(classMemberDecl);
+ }
+ else {
+ break _loop65;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_18);
+ }
+ return retVal;
+ }
+
+ public final OneOrMoreTypeParams oneOrMoreTypeParams() throws RecognitionException, TokenStreamException {
+ OneOrMoreTypeParams retVal = new OneOrMoreTypeParams() ;
+
+ Token comma = null;
+
+ try { // for error handling
+ TypeParam tp1 = null; TypeParam tpn = null;
+ tp1=typeParam();
+ retVal.addChild(tp1);
+ {
+ _loop45:
+ do {
+ if ((LA(1)==COMMA)) {
+ comma = LT(1);
+ match(COMMA);
+ tpn=typeParam();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(tpn);
+ }
+ else {
+ break _loop45;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_19);
+ }
+ return retVal;
+ }
+
+ public final TypeParam typeParam() throws RecognitionException, TokenStreamException {
+ TypeParam retVal = null ;
+
+ Token typeVarName = null;
+
+ try { // for error handling
+ TypeBoundsInfo typeBoundsInfo = null;
+ typeVarName = LT(1);
+ match(ID);
+ {
+ switch ( LA(1)) {
+ case LITERAL_extends:
+ {
+ typeBoundsInfo=typeBoundsInfo();
+ break;
+ }
+ case COMMA:
+ case GT:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new TypeParam(createTokenInfo(typeVarName), typeBoundsInfo);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_20);
+ }
+ return retVal;
+ }
+
+ public final TypeBoundsInfo typeBoundsInfo() throws RecognitionException, TokenStreamException {
+ TypeBoundsInfo retVal = null ;
+
+ Token extends_KW = null;
+
+ try { // for error handling
+ OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds = null;
+ extends_KW = LT(1);
+ match(LITERAL_extends);
+ oneOrMoreTypeParamBounds=oneOrMoreTypeParamBounds();
+ retVal = new TypeBoundsInfo(createTokenInfo(extends_KW), oneOrMoreTypeParamBounds);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_20);
+ }
+ return retVal;
+ }
+
+ public final OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds() throws RecognitionException, TokenStreamException {
+ OneOrMoreTypeParamBounds retVal = new OneOrMoreTypeParamBounds() ;
+
+ Token amp = null;
+
+ try { // for error handling
+ BoundExceptWildcard tb1 = null; BoundExceptWildcard tbn = null;
+ tb1=boundExceptWildcard();
+ retVal.addChild(tb1);
+ {
+ _loop51:
+ do {
+ if ((LA(1)==AMP)) {
+ amp = LT(1);
+ match(AMP);
+ tbn=boundExceptWildcard();
+ retVal.addChild(createTokenInfo(amp)); retVal.addChild(tbn);
+ }
+ else {
+ break _loop51;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_20);
+ }
+ return retVal;
+ }
+
+ public final OneOrMoreTypeArgs oneOrMoreTypeArgs() throws RecognitionException, TokenStreamException {
+ OneOrMoreTypeArgs retVal = new OneOrMoreTypeArgs() ;
+
+ Token comma = null;
+
+ try { // for error handling
+ TypeArg ta1 = null; TypeArg tan = null;
+ ta1=typeArg();
+ retVal.addChild(ta1);
+ {
+ _loop56:
+ do {
+ if ((LA(1)==COMMA)) {
+ comma = LT(1);
+ match(COMMA);
+ tan=typeArg();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(tan);
+ }
+ else {
+ break _loop56;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_19);
+ }
+ return retVal;
+ }
+
+ public final TypeArg typeArg() throws RecognitionException, TokenStreamException {
+ TypeArg retVal = null ;
+
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case ID:
+ {
+ retVal=boundExceptWildcard();
+ break;
+ }
+ case QMARK:
+ {
+ retVal=wildcard();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_20);
+ }
+ return retVal;
+ }
+
+ public final Wildcard wildcard() throws RecognitionException, TokenStreamException {
+ Wildcard retVal = null ;
+
+ Token qmark = null;
+
+ try { // for error handling
+ ExtendsOrSuper extendsOrSuper = null; BoundExceptWildcard boundExceptWildcard = null;
+ qmark = LT(1);
+ match(QMARK);
+ {
+ switch ( LA(1)) {
+ case LITERAL_extends:
+ case LITERAL_super:
+ {
+ extendsOrSuper=extendsOrSuper();
+ boundExceptWildcard=boundExceptWildcard();
+ break;
+ }
+ case COMMA:
+ case GT:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new Wildcard(createTokenInfo(qmark), extendsOrSuper, boundExceptWildcard);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_20);
+ }
+ return retVal;
+ }
+
+ public final ExtendsOrSuper extendsOrSuper() throws RecognitionException, TokenStreamException {
+ ExtendsOrSuper retVal = null ;
+
+ Token tok = LT(1);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_extends:
+ {
+ match(LITERAL_extends);
+ break;
+ }
+ case LITERAL_super:
+ {
+ match(LITERAL_super);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new ExtendsOrSuper(createTokenInfo(tok));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_7);
+ }
+ return retVal;
+ }
+
+ public final ClassMemberDecl classMemberDecl() throws RecognitionException, TokenStreamException {
+ ClassMemberDecl retVal = null ;
+
+
+ try { // for error handling
+ Annotations annotations = null; Modifiers modifiers = null;
+ annotations=annotations();
+ modifiers=modifiers();
+ {
+ switch ( LA(1)) {
+ case LITERAL_attr:
+ {
+ retVal=attribute(annotations, modifiers);
+ break;
+ }
+ case LITERAL_ref:
+ case LITERAL_val:
+ {
+ retVal=reference(annotations, modifiers);
+ break;
+ }
+ case LITERAL_op:
+ {
+ retVal=operation(annotations, modifiers);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_21);
+ }
+ return retVal;
+ }
+
+ public final Modifiers modifiers() throws RecognitionException, TokenStreamException {
+ Modifiers retVal = new Modifiers() ;
+
+
+ try { // for error handling
+ OptNegatedModifier optNegatedModifier = null;
+ {
+ _loop84:
+ do {
+ if (((LA(1) >= BANG && LA(1) <= LITERAL_id))) {
+ optNegatedModifier=optNegatedModifier();
+ retVal.addChild(optNegatedModifier);
+ }
+ else {
+ break _loop84;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_22);
+ }
+ return retVal;
+ }
+
+ public final Attribute attribute(
+ Annotations annotations, Modifiers modifiers
+ ) throws RecognitionException, TokenStreamException {
+ Attribute retVal = null ;
+
+ Token attr_KW = null;
+ Token name = null;
+ Token equals = null;
+ Token semi = null;
+
+ try { // for error handling
+ TypeWithMulti typeWithMulti = null; DefaultValueExpr defaultValueExpr = null;
+ attr_KW = LT(1);
+ match(LITERAL_attr);
+ typeWithMulti=typeWithMulti();
+ name = LT(1);
+ match(ID);
+ {
+ switch ( LA(1)) {
+ case EQUALS:
+ {
+ equals = LT(1);
+ match(EQUALS);
+ defaultValueExpr=defaultValueExpr();
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ semi = LT(1);
+ match(SEMI);
+ retVal = new Attribute(annotations, modifiers, createTokenInfo(attr_KW), typeWithMulti, createTokenInfo(name), createTokenInfo(equals), defaultValueExpr, createTokenInfo(semi));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_21);
+ }
+ return retVal;
+ }
+
+ public final Reference reference(
+ Annotations annotations, Modifiers modifiers
+ ) throws RecognitionException, TokenStreamException {
+ Reference retVal = null ;
+
+ Token hash = null;
+ Token oppositeName = null;
+ Token name = null;
+ Token semi = null;
+
+ try { // for error handling
+ ReferenceKind referenceKind = null; TypeWithMulti typeWithMulti = null;
+ referenceKind=referenceKind();
+ typeWithMulti=typeWithMulti();
+ {
+ switch ( LA(1)) {
+ case HASH:
+ {
+ hash = LT(1);
+ match(HASH);
+ oppositeName = LT(1);
+ match(ID);
+ break;
+ }
+ case ID:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ name = LT(1);
+ match(ID);
+ semi = LT(1);
+ match(SEMI);
+ retVal = new Reference(annotations, modifiers, referenceKind, typeWithMulti, createTokenInfo(hash), createTokenInfo(oppositeName), createTokenInfo(name), createTokenInfo(semi));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_21);
+ }
+ return retVal;
+ }
+
+ public final Operation operation(
+ Annotations annotations, Modifiers modifiers
+ ) throws RecognitionException, TokenStreamException {
+ Operation retVal = null ;
+
+ Token op_KW = null;
+ Token name = null;
+ Token lparen = null;
+ Token rparen = null;
+ Token throws_KW = null;
+ Token semi = null;
+
+ try { // for error handling
+ TypeParamsInfo typeParamsInfo = null; ResultType resType = null; Params params = null; CommaListBoundExceptWild exceptions = null;
+ op_KW = LT(1);
+ match(LITERAL_op);
+ {
+ switch ( LA(1)) {
+ case LT:
+ {
+ typeParamsInfo=typeParamsInfo();
+ break;
+ }
+ case ID:
+ case LITERAL_void:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ resType=resultType();
+ name = LT(1);
+ match(ID);
+ lparen = LT(1);
+ match(LPAREN);
+ {
+ switch ( LA(1)) {
+ case ID:
+ case AT:
+ case BANG:
+ case LITERAL_readonly:
+ case LITERAL_volatile:
+ case LITERAL_transient:
+ case LITERAL_unsettable:
+ case LITERAL_derived:
+ case LITERAL_unique:
+ case LITERAL_ordered:
+ case LITERAL_resolve:
+ case LITERAL_id:
+ {
+ params=params();
+ break;
+ }
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ rparen = LT(1);
+ match(RPAREN);
+ {
+ switch ( LA(1)) {
+ case LITERAL_throws:
+ {
+ throws_KW = LT(1);
+ match(LITERAL_throws);
+ exceptions=commaListBoundExceptWild();
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ semi = LT(1);
+ match(SEMI);
+ retVal = new Operation(annotations, modifiers, createTokenInfo(op_KW), typeParamsInfo, resType, createTokenInfo(name), createTokenInfo(lparen), params, createTokenInfo(rparen), createTokenInfo(throws_KW), exceptions, createTokenInfo(semi));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_21);
+ }
+ return retVal;
+ }
+
+ public final TypeWithMulti typeWithMulti() throws RecognitionException, TokenStreamException {
+ TypeWithMulti retVal = null ;
+
+
+ try { // for error handling
+ BoundExceptWildcard name = null; Multiplicity multiplicity = null;
+ name=boundExceptWildcard();
+ {
+ switch ( LA(1)) {
+ case LSQUARE:
+ {
+ multiplicity=multiplicity();
+ break;
+ }
+ case SEMI:
+ case ID:
+ case HASH:
+ case MINUS_GT:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new TypeWithMulti(name, multiplicity);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ }
+ return retVal;
+ }
+
+ public final DefaultValueExpr defaultValueExpr() throws RecognitionException, TokenStreamException {
+ DefaultValueExpr retVal = null ;
+
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_true:
+ case LITERAL_false:
+ {
+ retVal=boolExpr();
+ break;
+ }
+ case INT_LITERAL:
+ case MINUS:
+ {
+ retVal=intExpr();
+ break;
+ }
+ case STRING_LITERAL:
+ {
+ retVal=stringExpr();
+ break;
+ }
+ case CHAR_LITERAL:
+ {
+ retVal=charExpr();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_24);
+ }
+ return retVal;
+ }
+
+ public final Multiplicity multiplicity() throws RecognitionException, TokenStreamException {
+ Multiplicity retVal = null ;
+
+ Token lsquare = null;
+ Token rsquare = null;
+
+ try { // for error handling
+ MultiplicityExpr multiplicityExpr = null;
+ lsquare = LT(1);
+ match(LSQUARE);
+ {
+ switch ( LA(1)) {
+ case QMARK:
+ case STAR:
+ case PLUS:
+ case INT_LITERAL:
+ {
+ multiplicityExpr=multiplicityExpr();
+ break;
+ }
+ case RSQUARE:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ rsquare = LT(1);
+ match(RSQUARE);
+ retVal = new Multiplicity(createTokenInfo(lsquare), multiplicityExpr, createTokenInfo(rsquare));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ }
+ return retVal;
+ }
+
+ public final MultiplicityExpr multiplicityExpr() throws RecognitionException, TokenStreamException {
+ MultiplicityExpr retVal = null ;
+
+ Token dot_dot = null;
+
+ try { // for error handling
+ SimpleMultiplicityExpr lowerBound = null; SimpleMultiplicityExpr upperBound = null;
+ lowerBound=simpleMultiplicityExpr();
+ {
+ switch ( LA(1)) {
+ case DOT_DOT:
+ {
+ dot_dot = LT(1);
+ match(DOT_DOT);
+ upperBound=simpleMultiplicityExpr();
+ break;
+ }
+ case RSQUARE:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new MultiplicityExpr(lowerBound, createTokenInfo(dot_dot), upperBound);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_25);
+ }
+ return retVal;
+ }
+
+ public final SimpleMultiplicityExpr simpleMultiplicityExpr() throws RecognitionException, TokenStreamException {
+ SimpleMultiplicityExpr retVal = null ;
+
+ Token tok = LT(1);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case STAR:
+ {
+ match(STAR);
+ break;
+ }
+ case PLUS:
+ {
+ match(PLUS);
+ break;
+ }
+ case QMARK:
+ {
+ match(QMARK);
+ break;
+ }
+ case INT_LITERAL:
+ {
+ match(INT_LITERAL);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new SimpleMultiplicityExpr(createTokenInfo(tok));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_26);
+ }
+ return retVal;
+ }
+
+ public final ReferenceKind referenceKind() throws RecognitionException, TokenStreamException {
+ ReferenceKind retVal = null ;
+
+ Token tok = LT(1);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_ref:
+ {
+ match(LITERAL_ref);
+ break;
+ }
+ case LITERAL_val:
+ {
+ match(LITERAL_val);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new ReferenceKind(createTokenInfo(tok));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_7);
+ }
+ return retVal;
+ }
+
+ public final OptNegatedModifier optNegatedModifier() throws RecognitionException, TokenStreamException {
+ OptNegatedModifier retVal = null ;
+
+ Token bang = null;
+
+ try { // for error handling
+ Modifier modifier = null;
+ {
+ switch ( LA(1)) {
+ case BANG:
+ {
+ bang = LT(1);
+ match(BANG);
+ break;
+ }
+ case LITERAL_readonly:
+ case LITERAL_volatile:
+ case LITERAL_transient:
+ case LITERAL_unsettable:
+ case LITERAL_derived:
+ case LITERAL_unique:
+ case LITERAL_ordered:
+ case LITERAL_resolve:
+ case LITERAL_id:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ modifier=modifier();
+ retVal = new OptNegatedModifier(createTokenInfo(bang), modifier);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_27);
+ }
+ return retVal;
+ }
+
+ public final Modifier modifier() throws RecognitionException, TokenStreamException {
+ Modifier retVal = null ;
+
+ Token tok = LT(1);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_readonly:
+ {
+ match(LITERAL_readonly);
+ break;
+ }
+ case LITERAL_volatile:
+ {
+ match(LITERAL_volatile);
+ break;
+ }
+ case LITERAL_transient:
+ {
+ match(LITERAL_transient);
+ break;
+ }
+ case LITERAL_unsettable:
+ {
+ match(LITERAL_unsettable);
+ break;
+ }
+ case LITERAL_derived:
+ {
+ match(LITERAL_derived);
+ break;
+ }
+ case LITERAL_unique:
+ {
+ match(LITERAL_unique);
+ break;
+ }
+ case LITERAL_ordered:
+ {
+ match(LITERAL_ordered);
+ break;
+ }
+ case LITERAL_resolve:
+ {
+ match(LITERAL_resolve);
+ break;
+ }
+ case LITERAL_id:
+ {
+ match(LITERAL_id);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new Modifier(createTokenInfo(tok));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_27);
+ }
+ return retVal;
+ }
+
+ public final BoolExpr boolExpr() throws RecognitionException, TokenStreamException {
+ BoolExpr retVal = null ;
+
+
+ try { // for error handling
+ TrueOrFalse trueOrFalse = null;
+ trueOrFalse=trueOrFalse();
+ retVal = new BoolExpr(trueOrFalse);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_24);
+ }
+ return retVal;
+ }
+
+ public final IntExpr intExpr() throws RecognitionException, TokenStreamException {
+ IntExpr retVal = null ;
+
+ Token minus = null;
+ Token int_literal = null;
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case MINUS:
+ {
+ minus = LT(1);
+ match(MINUS);
+ break;
+ }
+ case INT_LITERAL:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ int_literal = LT(1);
+ match(INT_LITERAL);
+ retVal = new IntExpr(createTokenInfo(minus), createTokenInfo(int_literal));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_24);
+ }
+ return retVal;
+ }
+
+ public final StringExpr stringExpr() throws RecognitionException, TokenStreamException {
+ StringExpr retVal = null ;
+
+ Token string_literal = null;
+
+ try { // for error handling
+ string_literal = LT(1);
+ match(STRING_LITERAL);
+ retVal = new StringExpr(createTokenInfo(string_literal));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_24);
+ }
+ return retVal;
+ }
+
+ public final CharExpr charExpr() throws RecognitionException, TokenStreamException {
+ CharExpr retVal = null ;
+
+ Token char_literal = null;
+
+ try { // for error handling
+ char_literal = LT(1);
+ match(CHAR_LITERAL);
+ retVal = new CharExpr(createTokenInfo(char_literal));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_24);
+ }
+ return retVal;
+ }
+
+ public final TrueOrFalse trueOrFalse() throws RecognitionException, TokenStreamException {
+ TrueOrFalse retVal = null ;
+
+ Token tok = LT(1);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_true:
+ {
+ match(LITERAL_true);
+ break;
+ }
+ case LITERAL_false:
+ {
+ match(LITERAL_false);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ retVal = new TrueOrFalse(createTokenInfo(tok));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_24);
+ }
+ return retVal;
+ }
+
+ public final ResultType resultType() throws RecognitionException, TokenStreamException {
+ ResultType retVal = null ;
+
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case ID:
+ {
+ retVal=typeWithMulti();
+ break;
+ }
+ case LITERAL_void:
+ {
+ retVal=voidContainer();
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_7);
+ }
+ return retVal;
+ }
+
+ public final Params params() throws RecognitionException, TokenStreamException {
+ Params retVal = new Params() ;
+
+ Token comma = null;
+
+ try { // for error handling
+ Param p1 = null; Param pn = null;
+ p1=param();
+ retVal.addChild(p1);
+ {
+ _loop107:
+ do {
+ if ((LA(1)==COMMA)) {
+ comma = LT(1);
+ match(COMMA);
+ pn=param();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(pn);
+ }
+ else {
+ break _loop107;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_10);
+ }
+ return retVal;
+ }
+
+ public final VoidContainer voidContainer() throws RecognitionException, TokenStreamException {
+ VoidContainer retVal = null ;
+
+ Token void_KW = null;
+
+ try { // for error handling
+ void_KW = LT(1);
+ match(LITERAL_void);
+ retVal = new VoidContainer(createTokenInfo(void_KW));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_7);
+ }
+ return retVal;
+ }
+
+ public final Param param() throws RecognitionException, TokenStreamException {
+ Param retVal = null ;
+
+ Token name = null;
+
+ try { // for error handling
+ Annotations leadingAnnotations = null; Modifiers modifiers = null; TypeWithMulti typeWithMulti = null; Annotations trailingAnnotations = null;
+ leadingAnnotations=annotations();
+ modifiers=modifiers();
+ typeWithMulti=typeWithMulti();
+ name = LT(1);
+ match(ID);
+ trailingAnnotations=annotations();
+ retVal = new Param(leadingAnnotations, modifiers, typeWithMulti, createTokenInfo(name), trailingAnnotations);
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_11);
+ }
+ return retVal;
+ }
+
+ public final TransientModifier transientModifier() throws RecognitionException, TokenStreamException {
+ TransientModifier retVal = null ;
+
+ Token transient_KW = null;
+
+ try { // for error handling
+ transient_KW = LT(1);
+ match(LITERAL_transient);
+ retVal = new TransientModifier(createTokenInfo(transient_KW));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_28);
+ }
+ return retVal;
+ }
+
+ public final EnumLiterals enumLiterals() throws RecognitionException, TokenStreamException {
+ EnumLiterals retVal = new EnumLiterals() ;
+
+
+ try { // for error handling
+ EnumLiteral enumLiteral = null;
+ {
+ _loop115:
+ do {
+ if ((LA(1)==ID||LA(1)==AT)) {
+ enumLiteral=enumLiteral();
+ retVal.addChild(enumLiteral);
+ }
+ else {
+ break _loop115;
+ }
+
+ } while (true);
+ }
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_18);
+ }
+ return retVal;
+ }
+
+ public final EnumLiteral enumLiteral() throws RecognitionException, TokenStreamException {
+ EnumLiteral retVal = null ;
+
+ Token name = null;
+ Token equals = null;
+ Token val = null;
+ Token semi = null;
+
+ try { // for error handling
+ Annotations leadingAnnotations = null; Annotations trailingAnnotations = null;
+ leadingAnnotations=annotations();
+ name = LT(1);
+ match(ID);
+ {
+ switch ( LA(1)) {
+ case EQUALS:
+ {
+ equals = LT(1);
+ match(EQUALS);
+ val = LT(1);
+ match(INT_LITERAL);
+ break;
+ }
+ case SEMI:
+ case AT:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ trailingAnnotations=annotations();
+ semi = LT(1);
+ match(SEMI);
+ retVal = new EnumLiteral(leadingAnnotations, createTokenInfo(name), createTokenInfo(equals), createTokenInfo(val), trailingAnnotations, createTokenInfo(semi));
+ }
+ catch (RecognitionException ex) {
+ reportError(ex);
+ recover(ex,_tokenSet_29);
+ }
+ return retVal;
+ }
+
+
+ public static final String[] _tokenNames = {
+ "<0>",
+ "EOF",
+ "<2>",
+ "NULL_TREE_LOOKAHEAD",
+ "\"package\"",
+ "SEMI",
+ "ID",
+ "DOT",
+ "DOLLAR",
+ "STRING_LITERAL",
+ "AT",
+ "LPAREN",
+ "RPAREN",
+ "COMMA",
+ "EQUALS",
+ "\"import\"",
+ "LCURLY",
+ "RCURLY",
+ "\"extends\"",
+ "COLON",
+ "\"abstract\"",
+ "\"class\"",
+ "\"interface\"",
+ "LT",
+ "GT",
+ "AMP",
+ "QMARK",
+ "\"super\"",
+ "\"attr\"",
+ "LSQUARE",
+ "RSQUARE",
+ "DOT_DOT",
+ "STAR",
+ "PLUS",
+ "INT_LITERAL",
+ "HASH",
+ "\"ref\"",
+ "\"val\"",
+ "BANG",
+ "\"readonly\"",
+ "\"volatile\"",
+ "\"transient\"",
+ "\"unsettable\"",
+ "\"derived\"",
+ "\"unique\"",
+ "\"ordered\"",
+ "\"resolve\"",
+ "\"id\"",
+ "\"true\"",
+ "\"false\"",
+ "MINUS",
+ "CHAR_LITERAL",
+ "\"op\"",
+ "\"throws\"",
+ "\"void\"",
+ "\"datatype\"",
+ "\"enum\"",
+ "\"mapentry\"",
+ "MINUS_GT",
+ "GT_LT",
+ "LT_GT",
+ "ESC",
+ "DIGIT",
+ "WS",
+ "SINGLE_LINE_COMMENT",
+ "MULTI_LINE_COMMENT"
+ };
+
+ private static final long[] mk_tokenSet_0() {
+ long[] data = { 2L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
+ private static final long[] mk_tokenSet_1() {
+ long[] data = { 252203778163377170L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
+ private static final long[] mk_tokenSet_2() {
+ long[] data = { 252203778163344402L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
+ private static final long[] mk_tokenSet_3() {
+ long[] data = { 252203778163344400L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
+ private static final long[] mk_tokenSet_4() {
+ long[] data = { 131074L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
+ private static final long[] mk_tokenSet_5() {
+ long[] data = { 256986585293140080L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
+ private static final long[] mk_tokenSet_6() {
+ long[] data = { 288230411107661920L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
+ private static final long[] mk_tokenSet_7() {
+ long[] data = { 64L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7());
+ private static final long[] mk_tokenSet_8() {
+ long[] data = { 30752L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8());
+ private static final long[] mk_tokenSet_9() {
+ long[] data = { 256986585293141104L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9());
+ private static final long[] mk_tokenSet_10() {
+ long[] data = { 4096L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10());
+ private static final long[] mk_tokenSet_11() {
+ long[] data = { 12288L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11());
+ private static final long[] mk_tokenSet_12() {
+ long[] data = { 252203778163475474L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12());
+ private static final long[] mk_tokenSet_13() {
+ long[] data = { 6291456L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13());
+ private static final long[] mk_tokenSet_14() {
+ long[] data = { 18014398510334016L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14());
+ private static final long[] mk_tokenSet_15() {
+ long[] data = { 589856L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15());
+ private static final long[] mk_tokenSet_16() {
+ long[] data = { 288230411099250784L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16());
+ private static final long[] mk_tokenSet_17() {
+ long[] data = { 4785006153040896L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_17 = new BitSet(mk_tokenSet_17());
+ private static final long[] mk_tokenSet_18() {
+ long[] data = { 131072L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_18 = new BitSet(mk_tokenSet_18());
+ private static final long[] mk_tokenSet_19() {
+ long[] data = { 16777216L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_19 = new BitSet(mk_tokenSet_19());
+ private static final long[] mk_tokenSet_20() {
+ long[] data = { 16785408L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_20 = new BitSet(mk_tokenSet_20());
+ private static final long[] mk_tokenSet_21() {
+ long[] data = { 4785006153171968L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_21 = new BitSet(mk_tokenSet_21());
+ private static final long[] mk_tokenSet_22() {
+ long[] data = { 4503806054236224L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_22 = new BitSet(mk_tokenSet_22());
+ private static final long[] mk_tokenSet_23() {
+ long[] data = { 288230410511450208L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_23 = new BitSet(mk_tokenSet_23());
+ private static final long[] mk_tokenSet_24() {
+ long[] data = { 32L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_24 = new BitSet(mk_tokenSet_24());
+ private static final long[] mk_tokenSet_25() {
+ long[] data = { 1073741824L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_25 = new BitSet(mk_tokenSet_25());
+ private static final long[] mk_tokenSet_26() {
+ long[] data = { 3221225472L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_26 = new BitSet(mk_tokenSet_26());
+ private static final long[] mk_tokenSet_27() {
+ long[] data = { 4785006153039936L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_27 = new BitSet(mk_tokenSet_27());
+ private static final long[] mk_tokenSet_28() {
+ long[] data = { 36028797018963968L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_28 = new BitSet(mk_tokenSet_28());
+ private static final long[] mk_tokenSet_29() {
+ long[] data = { 132160L, 0L};
+ return data;
+ }
+ public static final BitSet _tokenSet_29 = new BitSet(mk_tokenSet_29());
+
+ }
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParser.smap b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParser.smap
new file mode 100644
index 0000000..f4ede77
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParser.smap
@@ -0,0 +1,1571 @@
+SMAP
+EmfaticParser.java
+G
+*S G
+*F
++ 0 Emfatic.g
+Emfatic.g
+*L
+3:3
+3:4
+3:5
+3:6
+17:25
+18:26
+19:27
+21:29
+22:30
+23:31
+24:32
+27:35
+28:36
+29:37
+30:38
+32:40
+33:41
+34:42
+35:43
+36:44
+38:46
+39:47
+40:48
+41:49
+42:50
+44:52
+45:53
+46:54
+47:55
+48:56
+52:82
+52:83
+52:86
+52:93
+52:94
+52:95
+52:96
+52:97
+52:98
+52:99
+54:87
+55:88
+55:89
+55:90
+55:91
+56:92
+59:101
+59:102
+59:107
+59:116
+59:117
+59:118
+59:119
+59:120
+59:121
+59:122
+61:108
+62:104
+62:105
+62:109
+62:110
+62:111
+62:112
+62:113
+62:114
+63:115
+66:205
+66:206
+66:211
+66:231
+66:232
+66:233
+66:234
+66:235
+66:236
+66:237
+68:212
+69:208
+69:213
+69:214
+69:215
+70:209
+70:216
+70:217
+70:218
+70:219
+70:220
+70:221
+70:222
+70:223
+70:224
+70:225
+70:226
+70:227
+70:229
+70:230
+73:239
+73:240
+73:242
+73:244
+73:264
+73:265
+73:266
+73:267
+73:268
+73:269
+73:270
+75:246
+75:247
+75:248
+75:249
+75:257
+75:258
+75:259
+75:260
+75:261
+76:252
+76:253
+76:254
+78:263
+81:272
+81:273
+81:276
+81:295
+81:296
+81:297
+81:298
+81:299
+81:300
+81:301
+83:278
+83:279
+83:280
+83:281
+83:289
+83:290
+83:291
+83:292
+83:293
+84:284
+84:285
+84:286
+88:303
+88:304
+88:308
+88:312
+88:313
+88:314
+88:315
+88:316
+88:317
+88:318
+90:306
+90:309
+90:310
+91:311
+94:320
+94:321
+94:324
+94:328
+94:329
+94:330
+94:331
+94:332
+94:333
+94:334
+96:325
+97:326
+98:327
+101:178
+101:179
+101:182
+101:197
+101:198
+101:199
+101:200
+101:201
+101:202
+101:203
+103:183
+104:184
+104:185
+104:186
+104:187
+104:188
+104:189
+104:190
+104:191
+104:192
+104:193
+104:195
+104:196
+107:336
+107:337
+107:343
+107:354
+107:355
+107:356
+107:357
+107:358
+107:359
+107:360
+109:344
+110:339
+110:340
+110:341
+110:345
+110:346
+110:347
+110:348
+110:349
+110:350
+110:351
+110:352
+111:353
+114:362
+114:363
+114:367
+114:386
+114:387
+114:388
+114:389
+114:390
+114:391
+114:392
+116:368
+117:369
+117:370
+118:365
+118:371
+118:372
+118:373
+118:374
+118:375
+118:376
+118:377
+118:378
+118:379
+118:380
+118:381
+118:382
+118:384
+118:385
+121:394
+121:395
+121:399
+121:406
+121:407
+121:408
+121:409
+121:410
+121:411
+121:412
+123:400
+124:397
+124:401
+124:402
+124:403
+124:404
+125:405
+128:124
+128:125
+128:128
+128:143
+128:144
+128:145
+128:146
+128:147
+128:148
+128:149
+130:129
+131:130
+131:131
+131:132
+131:133
+131:134
+131:135
+131:136
+131:137
+131:138
+131:139
+131:141
+131:142
+134:414
+134:415
+134:422
+134:444
+134:445
+134:446
+134:447
+134:448
+134:449
+134:450
+136:423
+137:417
+137:418
+137:419
+137:420
+137:424
+137:425
+137:427
+137:428
+137:429
+137:430
+137:431
+137:432
+137:434
+137:435
+137:436
+137:437
+137:440
+137:441
+137:442
+138:443
+141:151
+141:152
+141:155
+141:170
+141:171
+141:172
+141:173
+141:174
+141:175
+141:176
+143:156
+144:157
+144:158
+144:159
+144:160
+144:161
+144:162
+144:163
+144:164
+144:165
+144:166
+144:168
+144:169
+147:452
+147:453
+147:456
+147:495
+147:496
+147:497
+147:498
+147:499
+147:500
+147:501
+149:457
+150:458
+151:460
+151:461
+151:462
+151:463
+151:489
+151:490
+151:491
+151:492
+151:493
+152:466
+152:467
+152:468
+152:469
+152:470
+153:473
+153:474
+153:475
+153:476
+154:479
+154:480
+154:481
+155:484
+155:485
+155:486
+159:503
+159:504
+159:505
+159:506
+159:513
+159:525
+159:526
+159:527
+159:528
+159:529
+159:530
+159:531
+161:514
+162:508
+162:509
+162:510
+162:511
+162:515
+162:516
+162:517
+162:518
+162:519
+162:520
+162:521
+162:522
+162:523
+163:524
+166:533
+166:534
+166:535
+166:536
+166:544
+166:631
+166:632
+166:633
+166:634
+166:635
+166:636
+166:637
+168:545
+169:538
+169:539
+169:540
+169:541
+169:542
+169:547
+169:548
+169:549
+169:550
+169:558
+169:559
+169:560
+169:561
+169:562
+169:564
+169:565
+169:566
+169:568
+169:569
+169:570
+169:571
+169:580
+169:581
+169:582
+169:583
+169:584
+169:587
+169:588
+169:589
+169:590
+169:591
+169:592
+169:600
+169:601
+169:602
+169:603
+169:604
+169:607
+169:608
+169:609
+169:610
+169:611
+169:612
+169:619
+169:620
+169:621
+169:622
+169:623
+169:625
+169:626
+169:627
+169:628
+169:629
+170:630
+173:822
+173:823
+173:827
+173:846
+173:847
+173:848
+173:849
+173:850
+173:851
+173:852
+175:828
+176:829
+176:830
+177:825
+177:831
+177:832
+177:833
+177:834
+177:835
+177:836
+177:837
+177:838
+177:839
+177:840
+177:841
+177:842
+177:844
+177:845
+180:750
+180:751
+180:755
+180:759
+180:760
+180:761
+180:762
+180:763
+180:764
+180:765
+182:753
+182:756
+182:757
+183:758
+186:767
+186:768
+186:770
+186:772
+186:792
+186:793
+186:794
+186:795
+186:796
+186:797
+186:798
+188:774
+188:775
+188:776
+188:777
+188:785
+188:786
+188:787
+188:788
+188:789
+189:780
+189:781
+189:782
+191:791
+194:800
+194:801
+194:806
+194:814
+194:815
+194:816
+194:817
+194:818
+194:819
+194:820
+196:807
+197:803
+197:804
+197:808
+197:809
+197:810
+197:811
+197:812
+198:813
+201:929
+201:930
+201:934
+201:953
+201:954
+201:955
+201:956
+201:957
+201:958
+201:959
+203:935
+204:936
+204:937
+205:932
+205:938
+205:939
+205:940
+205:941
+205:942
+205:943
+205:944
+205:945
+205:946
+205:947
+205:948
+205:949
+205:951
+205:952
+208:961
+208:962
+208:966
+208:989
+208:990
+208:991
+208:992
+208:993
+208:994
+208:995
+210:967
+211:964
+211:968
+211:969
+211:971
+211:972
+211:973
+211:974
+211:982
+211:983
+211:984
+211:985
+211:986
+212:988
+215:997
+215:998
+215:1002
+215:1008
+215:1009
+215:1010
+215:1011
+215:1012
+215:1013
+215:1014
+217:1003
+218:1000
+218:1004
+218:1005
+218:1006
+219:1007
+222:1016
+222:1017
+222:1021
+222:1040
+222:1041
+222:1042
+222:1043
+222:1044
+222:1045
+222:1046
+224:1022
+225:1023
+225:1024
+226:1019
+226:1025
+226:1026
+226:1027
+226:1028
+226:1029
+226:1030
+226:1031
+226:1032
+226:1033
+226:1034
+226:1035
+226:1036
+226:1038
+226:1039
+229:854
+229:855
+229:860
+229:894
+229:895
+229:896
+229:897
+229:898
+229:899
+229:900
+231:861
+232:857
+232:858
+232:862
+232:864
+232:865
+232:866
+232:867
+232:868
+232:869
+232:870
+232:871
+232:887
+232:888
+232:889
+232:890
+232:891
+233:893
+236:1048
+236:1049
+236:1053
+236:1072
+236:1073
+236:1074
+236:1075
+236:1076
+236:1077
+236:1078
+238:1054
+239:1055
+239:1056
+240:1051
+240:1057
+240:1058
+240:1059
+240:1060
+240:1061
+240:1062
+240:1063
+240:1064
+240:1065
+240:1066
+240:1067
+240:1068
+240:1070
+240:1071
+243:1080
+243:1081
+243:1084
+243:1103
+243:1104
+243:1105
+243:1106
+243:1107
+243:1108
+243:1109
+245:1086
+245:1087
+245:1088
+245:1089
+245:1097
+245:1098
+245:1099
+245:1100
+245:1101
+246:1092
+246:1093
+246:1094
+250:1111
+250:1112
+250:1116
+250:1141
+250:1142
+250:1143
+250:1144
+250:1145
+250:1146
+250:1147
+252:1117
+253:1114
+253:1118
+253:1119
+253:1121
+253:1122
+253:1123
+253:1124
+253:1125
+253:1126
+253:1134
+253:1135
+253:1136
+253:1137
+253:1138
+254:1140
+257:1149
+257:1150
+257:1152
+257:1154
+257:1174
+257:1175
+257:1176
+257:1177
+257:1178
+257:1179
+257:1180
+259:1156
+259:1157
+259:1158
+259:1159
+259:1167
+259:1168
+259:1169
+259:1170
+259:1171
+260:1162
+260:1163
+260:1164
+262:1173
+265:902
+265:903
+265:906
+265:921
+265:922
+265:923
+265:924
+265:925
+265:926
+265:927
+267:907
+268:908
+268:909
+268:910
+268:911
+268:912
+268:913
+268:914
+268:915
+268:916
+268:917
+268:919
+268:920
+271:1182
+271:1183
+271:1186
+271:1214
+271:1215
+271:1216
+271:1217
+271:1218
+271:1219
+271:1220
+273:1187
+274:1188
+274:1189
+275:1191
+275:1192
+275:1193
+275:1194
+275:1208
+275:1209
+275:1210
+275:1211
+275:1212
+276:1197
+276:1198
+276:1199
+276:1200
+277:1203
+277:1204
+277:1205
+281:1249
+281:1250
+281:1251
+281:1252
+281:1259
+281:1288
+281:1289
+281:1290
+281:1291
+281:1292
+281:1293
+281:1294
+283:1260
+284:1254
+284:1255
+284:1256
+284:1257
+284:1261
+284:1262
+284:1263
+284:1264
+284:1265
+284:1267
+284:1268
+284:1269
+284:1270
+284:1271
+284:1272
+284:1279
+284:1280
+284:1281
+284:1282
+284:1283
+284:1285
+284:1286
+285:1287
+288:1442
+288:1443
+288:1446
+288:1470
+288:1471
+288:1472
+288:1473
+288:1474
+288:1475
+288:1476
+290:1447
+291:1448
+291:1450
+291:1451
+291:1452
+291:1453
+291:1463
+291:1464
+291:1465
+291:1466
+291:1467
+292:1469
+295:1521
+295:1522
+295:1527
+295:1554
+295:1555
+295:1556
+295:1557
+295:1558
+295:1559
+295:1560
+297:1528
+298:1524
+298:1525
+298:1529
+298:1530
+298:1532
+298:1533
+298:1534
+298:1535
+298:1536
+298:1537
+298:1538
+298:1545
+298:1546
+298:1547
+298:1548
+298:1549
+298:1551
+298:1552
+299:1553
+302:1562
+302:1563
+302:1567
+302:1590
+302:1591
+302:1592
+302:1593
+302:1594
+302:1595
+302:1596
+304:1568
+305:1565
+305:1569
+305:1571
+305:1572
+305:1573
+305:1574
+305:1575
+305:1576
+305:1583
+305:1584
+305:1585
+305:1586
+305:1587
+306:1589
+309:1598
+309:1599
+309:1601
+309:1603
+309:1633
+309:1634
+309:1635
+309:1636
+309:1637
+309:1638
+309:1639
+311:1605
+311:1606
+311:1607
+311:1608
+311:1626
+311:1627
+311:1628
+311:1629
+311:1630
+312:1611
+312:1612
+312:1613
+313:1616
+313:1617
+313:1618
+314:1621
+314:1622
+314:1623
+316:1632
+319:1296
+319:1297
+319:1298
+319:1299
+319:1306
+319:1335
+319:1336
+319:1337
+319:1338
+319:1339
+319:1340
+319:1341
+321:1307
+322:1301
+322:1302
+322:1303
+322:1304
+322:1308
+322:1309
+322:1311
+322:1312
+322:1313
+322:1314
+322:1315
+322:1316
+322:1317
+322:1324
+322:1325
+322:1326
+322:1327
+322:1328
+322:1330
+322:1331
+322:1332
+322:1333
+323:1334
+326:1641
+326:1642
+326:1644
+326:1646
+326:1666
+326:1667
+326:1668
+326:1669
+326:1670
+326:1671
+326:1672
+328:1648
+328:1649
+328:1650
+328:1651
+328:1659
+328:1660
+328:1661
+328:1662
+328:1663
+329:1654
+329:1655
+329:1656
+331:1665
+334:1222
+334:1223
+334:1226
+334:1241
+334:1242
+334:1243
+334:1244
+334:1245
+334:1246
+334:1247
+336:1227
+337:1228
+337:1229
+337:1230
+337:1231
+337:1232
+337:1233
+337:1234
+337:1235
+337:1236
+337:1237
+337:1239
+337:1240
+340:1674
+340:1675
+340:1679
+340:1709
+340:1710
+340:1711
+340:1712
+340:1713
+340:1714
+340:1715
+342:1680
+343:1677
+343:1682
+343:1683
+343:1684
+343:1685
+343:1686
+343:1701
+343:1702
+343:1703
+343:1704
+343:1705
+343:1707
+344:1708
+347:1717
+347:1718
+347:1720
+347:1722
+347:1777
+347:1778
+347:1779
+347:1780
+347:1781
+347:1782
+347:1783
+349:1724
+349:1725
+349:1726
+349:1727
+349:1770
+349:1771
+349:1772
+349:1773
+349:1774
+350:1730
+350:1731
+350:1732
+351:1735
+351:1736
+351:1737
+352:1740
+352:1741
+352:1742
+353:1745
+353:1746
+353:1747
+354:1750
+354:1751
+354:1752
+355:1755
+355:1756
+355:1757
+356:1760
+356:1761
+356:1762
+357:1765
+357:1766
+357:1767
+359:1776
+362:1478
+362:1479
+362:1482
+362:1513
+362:1514
+362:1515
+362:1516
+362:1517
+362:1518
+362:1519
+364:1484
+364:1485
+364:1486
+364:1487
+364:1488
+364:1507
+364:1508
+364:1509
+364:1510
+364:1511
+365:1491
+365:1492
+365:1493
+365:1494
+366:1497
+366:1498
+366:1499
+367:1502
+367:1503
+367:1504
+371:1785
+371:1786
+371:1789
+371:1793
+371:1794
+371:1795
+371:1796
+371:1797
+371:1798
+371:1799
+373:1790
+374:1791
+375:1792
+378:1871
+378:1872
+378:1874
+378:1876
+378:1896
+378:1897
+378:1898
+378:1899
+378:1900
+378:1901
+378:1902
+380:1878
+380:1879
+380:1880
+380:1881
+380:1889
+380:1890
+380:1891
+380:1892
+380:1893
+381:1884
+381:1885
+381:1886
+383:1895
+386:1801
+386:1802
+386:1807
+386:1829
+386:1830
+386:1831
+386:1832
+386:1833
+386:1834
+386:1835
+388:1804
+388:1805
+388:1809
+388:1810
+388:1811
+388:1812
+388:1813
+388:1820
+388:1821
+388:1822
+388:1823
+388:1824
+388:1826
+388:1827
+389:1828
+392:1837
+392:1838
+392:1842
+392:1846
+392:1847
+392:1848
+392:1849
+392:1850
+392:1851
+392:1852
+394:1840
+394:1843
+394:1844
+395:1845
+398:1854
+398:1855
+398:1859
+398:1863
+398:1864
+398:1865
+398:1866
+398:1867
+398:1868
+398:1869
+400:1857
+400:1860
+400:1861
+401:1862
+404:1343
+404:1344
+404:1345
+404:1346
+404:1355
+404:1434
+404:1435
+404:1436
+404:1437
+404:1438
+404:1439
+404:1440
+406:1356
+407:1348
+407:1349
+407:1350
+407:1351
+407:1352
+407:1353
+407:1357
+407:1358
+407:1360
+407:1361
+407:1362
+407:1363
+407:1371
+407:1372
+407:1373
+407:1374
+407:1375
+407:1377
+407:1378
+407:1379
+407:1380
+407:1381
+407:1383
+407:1384
+407:1385
+407:1386
+407:1387
+407:1388
+407:1389
+407:1390
+407:1391
+407:1392
+407:1393
+407:1394
+407:1395
+407:1396
+407:1397
+407:1404
+407:1405
+407:1406
+407:1407
+407:1408
+407:1410
+407:1411
+407:1413
+407:1414
+407:1415
+407:1416
+407:1417
+407:1418
+407:1425
+407:1426
+407:1427
+407:1428
+407:1429
+407:1431
+407:1432
+408:1433
+411:1904
+411:1905
+411:1908
+411:1927
+411:1928
+411:1929
+411:1930
+411:1931
+411:1932
+411:1933
+413:1910
+413:1911
+413:1912
+413:1913
+413:1921
+413:1922
+413:1923
+413:1924
+413:1925
+414:1916
+414:1917
+414:1918
+418:1967
+418:1968
+418:1972
+418:1976
+418:1977
+418:1978
+418:1979
+418:1980
+418:1981
+418:1982
+420:1970
+420:1973
+420:1974
+421:1975
+424:1935
+424:1936
+424:1940
+424:1959
+424:1960
+424:1961
+424:1962
+424:1963
+424:1964
+424:1965
+426:1941
+427:1942
+427:1943
+428:1938
+428:1944
+428:1945
+428:1946
+428:1947
+428:1948
+428:1949
+428:1950
+428:1951
+428:1952
+428:1953
+428:1954
+428:1955
+428:1957
+428:1958
+431:1984
+431:1985
+431:1989
+431:1998
+431:1999
+431:2000
+431:2001
+431:2002
+431:2003
+431:2004
+433:1990
+434:1987
+434:1991
+434:1992
+434:1993
+434:1994
+434:1995
+434:1996
+435:1997
+438:639
+438:640
+438:641
+438:642
+438:649
+438:678
+438:679
+438:680
+438:681
+438:682
+438:683
+438:684
+440:650
+441:644
+441:645
+441:646
+441:647
+441:652
+441:653
+441:654
+441:655
+441:662
+441:663
+441:664
+441:665
+441:666
+441:668
+441:669
+441:670
+441:671
+441:672
+441:673
+441:674
+441:675
+441:676
+442:677
+445:2006
+445:2007
+445:2011
+445:2015
+445:2016
+445:2017
+445:2018
+445:2019
+445:2020
+445:2021
+447:2009
+447:2012
+447:2013
+448:2014
+451:686
+451:687
+451:688
+451:689
+451:696
+451:708
+451:709
+451:710
+451:711
+451:712
+451:713
+451:714
+453:697
+454:691
+454:692
+454:693
+454:694
+454:698
+454:699
+454:700
+454:701
+454:702
+454:703
+454:704
+454:705
+454:706
+455:707
+458:2023
+458:2024
+458:2027
+458:2042
+458:2043
+458:2044
+458:2045
+458:2046
+458:2047
+458:2048
+460:2028
+461:2029
+461:2030
+461:2031
+461:2032
+461:2033
+461:2034
+461:2035
+461:2036
+461:2037
+461:2038
+461:2040
+461:2041
+464:2050
+464:2051
+464:2058
+464:2088
+464:2089
+464:2090
+464:2091
+464:2092
+464:2093
+464:2094
+466:2059
+467:2053
+467:2054
+467:2055
+467:2056
+467:2060
+467:2061
+467:2062
+467:2064
+467:2065
+467:2066
+467:2067
+467:2068
+467:2069
+467:2070
+467:2078
+467:2079
+467:2080
+467:2081
+467:2082
+467:2084
+467:2085
+467:2086
+468:2087
+471:716
+471:717
+471:718
+471:719
+471:727
+471:742
+471:743
+471:744
+471:745
+471:746
+471:747
+471:748
+473:728
+474:721
+474:722
+474:723
+474:724
+474:725
+474:729
+474:730
+474:731
+474:732
+474:733
+474:734
+474:735
+474:736
+474:737
+474:738
+474:739
+474:740
+475:741
+*E
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParserDriver.java b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParserDriver.java
new file mode 100644
index 0000000..9669183
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParserDriver.java
@@ -0,0 +1,167 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.emfatic.core.generator.ecore.Builder;
+import org.eclipse.emf.emfatic.core.generator.ecore.Connector;
+import org.eclipse.emf.emfatic.core.generator.ecore.EmfaticSemanticWarning;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.parser.IParser;
+import org.eclipse.gymnast.runtime.core.parser.ParseContext;
+import org.eclipse.gymnast.runtime.core.parser.ParseError;
+import org.eclipse.gymnast.runtime.core.parser.ParseMessage;
+
+import antlr.MismatchedCharException;
+import antlr.MismatchedTokenException;
+import antlr.NoViableAltException;
+import antlr.NoViableAltForCharException;
+import antlr.RecognitionException;
+import antlr.TokenStreamException;
+import antlr.TokenStreamRecognitionException;
+
+public class EmfaticParserDriver implements IParser {
+
+ public ParseContext parse(Reader input) {
+
+ EmfaticLexer lexer = new EmfaticLexer(input);
+ lexer.setColumn(0);
+ lexer.setTabSize(1);
+
+ EmfaticParser parser = new EmfaticParser(lexer);
+ ParseContext parseContext = new ParseContext();
+ parser.setParseContext(parseContext);
+
+ CompUnit compUnit = parseCompUnit(parser, parseContext);
+ if (compUnit != null) {
+ EPackage rootPackage = addErrorsFromAST(parseContext);
+ // for consumption by change listeners (notified by the editor)
+ compUnit.setAST(rootPackage);
+ }
+
+ if (parseContext.getMessageCount() == 0) {
+ System.out.println("Parse OK!");
+ } else {
+ ParseMessage[] msgs = parseContext.getMessages();
+ for (int i = 0; i < msgs.length; i++) {
+ // System.err.println(msgs[i].getMessage());
+ }
+ }
+
+ return parseContext;
+ }
+
+ private EPackage addErrorsFromAST(ParseContext parseContext) {
+ EPackage rootPackage = null;
+ // warnigns and errors computed not from the CST but from the AST
+ Builder builder = new Builder();
+ NullProgressMonitor npm = new NullProgressMonitor();
+ ResourceSet resourceSet = new ResourceSetImpl();
+ URI uri = URI.createPlatformResourceURI("dummy");
+ Resource resource = resourceSet.createResource(uri);
+ try {
+ builder.build(parseContext, resource, npm);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (!parseContext.hasErrors()) {
+ Connector connector = new Connector(builder);
+ connector.connect(parseContext, resource, npm);
+ rootPackage = (EPackage) resource.getContents().get(0);
+ if (rootPackage != null) {
+ // invoke EcoreValidator
+ Diagnostician diagnostician = new Diagnostician();
+ final Diagnostic diagnostic = diagnostician.validate(rootPackage);
+ if (diagnostic.getSeverity() == Diagnostic.OK) {
+ return rootPackage;
+ }
+ /*
+ * A tutorial on markers:
+ *
+ * http://www.eclipse.org/articles/Article-Mark%20My%20Words/mark-my-words.html
+ *
+ */
+
+ CompUnit compUnit = (CompUnit) parseContext.getParseRoot();
+ for (Diagnostic childDiagnostic : diagnostic.getChildren()) {
+ Set<ASTNode> problemNodes = new HashSet<ASTNode>();
+ String dMsg = childDiagnostic.getMessage();
+ if (childDiagnostic.getData().size() > 0) {
+ Object primarySourceOfProblem = childDiagnostic.getData().get(0);
+ if (primarySourceOfProblem != null && primarySourceOfProblem instanceof EObject) {
+ Set<ASTNode> cstUses = compUnit.getEcoreDecl2CstUse().get((EObject) primarySourceOfProblem);
+ problemNodes.addAll(cstUses);
+ if (problemNodes.size() == 0) {
+ problemNodes.add(compUnit.getPackageDecl());
+ }
+ }
+ }
+ for (ASTNode problemNode : problemNodes) {
+ ParseMessage pMsg = new EmfaticSemanticWarning.EcoreValidatorDiagnostic(problemNode, dMsg);
+ parseContext.addParseMessage(pMsg);
+ }
+ }
+ }
+ }
+ return rootPackage;
+ }
+
+ private CompUnit parseCompUnit(EmfaticParser parser, ParseContext parseContext) {
+ try {
+ CompUnit compUnit = parser.compUnit();
+ parseContext.setParseRoot(compUnit);
+ return compUnit;
+ }
+ catch (RecognitionException rex) {
+ parseContext.addParseMessage(createParseError(rex));
+ }
+ catch (TokenStreamRecognitionException tex) {
+ RecognitionException rex = tex.recog;
+ parseContext.addParseMessage(createParseError(rex));
+ }
+ catch (Exception ex) {
+ parseContext.addParseMessage(new ParseError(ex.getMessage(), 1));
+ }
+ return null;
+ }
+ static ParseError createParseError(RecognitionException ex) {
+ String message = ex.getMessage();
+ int offset = ex.getColumn();
+ int length = 0;
+
+ if (ex instanceof MismatchedCharException) {
+ length = 1;
+ } else if (ex instanceof MismatchedTokenException) {
+ MismatchedTokenException ex2 = (MismatchedTokenException) ex;
+ if ((ex2.token != null) && (ex2.token.getText() != null)) {
+ length = ex2.token.getText().length();
+ }
+ } else if (ex instanceof NoViableAltException) {
+ NoViableAltException ex2 = (NoViableAltException) ex;
+ if ((ex2.token != null) && (ex2.token.getText() != null)) {
+ length = ex2.token.getText().length();
+ }
+ } else if (ex instanceof NoViableAltForCharException) {
+ length = 1;
+ }
+
+ return new ParseError(message, offset, length);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParserTokenTypes.java b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParserTokenTypes.java
new file mode 100644
index 0000000..5fd453a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParserTokenTypes.java
@@ -0,0 +1,73 @@
+// $ANTLR : "Emfatic.g" -> "EmfaticLexer.java"$
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.*;
+import org.eclipse.gymnast.runtime.core.parser.*;
+import org.eclipse.gymnast.runtime.core.ast.*;
+
+public interface EmfaticParserTokenTypes {
+ int EOF = 1;
+ int NULL_TREE_LOOKAHEAD = 3;
+ int LITERAL_package = 4;
+ int SEMI = 5;
+ int ID = 6;
+ int DOT = 7;
+ int DOLLAR = 8;
+ int STRING_LITERAL = 9;
+ int AT = 10;
+ int LPAREN = 11;
+ int RPAREN = 12;
+ int COMMA = 13;
+ int EQUALS = 14;
+ int LITERAL_import = 15;
+ int LCURLY = 16;
+ int RCURLY = 17;
+ int LITERAL_extends = 18;
+ int COLON = 19;
+ int LITERAL_abstract = 20;
+ int LITERAL_class = 21;
+ int LITERAL_interface = 22;
+ int LT = 23;
+ int GT = 24;
+ int AMP = 25;
+ int QMARK = 26;
+ int LITERAL_super = 27;
+ int LITERAL_attr = 28;
+ int LSQUARE = 29;
+ int RSQUARE = 30;
+ int DOT_DOT = 31;
+ int STAR = 32;
+ int PLUS = 33;
+ int INT_LITERAL = 34;
+ int HASH = 35;
+ int LITERAL_ref = 36;
+ int LITERAL_val = 37;
+ int BANG = 38;
+ int LITERAL_readonly = 39;
+ int LITERAL_volatile = 40;
+ int LITERAL_transient = 41;
+ int LITERAL_unsettable = 42;
+ int LITERAL_derived = 43;
+ int LITERAL_unique = 44;
+ int LITERAL_ordered = 45;
+ int LITERAL_resolve = 46;
+ int LITERAL_id = 47;
+ int LITERAL_true = 48;
+ int LITERAL_false = 49;
+ int MINUS = 50;
+ int CHAR_LITERAL = 51;
+ int LITERAL_op = 52;
+ int LITERAL_throws = 53;
+ int LITERAL_void = 54;
+ int LITERAL_datatype = 55;
+ int LITERAL_enum = 56;
+ int LITERAL_mapentry = 57;
+ int MINUS_GT = 58;
+ int GT_LT = 59;
+ int LT_GT = 60;
+ int ESC = 61;
+ int DIGIT = 62;
+ int WS = 63;
+ int SINGLE_LINE_COMMENT = 64;
+ int MULTI_LINE_COMMENT = 65;
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParserTokenTypes.txt b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParserTokenTypes.txt
new file mode 100644
index 0000000..32e6b2c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/ANTLRv2parser/EmfaticParserTokenTypes.txt
@@ -0,0 +1,64 @@
+// $ANTLR : Emfatic.g -> EmfaticParserTokenTypes.txt$
+EmfaticParser // output token vocab name
+LITERAL_package="package"=4
+SEMI=5
+ID=6
+DOT=7
+DOLLAR=8
+STRING_LITERAL=9
+AT=10
+LPAREN=11
+RPAREN=12
+COMMA=13
+EQUALS=14
+LITERAL_import="import"=15
+LCURLY=16
+RCURLY=17
+LITERAL_extends="extends"=18
+COLON=19
+LITERAL_abstract="abstract"=20
+LITERAL_class="class"=21
+LITERAL_interface="interface"=22
+LT=23
+GT=24
+AMP=25
+QMARK=26
+LITERAL_super="super"=27
+LITERAL_attr="attr"=28
+LSQUARE=29
+RSQUARE=30
+DOT_DOT=31
+STAR=32
+PLUS=33
+INT_LITERAL=34
+HASH=35
+LITERAL_ref="ref"=36
+LITERAL_val="val"=37
+BANG=38
+LITERAL_readonly="readonly"=39
+LITERAL_volatile="volatile"=40
+LITERAL_transient="transient"=41
+LITERAL_unsettable="unsettable"=42
+LITERAL_derived="derived"=43
+LITERAL_unique="unique"=44
+LITERAL_ordered="ordered"=45
+LITERAL_resolve="resolve"=46
+LITERAL_id="id"=47
+LITERAL_true="true"=48
+LITERAL_false="false"=49
+MINUS=50
+CHAR_LITERAL=51
+LITERAL_op="op"=52
+LITERAL_throws="throws"=53
+LITERAL_void="void"=54
+LITERAL_datatype="datatype"=55
+LITERAL_enum="enum"=56
+LITERAL_mapentry="mapentry"=57
+MINUS_GT=58
+GT_LT=59
+LT_GT=60
+ESC=61
+DIGIT=62
+WS=63
+SINGLE_LINE_COMMENT=64
+MULTI_LINE_COMMENT=65
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/Emfatic.ast b/plugins/org.eclipse.emf.emfatic.core/grammar/Emfatic.ast
new file mode 100644
index 0000000..f73c54f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/Emfatic.ast
@@ -0,0 +1,119 @@
+language Emfatic;
+
+options { k=3;
+ parserPackageName="org.eclipse.emf.emfatic.core.lang.gen.parser";
+ astPackageName="org.eclipse.emf.emfatic.core.lang.gen.ast";
+ astBaseClassName="EmfaticASTNode";
+ }
+
+
+sequence compUnit [entry] : packageDecl importStmts topLevelDecls ;
+
+sequence packageDecl : annotations "package" name=qualifiedID SEMI ;
+
+list qualifiedID : id1=ID (qidSeparator idn=ID)* ;
+token qidSeparator : DOT | DOLLAR ;
+
+abstract stringLiteralOrQualifiedID : stringLiteralContainer | qualifiedIDContainer ;
+sequence stringLiteralContainer : STRING_LITERAL ;
+sequence qualifiedIDContainer : qualifiedID ;
+
+list annotations : annotation* ;
+sequence annotation : AT source=stringLiteralOrQualifiedID LPAREN keyEqualsValueList RPAREN ;
+list keyEqualsValueList : kv1=keyEqualsValue (COMMA kvn=keyEqualsValue)* ;
+sequence keyEqualsValue : key=stringLiteralOrQualifiedID EQUALS value=stringLiteralOrQualifiedID ;
+
+list importStmts : importStmt* ;
+
+sequence importStmt : "import" (alias=ID EQUALS)? uri=stringLiteralOrQualifiedID SEMI ;
+
+list topLevelDecls : topLevelDecl* ;
+
+abstract topLevelDecl : (annotations)
+ subPackageDecl | classDecl | dataTypeDecl | enumDecl | mapEntryDecl ;
+
+sequence subPackageDecl : "package" name=ID LCURLY topLevelDecls RCURLY ;
+
+sequence classDecl : (abstractModifier)?
+ classKind name=ID
+ (typeParamsInfo=typeParamsInfo)?
+ ("extends" superTypes=commaListBoundExceptWild)?
+ (COLON instClassName=boundExceptWildcard)?
+ LCURLY classMemberDecls RCURLY ;
+list commaListBoundExceptWild : tb1=boundExceptWildcard (COMMA tbn=boundExceptWildcard)*;
+
+sequence abstractModifier : "abstract" ;
+token classKind : "class" | "interface" ;
+
+sequence typeParamsInfo : LT oneOrMoreTypeParams GT ;
+list oneOrMoreTypeParams : tp1=typeParam (COMMA tpn=typeParam)* ;
+sequence typeParam : typeVarName=ID (typeBoundsInfo=typeBoundsInfo)? ;
+sequence typeBoundsInfo : "extends" oneOrMoreTypeParamBounds ;
+list oneOrMoreTypeParamBounds : tb1=boundExceptWildcard (AMP tbn=boundExceptWildcard)*;
+sequence boundExceptWildcard : rawTNameOrTVarOrParamzedTName=qualifiedID (LT oneOrMoreTypeArgs GT)? ;
+list oneOrMoreTypeArgs : ta1=typeArg (COMMA tan=typeArg)*;
+abstract typeArg : boundExceptWildcard | wildcard ;
+sequence wildcard : QMARK ( extendsOrSuper boundExceptWildcard )? ;
+token extendsOrSuper : "extends" | "super" ;
+
+// there are no array types in EMF
+/* dot means package nesting, there are no inner classes in EMF */
+
+
+list classMemberDecls : classMemberDecl* ;
+abstract classMemberDecl : (annotations modifiers) attribute | reference | operation ;
+
+sequence attribute : "attr" typeWithMulti name=ID (EQUALS defaultValueExpr)? SEMI ;
+
+sequence typeWithMulti : name=boundExceptWildcard (multiplicity)? ;
+
+sequence multiplicity : LSQUARE (multiplicityExpr)? RSQUARE ;
+sequence multiplicityExpr : lowerBound=simpleMultiplicityExpr (DOT_DOT upperBound=simpleMultiplicityExpr)? ;
+token simpleMultiplicityExpr : STAR | PLUS | QMARK | INT_LITERAL ;
+
+sequence reference : referenceKind typeWithMulti (HASH oppositeName=ID)? name=ID SEMI ;
+token referenceKind : "ref" | "val" ;
+
+list modifiers : optNegatedModifier* ;
+sequence optNegatedModifier : (BANG)? modifier ;
+token modifier
+// keyword EMF meaning
+: "readonly" // EStructuralFeature.changeable = false
+| "volatile" // EStructuralFeature.volatile = true
+| "transient" // EStructuralFeature.transient = true
+| "unsettable" // EStructuralFeature.unsettable = true
+| "derived" // EStructuralFeature.derived = true
+| "unique" // *ETypedElement.unique = true -- bag?
+| "ordered" // *ETypedElement.ordered = true -- random?
+| "resolve" // *EReference.resolveProxies = true -- local?
+| "id" // EAttribute.id = true
+;
+
+abstract defaultValueExpr : boolExpr | intExpr | stringExpr | charExpr ;
+sequence boolExpr : trueOrFalse ;
+token trueOrFalse : "true" | "false" ;
+sequence intExpr : (MINUS)? INT_LITERAL ;
+sequence stringExpr : STRING_LITERAL ;
+sequence charExpr : CHAR_LITERAL ;
+
+sequence operation : "op" (typeParamsInfo=typeParamsInfo)?
+ resType=resultType name=ID LPAREN (params)? RPAREN
+ ("throws" exceptions=commaListBoundExceptWild)? SEMI ;
+
+abstract resultType : typeWithMulti | voidContainer ;
+sequence voidContainer : "void" ;
+
+list params : p1=param (COMMA pn=param)*;
+sequence param : leadingAnnotations=annotations modifiers typeWithMulti name=ID trailingAnnotations=annotations ;
+
+// "transient" means !serializable
+sequence dataTypeDecl : (transientModifier)? "datatype" name=ID COLON instClassName=stringLiteralOrQualifiedID SEMI ; // TODO datatypes should accept type parameters
+sequence transientModifier : "transient" ;
+
+sequence enumDecl : "enum" name=ID LCURLY enumLiterals RCURLY ;
+list enumLiterals : enumLiteral* ;
+sequence enumLiteral : leadingAnnotations=annotations name=ID (EQUALS val=INT_LITERAL)? trailingAnnotations=annotations SEMI ;
+
+sequence mapEntryDecl : "mapentry" name=ID COLON key=typeWithMulti MINUS_GT value=typeWithMulti SEMI ;
+
+// the following tokens were added to cater for generics syntax : AMP, LT, GT
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/Emfatic2.jj b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/Emfatic2.jj
new file mode 100644
index 0000000..701a5a8
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/Emfatic2.jj
@@ -0,0 +1,716 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+options {
+ JDK_VERSION = "1.5";
+ STATIC = false ;
+ LOOKAHEAD=4;
+ FORCE_LA_CHECK = true;
+}
+
+PARSER_BEGIN(EmfaticParser)
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.*;
+import org.eclipse.gymnast.runtime.core.ast.*;
+
+public class EmfaticParser {
+
+ public TokenInfo createTokenInfo(Token tok) {
+ if (!(tok instanceof ExtToken)) return null;
+
+ ExtToken extToken = (ExtToken) tok;
+ return new TokenInfo(tok.image, extToken.tokenOffset, tok.kind);
+ }
+
+}
+PARSER_END(EmfaticParser)
+
+SKIP :
+{
+ < SINGLELINECOMMENT : <DOUBLESLASH> (~["\n","\r"])* ("\n"|"\r\n")>
+| < WS : ([" ", "\t", "\f", "\r", "\n"])+ >
+| "/*" : WithinComment
+}
+<WithinComment> SKIP :
+{
+ "*/" : DEFAULT
+}
+<WithinComment> MORE :
+{
+ < ~[] >
+}
+
+TOKEN :
+{
+ < PACKAGEKW : "package" >
+| < CLASSKW : "class" >
+| < IMPORTKW : "import" >
+| < ABSTRACTKW : "abstract" >
+| < INTERFACEKW : "interface" >
+| < EXTENDSKW : "extends" >
+| < SUPERKW : "super" >
+| < ATTRKW : "attr" >
+| < REFKW : "ref" >
+| < VALKW : "val" >
+| < READONLYKW : "readonly" >
+| < VOLATILEKW : "volatile" >
+| < TRANSIENTKW : "transient" >
+| < UNSETTABLEKW : "unsettable" >
+| < DERIVEDKW : "derived" >
+| < UNIQUEKW : "unique" >
+| < ORDEREDKW : "ordered" >
+| < RESOLVEKW : "resolve" >
+| < IDKW : "id" >
+| < TRUEKW : "true" >
+| < FALSEKW : "false" >
+| < OPKW : "op" >
+| < VOIDKW : "void" >
+| < DATATYPEKW : "datatype" >
+| < ENUMKW : "enum" >
+| < MAPENTRYKW : "mapentry" >
+| < THROWSKW : "throws" >
+
+| < #DOUBLESLASH : "//" >
+| < #DOUBLEQUOTE : "\"" >
+| < #SINGLEQUOTE : "'" >
+| < #BACKSLASH : "\\" >
+
+| < LCURLY : "{" >
+| < RCURLY : "}" >
+| < LSQUARE : "[" >
+| < RSQUARE : "]" >
+| < LPAREN : "(" >
+| < RPAREN : ")" >
+
+| < DOT : ".">
+| < COMMA : ",">
+| < COLON : ":">
+| < SEMI : ";">
+
+| < STAR : "*">
+| < PLUS : "+">
+| < MINUS : "-">
+| < EQUALS : "=">
+
+| < QMARK : "?">
+| < BANG : "!">
+| < DOLLAR : "$">
+| < HASH : "#">
+| < AT : "@">
+
+| < DOT_DOT : "..">
+| < MINUS_GT : "->">
+| < GT_LT : "><">
+| < LT_GT : "<>">
+
+| < AMP : "&" >
+| < LT : "<" >
+| < GT : ">" >
+
+| < STRING_LITERAL : <DOUBLEQUOTE> (<ESC> | ~["\""])* <DOUBLEQUOTE> >
+| < CHAR_LITERAL : <SINGLEQUOTE> (<ESC> | (~["'"])) <SINGLEQUOTE> >
+
+| < #LETTERORUNDERSCORE : ["a"-"z", "A"-"Z", "_"] >
+| < #LETTERORUNDERSCOREORDIGIT : ( <LETTERORUNDERSCORE> | <DIGIT> ) >
+
+| < INT_LITERAL : (<DIGIT>)+ >
+
+| < #DIGIT : ["0"-"9"] >
+
+// TODO: The <DIGITDIGITDIGIT> is cheesy it should be something like
+// ( options { warnWhenFollowAmbig = false; } : (DIGIT)+ )
+// but I don't want to deal with parsing that yet.
+| < #ESC : <BACKSLASH> ("t" | "f" | "r" | "n" | <DOUBLEQUOTE> | <SINGLEQUOTE> | <BACKSLASH> | <DIGITDIGITDIGIT> ) >
+| < #DIGITDIGITDIGIT : <DIGIT> <DIGIT> <DIGIT> >
+}
+
+TOKEN :
+{
+ < ID : ("~")? <LETTERORUNDERSCORE> (<LETTERORUNDERSCOREORDIGIT>)* >
+}
+
+
+CompUnit compUnit() :
+{ CompUnit retVal = null;
+ PackageDecl packageDecl = null;
+ ImportStmts importStmts = null;
+ TopLevelDecls topLevelDecls = null; }
+{
+packageDecl=packageDecl() importStmts=importStmts() topLevelDecls=topLevelDecls() <EOF>
+ { retVal = new CompUnit(packageDecl, importStmts, topLevelDecls);
+ return retVal; }
+}
+
+PackageDecl packageDecl() :
+{ PackageDecl retVal = null;
+ Annotations annotations = null;
+ Token package_KW = null;
+ QualifiedID name = null;
+ Token semi = null; }
+{
+annotations=annotations() package_KW=<PACKAGEKW> name=qualifiedID() semi=<SEMI>
+ { retVal = new PackageDecl(annotations, createTokenInfo(package_KW), name, createTokenInfo(semi));
+ return retVal; }
+}
+
+QualifiedID qualifiedID() :
+{ QualifiedID retVal = new QualifiedID();
+ Token id1 = null;
+ QidSeparator qidSeparator = null;
+ Token idn = null; }
+{ ( id1=<ID> { retVal.addChild(createTokenInfo(id1)); } )
+ ( qidSeparator=qidSeparator() idn=<ID> { retVal.addChild(qidSeparator); retVal.addChild(createTokenInfo(idn)); } )* { return retVal; } }
+
+QidSeparator qidSeparator() :
+{ Token tok; }
+{ tok=<DOT> { return new QidSeparator (createTokenInfo(tok)); }
+| tok=<DOLLAR> { return new QidSeparator (createTokenInfo(tok)); }
+}
+
+StringLiteralOrQualifiedID stringLiteralOrQualifiedID() :
+{ StringLiteralOrQualifiedID retVal = null; }
+{
+ ( retVal=stringLiteralContainer() { return retVal; }
+ | retVal=qualifiedIDContainer() { return retVal; }
+ )
+}
+
+StringLiteralContainer stringLiteralContainer() :
+{ StringLiteralContainer retVal = null;
+ Token string_literal = null; }
+{
+string_literal=<STRING_LITERAL>
+ { retVal = new StringLiteralContainer(createTokenInfo(string_literal));
+ return retVal; }
+}
+
+QualifiedIDContainer qualifiedIDContainer() :
+{ QualifiedIDContainer retVal = null;
+ QualifiedID qualifiedID = null; }
+{
+qualifiedID=qualifiedID()
+ { retVal = new QualifiedIDContainer(qualifiedID);
+ return retVal; }
+}
+
+Annotations annotations() :
+{ Annotations retVal = new Annotations();
+ Annotation annotation = null; }
+{ ( annotation=annotation() { retVal.addChild(annotation); } )* { return retVal; } }
+
+Annotation annotation() :
+{ Annotation retVal = null;
+ Token at = null;
+ StringLiteralOrQualifiedID source = null;
+ Token lparen = null;
+ KeyEqualsValueList keyEqualsValueList = null;
+ Token rparen = null; }
+{
+at=<AT> source=stringLiteralOrQualifiedID() lparen=<LPAREN> keyEqualsValueList=keyEqualsValueList() rparen=<RPAREN>
+ { retVal = new Annotation(createTokenInfo(at), source, createTokenInfo(lparen), keyEqualsValueList, createTokenInfo(rparen));
+ return retVal; }
+}
+
+KeyEqualsValueList keyEqualsValueList() :
+{ KeyEqualsValueList retVal = new KeyEqualsValueList();
+ KeyEqualsValue kv1 = null;
+ Token comma = null;
+ KeyEqualsValue kvn = null; }
+{ ( kv1=keyEqualsValue() { retVal.addChild(kv1); } )
+ ( comma=<COMMA> kvn=keyEqualsValue() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(kvn); } )* { return retVal; } }
+
+KeyEqualsValue keyEqualsValue() :
+{ KeyEqualsValue retVal = null;
+ StringLiteralOrQualifiedID key = null;
+ Token equals = null;
+ StringLiteralOrQualifiedID value = null; }
+{
+key=stringLiteralOrQualifiedID() equals=<EQUALS> value=stringLiteralOrQualifiedID()
+ { retVal = new KeyEqualsValue(key, createTokenInfo(equals), value);
+ return retVal; }
+}
+
+ImportStmts importStmts() :
+{ ImportStmts retVal = new ImportStmts();
+ ImportStmt importStmt = null; }
+{ ( importStmt=importStmt() { retVal.addChild(importStmt); } )* { return retVal; } }
+
+ImportStmt importStmt() :
+
+{ ImportStmt retVal = null;
+ Token import_KW = null;
+ Token alias = null;
+ Token equals = null;
+ StringLiteralOrQualifiedID uri = null;
+ Token semi = null; }
+{
+import_KW=<IMPORTKW> ( alias=<ID> equals=<EQUALS> )? uri=stringLiteralOrQualifiedID() semi=<SEMI>
+ { retVal = new ImportStmt(createTokenInfo(import_KW), createTokenInfo(alias), createTokenInfo(equals), uri, createTokenInfo(semi));
+ return retVal; }
+}
+
+TopLevelDecls topLevelDecls() :
+{ TopLevelDecls retVal = new TopLevelDecls();
+ TopLevelDecl topLevelDecl = null; }
+{ ( topLevelDecl=topLevelDecl() { retVal.addChild(topLevelDecl); } )* { return retVal; } }
+
+TopLevelDecl topLevelDecl() :
+{ TopLevelDecl retVal = null;
+ Annotations annotations = null; }
+{
+annotations=annotations()
+ ( retVal=subPackageDecl(annotations) { return retVal; }
+ | retVal=classDecl(annotations) { return retVal; }
+ | retVal=dataTypeDecl(annotations) { return retVal; }
+ | retVal=enumDecl(annotations) { return retVal; }
+ | retVal=mapEntryDecl(annotations) { return retVal; }
+ )
+}
+
+SubPackageDecl subPackageDecl(Annotations annotations) :
+{ SubPackageDecl retVal = null;
+ Token package_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ TopLevelDecls topLevelDecls = null;
+ Token rcurly = null; }
+{
+package_KW=<PACKAGEKW> name=<ID> lcurly=<LCURLY> topLevelDecls=topLevelDecls() rcurly=<RCURLY>
+ { retVal = new SubPackageDecl(annotations, createTokenInfo(package_KW), createTokenInfo(name), createTokenInfo(lcurly), topLevelDecls, createTokenInfo(rcurly));
+ return retVal; }
+}
+
+ClassDecl classDecl(Annotations annotations) :
+{ ClassDecl retVal = null;
+ AbstractModifier abstractModifier = null;
+ ClassKind classKind = null;
+ Token name = null;
+ TypeParamsInfo typeParamsInfo = null;
+ Token extends_KW = null;
+ CommaListBoundExceptWild superTypes = null;
+ Token colon = null;
+ BoundExceptWildcard instClassName = null;
+ Token lcurly = null;
+ ClassMemberDecls classMemberDecls = null;
+ Token rcurly = null; }
+{
+( abstractModifier=abstractModifier() )? classKind=classKind() name=<ID> ( typeParamsInfo=typeParamsInfo() )? ( extends_KW="extends" superTypes=commaListBoundExceptWild() )? ( colon=<COLON> instClassName=boundExceptWildcard() )? lcurly=<LCURLY> classMemberDecls=classMemberDecls() rcurly=<RCURLY>
+ { retVal = new ClassDecl(annotations, abstractModifier, classKind, createTokenInfo(name), typeParamsInfo, createTokenInfo(extends_KW), superTypes, createTokenInfo(colon), instClassName, createTokenInfo(lcurly), classMemberDecls, createTokenInfo(rcurly));
+ return retVal; }
+}
+
+CommaListBoundExceptWild commaListBoundExceptWild() :
+{ CommaListBoundExceptWild retVal = new CommaListBoundExceptWild();
+ BoundExceptWildcard tb1 = null;
+ Token comma = null;
+ BoundExceptWildcard tbn = null; }
+{ ( tb1=boundExceptWildcard() { retVal.addChild(tb1); } )
+ ( comma=<COMMA> tbn=boundExceptWildcard() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(tbn); } )* { return retVal; } }
+
+AbstractModifier abstractModifier() :
+{ AbstractModifier retVal = null;
+ Token abstract_KW = null; }
+{
+abstract_KW=<ABSTRACTKW>
+ { retVal = new AbstractModifier(createTokenInfo(abstract_KW));
+ return retVal; }
+}
+
+ClassKind classKind() :
+{ Token tok; }
+{ tok=<CLASSKW> { return new ClassKind (createTokenInfo(tok)); }
+| tok=<INTERFACEKW> { return new ClassKind (createTokenInfo(tok)); }
+}
+
+TypeParamsInfo typeParamsInfo() :
+{ TypeParamsInfo retVal = null;
+ Token lt = null;
+ OneOrMoreTypeParams oneOrMoreTypeParams = null;
+ Token gt = null; }
+{
+lt=<LT> oneOrMoreTypeParams=oneOrMoreTypeParams() gt=<GT>
+ { retVal = new TypeParamsInfo(createTokenInfo(lt), oneOrMoreTypeParams, createTokenInfo(gt));
+ return retVal; }
+}
+
+OneOrMoreTypeParams oneOrMoreTypeParams() :
+{ OneOrMoreTypeParams retVal = new OneOrMoreTypeParams();
+ TypeParam tp1 = null;
+ Token comma = null;
+ TypeParam tpn = null; }
+{ ( tp1=typeParam() { retVal.addChild(tp1); } )
+ ( comma=<COMMA> tpn=typeParam() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(tpn); } )* { return retVal; } }
+
+TypeParam typeParam() :
+{ TypeParam retVal = null;
+ Token typeVarName = null;
+ TypeBoundsInfo typeBoundsInfo = null; }
+{
+typeVarName=<ID> ( typeBoundsInfo=typeBoundsInfo() )?
+ { retVal = new TypeParam(createTokenInfo(typeVarName), typeBoundsInfo);
+ return retVal; }
+}
+
+TypeBoundsInfo typeBoundsInfo() :
+{ TypeBoundsInfo retVal = null;
+ Token extends_KW = null;
+ OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds = null; }
+{
+extends_KW=<EXTENDSKW> oneOrMoreTypeParamBounds=oneOrMoreTypeParamBounds()
+ { retVal = new TypeBoundsInfo(createTokenInfo(extends_KW), oneOrMoreTypeParamBounds);
+ return retVal; }
+}
+
+OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds() :
+{ OneOrMoreTypeParamBounds retVal = new OneOrMoreTypeParamBounds();
+ BoundExceptWildcard tb1 = null;
+ Token amp = null;
+ BoundExceptWildcard tbn = null; }
+{ ( tb1=boundExceptWildcard() { retVal.addChild(tb1); } )
+ ( amp=<AMP> tbn=boundExceptWildcard() { retVal.addChild(createTokenInfo(amp)); retVal.addChild(tbn); } )* { return retVal; } }
+
+BoundExceptWildcard boundExceptWildcard() :
+{ BoundExceptWildcard retVal = null;
+ QualifiedID rawTNameOrTVarOrParamzedTName = null;
+ Token lt = null;
+ OneOrMoreTypeArgs oneOrMoreTypeArgs = null;
+ Token gt = null; }
+{
+rawTNameOrTVarOrParamzedTName=qualifiedID() ( lt=<LT> oneOrMoreTypeArgs=oneOrMoreTypeArgs() gt=<GT> )?
+ { retVal = new BoundExceptWildcard(rawTNameOrTVarOrParamzedTName, createTokenInfo(lt), oneOrMoreTypeArgs, createTokenInfo(gt));
+ return retVal; }
+}
+
+OneOrMoreTypeArgs oneOrMoreTypeArgs() :
+{ OneOrMoreTypeArgs retVal = new OneOrMoreTypeArgs();
+ TypeArg ta1 = null;
+ Token comma = null;
+ TypeArg tan = null; }
+{ ( ta1=typeArg() { retVal.addChild(ta1); } )
+ ( comma=<COMMA> tan=typeArg() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(tan); } )* { return retVal; } }
+
+TypeArg typeArg() :
+{ TypeArg retVal = null; }
+{
+ ( retVal=boundExceptWildcard() { return retVal; }
+ | retVal=wildcard() { return retVal; }
+ )
+}
+
+Wildcard wildcard() :
+{ Wildcard retVal = null;
+ Token qmark = null;
+ ExtendsOrSuper extendsOrSuper = null;
+ BoundExceptWildcard boundExceptWildcard = null; }
+{
+qmark=<QMARK> ( extendsOrSuper=extendsOrSuper() boundExceptWildcard=boundExceptWildcard() )?
+ { retVal = new Wildcard(createTokenInfo(qmark), extendsOrSuper, boundExceptWildcard);
+ return retVal; }
+}
+
+ExtendsOrSuper extendsOrSuper() :
+{ Token tok; }
+{ tok=<EXTENDSKW> { return new ExtendsOrSuper (createTokenInfo(tok)); }
+| tok=<SUPERKW> { return new ExtendsOrSuper (createTokenInfo(tok)); }
+}
+
+ClassMemberDecls classMemberDecls() :
+{ ClassMemberDecls retVal = new ClassMemberDecls();
+ ClassMemberDecl classMemberDecl = null; }
+{ ( classMemberDecl=classMemberDecl() { retVal.addChild(classMemberDecl); } )* { return retVal; } }
+
+ClassMemberDecl classMemberDecl() :
+{ ClassMemberDecl retVal = null;
+ Annotations annotations = null;
+ Modifiers modifiers = null; }
+{
+annotations=annotations() modifiers=modifiers()
+ ( retVal=attribute(annotations, modifiers) { return retVal; }
+ | retVal=reference(annotations, modifiers) { return retVal; }
+ | retVal=operation(annotations, modifiers) { return retVal; }
+ )
+}
+
+Attribute attribute(Annotations annotations, Modifiers modifiers) :
+{ Attribute retVal = null;
+ Token attr_KW = null;
+ TypeWithMulti typeWithMulti = null;
+ Token name = null;
+ Token equals = null;
+ DefaultValueExpr defaultValueExpr = null;
+ Token semi = null; }
+{
+attr_KW=<ATTRKW> typeWithMulti=typeWithMulti() name=<ID> ( equals=<EQUALS> defaultValueExpr=defaultValueExpr() )? semi=<SEMI>
+ { retVal = new Attribute(annotations, modifiers, createTokenInfo(attr_KW), typeWithMulti, createTokenInfo(name), createTokenInfo(equals), defaultValueExpr, createTokenInfo(semi));
+ return retVal; }
+}
+
+TypeWithMulti typeWithMulti() :
+{ TypeWithMulti retVal = null;
+ BoundExceptWildcard name = null;
+ Multiplicity multiplicity = null; }
+{
+name=boundExceptWildcard() ( multiplicity=multiplicity() )?
+ { retVal = new TypeWithMulti(name, multiplicity);
+ return retVal; }
+}
+
+Multiplicity multiplicity() :
+{ Multiplicity retVal = null;
+ Token lsquare = null;
+ MultiplicityExpr multiplicityExpr = null;
+ Token rsquare = null; }
+{
+lsquare=<LSQUARE> ( multiplicityExpr=multiplicityExpr() )? rsquare=<RSQUARE>
+ { retVal = new Multiplicity(createTokenInfo(lsquare), multiplicityExpr, createTokenInfo(rsquare));
+ return retVal; }
+}
+
+MultiplicityExpr multiplicityExpr() :
+{ MultiplicityExpr retVal = null;
+ SimpleMultiplicityExpr lowerBound = null;
+ Token dot_dot = null;
+ SimpleMultiplicityExpr upperBound = null; }
+{
+lowerBound=simpleMultiplicityExpr() ( dot_dot=<DOT_DOT> upperBound=simpleMultiplicityExpr() )?
+ { retVal = new MultiplicityExpr(lowerBound, createTokenInfo(dot_dot), upperBound);
+ return retVal; }
+}
+
+SimpleMultiplicityExpr simpleMultiplicityExpr() :
+{ Token tok; }
+{ tok=<STAR> { return new SimpleMultiplicityExpr (createTokenInfo(tok)); }
+| tok=<PLUS> { return new SimpleMultiplicityExpr (createTokenInfo(tok)); }
+| tok=<QMARK> { return new SimpleMultiplicityExpr (createTokenInfo(tok)); }
+| tok=<INT_LITERAL> { return new SimpleMultiplicityExpr (createTokenInfo(tok)); }
+}
+
+Reference reference(Annotations annotations, Modifiers modifiers) :
+{ Reference retVal = null;
+ ReferenceKind referenceKind = null;
+ TypeWithMulti typeWithMulti = null;
+ Token hash = null;
+ Token oppositeName = null;
+ Token name = null;
+ Token semi = null; }
+{
+referenceKind=referenceKind() typeWithMulti=typeWithMulti() ( hash=<HASH> oppositeName=<ID> )? name=<ID> semi=<SEMI>
+ { retVal = new Reference(annotations, modifiers, referenceKind, typeWithMulti, createTokenInfo(hash), createTokenInfo(oppositeName), createTokenInfo(name), createTokenInfo(semi));
+ return retVal; }
+}
+
+ReferenceKind referenceKind() :
+{ Token tok; }
+{ tok=<REFKW> { return new ReferenceKind (createTokenInfo(tok)); }
+| tok=<VALKW> { return new ReferenceKind (createTokenInfo(tok)); }
+}
+
+Modifiers modifiers() :
+{ Modifiers retVal = new Modifiers();
+ OptNegatedModifier optNegatedModifier = null; }
+{ ( optNegatedModifier=optNegatedModifier() { retVal.addChild(optNegatedModifier); } )* { return retVal; } }
+
+OptNegatedModifier optNegatedModifier() :
+{ OptNegatedModifier retVal = null;
+ Token bang = null;
+ Modifier modifier = null; }
+{
+( bang=<BANG> )? modifier=modifier()
+ { retVal = new OptNegatedModifier(createTokenInfo(bang), modifier);
+ return retVal; }
+}
+
+Modifier modifier() :
+{ Token tok; }
+{ tok=<READONLYKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<VOLATILEKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<TRANSIENTKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<UNSETTABLEKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<DERIVEDKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<UNIQUEKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<ORDEREDKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<RESOLVEKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<IDKW> { return new Modifier (createTokenInfo(tok)); }
+}
+
+DefaultValueExpr defaultValueExpr() :
+{ DefaultValueExpr retVal = null; }
+{
+ ( retVal=boolExpr() { return retVal; }
+ | retVal=intExpr() { return retVal; }
+ | retVal=stringExpr() { return retVal; }
+ | retVal=charExpr() { return retVal; }
+ )
+}
+
+BoolExpr boolExpr() :
+{ BoolExpr retVal = null;
+ TrueOrFalse trueOrFalse = null; }
+{
+trueOrFalse=trueOrFalse()
+ { retVal = new BoolExpr(trueOrFalse);
+ return retVal; }
+}
+
+TrueOrFalse trueOrFalse() :
+{ Token tok; }
+{ tok=<TRUEKW> { return new TrueOrFalse (createTokenInfo(tok)); }
+| tok=<FALSEKW> { return new TrueOrFalse (createTokenInfo(tok)); }
+}
+
+IntExpr intExpr() :
+{ IntExpr retVal = null;
+ Token minus = null;
+ Token int_literal = null; }
+{
+( minus=<MINUS> )? int_literal=<INT_LITERAL>
+ { retVal = new IntExpr(createTokenInfo(minus), createTokenInfo(int_literal));
+ return retVal; }
+}
+
+StringExpr stringExpr() :
+{ StringExpr retVal = null;
+ Token string_literal = null; }
+{
+string_literal=<STRING_LITERAL>
+ { retVal = new StringExpr(createTokenInfo(string_literal));
+ return retVal; }
+}
+
+CharExpr charExpr() :
+{ CharExpr retVal = null;
+ Token char_literal = null; }
+{
+char_literal=<CHAR_LITERAL>
+ { retVal = new CharExpr(createTokenInfo(char_literal));
+ return retVal; }
+}
+
+Operation operation(Annotations annotations, Modifiers modifiers) :
+{ Operation retVal = null;
+ Token op_KW = null;
+ TypeParamsInfo typeParamsInfo = null;
+ ResultType resType = null;
+ Token name = null;
+ Token lparen = null;
+ Params params = null;
+ Token rparen = null;
+ Token throws_KW = null;
+ CommaListBoundExceptWild exceptions = null;
+ Token semi = null; }
+{
+op_KW=<OPKW> ( typeParamsInfo=typeParamsInfo() )? resType=resultType() name=<ID> lparen=<LPAREN> ( params=params() )? rparen=<RPAREN> ( throws_KW=<THROWSKW> exceptions=commaListBoundExceptWild() )? semi=<SEMI>
+ { retVal = new Operation(annotations, modifiers, createTokenInfo(op_KW), typeParamsInfo, resType, createTokenInfo(name), createTokenInfo(lparen), params, createTokenInfo(rparen), createTokenInfo(throws_KW), exceptions, createTokenInfo(semi));
+ return retVal; }
+}
+
+ResultType resultType() :
+{ ResultType retVal = null; }
+{
+ ( retVal=typeWithMulti() { return retVal; }
+ | retVal=voidContainer() { return retVal; }
+ )
+}
+
+VoidContainer voidContainer() :
+{ VoidContainer retVal = null;
+ Token void_KW = null; }
+{
+void_KW=<VOIDKW>
+ { retVal = new VoidContainer(createTokenInfo(void_KW));
+ return retVal; }
+}
+
+Params params() :
+{ Params retVal = new Params();
+ Param p1 = null;
+ Token comma = null;
+ Param pn = null; }
+{ ( p1=param() { retVal.addChild(p1); } )
+ ( comma=<COMMA> pn=param() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(pn); } )* { return retVal; } }
+
+Param param() :
+{ Param retVal = null;
+ Annotations leadingAnnotations = null;
+ Modifiers modifiers = null;
+ TypeWithMulti typeWithMulti = null;
+ Token name = null;
+ Annotations trailingAnnotations = null; }
+{
+leadingAnnotations=annotations() modifiers=modifiers() typeWithMulti=typeWithMulti() name=<ID> trailingAnnotations=annotations()
+ { retVal = new Param(leadingAnnotations, modifiers, typeWithMulti, createTokenInfo(name), trailingAnnotations);
+ return retVal; }
+}
+
+DataTypeDecl dataTypeDecl(Annotations annotations) :
+{ DataTypeDecl retVal = null;
+ TransientModifier transientModifier = null;
+ Token datatype_KW = null;
+ Token name = null;
+ Token colon = null;
+ StringLiteralOrQualifiedID instClassName = null;
+ Token semi = null; }
+{
+( transientModifier=transientModifier() )? datatype_KW=<DATATYPEKW> name=<ID> colon=<COLON> instClassName=stringLiteralOrQualifiedID() semi=<SEMI>
+ { retVal = new DataTypeDecl(annotations, transientModifier, createTokenInfo(datatype_KW), createTokenInfo(name), createTokenInfo(colon), instClassName, createTokenInfo(semi));
+ return retVal; }
+}
+
+TransientModifier transientModifier() :
+{ TransientModifier retVal = null;
+ Token transient_KW = null; }
+{
+transient_KW=<TRANSIENTKW>
+ { retVal = new TransientModifier(createTokenInfo(transient_KW));
+ return retVal; }
+}
+
+EnumDecl enumDecl(Annotations annotations) :
+{ EnumDecl retVal = null;
+ Token enum_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ EnumLiterals enumLiterals = null;
+ Token rcurly = null; }
+{
+enum_KW=<ENUMKW> name=<ID> lcurly=<LCURLY> enumLiterals=enumLiterals() rcurly=<RCURLY>
+ { retVal = new EnumDecl(annotations, createTokenInfo(enum_KW), createTokenInfo(name), createTokenInfo(lcurly), enumLiterals, createTokenInfo(rcurly));
+ return retVal; }
+}
+
+EnumLiterals enumLiterals() :
+{ EnumLiterals retVal = new EnumLiterals();
+ EnumLiteral enumLiteral = null; }
+{ ( enumLiteral=enumLiteral() { retVal.addChild(enumLiteral); } )* { return retVal; } }
+
+EnumLiteral enumLiteral() :
+{ EnumLiteral retVal = null;
+ Annotations leadingAnnotations = null;
+ Token name = null;
+ Token equals = null;
+ Token val = null;
+ Annotations trailingAnnotations = null;
+ Token semi = null; }
+{
+leadingAnnotations=annotations() name=<ID> ( equals=<EQUALS> val=<INT_LITERAL> )? trailingAnnotations=annotations() semi=<SEMI>
+ { retVal = new EnumLiteral(leadingAnnotations, createTokenInfo(name), createTokenInfo(equals), createTokenInfo(val), trailingAnnotations, createTokenInfo(semi));
+ return retVal; }
+}
+
+MapEntryDecl mapEntryDecl(Annotations annotations) :
+{ MapEntryDecl retVal = null;
+ Token mapentry_KW = null;
+ Token name = null;
+ Token colon = null;
+ TypeWithMulti key = null;
+ Token minus_gt = null;
+ TypeWithMulti value = null;
+ Token semi = null; }
+{
+mapentry_KW=<MAPENTRYKW> name=<ID> colon=<COLON> key=typeWithMulti() minus_gt=<MINUS_GT> value=typeWithMulti() semi=<SEMI>
+ { retVal = new MapEntryDecl(annotations, createTokenInfo(mapentry_KW), createTokenInfo(name), createTokenInfo(colon), key, createTokenInfo(minus_gt), value, createTokenInfo(semi));
+ return retVal; }
+}
+
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParser.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParser.java
new file mode 100644
index 0000000..81f3434
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParser.java
@@ -0,0 +1,2873 @@
+/* Generated By:JavaCC: Do not edit this line. EmfaticParser.java */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.*;
+import org.eclipse.gymnast.runtime.core.ast.*;
+
+public class EmfaticParser implements EmfaticParserConstants {
+
+ public TokenInfo createTokenInfo(Token tok) {
+ if (!(tok instanceof ExtToken)) return null;
+
+ ExtToken extToken = (ExtToken) tok;
+ return new TokenInfo(tok.image, extToken.tokenOffset, tok.kind);
+ }
+
+ final public CompUnit compUnit() throws ParseException {
+ CompUnit retVal = null;
+ PackageDecl packageDecl = null;
+ ImportStmts importStmts = null;
+ TopLevelDecls topLevelDecls = null;
+ packageDecl = packageDecl();
+ importStmts = importStmts();
+ topLevelDecls = topLevelDecls();
+ jj_consume_token(0);
+ retVal = new CompUnit(packageDecl, importStmts, topLevelDecls);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public PackageDecl packageDecl() throws ParseException {
+ PackageDecl retVal = null;
+ Annotations annotations = null;
+ Token package_KW = null;
+ QualifiedID name = null;
+ Token semi = null;
+ annotations = annotations();
+ package_KW = jj_consume_token(PACKAGEKW);
+ name = qualifiedID();
+ semi = jj_consume_token(SEMI);
+ retVal = new PackageDecl(annotations, createTokenInfo(package_KW), name, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public QualifiedID qualifiedID() throws ParseException {
+ QualifiedID retVal = new QualifiedID();
+ Token id1 = null;
+ QidSeparator qidSeparator = null;
+ Token idn = null;
+ id1 = jj_consume_token(ID);
+ retVal.addChild(createTokenInfo(id1));
+ label_1:
+ while (true) {
+ if (jj_2_1(4)) {
+ ;
+ } else {
+ break label_1;
+ }
+ qidSeparator = qidSeparator();
+ idn = jj_consume_token(ID);
+ retVal.addChild(qidSeparator); retVal.addChild(createTokenInfo(idn));
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public QidSeparator qidSeparator() throws ParseException {
+ Token tok;
+ if (jj_2_2(4)) {
+ tok = jj_consume_token(DOT);
+ {if (true) return new QidSeparator (createTokenInfo(tok));}
+ } else if (jj_2_3(4)) {
+ tok = jj_consume_token(DOLLAR);
+ {if (true) return new QidSeparator (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public StringLiteralOrQualifiedID stringLiteralOrQualifiedID() throws ParseException {
+ StringLiteralOrQualifiedID retVal = null;
+ if (jj_2_4(4)) {
+ retVal = stringLiteralContainer();
+ {if (true) return retVal;}
+ } else if (jj_2_5(4)) {
+ retVal = qualifiedIDContainer();
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public StringLiteralContainer stringLiteralContainer() throws ParseException {
+ StringLiteralContainer retVal = null;
+ Token string_literal = null;
+ string_literal = jj_consume_token(STRING_LITERAL);
+ retVal = new StringLiteralContainer(createTokenInfo(string_literal));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public QualifiedIDContainer qualifiedIDContainer() throws ParseException {
+ QualifiedIDContainer retVal = null;
+ QualifiedID qualifiedID = null;
+ qualifiedID = qualifiedID();
+ retVal = new QualifiedIDContainer(qualifiedID);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Annotations annotations() throws ParseException {
+ Annotations retVal = new Annotations();
+ Annotation annotation = null;
+ label_2:
+ while (true) {
+ if (jj_2_6(4)) {
+ ;
+ } else {
+ break label_2;
+ }
+ annotation = annotation();
+ retVal.addChild(annotation);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Annotation annotation() throws ParseException {
+ Annotation retVal = null;
+ Token at = null;
+ StringLiteralOrQualifiedID source = null;
+ Token lparen = null;
+ KeyEqualsValueList keyEqualsValueList = null;
+ Token rparen = null;
+ at = jj_consume_token(AT);
+ source = stringLiteralOrQualifiedID();
+ lparen = jj_consume_token(LPAREN);
+ keyEqualsValueList = keyEqualsValueList();
+ rparen = jj_consume_token(RPAREN);
+ retVal = new Annotation(createTokenInfo(at), source, createTokenInfo(lparen), keyEqualsValueList, createTokenInfo(rparen));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public KeyEqualsValueList keyEqualsValueList() throws ParseException {
+ KeyEqualsValueList retVal = new KeyEqualsValueList();
+ KeyEqualsValue kv1 = null;
+ Token comma = null;
+ KeyEqualsValue kvn = null;
+ kv1 = keyEqualsValue();
+ retVal.addChild(kv1);
+ label_3:
+ while (true) {
+ if (jj_2_7(4)) {
+ ;
+ } else {
+ break label_3;
+ }
+ comma = jj_consume_token(COMMA);
+ kvn = keyEqualsValue();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(kvn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public KeyEqualsValue keyEqualsValue() throws ParseException {
+ KeyEqualsValue retVal = null;
+ StringLiteralOrQualifiedID key = null;
+ Token equals = null;
+ StringLiteralOrQualifiedID value = null;
+ key = stringLiteralOrQualifiedID();
+ equals = jj_consume_token(EQUALS);
+ value = stringLiteralOrQualifiedID();
+ retVal = new KeyEqualsValue(key, createTokenInfo(equals), value);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ImportStmts importStmts() throws ParseException {
+ ImportStmts retVal = new ImportStmts();
+ ImportStmt importStmt = null;
+ label_4:
+ while (true) {
+ if (jj_2_8(4)) {
+ ;
+ } else {
+ break label_4;
+ }
+ importStmt = importStmt();
+ retVal.addChild(importStmt);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ImportStmt importStmt() throws ParseException {
+ ImportStmt retVal = null;
+ Token import_KW = null;
+ Token alias = null;
+ Token equals = null;
+ StringLiteralOrQualifiedID uri = null;
+ Token semi = null;
+ import_KW = jj_consume_token(IMPORTKW);
+ if (jj_2_9(4)) {
+ alias = jj_consume_token(ID);
+ equals = jj_consume_token(EQUALS);
+ } else {
+ ;
+ }
+ uri = stringLiteralOrQualifiedID();
+ semi = jj_consume_token(SEMI);
+ retVal = new ImportStmt(createTokenInfo(import_KW), createTokenInfo(alias), createTokenInfo(equals), uri, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TopLevelDecls topLevelDecls() throws ParseException {
+ TopLevelDecls retVal = new TopLevelDecls();
+ TopLevelDecl topLevelDecl = null;
+ label_5:
+ while (true) {
+ if (jj_2_10(4)) {
+ ;
+ } else {
+ break label_5;
+ }
+ topLevelDecl = topLevelDecl();
+ retVal.addChild(topLevelDecl);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TopLevelDecl topLevelDecl() throws ParseException {
+ TopLevelDecl retVal = null;
+ Annotations annotations = null;
+ annotations = annotations();
+ if (jj_2_11(4)) {
+ retVal = subPackageDecl(annotations);
+ {if (true) return retVal;}
+ } else if (jj_2_12(4)) {
+ retVal = classDecl(annotations);
+ {if (true) return retVal;}
+ } else if (jj_2_13(4)) {
+ retVal = dataTypeDecl(annotations);
+ {if (true) return retVal;}
+ } else if (jj_2_14(4)) {
+ retVal = enumDecl(annotations);
+ {if (true) return retVal;}
+ } else if (jj_2_15(4)) {
+ retVal = mapEntryDecl(annotations);
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public SubPackageDecl subPackageDecl(Annotations annotations) throws ParseException {
+ SubPackageDecl retVal = null;
+ Token package_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ TopLevelDecls topLevelDecls = null;
+ Token rcurly = null;
+ package_KW = jj_consume_token(PACKAGEKW);
+ name = jj_consume_token(ID);
+ lcurly = jj_consume_token(LCURLY);
+ topLevelDecls = topLevelDecls();
+ rcurly = jj_consume_token(RCURLY);
+ retVal = new SubPackageDecl(annotations, createTokenInfo(package_KW), createTokenInfo(name), createTokenInfo(lcurly), topLevelDecls, createTokenInfo(rcurly));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ClassDecl classDecl(Annotations annotations) throws ParseException {
+ ClassDecl retVal = null;
+ AbstractModifier abstractModifier = null;
+ ClassKind classKind = null;
+ Token name = null;
+ TypeParamsInfo typeParamsInfo = null;
+ Token extends_KW = null;
+ CommaListBoundExceptWild superTypes = null;
+ Token colon = null;
+ BoundExceptWildcard instClassName = null;
+ Token lcurly = null;
+ ClassMemberDecls classMemberDecls = null;
+ Token rcurly = null;
+ if (jj_2_16(4)) {
+ abstractModifier = abstractModifier();
+ } else {
+ ;
+ }
+ classKind = classKind();
+ name = jj_consume_token(ID);
+ if (jj_2_17(4)) {
+ typeParamsInfo = typeParamsInfo();
+ } else {
+ ;
+ }
+ if (jj_2_18(4)) {
+ extends_KW = jj_consume_token(EXTENDSKW);
+ superTypes = commaListBoundExceptWild();
+ } else {
+ ;
+ }
+ if (jj_2_19(4)) {
+ colon = jj_consume_token(COLON);
+ instClassName = boundExceptWildcard();
+ } else {
+ ;
+ }
+ lcurly = jj_consume_token(LCURLY);
+ classMemberDecls = classMemberDecls();
+ rcurly = jj_consume_token(RCURLY);
+ retVal = new ClassDecl(annotations, abstractModifier, classKind, createTokenInfo(name), typeParamsInfo, createTokenInfo(extends_KW), superTypes, createTokenInfo(colon), instClassName, createTokenInfo(lcurly), classMemberDecls, createTokenInfo(rcurly));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public CommaListBoundExceptWild commaListBoundExceptWild() throws ParseException {
+ CommaListBoundExceptWild retVal = new CommaListBoundExceptWild();
+ BoundExceptWildcard tb1 = null;
+ Token comma = null;
+ BoundExceptWildcard tbn = null;
+ tb1 = boundExceptWildcard();
+ retVal.addChild(tb1);
+ label_6:
+ while (true) {
+ if (jj_2_20(4)) {
+ ;
+ } else {
+ break label_6;
+ }
+ comma = jj_consume_token(COMMA);
+ tbn = boundExceptWildcard();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(tbn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public AbstractModifier abstractModifier() throws ParseException {
+ AbstractModifier retVal = null;
+ Token abstract_KW = null;
+ abstract_KW = jj_consume_token(ABSTRACTKW);
+ retVal = new AbstractModifier(createTokenInfo(abstract_KW));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ClassKind classKind() throws ParseException {
+ Token tok;
+ if (jj_2_21(4)) {
+ tok = jj_consume_token(CLASSKW);
+ {if (true) return new ClassKind (createTokenInfo(tok));}
+ } else if (jj_2_22(4)) {
+ tok = jj_consume_token(INTERFACEKW);
+ {if (true) return new ClassKind (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeParamsInfo typeParamsInfo() throws ParseException {
+ TypeParamsInfo retVal = null;
+ Token lt = null;
+ OneOrMoreTypeParams oneOrMoreTypeParams = null;
+ Token gt = null;
+ lt = jj_consume_token(LT);
+ oneOrMoreTypeParams = oneOrMoreTypeParams();
+ gt = jj_consume_token(GT);
+ retVal = new TypeParamsInfo(createTokenInfo(lt), oneOrMoreTypeParams, createTokenInfo(gt));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public OneOrMoreTypeParams oneOrMoreTypeParams() throws ParseException {
+ OneOrMoreTypeParams retVal = new OneOrMoreTypeParams();
+ TypeParam tp1 = null;
+ Token comma = null;
+ TypeParam tpn = null;
+ tp1 = typeParam();
+ retVal.addChild(tp1);
+ label_7:
+ while (true) {
+ if (jj_2_23(4)) {
+ ;
+ } else {
+ break label_7;
+ }
+ comma = jj_consume_token(COMMA);
+ tpn = typeParam();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(tpn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeParam typeParam() throws ParseException {
+ TypeParam retVal = null;
+ Token typeVarName = null;
+ TypeBoundsInfo typeBoundsInfo = null;
+ typeVarName = jj_consume_token(ID);
+ if (jj_2_24(4)) {
+ typeBoundsInfo = typeBoundsInfo();
+ } else {
+ ;
+ }
+ retVal = new TypeParam(createTokenInfo(typeVarName), typeBoundsInfo);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeBoundsInfo typeBoundsInfo() throws ParseException {
+ TypeBoundsInfo retVal = null;
+ Token extends_KW = null;
+ OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds = null;
+ extends_KW = jj_consume_token(EXTENDSKW);
+ oneOrMoreTypeParamBounds = oneOrMoreTypeParamBounds();
+ retVal = new TypeBoundsInfo(createTokenInfo(extends_KW), oneOrMoreTypeParamBounds);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds() throws ParseException {
+ OneOrMoreTypeParamBounds retVal = new OneOrMoreTypeParamBounds();
+ BoundExceptWildcard tb1 = null;
+ Token amp = null;
+ BoundExceptWildcard tbn = null;
+ tb1 = boundExceptWildcard();
+ retVal.addChild(tb1);
+ label_8:
+ while (true) {
+ if (jj_2_25(4)) {
+ ;
+ } else {
+ break label_8;
+ }
+ amp = jj_consume_token(AMP);
+ tbn = boundExceptWildcard();
+ retVal.addChild(createTokenInfo(amp)); retVal.addChild(tbn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public BoundExceptWildcard boundExceptWildcard() throws ParseException {
+ BoundExceptWildcard retVal = null;
+ QualifiedID rawTNameOrTVarOrParamzedTName = null;
+ Token lt = null;
+ OneOrMoreTypeArgs oneOrMoreTypeArgs = null;
+ Token gt = null;
+ rawTNameOrTVarOrParamzedTName = qualifiedID();
+ if (jj_2_26(4)) {
+ lt = jj_consume_token(LT);
+ oneOrMoreTypeArgs = oneOrMoreTypeArgs();
+ gt = jj_consume_token(GT);
+ } else {
+ ;
+ }
+ retVal = new BoundExceptWildcard(rawTNameOrTVarOrParamzedTName, createTokenInfo(lt), oneOrMoreTypeArgs, createTokenInfo(gt));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public OneOrMoreTypeArgs oneOrMoreTypeArgs() throws ParseException {
+ OneOrMoreTypeArgs retVal = new OneOrMoreTypeArgs();
+ TypeArg ta1 = null;
+ Token comma = null;
+ TypeArg tan = null;
+ ta1 = typeArg();
+ retVal.addChild(ta1);
+ label_9:
+ while (true) {
+ if (jj_2_27(4)) {
+ ;
+ } else {
+ break label_9;
+ }
+ comma = jj_consume_token(COMMA);
+ tan = typeArg();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(tan);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeArg typeArg() throws ParseException {
+ TypeArg retVal = null;
+ if (jj_2_28(4)) {
+ retVal = boundExceptWildcard();
+ {if (true) return retVal;}
+ } else if (jj_2_29(4)) {
+ retVal = wildcard();
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Wildcard wildcard() throws ParseException {
+ Wildcard retVal = null;
+ Token qmark = null;
+ ExtendsOrSuper extendsOrSuper = null;
+ BoundExceptWildcard boundExceptWildcard = null;
+ qmark = jj_consume_token(QMARK);
+ if (jj_2_30(4)) {
+ extendsOrSuper = extendsOrSuper();
+ boundExceptWildcard = boundExceptWildcard();
+ } else {
+ ;
+ }
+ retVal = new Wildcard(createTokenInfo(qmark), extendsOrSuper, boundExceptWildcard);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ExtendsOrSuper extendsOrSuper() throws ParseException {
+ Token tok;
+ if (jj_2_31(4)) {
+ tok = jj_consume_token(EXTENDSKW);
+ {if (true) return new ExtendsOrSuper (createTokenInfo(tok));}
+ } else if (jj_2_32(4)) {
+ tok = jj_consume_token(SUPERKW);
+ {if (true) return new ExtendsOrSuper (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ClassMemberDecls classMemberDecls() throws ParseException {
+ ClassMemberDecls retVal = new ClassMemberDecls();
+ ClassMemberDecl classMemberDecl = null;
+ label_10:
+ while (true) {
+ if (jj_2_33(4)) {
+ ;
+ } else {
+ break label_10;
+ }
+ classMemberDecl = classMemberDecl();
+ retVal.addChild(classMemberDecl);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ClassMemberDecl classMemberDecl() throws ParseException {
+ ClassMemberDecl retVal = null;
+ Annotations annotations = null;
+ Modifiers modifiers = null;
+ annotations = annotations();
+ modifiers = modifiers();
+ if (jj_2_34(4)) {
+ retVal = attribute(annotations, modifiers);
+ {if (true) return retVal;}
+ } else if (jj_2_35(4)) {
+ retVal = reference(annotations, modifiers);
+ {if (true) return retVal;}
+ } else if (jj_2_36(4)) {
+ retVal = operation(annotations, modifiers);
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Attribute attribute(Annotations annotations, Modifiers modifiers) throws ParseException {
+ Attribute retVal = null;
+ Token attr_KW = null;
+ TypeWithMulti typeWithMulti = null;
+ Token name = null;
+ Token equals = null;
+ DefaultValueExpr defaultValueExpr = null;
+ Token semi = null;
+ attr_KW = jj_consume_token(ATTRKW);
+ typeWithMulti = typeWithMulti();
+ name = jj_consume_token(ID);
+ if (jj_2_37(4)) {
+ equals = jj_consume_token(EQUALS);
+ defaultValueExpr = defaultValueExpr();
+ } else {
+ ;
+ }
+ semi = jj_consume_token(SEMI);
+ retVal = new Attribute(annotations, modifiers, createTokenInfo(attr_KW), typeWithMulti, createTokenInfo(name), createTokenInfo(equals), defaultValueExpr, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeWithMulti typeWithMulti() throws ParseException {
+ TypeWithMulti retVal = null;
+ BoundExceptWildcard name = null;
+ Multiplicity multiplicity = null;
+ name = boundExceptWildcard();
+ if (jj_2_38(4)) {
+ multiplicity = multiplicity();
+ } else {
+ ;
+ }
+ retVal = new TypeWithMulti(name, multiplicity);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Multiplicity multiplicity() throws ParseException {
+ Multiplicity retVal = null;
+ Token lsquare = null;
+ MultiplicityExpr multiplicityExpr = null;
+ Token rsquare = null;
+ lsquare = jj_consume_token(LSQUARE);
+ if (jj_2_39(4)) {
+ multiplicityExpr = multiplicityExpr();
+ } else {
+ ;
+ }
+ rsquare = jj_consume_token(RSQUARE);
+ retVal = new Multiplicity(createTokenInfo(lsquare), multiplicityExpr, createTokenInfo(rsquare));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public MultiplicityExpr multiplicityExpr() throws ParseException {
+ MultiplicityExpr retVal = null;
+ SimpleMultiplicityExpr lowerBound = null;
+ Token dot_dot = null;
+ SimpleMultiplicityExpr upperBound = null;
+ lowerBound = simpleMultiplicityExpr();
+ if (jj_2_40(4)) {
+ dot_dot = jj_consume_token(DOT_DOT);
+ upperBound = simpleMultiplicityExpr();
+ } else {
+ ;
+ }
+ retVal = new MultiplicityExpr(lowerBound, createTokenInfo(dot_dot), upperBound);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public SimpleMultiplicityExpr simpleMultiplicityExpr() throws ParseException {
+ Token tok;
+ if (jj_2_41(4)) {
+ tok = jj_consume_token(STAR);
+ {if (true) return new SimpleMultiplicityExpr (createTokenInfo(tok));}
+ } else if (jj_2_42(4)) {
+ tok = jj_consume_token(PLUS);
+ {if (true) return new SimpleMultiplicityExpr (createTokenInfo(tok));}
+ } else if (jj_2_43(4)) {
+ tok = jj_consume_token(QMARK);
+ {if (true) return new SimpleMultiplicityExpr (createTokenInfo(tok));}
+ } else if (jj_2_44(4)) {
+ tok = jj_consume_token(INT_LITERAL);
+ {if (true) return new SimpleMultiplicityExpr (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Reference reference(Annotations annotations, Modifiers modifiers) throws ParseException {
+ Reference retVal = null;
+ ReferenceKind referenceKind = null;
+ TypeWithMulti typeWithMulti = null;
+ Token hash = null;
+ Token oppositeName = null;
+ Token name = null;
+ Token semi = null;
+ referenceKind = referenceKind();
+ typeWithMulti = typeWithMulti();
+ if (jj_2_45(4)) {
+ hash = jj_consume_token(HASH);
+ oppositeName = jj_consume_token(ID);
+ } else {
+ ;
+ }
+ name = jj_consume_token(ID);
+ semi = jj_consume_token(SEMI);
+ retVal = new Reference(annotations, modifiers, referenceKind, typeWithMulti, createTokenInfo(hash), createTokenInfo(oppositeName), createTokenInfo(name), createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ReferenceKind referenceKind() throws ParseException {
+ Token tok;
+ if (jj_2_46(4)) {
+ tok = jj_consume_token(REFKW);
+ {if (true) return new ReferenceKind (createTokenInfo(tok));}
+ } else if (jj_2_47(4)) {
+ tok = jj_consume_token(VALKW);
+ {if (true) return new ReferenceKind (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Modifiers modifiers() throws ParseException {
+ Modifiers retVal = new Modifiers();
+ OptNegatedModifier optNegatedModifier = null;
+ label_11:
+ while (true) {
+ if (jj_2_48(4)) {
+ ;
+ } else {
+ break label_11;
+ }
+ optNegatedModifier = optNegatedModifier();
+ retVal.addChild(optNegatedModifier);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public OptNegatedModifier optNegatedModifier() throws ParseException {
+ OptNegatedModifier retVal = null;
+ Token bang = null;
+ Modifier modifier = null;
+ if (jj_2_49(4)) {
+ bang = jj_consume_token(BANG);
+ } else {
+ ;
+ }
+ modifier = modifier();
+ retVal = new OptNegatedModifier(createTokenInfo(bang), modifier);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Modifier modifier() throws ParseException {
+ Token tok;
+ if (jj_2_50(4)) {
+ tok = jj_consume_token(READONLYKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_51(4)) {
+ tok = jj_consume_token(VOLATILEKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_52(4)) {
+ tok = jj_consume_token(TRANSIENTKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_53(4)) {
+ tok = jj_consume_token(UNSETTABLEKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_54(4)) {
+ tok = jj_consume_token(DERIVEDKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_55(4)) {
+ tok = jj_consume_token(UNIQUEKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_56(4)) {
+ tok = jj_consume_token(ORDEREDKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_57(4)) {
+ tok = jj_consume_token(RESOLVEKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_58(4)) {
+ tok = jj_consume_token(IDKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public DefaultValueExpr defaultValueExpr() throws ParseException {
+ DefaultValueExpr retVal = null;
+ if (jj_2_59(4)) {
+ retVal = boolExpr();
+ {if (true) return retVal;}
+ } else if (jj_2_60(4)) {
+ retVal = intExpr();
+ {if (true) return retVal;}
+ } else if (jj_2_61(4)) {
+ retVal = stringExpr();
+ {if (true) return retVal;}
+ } else if (jj_2_62(4)) {
+ retVal = charExpr();
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public BoolExpr boolExpr() throws ParseException {
+ BoolExpr retVal = null;
+ TrueOrFalse trueOrFalse = null;
+ trueOrFalse = trueOrFalse();
+ retVal = new BoolExpr(trueOrFalse);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TrueOrFalse trueOrFalse() throws ParseException {
+ Token tok;
+ if (jj_2_63(4)) {
+ tok = jj_consume_token(TRUEKW);
+ {if (true) return new TrueOrFalse (createTokenInfo(tok));}
+ } else if (jj_2_64(4)) {
+ tok = jj_consume_token(FALSEKW);
+ {if (true) return new TrueOrFalse (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public IntExpr intExpr() throws ParseException {
+ IntExpr retVal = null;
+ Token minus = null;
+ Token int_literal = null;
+ if (jj_2_65(4)) {
+ minus = jj_consume_token(MINUS);
+ } else {
+ ;
+ }
+ int_literal = jj_consume_token(INT_LITERAL);
+ retVal = new IntExpr(createTokenInfo(minus), createTokenInfo(int_literal));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public StringExpr stringExpr() throws ParseException {
+ StringExpr retVal = null;
+ Token string_literal = null;
+ string_literal = jj_consume_token(STRING_LITERAL);
+ retVal = new StringExpr(createTokenInfo(string_literal));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public CharExpr charExpr() throws ParseException {
+ CharExpr retVal = null;
+ Token char_literal = null;
+ char_literal = jj_consume_token(CHAR_LITERAL);
+ retVal = new CharExpr(createTokenInfo(char_literal));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Operation operation(Annotations annotations, Modifiers modifiers) throws ParseException {
+ Operation retVal = null;
+ Token op_KW = null;
+ TypeParamsInfo typeParamsInfo = null;
+ ResultType resType = null;
+ Token name = null;
+ Token lparen = null;
+ Params params = null;
+ Token rparen = null;
+ Token throws_KW = null;
+ CommaListBoundExceptWild exceptions = null;
+ Token semi = null;
+ op_KW = jj_consume_token(OPKW);
+ if (jj_2_66(4)) {
+ typeParamsInfo = typeParamsInfo();
+ } else {
+ ;
+ }
+ resType = resultType();
+ name = jj_consume_token(ID);
+ lparen = jj_consume_token(LPAREN);
+ if (jj_2_67(4)) {
+ params = params();
+ } else {
+ ;
+ }
+ rparen = jj_consume_token(RPAREN);
+ if (jj_2_68(4)) {
+ throws_KW = jj_consume_token(THROWSKW);
+ exceptions = commaListBoundExceptWild();
+ } else {
+ ;
+ }
+ semi = jj_consume_token(SEMI);
+ retVal = new Operation(annotations, modifiers, createTokenInfo(op_KW), typeParamsInfo, resType, createTokenInfo(name), createTokenInfo(lparen), params, createTokenInfo(rparen), createTokenInfo(throws_KW), exceptions, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ResultType resultType() throws ParseException {
+ ResultType retVal = null;
+ if (jj_2_69(4)) {
+ retVal = typeWithMulti();
+ {if (true) return retVal;}
+ } else if (jj_2_70(4)) {
+ retVal = voidContainer();
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public VoidContainer voidContainer() throws ParseException {
+ VoidContainer retVal = null;
+ Token void_KW = null;
+ void_KW = jj_consume_token(VOIDKW);
+ retVal = new VoidContainer(createTokenInfo(void_KW));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Params params() throws ParseException {
+ Params retVal = new Params();
+ Param p1 = null;
+ Token comma = null;
+ Param pn = null;
+ p1 = param();
+ retVal.addChild(p1);
+ label_12:
+ while (true) {
+ if (jj_2_71(4)) {
+ ;
+ } else {
+ break label_12;
+ }
+ comma = jj_consume_token(COMMA);
+ pn = param();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(pn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Param param() throws ParseException {
+ Param retVal = null;
+ Annotations leadingAnnotations = null;
+ Modifiers modifiers = null;
+ TypeWithMulti typeWithMulti = null;
+ Token name = null;
+ Annotations trailingAnnotations = null;
+ leadingAnnotations = annotations();
+ modifiers = modifiers();
+ typeWithMulti = typeWithMulti();
+ name = jj_consume_token(ID);
+ trailingAnnotations = annotations();
+ retVal = new Param(leadingAnnotations, modifiers, typeWithMulti, createTokenInfo(name), trailingAnnotations);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public DataTypeDecl dataTypeDecl(Annotations annotations) throws ParseException {
+ DataTypeDecl retVal = null;
+ TransientModifier transientModifier = null;
+ Token datatype_KW = null;
+ Token name = null;
+ Token colon = null;
+ StringLiteralOrQualifiedID instClassName = null;
+ Token semi = null;
+ if (jj_2_72(4)) {
+ transientModifier = transientModifier();
+ } else {
+ ;
+ }
+ datatype_KW = jj_consume_token(DATATYPEKW);
+ name = jj_consume_token(ID);
+ colon = jj_consume_token(COLON);
+ instClassName = stringLiteralOrQualifiedID();
+ semi = jj_consume_token(SEMI);
+ retVal = new DataTypeDecl(annotations, transientModifier, createTokenInfo(datatype_KW), createTokenInfo(name), createTokenInfo(colon), instClassName, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TransientModifier transientModifier() throws ParseException {
+ TransientModifier retVal = null;
+ Token transient_KW = null;
+ transient_KW = jj_consume_token(TRANSIENTKW);
+ retVal = new TransientModifier(createTokenInfo(transient_KW));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public EnumDecl enumDecl(Annotations annotations) throws ParseException {
+ EnumDecl retVal = null;
+ Token enum_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ EnumLiterals enumLiterals = null;
+ Token rcurly = null;
+ enum_KW = jj_consume_token(ENUMKW);
+ name = jj_consume_token(ID);
+ lcurly = jj_consume_token(LCURLY);
+ enumLiterals = enumLiterals();
+ rcurly = jj_consume_token(RCURLY);
+ retVal = new EnumDecl(annotations, createTokenInfo(enum_KW), createTokenInfo(name), createTokenInfo(lcurly), enumLiterals, createTokenInfo(rcurly));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public EnumLiterals enumLiterals() throws ParseException {
+ EnumLiterals retVal = new EnumLiterals();
+ EnumLiteral enumLiteral = null;
+ label_13:
+ while (true) {
+ if (jj_2_73(4)) {
+ ;
+ } else {
+ break label_13;
+ }
+ enumLiteral = enumLiteral();
+ retVal.addChild(enumLiteral);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public EnumLiteral enumLiteral() throws ParseException {
+ EnumLiteral retVal = null;
+ Annotations leadingAnnotations = null;
+ Token name = null;
+ Token equals = null;
+ Token val = null;
+ Annotations trailingAnnotations = null;
+ Token semi = null;
+ leadingAnnotations = annotations();
+ name = jj_consume_token(ID);
+ if (jj_2_74(4)) {
+ equals = jj_consume_token(EQUALS);
+ val = jj_consume_token(INT_LITERAL);
+ } else {
+ ;
+ }
+ trailingAnnotations = annotations();
+ semi = jj_consume_token(SEMI);
+ retVal = new EnumLiteral(leadingAnnotations, createTokenInfo(name), createTokenInfo(equals), createTokenInfo(val), trailingAnnotations, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public MapEntryDecl mapEntryDecl(Annotations annotations) throws ParseException {
+ MapEntryDecl retVal = null;
+ Token mapentry_KW = null;
+ Token name = null;
+ Token colon = null;
+ TypeWithMulti key = null;
+ Token minus_gt = null;
+ TypeWithMulti value = null;
+ Token semi = null;
+ mapentry_KW = jj_consume_token(MAPENTRYKW);
+ name = jj_consume_token(ID);
+ colon = jj_consume_token(COLON);
+ key = typeWithMulti();
+ minus_gt = jj_consume_token(MINUS_GT);
+ value = typeWithMulti();
+ semi = jj_consume_token(SEMI);
+ retVal = new MapEntryDecl(annotations, createTokenInfo(mapentry_KW), createTokenInfo(name), createTokenInfo(colon), key, createTokenInfo(minus_gt), value, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private boolean jj_2_1(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_1(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(0, xla); }
+ }
+
+ final private boolean jj_2_2(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_2(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(1, xla); }
+ }
+
+ final private boolean jj_2_3(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_3(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(2, xla); }
+ }
+
+ final private boolean jj_2_4(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_4(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(3, xla); }
+ }
+
+ final private boolean jj_2_5(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_5(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(4, xla); }
+ }
+
+ final private boolean jj_2_6(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_6(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(5, xla); }
+ }
+
+ final private boolean jj_2_7(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_7(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(6, xla); }
+ }
+
+ final private boolean jj_2_8(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_8(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(7, xla); }
+ }
+
+ final private boolean jj_2_9(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_9(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(8, xla); }
+ }
+
+ final private boolean jj_2_10(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_10(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(9, xla); }
+ }
+
+ final private boolean jj_2_11(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_11(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(10, xla); }
+ }
+
+ final private boolean jj_2_12(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_12(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(11, xla); }
+ }
+
+ final private boolean jj_2_13(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_13(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(12, xla); }
+ }
+
+ final private boolean jj_2_14(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_14(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(13, xla); }
+ }
+
+ final private boolean jj_2_15(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_15(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(14, xla); }
+ }
+
+ final private boolean jj_2_16(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_16(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(15, xla); }
+ }
+
+ final private boolean jj_2_17(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_17(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(16, xla); }
+ }
+
+ final private boolean jj_2_18(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_18(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(17, xla); }
+ }
+
+ final private boolean jj_2_19(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_19(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(18, xla); }
+ }
+
+ final private boolean jj_2_20(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_20(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(19, xla); }
+ }
+
+ final private boolean jj_2_21(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_21(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(20, xla); }
+ }
+
+ final private boolean jj_2_22(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_22(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(21, xla); }
+ }
+
+ final private boolean jj_2_23(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_23(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(22, xla); }
+ }
+
+ final private boolean jj_2_24(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_24(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(23, xla); }
+ }
+
+ final private boolean jj_2_25(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_25(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(24, xla); }
+ }
+
+ final private boolean jj_2_26(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_26(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(25, xla); }
+ }
+
+ final private boolean jj_2_27(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_27(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(26, xla); }
+ }
+
+ final private boolean jj_2_28(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_28(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(27, xla); }
+ }
+
+ final private boolean jj_2_29(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_29(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(28, xla); }
+ }
+
+ final private boolean jj_2_30(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_30(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(29, xla); }
+ }
+
+ final private boolean jj_2_31(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_31(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(30, xla); }
+ }
+
+ final private boolean jj_2_32(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_32(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(31, xla); }
+ }
+
+ final private boolean jj_2_33(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_33(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(32, xla); }
+ }
+
+ final private boolean jj_2_34(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_34(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(33, xla); }
+ }
+
+ final private boolean jj_2_35(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_35(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(34, xla); }
+ }
+
+ final private boolean jj_2_36(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_36(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(35, xla); }
+ }
+
+ final private boolean jj_2_37(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_37(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(36, xla); }
+ }
+
+ final private boolean jj_2_38(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_38(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(37, xla); }
+ }
+
+ final private boolean jj_2_39(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_39(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(38, xla); }
+ }
+
+ final private boolean jj_2_40(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_40(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(39, xla); }
+ }
+
+ final private boolean jj_2_41(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_41(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(40, xla); }
+ }
+
+ final private boolean jj_2_42(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_42(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(41, xla); }
+ }
+
+ final private boolean jj_2_43(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_43(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(42, xla); }
+ }
+
+ final private boolean jj_2_44(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_44(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(43, xla); }
+ }
+
+ final private boolean jj_2_45(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_45(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(44, xla); }
+ }
+
+ final private boolean jj_2_46(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_46(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(45, xla); }
+ }
+
+ final private boolean jj_2_47(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_47(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(46, xla); }
+ }
+
+ final private boolean jj_2_48(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_48(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(47, xla); }
+ }
+
+ final private boolean jj_2_49(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_49(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(48, xla); }
+ }
+
+ final private boolean jj_2_50(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_50(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(49, xla); }
+ }
+
+ final private boolean jj_2_51(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_51(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(50, xla); }
+ }
+
+ final private boolean jj_2_52(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_52(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(51, xla); }
+ }
+
+ final private boolean jj_2_53(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_53(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(52, xla); }
+ }
+
+ final private boolean jj_2_54(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_54(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(53, xla); }
+ }
+
+ final private boolean jj_2_55(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_55(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(54, xla); }
+ }
+
+ final private boolean jj_2_56(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_56(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(55, xla); }
+ }
+
+ final private boolean jj_2_57(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_57(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(56, xla); }
+ }
+
+ final private boolean jj_2_58(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_58(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(57, xla); }
+ }
+
+ final private boolean jj_2_59(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_59(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(58, xla); }
+ }
+
+ final private boolean jj_2_60(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_60(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(59, xla); }
+ }
+
+ final private boolean jj_2_61(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_61(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(60, xla); }
+ }
+
+ final private boolean jj_2_62(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_62(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(61, xla); }
+ }
+
+ final private boolean jj_2_63(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_63(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(62, xla); }
+ }
+
+ final private boolean jj_2_64(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_64(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(63, xla); }
+ }
+
+ final private boolean jj_2_65(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_65(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(64, xla); }
+ }
+
+ final private boolean jj_2_66(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_66(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(65, xla); }
+ }
+
+ final private boolean jj_2_67(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_67(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(66, xla); }
+ }
+
+ final private boolean jj_2_68(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_68(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(67, xla); }
+ }
+
+ final private boolean jj_2_69(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_69(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(68, xla); }
+ }
+
+ final private boolean jj_2_70(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_70(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(69, xla); }
+ }
+
+ final private boolean jj_2_71(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_71(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(70, xla); }
+ }
+
+ final private boolean jj_2_72(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_72(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(71, xla); }
+ }
+
+ final private boolean jj_2_73(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_73(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(72, xla); }
+ }
+
+ final private boolean jj_2_74(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_74(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(73, xla); }
+ }
+
+ final private boolean jj_3_65() {
+ if (jj_scan_token(MINUS)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_46() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_65()) jj_scanpos = xsp;
+ if (jj_scan_token(INT_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_25() {
+ if (jj_scan_token(AMP)) return true;
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_15() {
+ if (jj_scan_token(STRING_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_17() {
+ if (jj_3R_27()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_64() {
+ if (jj_3R_29()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_25()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_5() {
+ if (jj_3R_16()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_64() {
+ if (jj_scan_token(FALSEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_69() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_63()) {
+ jj_scanpos = xsp;
+ if (jj_3_64()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_4() {
+ if (jj_3R_15()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_24() {
+ if (jj_3R_31()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_45() {
+ if (jj_scan_token(HASH)) return true;
+ if (jj_scan_token(ID)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_63() {
+ if (jj_scan_token(TRUEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_56() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_4()) {
+ jj_scanpos = xsp;
+ if (jj_3_5()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_3() {
+ if (jj_scan_token(DOLLAR)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_45() {
+ if (jj_3R_69()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_31() {
+ if (jj_scan_token(EXTENDSKW)) return true;
+ if (jj_3R_64()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_14() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_2()) {
+ jj_scanpos = xsp;
+ if (jj_3_3()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_2() {
+ if (jj_scan_token(DOT)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_74() {
+ if (jj_scan_token(EQUALS)) return true;
+ if (jj_scan_token(INT_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_1() {
+ if (jj_3R_14()) return true;
+ if (jj_scan_token(ID)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_68() {
+ if (jj_scan_token(THROWSKW)) return true;
+ if (jj_3R_28()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_62() {
+ if (jj_3R_48()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_55() {
+ if (jj_scan_token(ID)) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_1()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_61() {
+ if (jj_3R_47()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_60() {
+ if (jj_3R_46()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_59() {
+ if (jj_3R_45()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_40() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_59()) {
+ jj_scanpos = xsp;
+ if (jj_3_60()) {
+ jj_scanpos = xsp;
+ if (jj_3_61()) {
+ jj_scanpos = xsp;
+ if (jj_3_62()) return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_30() {
+ if (jj_scan_token(ID)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_24()) jj_scanpos = xsp;
+ return false;
+ }
+
+ final private boolean jj_3_23() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_30()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_58() {
+ if (jj_scan_token(IDKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_63() {
+ if (jj_3R_30()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_23()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_57() {
+ if (jj_scan_token(RESOLVEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_56() {
+ if (jj_scan_token(ORDEREDKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_55() {
+ if (jj_scan_token(UNIQUEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_54() {
+ if (jj_scan_token(DERIVEDKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_53() {
+ if (jj_scan_token(UNSETTABLEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_52() {
+ if (jj_scan_token(TRANSIENTKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_51() {
+ if (jj_scan_token(VOLATILEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_68() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_50()) {
+ jj_scanpos = xsp;
+ if (jj_3_51()) {
+ jj_scanpos = xsp;
+ if (jj_3_52()) {
+ jj_scanpos = xsp;
+ if (jj_3_53()) {
+ jj_scanpos = xsp;
+ if (jj_3_54()) {
+ jj_scanpos = xsp;
+ if (jj_3_55()) {
+ jj_scanpos = xsp;
+ if (jj_3_56()) {
+ jj_scanpos = xsp;
+ if (jj_3_57()) {
+ jj_scanpos = xsp;
+ if (jj_3_58()) return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_50() {
+ if (jj_scan_token(READONLYKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_27() {
+ if (jj_scan_token(LT)) return true;
+ if (jj_3R_63()) return true;
+ if (jj_scan_token(GT)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_49() {
+ if (jj_scan_token(BANG)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_25() {
+ if (jj_scan_token(MAPENTRYKW)) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(COLON)) return true;
+ if (jj_3R_50()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_44() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_49()) jj_scanpos = xsp;
+ if (jj_3R_68()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_22() {
+ if (jj_scan_token(INTERFACEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_48() {
+ if (jj_3R_44()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_60() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_21()) {
+ jj_scanpos = xsp;
+ if (jj_3_22()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_21() {
+ if (jj_scan_token(CLASSKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_65() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_48()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_40() {
+ if (jj_scan_token(DOT_DOT)) return true;
+ if (jj_3R_43()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_67() {
+ if (jj_3R_49()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_47() {
+ if (jj_scan_token(VALKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_66() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_46()) {
+ jj_scanpos = xsp;
+ if (jj_3_47()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_46() {
+ if (jj_scan_token(REFKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_26() {
+ if (jj_scan_token(ABSTRACTKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_54() {
+ if (jj_3R_58()) return true;
+ if (jj_scan_token(ID)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_74()) jj_scanpos = xsp;
+ if (jj_3R_58()) return true;
+ if (jj_scan_token(SEMI)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_20() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_37() {
+ if (jj_scan_token(EQUALS)) return true;
+ if (jj_3R_40()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_28() {
+ if (jj_3R_29()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_20()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_38() {
+ if (jj_3R_66()) return true;
+ if (jj_3R_50()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_45()) jj_scanpos = xsp;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(SEMI)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_73() {
+ if (jj_3R_54()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_62() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_73()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_16() {
+ if (jj_3R_26()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_22() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_16()) jj_scanpos = xsp;
+ if (jj_3R_60()) return true;
+ if (jj_scan_token(ID)) return true;
+ xsp = jj_scanpos;
+ if (jj_3_17()) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_3_18()) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_3_19()) jj_scanpos = xsp;
+ if (jj_scan_token(LCURLY)) return true;
+ if (jj_3R_61()) return true;
+ if (jj_scan_token(RCURLY)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_44() {
+ if (jj_scan_token(INT_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_43() {
+ if (jj_scan_token(QMARK)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_24() {
+ if (jj_scan_token(ENUMKW)) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(LCURLY)) return true;
+ if (jj_3R_62()) return true;
+ if (jj_scan_token(RCURLY)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_42() {
+ if (jj_scan_token(PLUS)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_43() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_41()) {
+ jj_scanpos = xsp;
+ if (jj_3_42()) {
+ jj_scanpos = xsp;
+ if (jj_3_43()) {
+ jj_scanpos = xsp;
+ if (jj_3_44()) return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_39() {
+ if (jj_3R_42()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_41() {
+ if (jj_scan_token(STAR)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_38() {
+ if (jj_3R_41()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_42() {
+ if (jj_3R_43()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_40()) jj_scanpos = xsp;
+ return false;
+ }
+
+ final private boolean jj_3_19() {
+ if (jj_scan_token(COLON)) return true;
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_53() {
+ if (jj_scan_token(TRANSIENTKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_21() {
+ if (jj_scan_token(PACKAGEKW)) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(LCURLY)) return true;
+ if (jj_3R_59()) return true;
+ if (jj_scan_token(RCURLY)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_72() {
+ if (jj_3R_53()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_41() {
+ if (jj_scan_token(LSQUARE)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_39()) jj_scanpos = xsp;
+ if (jj_scan_token(RSQUARE)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_23() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_72()) jj_scanpos = xsp;
+ if (jj_scan_token(DATATYPEKW)) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(COLON)) return true;
+ if (jj_3R_56()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_9() {
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(EQUALS)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_15() {
+ if (jj_3R_25()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_14() {
+ if (jj_3R_24()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_13() {
+ if (jj_3R_23()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_12() {
+ if (jj_3R_22()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_11() {
+ if (jj_3R_21()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_50() {
+ if (jj_3R_29()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_38()) jj_scanpos = xsp;
+ return false;
+ }
+
+ final private boolean jj_3R_20() {
+ if (jj_3R_58()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_11()) {
+ jj_scanpos = xsp;
+ if (jj_3_12()) {
+ jj_scanpos = xsp;
+ if (jj_3_13()) {
+ jj_scanpos = xsp;
+ if (jj_3_14()) {
+ jj_scanpos = xsp;
+ if (jj_3_15()) return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_10() {
+ if (jj_3R_20()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_52() {
+ if (jj_3R_58()) return true;
+ if (jj_3R_65()) return true;
+ if (jj_3R_50()) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_3R_58()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_59() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_10()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_37() {
+ if (jj_scan_token(ATTRKW)) return true;
+ if (jj_3R_50()) return true;
+ if (jj_scan_token(ID)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_37()) jj_scanpos = xsp;
+ if (jj_scan_token(SEMI)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_71() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_52()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_49() {
+ if (jj_3R_52()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_71()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_19() {
+ if (jj_scan_token(IMPORTKW)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_9()) jj_scanpos = xsp;
+ if (jj_3R_56()) return true;
+ if (jj_scan_token(SEMI)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_36() {
+ if (jj_3R_39()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_35() {
+ if (jj_3R_38()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_34() {
+ if (jj_3R_37()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_8() {
+ if (jj_3R_19()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_51() {
+ if (jj_scan_token(VOIDKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_36() {
+ if (jj_3R_58()) return true;
+ if (jj_3R_65()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_34()) {
+ jj_scanpos = xsp;
+ if (jj_3_35()) {
+ jj_scanpos = xsp;
+ if (jj_3_36()) return true;
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_66() {
+ if (jj_3R_27()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_26() {
+ if (jj_scan_token(LT)) return true;
+ if (jj_3R_32()) return true;
+ if (jj_scan_token(GT)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_33() {
+ if (jj_3R_36()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_70() {
+ if (jj_3R_51()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_69() {
+ if (jj_3R_50()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_61() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_33()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_30() {
+ if (jj_3R_35()) return true;
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_67() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_69()) {
+ jj_scanpos = xsp;
+ if (jj_3_70()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_18() {
+ if (jj_3R_56()) return true;
+ if (jj_scan_token(EQUALS)) return true;
+ if (jj_3R_56()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_32() {
+ if (jj_scan_token(SUPERKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_35() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_31()) {
+ jj_scanpos = xsp;
+ if (jj_3_32()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_7() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_18()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_31() {
+ if (jj_scan_token(EXTENDSKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_57() {
+ if (jj_3R_18()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_39() {
+ if (jj_scan_token(OPKW)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_66()) jj_scanpos = xsp;
+ if (jj_3R_67()) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(LPAREN)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_18() {
+ if (jj_scan_token(EXTENDSKW)) return true;
+ if (jj_3R_28()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_34() {
+ if (jj_scan_token(QMARK)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_30()) jj_scanpos = xsp;
+ return false;
+ }
+
+ final private boolean jj_3R_17() {
+ if (jj_scan_token(AT)) return true;
+ if (jj_3R_56()) return true;
+ if (jj_scan_token(LPAREN)) return true;
+ if (jj_3R_57()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_29() {
+ if (jj_3R_34()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_28() {
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_33() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_28()) {
+ jj_scanpos = xsp;
+ if (jj_3_29()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_6() {
+ if (jj_3R_17()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_27() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_33()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_48() {
+ if (jj_scan_token(CHAR_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_58() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_6()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_32() {
+ if (jj_3R_33()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_27()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_47() {
+ if (jj_scan_token(STRING_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_16() {
+ if (jj_3R_55()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_29() {
+ if (jj_3R_55()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_26()) jj_scanpos = xsp;
+ return false;
+ }
+
+ public EmfaticParserTokenManager token_source;
+ SimpleCharStream jj_input_stream;
+ public Token token, jj_nt;
+ private int jj_ntk;
+ private Token jj_scanpos, jj_lastpos;
+ private int jj_la;
+ public boolean lookingAhead = false;
+ private boolean jj_semLA;
+ private int jj_gen;
+ final private int[] jj_la1 = new int[0];
+ static private int[] jj_la1_0;
+ static private int[] jj_la1_1;
+ static private int[] jj_la1_2;
+ static {
+ jj_la1_0();
+ jj_la1_1();
+ jj_la1_2();
+ }
+ private static void jj_la1_0() {
+ jj_la1_0 = new int[] {};
+ }
+ private static void jj_la1_1() {
+ jj_la1_1 = new int[] {};
+ }
+ private static void jj_la1_2() {
+ jj_la1_2 = new int[] {};
+ }
+ final private JJCalls[] jj_2_rtns = new JJCalls[74];
+ private boolean jj_rescan = false;
+ private int jj_gc = 0;
+
+ public EmfaticParser(java.io.InputStream stream) {
+ this(stream, null);
+ }
+ public EmfaticParser(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source = new EmfaticParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public void ReInit(java.io.InputStream stream) {
+ ReInit(stream, null);
+ }
+ public void ReInit(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public EmfaticParser(java.io.Reader stream) {
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);
+ token_source = new EmfaticParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public void ReInit(java.io.Reader stream) {
+ jj_input_stream.ReInit(stream, 1, 1);
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public EmfaticParser(EmfaticParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public void ReInit(EmfaticParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ final private Token jj_consume_token(int kind) throws ParseException {
+ Token oldToken;
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ if (token.kind == kind) {
+ jj_gen++;
+ if (++jj_gc > 100) {
+ jj_gc = 0;
+ for (int i = 0; i < jj_2_rtns.length; i++) {
+ JJCalls c = jj_2_rtns[i];
+ while (c != null) {
+ if (c.gen < jj_gen) c.first = null;
+ c = c.next;
+ }
+ }
+ }
+ return token;
+ }
+ token = oldToken;
+ jj_kind = kind;
+ throw generateParseException();
+ }
+
+ static private final class LookaheadSuccess extends java.lang.Error { }
+ final private LookaheadSuccess jj_ls = new LookaheadSuccess();
+ final private boolean jj_scan_token(int kind) {
+ if (jj_scanpos == jj_lastpos) {
+ jj_la--;
+ if (jj_scanpos.next == null) {
+ jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
+ } else {
+ jj_lastpos = jj_scanpos = jj_scanpos.next;
+ }
+ } else {
+ jj_scanpos = jj_scanpos.next;
+ }
+ if (jj_rescan) {
+ int i = 0; Token tok = token;
+ while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
+ if (tok != null) jj_add_error_token(kind, i);
+ }
+ if (jj_scanpos.kind != kind) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
+ return false;
+ }
+
+ final public Token getNextToken() {
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ jj_gen++;
+ return token;
+ }
+
+ final public Token getToken(int index) {
+ Token t = lookingAhead ? jj_scanpos : token;
+ for (int i = 0; i < index; i++) {
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
+ }
+ return t;
+ }
+
+ final private int jj_ntk() {
+ if ((jj_nt=token.next) == null)
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+ else
+ return (jj_ntk = jj_nt.kind);
+ }
+
+ private java.util.Vector<int[]> jj_expentries = new java.util.Vector<int[]>();
+ private int[] jj_expentry;
+ private int jj_kind = -1;
+ private int[] jj_lasttokens = new int[100];
+ private int jj_endpos;
+
+ private void jj_add_error_token(int kind, int pos) {
+ if (pos >= 100) return;
+ if (pos == jj_endpos + 1) {
+ jj_lasttokens[jj_endpos++] = kind;
+ } else if (jj_endpos != 0) {
+ jj_expentry = new int[jj_endpos];
+ for (int i = 0; i < jj_endpos; i++) {
+ jj_expentry[i] = jj_lasttokens[i];
+ }
+ boolean exists = false;
+ for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
+ int[] oldentry = (int[])(e.nextElement());
+ if (oldentry.length == jj_expentry.length) {
+ exists = true;
+ for (int i = 0; i < jj_expentry.length; i++) {
+ if (oldentry[i] != jj_expentry[i]) {
+ exists = false;
+ break;
+ }
+ }
+ if (exists) break;
+ }
+ }
+ if (!exists) jj_expentries.addElement(jj_expentry);
+ if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
+ }
+ }
+
+ public ParseException generateParseException() {
+ jj_expentries.removeAllElements();
+ boolean[] la1tokens = new boolean[72];
+ for (int i = 0; i < 72; i++) {
+ la1tokens[i] = false;
+ }
+ if (jj_kind >= 0) {
+ la1tokens[jj_kind] = true;
+ jj_kind = -1;
+ }
+ for (int i = 0; i < 0; i++) {
+ if (jj_la1[i] == jj_gen) {
+ for (int j = 0; j < 32; j++) {
+ if ((jj_la1_0[i] & (1<<j)) != 0) {
+ la1tokens[j] = true;
+ }
+ if ((jj_la1_1[i] & (1<<j)) != 0) {
+ la1tokens[32+j] = true;
+ }
+ if ((jj_la1_2[i] & (1<<j)) != 0) {
+ la1tokens[64+j] = true;
+ }
+ }
+ }
+ }
+ for (int i = 0; i < 72; i++) {
+ if (la1tokens[i]) {
+ jj_expentry = new int[1];
+ jj_expentry[0] = i;
+ jj_expentries.addElement(jj_expentry);
+ }
+ }
+ jj_endpos = 0;
+ jj_rescan_token();
+ jj_add_error_token(0, 0);
+ int[][] exptokseq = new int[jj_expentries.size()][];
+ for (int i = 0; i < jj_expentries.size(); i++) {
+ exptokseq[i] = (int[])jj_expentries.elementAt(i);
+ }
+ return new ParseException(token, exptokseq, tokenImage);
+ }
+
+ final public void enable_tracing() {
+ }
+
+ final public void disable_tracing() {
+ }
+
+ final private void jj_rescan_token() {
+ jj_rescan = true;
+ for (int i = 0; i < 74; i++) {
+ try {
+ JJCalls p = jj_2_rtns[i];
+ do {
+ if (p.gen > jj_gen) {
+ jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
+ switch (i) {
+ case 0: jj_3_1(); break;
+ case 1: jj_3_2(); break;
+ case 2: jj_3_3(); break;
+ case 3: jj_3_4(); break;
+ case 4: jj_3_5(); break;
+ case 5: jj_3_6(); break;
+ case 6: jj_3_7(); break;
+ case 7: jj_3_8(); break;
+ case 8: jj_3_9(); break;
+ case 9: jj_3_10(); break;
+ case 10: jj_3_11(); break;
+ case 11: jj_3_12(); break;
+ case 12: jj_3_13(); break;
+ case 13: jj_3_14(); break;
+ case 14: jj_3_15(); break;
+ case 15: jj_3_16(); break;
+ case 16: jj_3_17(); break;
+ case 17: jj_3_18(); break;
+ case 18: jj_3_19(); break;
+ case 19: jj_3_20(); break;
+ case 20: jj_3_21(); break;
+ case 21: jj_3_22(); break;
+ case 22: jj_3_23(); break;
+ case 23: jj_3_24(); break;
+ case 24: jj_3_25(); break;
+ case 25: jj_3_26(); break;
+ case 26: jj_3_27(); break;
+ case 27: jj_3_28(); break;
+ case 28: jj_3_29(); break;
+ case 29: jj_3_30(); break;
+ case 30: jj_3_31(); break;
+ case 31: jj_3_32(); break;
+ case 32: jj_3_33(); break;
+ case 33: jj_3_34(); break;
+ case 34: jj_3_35(); break;
+ case 35: jj_3_36(); break;
+ case 36: jj_3_37(); break;
+ case 37: jj_3_38(); break;
+ case 38: jj_3_39(); break;
+ case 39: jj_3_40(); break;
+ case 40: jj_3_41(); break;
+ case 41: jj_3_42(); break;
+ case 42: jj_3_43(); break;
+ case 43: jj_3_44(); break;
+ case 44: jj_3_45(); break;
+ case 45: jj_3_46(); break;
+ case 46: jj_3_47(); break;
+ case 47: jj_3_48(); break;
+ case 48: jj_3_49(); break;
+ case 49: jj_3_50(); break;
+ case 50: jj_3_51(); break;
+ case 51: jj_3_52(); break;
+ case 52: jj_3_53(); break;
+ case 53: jj_3_54(); break;
+ case 54: jj_3_55(); break;
+ case 55: jj_3_56(); break;
+ case 56: jj_3_57(); break;
+ case 57: jj_3_58(); break;
+ case 58: jj_3_59(); break;
+ case 59: jj_3_60(); break;
+ case 60: jj_3_61(); break;
+ case 61: jj_3_62(); break;
+ case 62: jj_3_63(); break;
+ case 63: jj_3_64(); break;
+ case 64: jj_3_65(); break;
+ case 65: jj_3_66(); break;
+ case 66: jj_3_67(); break;
+ case 67: jj_3_68(); break;
+ case 68: jj_3_69(); break;
+ case 69: jj_3_70(); break;
+ case 70: jj_3_71(); break;
+ case 71: jj_3_72(); break;
+ case 72: jj_3_73(); break;
+ case 73: jj_3_74(); break;
+ }
+ }
+ p = p.next;
+ } while (p != null);
+ } catch(LookaheadSuccess ls) { }
+ }
+ jj_rescan = false;
+ }
+
+ final private void jj_save(int index, int xla) {
+ JJCalls p = jj_2_rtns[index];
+ while (p.gen > jj_gen) {
+ if (p.next == null) { p = p.next = new JJCalls(); break; }
+ p = p.next;
+ }
+ p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
+ }
+
+ static final class JJCalls {
+ int gen;
+ Token first;
+ int arg;
+ JJCalls next;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParserConstants.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParserConstants.java
new file mode 100644
index 0000000..da8ee99
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParserConstants.java
@@ -0,0 +1,154 @@
+/* Generated By:JavaCC: Do not edit this line. EmfaticParserConstants.java */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public interface EmfaticParserConstants {
+
+ int EOF = 0;
+ int SINGLELINECOMMENT = 1;
+ int WS = 2;
+ int PACKAGEKW = 6;
+ int CLASSKW = 7;
+ int IMPORTKW = 8;
+ int ABSTRACTKW = 9;
+ int INTERFACEKW = 10;
+ int EXTENDSKW = 11;
+ int SUPERKW = 12;
+ int ATTRKW = 13;
+ int REFKW = 14;
+ int VALKW = 15;
+ int READONLYKW = 16;
+ int VOLATILEKW = 17;
+ int TRANSIENTKW = 18;
+ int UNSETTABLEKW = 19;
+ int DERIVEDKW = 20;
+ int UNIQUEKW = 21;
+ int ORDEREDKW = 22;
+ int RESOLVEKW = 23;
+ int IDKW = 24;
+ int TRUEKW = 25;
+ int FALSEKW = 26;
+ int OPKW = 27;
+ int VOIDKW = 28;
+ int DATATYPEKW = 29;
+ int ENUMKW = 30;
+ int MAPENTRYKW = 31;
+ int THROWSKW = 32;
+ int DOUBLESLASH = 33;
+ int DOUBLEQUOTE = 34;
+ int SINGLEQUOTE = 35;
+ int BACKSLASH = 36;
+ int LCURLY = 37;
+ int RCURLY = 38;
+ int LSQUARE = 39;
+ int RSQUARE = 40;
+ int LPAREN = 41;
+ int RPAREN = 42;
+ int DOT = 43;
+ int COMMA = 44;
+ int COLON = 45;
+ int SEMI = 46;
+ int STAR = 47;
+ int PLUS = 48;
+ int MINUS = 49;
+ int EQUALS = 50;
+ int QMARK = 51;
+ int BANG = 52;
+ int DOLLAR = 53;
+ int HASH = 54;
+ int AT = 55;
+ int DOT_DOT = 56;
+ int MINUS_GT = 57;
+ int GT_LT = 58;
+ int LT_GT = 59;
+ int AMP = 60;
+ int LT = 61;
+ int GT = 62;
+ int STRING_LITERAL = 63;
+ int CHAR_LITERAL = 64;
+ int LETTERORUNDERSCORE = 65;
+ int LETTERORUNDERSCOREORDIGIT = 66;
+ int INT_LITERAL = 67;
+ int DIGIT = 68;
+ int ESC = 69;
+ int DIGITDIGITDIGIT = 70;
+ int ID = 71;
+
+ int DEFAULT = 0;
+ int WithinComment = 1;
+
+ String[] tokenImage = {
+ "<EOF>",
+ "<SINGLELINECOMMENT>",
+ "<WS>",
+ "\"/*\"",
+ "\"*/\"",
+ "<token of kind 5>",
+ "\"package\"",
+ "\"class\"",
+ "\"import\"",
+ "\"abstract\"",
+ "\"interface\"",
+ "\"extends\"",
+ "\"super\"",
+ "\"attr\"",
+ "\"ref\"",
+ "\"val\"",
+ "\"readonly\"",
+ "\"volatile\"",
+ "\"transient\"",
+ "\"unsettable\"",
+ "\"derived\"",
+ "\"unique\"",
+ "\"ordered\"",
+ "\"resolve\"",
+ "\"id\"",
+ "\"true\"",
+ "\"false\"",
+ "\"op\"",
+ "\"void\"",
+ "\"datatype\"",
+ "\"enum\"",
+ "\"mapentry\"",
+ "\"throws\"",
+ "\"//\"",
+ "\"\\\"\"",
+ "\"\\\'\"",
+ "\"\\\\\"",
+ "\"{\"",
+ "\"}\"",
+ "\"[\"",
+ "\"]\"",
+ "\"(\"",
+ "\")\"",
+ "\".\"",
+ "\",\"",
+ "\":\"",
+ "\";\"",
+ "\"*\"",
+ "\"+\"",
+ "\"-\"",
+ "\"=\"",
+ "\"?\"",
+ "\"!\"",
+ "\"$\"",
+ "\"#\"",
+ "\"@\"",
+ "\"..\"",
+ "\"->\"",
+ "\"><\"",
+ "\"<>\"",
+ "\"&\"",
+ "\"<\"",
+ "\">\"",
+ "<STRING_LITERAL>",
+ "<CHAR_LITERAL>",
+ "<LETTERORUNDERSCORE>",
+ "<LETTERORUNDERSCOREORDIGIT>",
+ "<INT_LITERAL>",
+ "<DIGIT>",
+ "<ESC>",
+ "<DIGITDIGITDIGIT>",
+ "<ID>",
+ };
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParserDriver.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParserDriver.java
new file mode 100644
index 0000000..bdefb25
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParserDriver.java
@@ -0,0 +1,141 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.emfatic.core.generator.ecore.Builder;
+import org.eclipse.emf.emfatic.core.generator.ecore.Connector;
+import org.eclipse.emf.emfatic.core.generator.ecore.EmfaticSemanticWarning;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.parser.IParser;
+import org.eclipse.gymnast.runtime.core.parser.ParseContext;
+import org.eclipse.gymnast.runtime.core.parser.ParseError;
+import org.eclipse.gymnast.runtime.core.parser.ParseMessage;
+
+public class EmfaticParserDriver implements IParser {
+
+ public ParseContext parse(Reader input) {
+
+ ExtSimpleCharStream stream = new ExtSimpleCharStream(input);
+ ExtEmfaticParserTokenManager tokenManager = new ExtEmfaticParserTokenManager(stream);
+ EmfaticParser parser = new EmfaticParser(tokenManager);
+ ParseContext parseContext = new ParseContext();
+ CompUnit compUnit = parseCompUnit(parser, parseContext);
+ if (compUnit != null) {
+ EPackage rootPackage = addErrorsFromAST(parseContext);
+ // for consumption by change listeners (notified by the editor)
+ compUnit.setAST(rootPackage);
+ }
+
+ if (parseContext.getMessageCount() == 0) {
+ System.out.println("Parse OK!");
+ }
+ else {
+ ParseMessage[] msgs = parseContext.getMessages();
+ for (int i = 0; i < msgs.length; i++) {
+ // System.err.println(msgs[i].getMessage());
+ }
+ }
+
+ return parseContext;
+ }
+
+ private EPackage addErrorsFromAST(ParseContext parseContext) {
+ EPackage rootPackage = null;
+ // warnigns and errors computed not from the CST but from the AST
+ Builder builder = new Builder();
+ NullProgressMonitor npm = new NullProgressMonitor();
+ ResourceSet resourceSet = new ResourceSetImpl();
+ URI uri = URI.createPlatformResourceURI("dummy");
+ Resource resource = resourceSet.createResource(uri);
+ try {
+ builder.build(parseContext, resource, npm);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (!parseContext.hasErrors()) {
+ Connector connector = new Connector(builder);
+ connector.connect(parseContext, resource, npm);
+ rootPackage = (EPackage) resource.getContents().get(0);
+ if (rootPackage != null) {
+ // invoke EcoreValidator
+ Diagnostician diagnostician = new Diagnostician();
+ final Diagnostic diagnostic = diagnostician.validate(rootPackage);
+ if (diagnostic.getSeverity() == Diagnostic.OK) {
+ return rootPackage;
+ }
+ /*
+ * A tutorial on markers:
+ *
+ * http://www.eclipse.org/articles/Article-Mark%20My%20Words/mark-my-words.html
+ *
+ */
+
+ CompUnit compUnit = (CompUnit) parseContext.getParseRoot();
+ for (Diagnostic childDiagnostic : diagnostic.getChildren()) {
+ Set<ASTNode> problemNodes = new HashSet<ASTNode>();
+ String dMsg = childDiagnostic.getMessage();
+ if (childDiagnostic.getData().size() > 0) {
+ Object primarySourceOfProblem = childDiagnostic.getData().get(0);
+ if (primarySourceOfProblem != null && primarySourceOfProblem instanceof EObject) {
+ Set<ASTNode> cstUses = compUnit.getEcoreDecl2CstUse().get((EObject) primarySourceOfProblem);
+ problemNodes.addAll(cstUses);
+ if (problemNodes.size() == 0) {
+ problemNodes.add(compUnit.getPackageDecl());
+ }
+ }
+ }
+ for (ASTNode problemNode : problemNodes) {
+ ParseMessage pMsg = new EmfaticSemanticWarning.EcoreValidatorDiagnostic(problemNode, dMsg);
+ parseContext.addParseMessage(pMsg);
+ }
+ }
+ }
+ }
+ return rootPackage;
+ }
+
+ private CompUnit parseCompUnit(EmfaticParser parser, ParseContext parseContext) {
+ try {
+ CompUnit compUnit = parser.compUnit();
+ parseContext.setParseRoot(compUnit);
+ return compUnit;
+ } catch (ParseException ex) {
+ ParseError parseError;
+ Token token = ex.currentToken;
+ if (token instanceof ExtToken) {
+ ExtToken extToken = (ExtToken) token;
+ int offset = extToken.tokenOffset;
+ String tokenText = token.image;
+ int length = (tokenText == null) ? 0 : tokenText.length();
+ parseError = new ParseError(ex.getMessage(), offset, length);
+ }
+ else {
+ parseError = new ParseError(ex.getMessage(), 1);
+ }
+ parseContext.addParseMessage(parseError);
+ }
+ catch (TokenMgrError ex) {
+ ParseError parseError = new ParseError(ex.getMessage(), 1);
+ parseContext.addParseMessage(parseError);
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParserTokenManager.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParserTokenManager.java
new file mode 100644
index 0000000..e2c3893
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/EmfaticParserTokenManager.java
@@ -0,0 +1,1057 @@
+/* Generated By:JavaCC: Do not edit this line. EmfaticParserTokenManager.java */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.*;
+import org.eclipse.gymnast.runtime.core.ast.*;
+
+public class EmfaticParserTokenManager implements EmfaticParserConstants
+{
+ public java.io.PrintStream debugStream = System.out;
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private final int jjStopStringLiteralDfa_0(int pos, long active0)
+{
+ switch (pos)
+ {
+ case 0:
+ if ((active0 & 0x8L) != 0L)
+ return 0;
+ if ((active0 & 0x1ffffffc0L) != 0L)
+ {
+ jjmatchedKind = 71;
+ return 26;
+ }
+ return -1;
+ case 1:
+ if ((active0 & 0x9000000L) != 0L)
+ return 26;
+ if ((active0 & 0x1f6ffffc0L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 1;
+ return 26;
+ }
+ return -1;
+ case 2:
+ if ((active0 & 0xc000L) != 0L)
+ return 26;
+ if ((active0 & 0x1f6ff3fc0L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 2;
+ return 26;
+ }
+ return -1;
+ case 3:
+ if ((active0 & 0x52002000L) != 0L)
+ return 26;
+ if ((active0 & 0x1a4ff1fc0L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 3;
+ return 26;
+ }
+ return -1;
+ case 4:
+ if ((active0 & 0x4001080L) != 0L)
+ return 26;
+ if ((active0 & 0x1a0ff0f40L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 4;
+ return 26;
+ }
+ return -1;
+ case 5:
+ if ((active0 & 0x100200100L) != 0L)
+ return 26;
+ if ((active0 & 0xa0df0e40L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 5;
+ return 26;
+ }
+ return -1;
+ case 6:
+ if ((active0 & 0xa00f0600L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 6;
+ return 26;
+ }
+ if ((active0 & 0xd00840L) != 0L)
+ return 26;
+ return -1;
+ case 7:
+ if ((active0 & 0xa0030200L) != 0L)
+ return 26;
+ if ((active0 & 0xc0400L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 7;
+ return 26;
+ }
+ return -1;
+ case 8:
+ if ((active0 & 0x40400L) != 0L)
+ return 26;
+ if ((active0 & 0x80000L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 8;
+ return 26;
+ }
+ return -1;
+ default :
+ return -1;
+ }
+}
+private final int jjStartNfa_0(int pos, long active0)
+{
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
+}
+private final int jjStopAtPos(int pos, int kind)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ return pos + 1;
+}
+private final int jjStartNfaWithStates_0(int pos, int kind, int state)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return pos + 1; }
+ return jjMoveNfa_0(state, pos + 1);
+}
+private final int jjMoveStringLiteralDfa0_0()
+{
+ switch(curChar)
+ {
+ case 33:
+ return jjStopAtPos(0, 52);
+ case 35:
+ return jjStopAtPos(0, 54);
+ case 36:
+ return jjStopAtPos(0, 53);
+ case 38:
+ return jjStopAtPos(0, 60);
+ case 40:
+ return jjStopAtPos(0, 41);
+ case 41:
+ return jjStopAtPos(0, 42);
+ case 42:
+ return jjStopAtPos(0, 47);
+ case 43:
+ return jjStopAtPos(0, 48);
+ case 44:
+ return jjStopAtPos(0, 44);
+ case 45:
+ jjmatchedKind = 49;
+ return jjMoveStringLiteralDfa1_0(0x200000000000000L);
+ case 46:
+ jjmatchedKind = 43;
+ return jjMoveStringLiteralDfa1_0(0x100000000000000L);
+ case 47:
+ return jjMoveStringLiteralDfa1_0(0x8L);
+ case 58:
+ return jjStopAtPos(0, 45);
+ case 59:
+ return jjStopAtPos(0, 46);
+ case 60:
+ jjmatchedKind = 61;
+ return jjMoveStringLiteralDfa1_0(0x800000000000000L);
+ case 61:
+ return jjStopAtPos(0, 50);
+ case 62:
+ jjmatchedKind = 62;
+ return jjMoveStringLiteralDfa1_0(0x400000000000000L);
+ case 63:
+ return jjStopAtPos(0, 51);
+ case 64:
+ return jjStopAtPos(0, 55);
+ case 91:
+ return jjStopAtPos(0, 39);
+ case 93:
+ return jjStopAtPos(0, 40);
+ case 97:
+ return jjMoveStringLiteralDfa1_0(0x2200L);
+ case 99:
+ return jjMoveStringLiteralDfa1_0(0x80L);
+ case 100:
+ return jjMoveStringLiteralDfa1_0(0x20100000L);
+ case 101:
+ return jjMoveStringLiteralDfa1_0(0x40000800L);
+ case 102:
+ return jjMoveStringLiteralDfa1_0(0x4000000L);
+ case 105:
+ return jjMoveStringLiteralDfa1_0(0x1000500L);
+ case 109:
+ return jjMoveStringLiteralDfa1_0(0x80000000L);
+ case 111:
+ return jjMoveStringLiteralDfa1_0(0x8400000L);
+ case 112:
+ return jjMoveStringLiteralDfa1_0(0x40L);
+ case 114:
+ return jjMoveStringLiteralDfa1_0(0x814000L);
+ case 115:
+ return jjMoveStringLiteralDfa1_0(0x1000L);
+ case 116:
+ return jjMoveStringLiteralDfa1_0(0x102040000L);
+ case 117:
+ return jjMoveStringLiteralDfa1_0(0x280000L);
+ case 118:
+ return jjMoveStringLiteralDfa1_0(0x10028000L);
+ case 123:
+ return jjStopAtPos(0, 37);
+ case 125:
+ return jjStopAtPos(0, 38);
+ default :
+ return jjMoveNfa_0(5, 0);
+ }
+}
+private final int jjMoveStringLiteralDfa1_0(long active0)
+{
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(0, active0);
+ return 1;
+ }
+ switch(curChar)
+ {
+ case 42:
+ if ((active0 & 0x8L) != 0L)
+ return jjStopAtPos(1, 3);
+ break;
+ case 46:
+ if ((active0 & 0x100000000000000L) != 0L)
+ return jjStopAtPos(1, 56);
+ break;
+ case 60:
+ if ((active0 & 0x400000000000000L) != 0L)
+ return jjStopAtPos(1, 58);
+ break;
+ case 62:
+ if ((active0 & 0x200000000000000L) != 0L)
+ return jjStopAtPos(1, 57);
+ else if ((active0 & 0x800000000000000L) != 0L)
+ return jjStopAtPos(1, 59);
+ break;
+ case 97:
+ return jjMoveStringLiteralDfa2_0(active0, 0xa4008040L);
+ case 98:
+ return jjMoveStringLiteralDfa2_0(active0, 0x200L);
+ case 100:
+ if ((active0 & 0x1000000L) != 0L)
+ return jjStartNfaWithStates_0(1, 24, 26);
+ break;
+ case 101:
+ return jjMoveStringLiteralDfa2_0(active0, 0x914000L);
+ case 104:
+ return jjMoveStringLiteralDfa2_0(active0, 0x100000000L);
+ case 108:
+ return jjMoveStringLiteralDfa2_0(active0, 0x80L);
+ case 109:
+ return jjMoveStringLiteralDfa2_0(active0, 0x100L);
+ case 110:
+ return jjMoveStringLiteralDfa2_0(active0, 0x40280400L);
+ case 111:
+ return jjMoveStringLiteralDfa2_0(active0, 0x10020000L);
+ case 112:
+ if ((active0 & 0x8000000L) != 0L)
+ return jjStartNfaWithStates_0(1, 27, 26);
+ break;
+ case 114:
+ return jjMoveStringLiteralDfa2_0(active0, 0x2440000L);
+ case 116:
+ return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
+ case 117:
+ return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
+ case 120:
+ return jjMoveStringLiteralDfa2_0(active0, 0x800L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(0, active0);
+}
+private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(0, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(1, active0);
+ return 2;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa3_0(active0, 0x50080L);
+ case 99:
+ return jjMoveStringLiteralDfa3_0(active0, 0x40L);
+ case 100:
+ return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
+ case 102:
+ if ((active0 & 0x4000L) != 0L)
+ return jjStartNfaWithStates_0(2, 14, 26);
+ break;
+ case 105:
+ return jjMoveStringLiteralDfa3_0(active0, 0x10200000L);
+ case 108:
+ if ((active0 & 0x8000L) != 0L)
+ return jjStartNfaWithStates_0(2, 15, 26);
+ return jjMoveStringLiteralDfa3_0(active0, 0x4020000L);
+ case 112:
+ return jjMoveStringLiteralDfa3_0(active0, 0x80001100L);
+ case 114:
+ return jjMoveStringLiteralDfa3_0(active0, 0x100100000L);
+ case 115:
+ return jjMoveStringLiteralDfa3_0(active0, 0x880200L);
+ case 116:
+ return jjMoveStringLiteralDfa3_0(active0, 0x20002c00L);
+ case 117:
+ return jjMoveStringLiteralDfa3_0(active0, 0x42000000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(1, active0);
+}
+private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(1, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(2, active0);
+ return 3;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa4_0(active0, 0x20020000L);
+ case 100:
+ if ((active0 & 0x10000000L) != 0L)
+ return jjStartNfaWithStates_0(3, 28, 26);
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000L);
+ case 101:
+ if ((active0 & 0x2000000L) != 0L)
+ return jjStartNfaWithStates_0(3, 25, 26);
+ return jjMoveStringLiteralDfa4_0(active0, 0x80481c00L);
+ case 105:
+ return jjMoveStringLiteralDfa4_0(active0, 0x100000L);
+ case 107:
+ return jjMoveStringLiteralDfa4_0(active0, 0x40L);
+ case 109:
+ if ((active0 & 0x40000000L) != 0L)
+ return jjStartNfaWithStates_0(3, 30, 26);
+ break;
+ case 110:
+ return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
+ case 111:
+ return jjMoveStringLiteralDfa4_0(active0, 0x100800100L);
+ case 113:
+ return jjMoveStringLiteralDfa4_0(active0, 0x200000L);
+ case 114:
+ if ((active0 & 0x2000L) != 0L)
+ return jjStartNfaWithStates_0(3, 13, 26);
+ break;
+ case 115:
+ return jjMoveStringLiteralDfa4_0(active0, 0x4000080L);
+ case 116:
+ return jjMoveStringLiteralDfa4_0(active0, 0x200L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(2, active0);
+}
+private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(2, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(3, active0);
+ return 4;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa5_0(active0, 0x40L);
+ case 101:
+ if ((active0 & 0x4000000L) != 0L)
+ return jjStartNfaWithStates_0(4, 26, 26);
+ break;
+ case 108:
+ return jjMoveStringLiteralDfa5_0(active0, 0x800000L);
+ case 110:
+ return jjMoveStringLiteralDfa5_0(active0, 0x80000800L);
+ case 111:
+ return jjMoveStringLiteralDfa5_0(active0, 0x10000L);
+ case 114:
+ if ((active0 & 0x1000L) != 0L)
+ return jjStartNfaWithStates_0(4, 12, 26);
+ return jjMoveStringLiteralDfa5_0(active0, 0x400700L);
+ case 115:
+ if ((active0 & 0x80L) != 0L)
+ return jjStartNfaWithStates_0(4, 7, 26);
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000L);
+ case 116:
+ return jjMoveStringLiteralDfa5_0(active0, 0x200a0000L);
+ case 117:
+ return jjMoveStringLiteralDfa5_0(active0, 0x200000L);
+ case 118:
+ return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
+ case 119:
+ return jjMoveStringLiteralDfa5_0(active0, 0x100000000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(3, active0);
+}
+private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(3, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(4, active0);
+ return 5;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa6_0(active0, 0x200L);
+ case 100:
+ return jjMoveStringLiteralDfa6_0(active0, 0x800L);
+ case 101:
+ if ((active0 & 0x200000L) != 0L)
+ return jjStartNfaWithStates_0(5, 21, 26);
+ return jjMoveStringLiteralDfa6_0(active0, 0x500000L);
+ case 102:
+ return jjMoveStringLiteralDfa6_0(active0, 0x400L);
+ case 103:
+ return jjMoveStringLiteralDfa6_0(active0, 0x40L);
+ case 105:
+ return jjMoveStringLiteralDfa6_0(active0, 0x60000L);
+ case 110:
+ return jjMoveStringLiteralDfa6_0(active0, 0x10000L);
+ case 115:
+ if ((active0 & 0x100000000L) != 0L)
+ return jjStartNfaWithStates_0(5, 32, 26);
+ break;
+ case 116:
+ if ((active0 & 0x100L) != 0L)
+ return jjStartNfaWithStates_0(5, 8, 26);
+ return jjMoveStringLiteralDfa6_0(active0, 0x80080000L);
+ case 118:
+ return jjMoveStringLiteralDfa6_0(active0, 0x800000L);
+ case 121:
+ return jjMoveStringLiteralDfa6_0(active0, 0x20000000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(4, active0);
+}
+private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(4, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(5, active0);
+ return 6;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa7_0(active0, 0x80400L);
+ case 99:
+ return jjMoveStringLiteralDfa7_0(active0, 0x200L);
+ case 100:
+ if ((active0 & 0x100000L) != 0L)
+ return jjStartNfaWithStates_0(6, 20, 26);
+ else if ((active0 & 0x400000L) != 0L)
+ return jjStartNfaWithStates_0(6, 22, 26);
+ break;
+ case 101:
+ if ((active0 & 0x40L) != 0L)
+ return jjStartNfaWithStates_0(6, 6, 26);
+ else if ((active0 & 0x800000L) != 0L)
+ return jjStartNfaWithStates_0(6, 23, 26);
+ return jjMoveStringLiteralDfa7_0(active0, 0x40000L);
+ case 108:
+ return jjMoveStringLiteralDfa7_0(active0, 0x30000L);
+ case 112:
+ return jjMoveStringLiteralDfa7_0(active0, 0x20000000L);
+ case 114:
+ return jjMoveStringLiteralDfa7_0(active0, 0x80000000L);
+ case 115:
+ if ((active0 & 0x800L) != 0L)
+ return jjStartNfaWithStates_0(6, 11, 26);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(5, active0);
+}
+private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(5, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(6, active0);
+ return 7;
+ }
+ switch(curChar)
+ {
+ case 98:
+ return jjMoveStringLiteralDfa8_0(active0, 0x80000L);
+ case 99:
+ return jjMoveStringLiteralDfa8_0(active0, 0x400L);
+ case 101:
+ if ((active0 & 0x20000L) != 0L)
+ return jjStartNfaWithStates_0(7, 17, 26);
+ else if ((active0 & 0x20000000L) != 0L)
+ return jjStartNfaWithStates_0(7, 29, 26);
+ break;
+ case 110:
+ return jjMoveStringLiteralDfa8_0(active0, 0x40000L);
+ case 116:
+ if ((active0 & 0x200L) != 0L)
+ return jjStartNfaWithStates_0(7, 9, 26);
+ break;
+ case 121:
+ if ((active0 & 0x10000L) != 0L)
+ return jjStartNfaWithStates_0(7, 16, 26);
+ else if ((active0 & 0x80000000L) != 0L)
+ return jjStartNfaWithStates_0(7, 31, 26);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(6, active0);
+}
+private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(6, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(7, active0);
+ return 8;
+ }
+ switch(curChar)
+ {
+ case 101:
+ if ((active0 & 0x400L) != 0L)
+ return jjStartNfaWithStates_0(8, 10, 26);
+ break;
+ case 108:
+ return jjMoveStringLiteralDfa9_0(active0, 0x80000L);
+ case 116:
+ if ((active0 & 0x40000L) != 0L)
+ return jjStartNfaWithStates_0(8, 18, 26);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(7, active0);
+}
+private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(7, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(8, active0);
+ return 9;
+ }
+ switch(curChar)
+ {
+ case 101:
+ if ((active0 & 0x80000L) != 0L)
+ return jjStartNfaWithStates_0(9, 19, 26);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(8, active0);
+}
+private final void jjCheckNAdd(int state)
+{
+ if (jjrounds[state] != jjround)
+ {
+ jjstateSet[jjnewStateCnt++] = state;
+ jjrounds[state] = jjround;
+ }
+}
+private final void jjAddStates(int start, int end)
+{
+ do {
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+ } while (start++ != end);
+}
+private final void jjCheckNAddTwoStates(int state1, int state2)
+{
+ jjCheckNAdd(state1);
+ jjCheckNAdd(state2);
+}
+private final void jjCheckNAddStates(int start, int end)
+{
+ do {
+ jjCheckNAdd(jjnextStates[start]);
+ } while (start++ != end);
+}
+private final void jjCheckNAddStates(int start)
+{
+ jjCheckNAdd(jjnextStates[start]);
+ jjCheckNAdd(jjnextStates[start + 1]);
+}
+static final long[] jjbitVec0 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+private final int jjMoveNfa_0(int startState, int curPos)
+{
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 27;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 5:
+ if ((0x3ff000000000000L & l) != 0L)
+ {
+ if (kind > 67)
+ kind = 67;
+ jjCheckNAdd(23);
+ }
+ else if ((0x100003600L & l) != 0L)
+ {
+ if (kind > 2)
+ kind = 2;
+ jjCheckNAdd(6);
+ }
+ else if (curChar == 39)
+ jjAddStates(0, 1);
+ else if (curChar == 34)
+ jjCheckNAddStates(2, 4);
+ else if (curChar == 47)
+ jjstateSet[jjnewStateCnt++] = 0;
+ break;
+ case 0:
+ if (curChar == 47)
+ jjCheckNAddStates(5, 7);
+ break;
+ case 1:
+ if ((0xffffffffffffdbffL & l) != 0L)
+ jjCheckNAddStates(5, 7);
+ break;
+ case 2:
+ case 3:
+ if (curChar == 10 && kind > 1)
+ kind = 1;
+ break;
+ case 4:
+ if (curChar == 13)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 6:
+ if ((0x100003600L & l) == 0L)
+ break;
+ if (kind > 2)
+ kind = 2;
+ jjCheckNAdd(6);
+ break;
+ case 7:
+ if (curChar == 34)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 9:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 10:
+ if ((0xfffffffbffffffffL & l) != 0L)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 11:
+ if (curChar == 34 && kind > 63)
+ kind = 63;
+ break;
+ case 12:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 13;
+ break;
+ case 13:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 14;
+ break;
+ case 14:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 15:
+ if (curChar == 39)
+ jjAddStates(0, 1);
+ break;
+ case 17:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAdd(18);
+ break;
+ case 18:
+ if (curChar == 39 && kind > 64)
+ kind = 64;
+ break;
+ case 19:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 20;
+ break;
+ case 20:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 21;
+ break;
+ case 21:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAdd(18);
+ break;
+ case 22:
+ if ((0xffffff7fffffffffL & l) != 0L)
+ jjCheckNAdd(18);
+ break;
+ case 23:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 67)
+ kind = 67;
+ jjCheckNAdd(23);
+ break;
+ case 26:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 71)
+ kind = 71;
+ jjstateSet[jjnewStateCnt++] = 26;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 5:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ {
+ if (kind > 71)
+ kind = 71;
+ jjCheckNAdd(26);
+ }
+ else if (curChar == 126)
+ jjstateSet[jjnewStateCnt++] = 25;
+ break;
+ case 1:
+ jjAddStates(5, 7);
+ break;
+ case 8:
+ if (curChar == 92)
+ jjAddStates(8, 9);
+ break;
+ case 9:
+ if ((0x14404010000000L & l) != 0L)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 10:
+ jjCheckNAddStates(2, 4);
+ break;
+ case 16:
+ if (curChar == 92)
+ jjAddStates(10, 11);
+ break;
+ case 17:
+ if ((0x14404010000000L & l) != 0L)
+ jjCheckNAdd(18);
+ break;
+ case 22:
+ jjCheckNAdd(18);
+ break;
+ case 24:
+ if (curChar == 126)
+ jjstateSet[jjnewStateCnt++] = 25;
+ break;
+ case 25:
+ case 26:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 71)
+ kind = 71;
+ jjCheckNAdd(26);
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 1:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjAddStates(5, 7);
+ break;
+ case 10:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjAddStates(2, 4);
+ break;
+ case 22:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjstateSet[jjnewStateCnt++] = 18;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 27 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return curPos; }
+ }
+}
+private final int jjMoveStringLiteralDfa0_1()
+{
+ switch(curChar)
+ {
+ case 42:
+ return jjMoveStringLiteralDfa1_1(0x10L);
+ default :
+ return 1;
+ }
+}
+private final int jjMoveStringLiteralDfa1_1(long active0)
+{
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return 1;
+ }
+ switch(curChar)
+ {
+ case 47:
+ if ((active0 & 0x10L) != 0L)
+ return jjStopAtPos(1, 4);
+ break;
+ default :
+ return 2;
+ }
+ return 2;
+}
+static final int[] jjnextStates = {
+ 16, 22, 8, 10, 11, 1, 2, 4, 9, 12, 17, 19,
+};
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, "\160\141\143\153\141\147\145",
+"\143\154\141\163\163", "\151\155\160\157\162\164", "\141\142\163\164\162\141\143\164",
+"\151\156\164\145\162\146\141\143\145", "\145\170\164\145\156\144\163", "\163\165\160\145\162", "\141\164\164\162",
+"\162\145\146", "\166\141\154", "\162\145\141\144\157\156\154\171",
+"\166\157\154\141\164\151\154\145", "\164\162\141\156\163\151\145\156\164",
+"\165\156\163\145\164\164\141\142\154\145", "\144\145\162\151\166\145\144", "\165\156\151\161\165\145",
+"\157\162\144\145\162\145\144", "\162\145\163\157\154\166\145", "\151\144", "\164\162\165\145",
+"\146\141\154\163\145", "\157\160", "\166\157\151\144", "\144\141\164\141\164\171\160\145",
+"\145\156\165\155", "\155\141\160\145\156\164\162\171", "\164\150\162\157\167\163", null, null,
+null, null, "\173", "\175", "\133", "\135", "\50", "\51", "\56", "\54", "\72",
+"\73", "\52", "\53", "\55", "\75", "\77", "\41", "\44", "\43", "\100", "\56\56",
+"\55\76", "\76\74", "\74\76", "\46", "\74", "\76", null, null, null, null, null, null,
+null, null, null, };
+public static final String[] lexStateNames = {
+ "DEFAULT",
+ "WithinComment",
+};
+public static final int[] jjnewLexState = {
+ -1, -1, -1, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+};
+static final long[] jjtoToken = {
+ 0xffffffe1ffffffc1L, 0x89L,
+};
+static final long[] jjtoSkip = {
+ 0x1eL, 0x0L,
+};
+static final long[] jjtoMore = {
+ 0x20L, 0x0L,
+};
+protected SimpleCharStream input_stream;
+private final int[] jjrounds = new int[27];
+private final int[] jjstateSet = new int[54];
+protected char curChar;
+public EmfaticParserTokenManager(SimpleCharStream stream){
+ if (SimpleCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+ input_stream = stream;
+}
+public EmfaticParserTokenManager(SimpleCharStream stream, int lexState){
+ this(stream);
+ SwitchTo(lexState);
+}
+public void ReInit(SimpleCharStream stream)
+{
+ jjmatchedPos = jjnewStateCnt = 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+}
+private final void ReInitRounds()
+{
+ int i;
+ jjround = 0x80000001;
+ for (i = 27; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+}
+public void ReInit(SimpleCharStream stream, int lexState)
+{
+ ReInit(stream);
+ SwitchTo(lexState);
+}
+public void SwitchTo(int lexState)
+{
+ if (lexState >= 2 || lexState < 0)
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+ else
+ curLexState = lexState;
+}
+
+protected Token jjFillToken()
+{
+ Token t = Token.newToken(jjmatchedKind);
+ t.kind = jjmatchedKind;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ t.image = (im == null) ? input_stream.GetImage() : im;
+ t.beginLine = input_stream.getBeginLine();
+ t.beginColumn = input_stream.getBeginColumn();
+ t.endLine = input_stream.getEndLine();
+ t.endColumn = input_stream.getEndColumn();
+ return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+public Token getNextToken()
+{
+ int kind;
+ Token specialToken = null;
+ Token matchedToken;
+ int curPos = 0;
+
+ EOFLoop :
+ for (;;)
+ {
+ try
+ {
+ curChar = input_stream.BeginToken();
+ }
+ catch(java.io.IOException e)
+ {
+ jjmatchedKind = 0;
+ matchedToken = jjFillToken();
+ return matchedToken;
+ }
+
+ for (;;)
+ {
+ switch(curLexState)
+ {
+ case 0:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_0();
+ break;
+ case 1:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_1();
+ if (jjmatchedPos == 0 && jjmatchedKind > 5)
+ {
+ jjmatchedKind = 5;
+ }
+ break;
+ }
+ if (jjmatchedKind != 0x7fffffff)
+ {
+ if (jjmatchedPos + 1 < curPos)
+ input_stream.backup(curPos - jjmatchedPos - 1);
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ matchedToken = jjFillToken();
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ return matchedToken;
+ }
+ else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ continue EOFLoop;
+ }
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ curPos = 0;
+ jjmatchedKind = 0x7fffffff;
+ try {
+ curChar = input_stream.readChar();
+ continue;
+ }
+ catch (java.io.IOException e1) { }
+ }
+ int error_line = input_stream.getEndLine();
+ int error_column = input_stream.getEndColumn();
+ String error_after = null;
+ boolean EOFSeen = false;
+ try { input_stream.readChar(); input_stream.backup(1); }
+ catch (java.io.IOException e1) {
+ EOFSeen = true;
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ if (curChar == '\n' || curChar == '\r') {
+ error_line++;
+ error_column = 0;
+ }
+ else
+ error_column++;
+ }
+ if (!EOFSeen) {
+ input_stream.backup(1);
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ }
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+ }
+ }
+}
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ExtEmfaticParserTokenManager.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ExtEmfaticParserTokenManager.java
new file mode 100644
index 0000000..66a219f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ExtEmfaticParserTokenManager.java
@@ -0,0 +1,29 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public class ExtEmfaticParserTokenManager extends EmfaticParserTokenManager {
+
+ private final ExtSimpleCharStream _stream;
+
+ public ExtEmfaticParserTokenManager(ExtSimpleCharStream stream) {
+ super(stream);
+ _stream = stream;
+ }
+
+ protected Token jjFillToken() {
+ ExtToken t = new ExtToken();
+ t.kind = jjmatchedKind;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ t.image = (im == null) ? input_stream.GetImage() : im;
+ t.beginLine = input_stream.getBeginLine();
+ t.beginColumn = input_stream.getBeginColumn();
+ t.endLine = input_stream.getEndLine();
+ t.endColumn = input_stream.getEndColumn();
+ t.tokenOffset = _stream.tokenBeginOffset;
+ return t;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ExtSimpleCharStream.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ExtSimpleCharStream.java
new file mode 100644
index 0000000..c7d94a2
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ExtSimpleCharStream.java
@@ -0,0 +1,41 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public class ExtSimpleCharStream extends SimpleCharStream {
+
+ /**
+ * The current character position in the input stream.
+ */
+ public int inputOffset = -1;
+
+ /**
+ * The start position of the current token in the input stream.
+ */
+ public int tokenBeginOffset;
+
+
+ public ExtSimpleCharStream(java.io.Reader dstream) {
+ super(dstream);
+ }
+
+ public char BeginToken() throws java.io.IOException {
+ tokenBegin = -1;
+ tokenBeginOffset = -1;
+
+ char c = readChar();
+
+ tokenBegin = bufpos;
+ tokenBeginOffset = inputOffset;
+
+ return c;
+ }
+
+ protected void UpdateLineColumn(char c) {
+ inputOffset++;
+ super.UpdateLineColumn(c);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ExtToken.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ExtToken.java
new file mode 100644
index 0000000..3eb547d
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ExtToken.java
@@ -0,0 +1,14 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public class ExtToken extends Token {
+
+ /**
+ * The start position of the token in the input stream.
+ */
+ public int tokenOffset;
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ParseException.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ParseException.java
new file mode 100644
index 0000000..8a43495
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/ParseException.java
@@ -0,0 +1,192 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+/**
+ * This exception is thrown when parse errors are encountered.
+ * You can explicitly create objects of this exception type by
+ * calling the method generateParseException in the generated
+ * parser.
+ *
+ * You can modify this class to customize your error reporting
+ * mechanisms so long as you retain the public fields.
+ */
+public class ParseException extends Exception {
+
+ /**
+ * This constructor is used by the method "generateParseException"
+ * in the generated parser. Calling this constructor generates
+ * a new object of this type with the fields "currentToken",
+ * "expectedTokenSequences", and "tokenImage" set. The boolean
+ * flag "specialConstructor" is also set to true to indicate that
+ * this constructor was used to create this object.
+ * This constructor calls its super class with the empty string
+ * to force the "toString" method of parent class "Throwable" to
+ * print the error message in the form:
+ * ParseException: <result of getMessage>
+ */
+ public ParseException(Token currentTokenVal,
+ int[][] expectedTokenSequencesVal,
+ String[] tokenImageVal
+ )
+ {
+ super("");
+ specialConstructor = true;
+ currentToken = currentTokenVal;
+ expectedTokenSequences = expectedTokenSequencesVal;
+ tokenImage = tokenImageVal;
+ }
+
+ /**
+ * The following constructors are for use by you for whatever
+ * purpose you can think of. Constructing the exception in this
+ * manner makes the exception behave in the normal way - i.e., as
+ * documented in the class "Throwable". The fields "errorToken",
+ * "expectedTokenSequences", and "tokenImage" do not contain
+ * relevant information. The JavaCC generated code does not use
+ * these constructors.
+ */
+
+ public ParseException() {
+ super();
+ specialConstructor = false;
+ }
+
+ public ParseException(String message) {
+ super(message);
+ specialConstructor = false;
+ }
+
+ /**
+ * This variable determines which constructor was used to create
+ * this object and thereby affects the semantics of the
+ * "getMessage" method (see below).
+ */
+ protected boolean specialConstructor;
+
+ /**
+ * This is the last token that has been consumed successfully. If
+ * this object has been created due to a parse error, the token
+ * followng this token will (therefore) be the first error token.
+ */
+ public Token currentToken;
+
+ /**
+ * Each entry in this array is an array of integers. Each array
+ * of integers represents a sequence of tokens (by their ordinal
+ * values) that is expected at this point of the parse.
+ */
+ public int[][] expectedTokenSequences;
+
+ /**
+ * This is a reference to the "tokenImage" array of the generated
+ * parser within which the parse error occurred. This array is
+ * defined in the generated ...Constants interface.
+ */
+ public String[] tokenImage;
+
+ /**
+ * This method has the standard behavior when this object has been
+ * created using the standard constructors. Otherwise, it uses
+ * "currentToken" and "expectedTokenSequences" to generate a parse
+ * error message and returns it. If this object has been created
+ * due to a parse error, and you do not catch it (it gets thrown
+ * from the parser), then this method is called during the printing
+ * of the final stack trace, and hence the correct error message
+ * gets displayed.
+ */
+ public String getMessage() {
+ if (!specialConstructor) {
+ return super.getMessage();
+ }
+ StringBuffer expected = new StringBuffer();
+ int maxSize = 0;
+ for (int i = 0; i < expectedTokenSequences.length; i++) {
+ if (maxSize < expectedTokenSequences[i].length) {
+ maxSize = expectedTokenSequences[i].length;
+ }
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(" ");
+ }
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+ expected.append("...");
+ }
+ expected.append(eol).append(" ");
+ }
+ String retval = "Encountered \"";
+ Token tok = currentToken.next;
+ for (int i = 0; i < maxSize; i++) {
+ if (i != 0) retval += " ";
+ if (tok.kind == 0) {
+ retval += tokenImage[0];
+ break;
+ }
+ retval += add_escapes(tok.image);
+ tok = tok.next;
+ }
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+ retval += "." + eol;
+ if (expectedTokenSequences.length == 1) {
+ retval += "Was expecting:" + eol + " ";
+ } else {
+ retval += "Was expecting one of:" + eol + " ";
+ }
+ retval += expected.toString();
+ return retval;
+ }
+
+ /**
+ * The end of line string for this machine.
+ */
+ protected String eol = System.getProperty("line.separator", "\n");
+
+ /**
+ * Used to convert raw characters to their escaped version
+ * when these raw version cannot be used as part of an ASCII
+ * string literal.
+ */
+ protected String add_escapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/SimpleCharStream.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/SimpleCharStream.java
new file mode 100644
index 0000000..1ae5816
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/SimpleCharStream.java
@@ -0,0 +1,439 @@
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+public class SimpleCharStream
+{
+ public static final boolean staticFlag = false;
+ int bufsize;
+ int available;
+ int tokenBegin;
+ public int bufpos = -1;
+ protected int bufline[];
+ protected int bufcolumn[];
+
+ protected int column = 0;
+ protected int line = 1;
+
+ protected boolean prevCharIsCR = false;
+ protected boolean prevCharIsLF = false;
+
+ protected java.io.Reader inputStream;
+
+ protected char[] buffer;
+ protected int maxNextCharInd = 0;
+ protected int inBuf = 0;
+ protected int tabSize = 8;
+
+ protected void setTabSize(int i) { tabSize = i; }
+ protected int getTabSize(int i) { return tabSize; }
+
+
+ protected void ExpandBuff(boolean wrapAround)
+ {
+ char[] newbuffer = new char[bufsize + 2048];
+ int newbufline[] = new int[bufsize + 2048];
+ int newbufcolumn[] = new int[bufsize + 2048];
+
+ try
+ {
+ if (wrapAround)
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ System.arraycopy(buffer, 0, newbuffer,
+ bufsize - tokenBegin, bufpos);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+ }
+ else
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos -= tokenBegin);
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new Error(t.getMessage());
+ }
+
+
+ bufsize += 2048;
+ available = bufsize;
+ tokenBegin = 0;
+ }
+
+ protected void FillBuff() throws java.io.IOException
+ {
+ if (maxNextCharInd == available)
+ {
+ if (available == bufsize)
+ {
+ if (tokenBegin > 2048)
+ {
+ bufpos = maxNextCharInd = 0;
+ available = tokenBegin;
+ }
+ else if (tokenBegin < 0)
+ bufpos = maxNextCharInd = 0;
+ else
+ ExpandBuff(false);
+ }
+ else if (available > tokenBegin)
+ available = bufsize;
+ else if ((tokenBegin - available) < 2048)
+ ExpandBuff(true);
+ else
+ available = tokenBegin;
+ }
+
+ int i;
+ try {
+ if ((i = inputStream.read(buffer, maxNextCharInd,
+ available - maxNextCharInd)) == -1)
+ {
+ inputStream.close();
+ throw new java.io.IOException();
+ }
+ else
+ maxNextCharInd += i;
+ return;
+ }
+ catch(java.io.IOException e) {
+ --bufpos;
+ backup(0);
+ if (tokenBegin == -1)
+ tokenBegin = bufpos;
+ throw e;
+ }
+ }
+
+ public char BeginToken() throws java.io.IOException
+ {
+ tokenBegin = -1;
+ char c = readChar();
+ tokenBegin = bufpos;
+
+ return c;
+ }
+
+ protected void UpdateLineColumn(char c)
+ {
+ column++;
+
+ if (prevCharIsLF)
+ {
+ prevCharIsLF = false;
+ line += (column = 1);
+ }
+ else if (prevCharIsCR)
+ {
+ prevCharIsCR = false;
+ if (c == '\n')
+ {
+ prevCharIsLF = true;
+ }
+ else
+ line += (column = 1);
+ }
+
+ switch (c)
+ {
+ case '\r' :
+ prevCharIsCR = true;
+ break;
+ case '\n' :
+ prevCharIsLF = true;
+ break;
+ case '\t' :
+ column--;
+ column += (tabSize - (column % tabSize));
+ break;
+ default :
+ break;
+ }
+
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
+ }
+
+ public char readChar() throws java.io.IOException
+ {
+ if (inBuf > 0)
+ {
+ --inBuf;
+
+ if (++bufpos == bufsize)
+ bufpos = 0;
+
+ return buffer[bufpos];
+ }
+
+ if (++bufpos >= maxNextCharInd)
+ FillBuff();
+
+ char c = buffer[bufpos];
+
+ UpdateLineColumn(c);
+ return (c);
+ }
+
+ /**
+ * @deprecated
+ * @see #getEndColumn
+ */
+
+ public int getColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ /**
+ * @deprecated
+ * @see #getEndLine
+ */
+
+ public int getLine() {
+ return bufline[bufpos];
+ }
+
+ public int getEndColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ public int getEndLine() {
+ return bufline[bufpos];
+ }
+
+ public int getBeginColumn() {
+ return bufcolumn[tokenBegin];
+ }
+
+ public int getBeginLine() {
+ return bufline[tokenBegin];
+ }
+
+ public void backup(int amount) {
+
+ inBuf += amount;
+ if ((bufpos -= amount) < 0)
+ bufpos += bufsize;
+ }
+
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.Reader dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ if (buffer == null || buffersize != buffer.length)
+ {
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+ prevCharIsLF = prevCharIsCR = false;
+ tokenBegin = inBuf = maxNextCharInd = 0;
+ bufpos = -1;
+ }
+
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ public void ReInit(java.io.Reader dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, 1, 1, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, startline, startcolumn, 4096);
+ }
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+ public String GetImage()
+ {
+ if (bufpos >= tokenBegin)
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+ else
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+ new String(buffer, 0, bufpos + 1);
+ }
+
+ public char[] GetSuffix(int len)
+ {
+ char[] ret = new char[len];
+
+ if ((bufpos + 1) >= len)
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+ else
+ {
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+ len - bufpos - 1);
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+ }
+
+ return ret;
+ }
+
+ public void Done()
+ {
+ buffer = null;
+ bufline = null;
+ bufcolumn = null;
+ }
+
+ /**
+ * Method to adjust line and column numbers for the start of a token.
+ */
+ public void adjustBeginLineColumn(int newLine, int newCol)
+ {
+ int start = tokenBegin;
+ int len;
+
+ if (bufpos >= tokenBegin)
+ {
+ len = bufpos - tokenBegin + inBuf + 1;
+ }
+ else
+ {
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+ }
+
+ int i = 0, j = 0, k = 0;
+ int nextColDiff = 0, columnDiff = 0;
+
+ while (i < len &&
+ bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
+ {
+ bufline[j] = newLine;
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+ bufcolumn[j] = newCol + columnDiff;
+ columnDiff = nextColDiff;
+ i++;
+ }
+
+ if (i < len)
+ {
+ bufline[j] = newLine++;
+ bufcolumn[j] = newCol + columnDiff;
+
+ while (i++ < len)
+ {
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ bufline[j] = newLine++;
+ else
+ bufline[j] = newLine;
+ }
+ }
+
+ line = bufline[j];
+ column = bufcolumn[j];
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/Token.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/Token.java
new file mode 100644
index 0000000..c1b2351
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/Token.java
@@ -0,0 +1,81 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+/**
+ * Describes the input token stream.
+ */
+
+public class Token {
+
+ /**
+ * An integer that describes the kind of this token. This numbering
+ * system is determined by JavaCCParser, and a table of these numbers is
+ * stored in the file ...Constants.java.
+ */
+ public int kind;
+
+ /**
+ * beginLine and beginColumn describe the position of the first character
+ * of this token; endLine and endColumn describe the position of the
+ * last character of this token.
+ */
+ public int beginLine, beginColumn, endLine, endColumn;
+
+ /**
+ * The string image of the token.
+ */
+ public String image;
+
+ /**
+ * A reference to the next regular (non-special) token from the input
+ * stream. If this is the last token from the input stream, or if the
+ * token manager has not read tokens beyond this one, this field is
+ * set to null. This is true only if this token is also a regular
+ * token. Otherwise, see below for a description of the contents of
+ * this field.
+ */
+ public Token next;
+
+ /**
+ * This field is used to access special tokens that occur prior to this
+ * token, but after the immediately preceding regular (non-special) token.
+ * If there are no such special tokens, this field is set to null.
+ * When there are more than one such special token, this field refers
+ * to the last of these special tokens, which in turn refers to the next
+ * previous special token through its specialToken field, and so on
+ * until the first special token (whose specialToken field is null).
+ * The next fields of special tokens refer to other special tokens that
+ * immediately follow it (without an intervening regular token). If there
+ * is no such token, this field is null.
+ */
+ public Token specialToken;
+
+ /**
+ * Returns the image.
+ */
+ public String toString()
+ {
+ return image;
+ }
+
+ /**
+ * Returns a new Token object, by default. However, if you want, you
+ * can create and return subclass objects based on the value of ofKind.
+ * Simply add the cases to the switch for all those special cases.
+ * For example, if you have a subclass of Token called IDToken that
+ * you want to create if ofKind is ID, simlpy add something like :
+ *
+ * case MyParserConstants.ID : return new IDToken();
+ *
+ * to the following switch statement. Then you can cast matchedToken
+ * variable to the appropriate type and use it in your lexical actions.
+ */
+ public static final Token newToken(int ofKind)
+ {
+ switch(ofKind)
+ {
+ default : return new Token();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/TokenMgrError.java b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/TokenMgrError.java
new file mode 100644
index 0000000..2641d3b
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/grammar/javaccParser/TokenMgrError.java
@@ -0,0 +1,133 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public class TokenMgrError extends Error
+{
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
+
+ /**
+ * Lexical error occured.
+ */
+ static final int LEXICAL_ERROR = 0;
+
+ /**
+ * An attempt wass made to create a second instance of a static token manager.
+ */
+ static final int STATIC_LEXER_ERROR = 1;
+
+ /**
+ * Tried to change to an invalid lexical state.
+ */
+ static final int INVALID_LEXICAL_STATE = 2;
+
+ /**
+ * Detected (and bailed out of) an infinite loop in the token manager.
+ */
+ static final int LOOP_DETECTED = 3;
+
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+
+ /**
+ * Replaces unprintable characters by their espaced (or unicode escaped)
+ * equivalents in the given string
+ */
+ protected static final String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+ /**
+ * Returns a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ * Parameters :
+ * EOFSeen : indicates if EOF caused the lexicl error
+ * curLexState : lexical state in which this error occured
+ * errorLine : line number when the error occured
+ * errorColumn : column number when the error occured
+ * errorAfter : prefix that was seen before this error occured
+ * curchar : the offending character
+ * Note: You can customize the lexical error message by modifying this method.
+ */
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ return("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
+ }
+
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ *
+ * "Internal Error : Please file a bug report .... "
+ *
+ * from this method for such cases in the release version of your parser.
+ */
+ public String getMessage() {
+ return super.getMessage();
+ }
+
+ /*
+ * Constructors of various flavors follow.
+ */
+
+ public TokenMgrError() {
+ }
+
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
+
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/plugin.properties b/plugins/org.eclipse.emf.emfatic.core/plugin.properties
new file mode 100644
index 0000000..0cd752c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/plugin.properties
@@ -0,0 +1,43 @@
+###############################################################################
+# Copyright (c) 2001, 2004 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+#/**
+# * <copyright>
+# *
+# * Copyright (c) 2004,2006 IBM Corporation and others.
+# * All rights reserved. This program and the accompanying materials
+# * are made available under the terms of the Eclipse Public License v1.0
+# * which accompanies this distribution, and is available at
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * IBM - Initial API and implementation
+# *
+# * </copyright>
+# *
+# * $Id: plugin.properties,v 1.1 2008/01/15 06:10:15 cdaly Exp $
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+# ==============================================================================
+# Do not change the properties between this line and the last line containing:
+# %%% END OF TRANSLATED PROPERTIES %%%
+# Instead, either redefine an existing property, or create a new property,
+# append it to the end of the file, and change the code to use the new name.
+# ==============================================================================
+
+# ==============================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# The above properties have been shipped for translation.
+# ==============================================================================
+
+Plugin.name = Emfatic Core
+Plugin.providerName = Eclipse.org
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/EmfaticCorePlugin.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/EmfaticCorePlugin.java
new file mode 100644
index 0000000..2fd01a9
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/EmfaticCorePlugin.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class EmfaticCorePlugin extends AbstractUIPlugin {
+ //The shared instance.
+ private static EmfaticCorePlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+
+ /**
+ * The constructor.
+ */
+ public EmfaticCorePlugin() {
+ super();
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.eclipse.emf.emfatic.core.EmfaticCorePluginResources");
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static EmfaticCorePlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = EmfaticCorePlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Builder.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Builder.java
new file mode 100644
index 0000000..07dab44
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Builder.java
@@ -0,0 +1,572 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generator.ecore;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypeParameter;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.emfatic.core.generics.util.OneToOneMap;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Annotation;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Annotations;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Attribute;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.DataTypeDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNodeVisitor;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticTokenNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EnumDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EnumLiteral;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.KeyEqualsValue;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.MapEntryDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Modifier;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Modifiers;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Multiplicity;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.OneOrMoreTypeParams;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Operation;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.OptNegatedModifier;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.PackageDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Param;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Reference;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.SubPackageDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TopLevelDecls;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeParam;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeWithMulti;
+import org.eclipse.emf.emfatic.core.util.EmfaticAnnotationMap;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.parser.ParseContext;
+
+
+public class Builder extends GenerationPhase {
+
+ private EmfaticAnnotationMap _annotationMap;
+ private OneToOneMap<ASTNode, EObject> cstDecl2EcoreAST = new OneToOneMap<ASTNode, EObject>();
+
+
+ public Builder() {
+ }
+
+ public void build(ParseContext parseContext, Resource resource, IProgressMonitor monitor) throws IOException {
+ cstDecl2EcoreAST.clear();
+ initParseContext(parseContext);
+ _annotationMap = new EmfaticAnnotationMap();
+ CompUnit compUnit = (CompUnit) parseContext.getParseRoot();
+ buildPackage(compUnit, resource);
+ }
+
+ private void buildPackage(CompUnit compUnit, Resource resource) {
+ PackageDecl packageDecl = compUnit.getPackageDecl();
+ if (packageDecl != null) {
+ String name = getIDText(packageDecl.getName());
+ buildPackage(name, packageDecl.getAnnotations(), compUnit.getTopLevelDecls(), resource.getContents());
+ }
+ }
+
+ private void buildPackage(SubPackageDecl packageDecl, EPackage parentPackage) {
+ String name = getIDText(packageDecl.getName());
+ buildPackage(name, packageDecl.getAnnotations(), packageDecl.getTopLevelDecls(), parentPackage
+ .getESubpackages());
+ }
+
+ private void buildPackage(String name, Annotations annotations, TopLevelDecls topLevelDecls, EList parentContents) {
+ final EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage();
+ cstDecl2EcoreAST.put(topLevelDecls.getParent(), ePackage);
+ ePackage.setName(name);
+ buildAnnotations(annotations, ePackage);
+ parentContents.add(ePackage);
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(SubPackageDecl subPackageDecl) {
+ if (!isDuplicateName(ePackage, subPackageDecl.getName()))
+ buildPackage(subPackageDecl, ePackage);
+ return false;
+ }
+
+ public boolean beginVisit(ClassDecl classDecl) {
+ if (!isDuplicateName(ePackage, classDecl.getName()))
+ buildClass(classDecl, ePackage);
+ return false;
+ }
+
+ public boolean beginVisit(EnumDecl enumDecl) {
+ if (!isDuplicateName(ePackage, enumDecl.getName()))
+ buildEnum(enumDecl, ePackage);
+ return false;
+ }
+
+ public boolean beginVisit(DataTypeDecl dataTypeDecl) {
+ if (!isDuplicateName(ePackage, dataTypeDecl.getName()))
+ buildDataType(dataTypeDecl, ePackage);
+ return false;
+ }
+
+ public boolean beginVisit(MapEntryDecl mapEntryDecl) {
+ if (!isDuplicateName(ePackage, mapEntryDecl.getName()))
+ buildMapEntry(mapEntryDecl, ePackage);
+ return false;
+ }
+
+ }).visit(topLevelDecls);
+ }
+
+ private boolean isDuplicateName(EPackage containingPackage, EmfaticTokenNode nameTokenNode) {
+ String name = getIDText(nameTokenNode);
+ if (getSubPackage(containingPackage, name) != null) {
+ logError(new EmfaticSemanticError.DuplicatePackageMemberDeclaration(nameTokenNode));
+ return true;
+ }
+ if (containingPackage.getEClassifier(name) != null) {
+ logError(new EmfaticSemanticError.DuplicatePackageMemberDeclaration(nameTokenNode));
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private void buildClass(ClassDecl classDecl, EPackage ePackage) {
+ final EClass eClass = EcoreFactory.eINSTANCE.createEClass();
+ cstDecl2EcoreAST.put(classDecl, eClass);
+ String name = getIDText(classDecl.getName());
+ eClass.setName(name);
+ boolean isAbstract = classDecl.getAbstractModifier() != null;
+ eClass.setAbstract(isAbstract);
+ boolean isInterface = "interface".equals(classDecl.getClassKind().getText());
+ eClass.setInterface(isInterface);
+ if (classDecl.getInstClassName() != null) {
+ String instClassName = getValue(classDecl.getInstClassName());
+ eClass.setInstanceClassName(instClassName);
+ }
+ buildAnnotations(classDecl.getAnnotations(), eClass);
+ ePackage.getEClassifiers().add(eClass);
+
+ processTypeParamVarsInEClass(classDecl, eClass);
+
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(Attribute attribute) {
+ if (isDuplicateName(eClass, attribute.getName())) {
+ return false;
+ } else {
+ EAttribute eAttr = EcoreFactory.eINSTANCE.createEAttribute();
+ cstDecl2EcoreAST.put(attribute, eAttr);
+ String attrName = getIDText(attribute.getName());
+ eAttr.setName(attrName);
+ processModifiers(attribute.getModifiers(), eAttr);
+ setMultiplicity(attribute.getTypeWithMulti().getMultiplicity(), eAttr);
+ eClass.getEStructuralFeatures().add(eAttr);
+ if (attribute.getDefaultValueExpr() != null) {
+ String dv = TokenText.Get(attribute.getDefaultValueExpr());
+ eAttr.setDefaultValueLiteral(dv);
+ }
+ buildAnnotations(attribute.getAnnotations(), eAttr);
+ return false;
+ }
+ }
+
+ public boolean beginVisit(Reference reference) {
+ if (isDuplicateName(eClass, reference.getName())) {
+ return false;
+ } else {
+ EReference eRef = EcoreFactory.eINSTANCE.createEReference();
+ cstDecl2EcoreAST.put(reference, eRef);
+ String refName = getIDText(reference.getName());
+ eRef.setName(refName);
+ processModifiers(reference.getModifiers(), eRef);
+ setMultiplicity(reference.getTypeWithMulti().getMultiplicity(), eRef);
+ eClass.getEStructuralFeatures().add(eRef);
+ buildAnnotations(reference.getAnnotations(), eRef);
+ return false;
+ }
+ }
+
+ public boolean beginVisit(Operation operation) {
+ buildOperation(operation, eClass);
+ return false;
+ }
+
+ }).visit(classDecl.getClassMemberDecls());
+
+ }
+
+ /**
+ * processing of the bounds of type params has to be delayed as some of them
+ * may refer to EClass'es not yet added to the EPackage. The type variables
+ * (but not their bounds) are added now however as they may be needed to
+ * correctly determine usages-declarations: a type variable with the same
+ * name as an EClassifier effectively hides it. thus explaining why type
+ * vars are added to the EClass before any attr or ref or op.
+ */
+ private void processTypeParamVarsInEClass(ClassDecl classDecl, final EClass eClass) {
+ if (classDecl.getTypeParamsInfo() == null) {
+ return;
+ }
+ OneOrMoreTypeParams oomtps = classDecl.getTypeParamsInfo().getOneOrMoreTypeParams();
+ if (oomtps == null) {
+ return;
+ }
+ for (ASTNode n : oomtps.getChildren()) {
+ if (n instanceof TypeParam) {
+ TypeParam tp = (TypeParam) n;
+ EmfaticTokenNode nameTokenNode = tp.getTypeVarName();
+ if (isDuplicateTypeVarName(eClass.getETypeParameters(), nameTokenNode)) {
+ logError(new EmfaticSemanticError.DuplicateTypeVariableName(nameTokenNode));
+ } else {
+ ETypeParameter etp = EcoreFactory.eINSTANCE.createETypeParameter();
+ cstDecl2EcoreAST.put(tp, etp);
+ String tvName = getIDText(tp.getTypeVarName());
+ etp.setName(tvName);
+ eClass.getETypeParameters().add(etp);
+ }
+ }
+ }
+ }
+
+ private void processTypeParamVarsInEOperation(Operation oDecl, final EOperation eOp) {
+ if (oDecl.getTypeParamsInfo() == null) {
+ return;
+ }
+ OneOrMoreTypeParams oomtps = oDecl.getTypeParamsInfo().getOneOrMoreTypeParams();
+ if (oomtps == null) {
+ return;
+ }
+ for (ASTNode n : oomtps.getChildren()) {
+ if (n instanceof TypeParam) {
+ TypeParam tp = (TypeParam) n;
+ EmfaticTokenNode nameTokenNode = tp.getTypeVarName();
+ // look out for duplicates among other operation-level type
+ // params
+ if (isDuplicateTypeVarName(eOp.getETypeParameters(), nameTokenNode)) {
+ logError(new EmfaticSemanticError.DuplicateTypeVariableName(nameTokenNode));
+ } else {
+ // look out for duplicates among class-level type params
+ if (isDuplicateTypeVarName(eOp.getEContainingClass().getETypeParameters(), nameTokenNode)) {
+ logError(new EmfaticSemanticError.DuplicateTypeVariableName(nameTokenNode));
+ } else {
+ ETypeParameter etp = EcoreFactory.eINSTANCE.createETypeParameter();
+ cstDecl2EcoreAST.put(tp, etp);
+ String tvName = getIDText(tp.getTypeVarName());
+ etp.setName(tvName);
+ eOp.getETypeParameters().add(etp);
+ }
+ }
+ }
+ }
+ }
+
+ private boolean isDuplicateTypeVarName(EList<ETypeParameter> typeParameters, EmfaticTokenNode nameTokenNode) {
+ String tvName = getIDText(nameTokenNode);
+ for (ETypeParameter tp : typeParameters) {
+ if (tp.getName().equals(tvName)) {
+ logError(new EmfaticSemanticError.DuplicateTypeVariableName(nameTokenNode));
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isDuplicateName(EClass containingClass, EmfaticTokenNode nameTokenNode) {
+ String name = getIDText(nameTokenNode);
+ if (containingClass.getEStructuralFeature(name) != null) {
+ logError(new EmfaticSemanticError.DuplicateClassStructuralFeatureDeclaration(nameTokenNode));
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private void buildOperation(Operation operation, EClass eClass) {
+ final EOperation eOp = EcoreFactory.eINSTANCE.createEOperation();
+ cstDecl2EcoreAST.put(operation, eOp);
+ String opName = getIDText(operation.getName());
+ eOp.setName(opName);
+ processModifiers(operation.getModifiers(), eOp);
+ if (operation.getResType() instanceof TypeWithMulti) {
+ TypeWithMulti twm = (TypeWithMulti) operation.getResType();
+ Multiplicity opMulti = twm.getMultiplicity();
+ setMultiplicity(opMulti, eOp);
+ }
+ eClass.getEOperations().add(eOp);
+ buildAnnotations(operation.getAnnotations(), eOp);
+ if (operation.getParams() != null)
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(Param param) {
+ EParameter eParam = EcoreFactory.eINSTANCE.createEParameter();
+ cstDecl2EcoreAST.put(param, eParam);
+ String paramName = getIDText(param.getName());
+ eParam.setName(paramName);
+ processModifiers(param.getModifiers(), eParam);
+ setMultiplicity(param.getTypeWithMulti().getMultiplicity(), eParam);
+ eOp.getEParameters().add(eParam);
+ buildAnnotations(param, eParam);
+ return false;
+ }
+
+ }).visit(operation.getParams());
+ processTypeParamVarsInEOperation(operation, eOp);
+ }
+
+ private void buildEnum(EnumDecl enumDecl, EPackage ePackage) {
+ final EEnum eEnum = EcoreFactory.eINSTANCE.createEEnum();
+ cstDecl2EcoreAST.put(enumDecl, eEnum);
+ final int lastVal[] = { -1 };
+ String name = getIDText(enumDecl.getName());
+ eEnum.setName(name);
+ buildAnnotations(enumDecl.getAnnotations(), eEnum);
+ ePackage.getEClassifiers().add(eEnum);
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(EnumLiteral enumLiteral) {
+ EEnumLiteral eLit = EcoreFactory.eINSTANCE.createEEnumLiteral();
+ cstDecl2EcoreAST.put(enumLiteral, eLit);
+ String literalName = getIDText(enumLiteral.getName());
+ eLit.setName(literalName);
+ int value;
+ if (enumLiteral.getVal() == null)
+ value = lastVal[0] + 1;
+ else
+ value = Integer.parseInt(enumLiteral.getVal().getText());
+ eLit.setValue(value);
+ lastVal[0] = value;
+ buildAnnotations(enumLiteral, eLit);
+ eEnum.getELiterals().add(eLit);
+ return false;
+ }
+
+ }).visit(enumDecl.getEnumLiterals());
+ }
+
+ private void buildDataType(DataTypeDecl dataTypeDecl, EPackage ePackage) {
+ EDataType eDataType = EcoreFactory.eINSTANCE.createEDataType();
+ cstDecl2EcoreAST.put(dataTypeDecl, eDataType);
+ String name = getIDText(dataTypeDecl.getName());
+ eDataType.setName(name);
+ boolean isSerializable = dataTypeDecl.getTransientModifier() == null;
+ eDataType.setSerializable(isSerializable);
+ String instClassName = getValue(dataTypeDecl.getInstClassName());
+ eDataType.setInstanceClassName(instClassName);
+ buildAnnotations(dataTypeDecl.getAnnotations(), eDataType);
+ ePackage.getEClassifiers().add(eDataType);
+ }
+
+ private void buildMapEntry(MapEntryDecl mapEntryDecl, EPackage ePackage) {
+ EClass eClass = EcoreFactory.eINSTANCE.createEClass();
+ cstDecl2EcoreAST.put(mapEntryDecl, eClass);
+ String name = getIDText(mapEntryDecl.getName());
+ eClass.setName(name);
+ eClass.setInstanceClassName("java.util.Map$Entry");
+ buildAnnotations(mapEntryDecl.getAnnotations(), eClass);
+ ePackage.getEClassifiers().add(eClass);
+ }
+
+ private void buildAnnotations(EmfaticASTNode node, final EModelElement eModelElement) {
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(Annotation annotation) {
+ String literalSourceURI = getValue(annotation.getSource());
+ if ("namespace".equals(literalSourceURI.toLowerCase()) && (eModelElement instanceof EPackage)) {
+ processPackageNamespaceAnnotation(annotation, (EPackage) eModelElement);
+ } else {
+ EAnnotation eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
+ cstDecl2EcoreAST.put(annotation, eAnnotation);
+ String mappedSourceURI = _annotationMap.mapSourceURI(literalSourceURI);
+ if (mappedSourceURI != null)
+ eAnnotation.setSource(mappedSourceURI);
+ else
+ eAnnotation.setSource(literalSourceURI);
+ eModelElement.getEAnnotations().add(eAnnotation);
+ if ("http://www.eclipse.org/emf/2004/EmfaticAnnotationMap".equals(eAnnotation.getSource()))
+ updateAnnotationMap(annotation, eAnnotation);
+ else
+ processAnnotation(annotation, eAnnotation, literalSourceURI);
+ }
+ return false;
+ }
+
+ }).visit(node);
+ }
+
+ private void updateAnnotationMap(Annotation annotation, final EAnnotation eAnnotation) {
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(KeyEqualsValue keyEqualsValue) {
+ String key = getValue(keyEqualsValue.getKey());
+ String value = getValue(keyEqualsValue.getValue());
+ String label = _annotationMap.addMapping(key, value, keyEqualsValue, Builder.this);
+ if (label != null)
+ if (value != null)
+ eAnnotation.getDetails().put(key, value);
+ else
+ eAnnotation.getDetails().put(key, label);
+ return false;
+ }
+
+ }).visit(annotation);
+ }
+
+ private void processAnnotation(Annotation annotation, final EAnnotation eAnnotation, String literalSourceURI) {
+ final int temp[] = new int[1];
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(KeyEqualsValue keyEqualsValue) {
+ temp[0]++;
+ return false;
+ }
+
+ }).visit(annotation);
+ final int paramCount = temp[0];
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(KeyEqualsValue keyEqualsValue) {
+ paramIndex++;
+ String key;
+ String value;
+ if (keyEqualsValue.getEquals() != null) {
+ key = getValue(keyEqualsValue.getKey());
+ value = getValue(keyEqualsValue.getValue());
+ } else {
+ key = _annotationMap.getImplicitKeyName(eAnnotation.getSource(), paramIndex, paramCount);
+ if (key == null) {
+ key = "value";
+ if (paramIndex > 0)
+ key = key + Integer.toString(paramIndex + 1);
+ logWarning(new EmfaticSemanticWarning.UnknownAttributeImplicitKey(keyEqualsValue, key));
+ }
+ value = getValue(keyEqualsValue.getKey());
+ }
+ eAnnotation.getDetails().put(key, value);
+ return false;
+ }
+
+ int paramIndex;
+
+ {
+ paramIndex = -1;
+ }
+ }).visit(annotation);
+ }
+
+ private void processPackageNamespaceAnnotation(Annotation namespaceAnnotation, final EPackage ePackage) {
+
+ new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(KeyEqualsValue keyEqualsValue) {
+ String key = getValue(keyEqualsValue.getKey()).toLowerCase();
+ String value = getValue(keyEqualsValue.getValue());
+
+ if (EmfaticAnnotationMap.EPACKAGE_NSPREFIX_KEY.equals(key)) {
+ ePackage.setNsPrefix(value);
+ }
+ else if (EmfaticAnnotationMap.EPACKAGE_NSURI_KEY.equals(key)) {
+ ePackage.setNsURI(value);
+ }
+ else {
+ logWarning(new EmfaticSemanticWarning.UnknownEPackageNamespaceAttributeKey(keyEqualsValue));
+ }
+
+ return false;
+ }
+
+ }.visit(namespaceAnnotation);
+
+ }
+
+
+ //
+ // Modifiers
+ //
+
+ private void processModifiers(Modifiers modifiers, final ETypedElement eTypedElement) {
+ new EmfaticASTNodeVisitor() {
+ public boolean beginVisit(OptNegatedModifier optNegatedModifier) {
+ boolean modifierValue = (optNegatedModifier.getBang() == null);
+ String modifierText = optNegatedModifier.getModifier().getText();
+
+ if (modifierText.equals(Modifier.KW_UNIQUE)) {
+ eTypedElement.setUnique(modifierValue);
+ }
+ else if (modifierText.equals(Modifier.KW_ORDERED)) {
+ eTypedElement.setOrdered(modifierValue);
+ }
+
+ return false;
+ }
+ }.visit(modifiers);
+
+ if (eTypedElement instanceof EStructuralFeature) {
+ processModifiersHelper(modifiers, (EStructuralFeature)eTypedElement);
+ }
+ }
+
+ private void processModifiersHelper(Modifiers modifiers, final EStructuralFeature eStructuralFeature) {
+ new EmfaticASTNodeVisitor() {
+ public boolean beginVisit(OptNegatedModifier optNegatedModifier) {
+ boolean modifierValue = (optNegatedModifier.getBang() == null);
+ String modifierText = optNegatedModifier.getModifier().getText();
+
+ if (modifierText.equals(Modifier.KW_READONLY)) {
+ eStructuralFeature.setChangeable(!modifierValue);
+ }
+ else if (modifierText.equals(Modifier.KW_VOLATILE)) {
+ eStructuralFeature.setVolatile(modifierValue);
+ }
+ else if (modifierText.equals(Modifier.KW_TRANSIENT)) {
+ eStructuralFeature.setTransient(modifierValue);
+ }
+ else if (modifierText.equals(Modifier.KW_UNSETTABLE)) {
+ eStructuralFeature.setUnsettable(modifierValue);
+ }
+ else if (modifierText.equals(Modifier.KW_DERIVED)) {
+ eStructuralFeature.setDerived(modifierValue);
+ }
+ else if (modifierText.equals(Modifier.KW_ID)) {
+ if (eStructuralFeature instanceof EAttribute) {
+ EAttribute eAttribute = (EAttribute)eStructuralFeature;
+ eAttribute.setID(modifierValue);
+ }
+ }
+ else if (modifierText.equals(Modifier.KW_RESOLVE)) {
+ if (eStructuralFeature instanceof EReference) {
+ EReference eReference = (EReference)eStructuralFeature;
+ eReference.setResolveProxies(modifierValue);
+ }
+ }
+
+ return false;
+ }
+ }.visit(modifiers);
+
+ }
+
+ protected OneToOneMap<ASTNode, EObject> getCstDecl2EcoreASTMap() {
+ return cstDecl2EcoreAST;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Connector.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Connector.java
new file mode 100644
index 0000000..f39dbbd
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/Connector.java
@@ -0,0 +1,644 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generator.ecore;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EGenericType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.ETypeParameter;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.emfatic.core.generics.util.GenericsUtil;
+import org.eclipse.emf.emfatic.core.generics.util.OneToManyMap;
+import org.eclipse.emf.emfatic.core.generics.util.OneToOneMap;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Attribute;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.BoundExceptWildcard;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNodeVisitor;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ImportStmt;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ImportStmts;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.MapEntryDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Multiplicity;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.OneOrMoreTypeArgs;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Operation;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Param;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.QualifiedID;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Reference;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ResultType;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.SubPackageDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TopLevelDecls;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeArg;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeParam;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeParamsInfo;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeWithMulti;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.VoidContainer;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Wildcard;
+import org.eclipse.emf.emfatic.core.util.EmfaticBasicTypes;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.parser.ParseContext;
+
+
+
+/**
+ *
+ * @author cjdaly@us.ibm.com
+ * @author miguel.garcia@tuhh.de
+ */
+ public class Connector extends GenerationPhase {
+
+ private OneToOneMap<ASTNode, EObject> cstDecl2EcoreAST = null;
+ private OneToManyMap<EObject, ASTNode> ecoreDecl2cstUse = new OneToManyMap<EObject, ASTNode>();
+
+ public Connector(Builder b) {
+ this.cstDecl2EcoreAST = b.getCstDecl2EcoreASTMap();
+ }
+
+ public void connect(ParseContext parseContext, Resource resource, IProgressMonitor monitor) {
+ ecoreDecl2cstUse.clear();
+ initParseContext(parseContext);
+ CompUnit compUnit = (CompUnit) parseContext.getParseRoot();
+ _importedPackages = new ArrayList<EPackage>();
+ _importedPackages.add(EcorePackage.eINSTANCE);
+ doImports(compUnit.getImportStmts());
+ EPackage mainPackage = (EPackage) resource.getContents().get(0);
+ doPackage(compUnit.getTopLevelDecls(), mainPackage);
+ compUnit.setMaps(cstDecl2EcoreAST, ecoreDecl2cstUse);
+ }
+
+ private void doImports(ImportStmts importStmts) {
+ final ResourceSet resourceSet = new ResourceSetImpl();
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(ImportStmt importStmt) {
+ String uriText = getValue(importStmt.getUri());
+ URI uri = URI.createURI(uriText);
+ Resource resource = tryLoadResource(uri);
+ if (resource != null) {
+ EPackage ePackage = (EPackage) resource.getContents().get(0);
+ _importedPackages.add(ePackage);
+ } else {
+ logError(new EmfaticSemanticError.ImportNotFound(importStmt));
+ }
+ return false;
+ }
+
+ private Resource tryLoadResource(URI uri) {
+ try {
+ Resource resource = resourceSet.getResource(uri, true);
+ if (resource != null && resource.isLoaded())
+ return resource;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return null;
+ }
+
+ }).visit(importStmts);
+ }
+
+ private void doPackage(TopLevelDecls topLevelDecls, final EPackage ePackage) {
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(SubPackageDecl subPackageDecl) {
+ String subPackageName = getIDText(subPackageDecl.getName());
+ EPackage subPackage = getSubPackage(ePackage, subPackageName);
+ doPackage(subPackageDecl.getTopLevelDecls(), subPackage);
+ return false;
+ }
+
+ public boolean beginVisit(ClassDecl classDecl) {
+ String className = getIDText(classDecl.getName());
+ EClass eClass = (EClass) ePackage.getEClassifier(className);
+ doClass(classDecl, eClass);
+ return false;
+ }
+
+ public boolean beginVisit(MapEntryDecl mapEntryDecl) {
+ String className = getIDText(mapEntryDecl.getName());
+ EClass eClass = (EClass) ePackage.getEClassifier(className);
+ doMapEntry(mapEntryDecl, eClass);
+ return false;
+ }
+
+ }).visit(topLevelDecls);
+ }
+
+ private void doClass(ClassDecl classDecl, final EClass eClass) {
+ final EPackage ePackage = eClass.getEPackage();
+
+ // resolve the bounds for each type param
+ if (classDecl.getTypeParamsInfo() != null) {
+ addBoundsToTypeParams(classDecl.getTypeParamsInfo(), eClass.getETypeParameters(), ePackage);
+ }
+
+ if (classDecl.getSuperTypes() != null)
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(BoundExceptWildcard bew) {
+ List<ETypeParameter> visibleTPs = eClass.getETypeParameters();
+ // add AST nodes for super types
+ EGenericType superType = resolve(ePackage, bew, visibleTPs);
+ if (superType != null) {
+ placeBewInBigMap(bew, superType);
+ EClassifier superClass = superType.getEClassifier();
+ if (GenericsUtil.isRefToClassifier(superType)) {
+ if (superClass instanceof EClass) {
+ eClass.getESuperTypes().add((EClass)superClass);
+ } else {
+ QualifiedID qualifiedID = bew.getRawTNameOrTVarOrParamzedTName();
+ logError(new EmfaticSemanticError.IllegalSuperClassKind(qualifiedID));
+ }
+ } else {
+ eClass.getEGenericSuperTypes().add(superType);
+ }
+ } else {
+ QualifiedID qualifiedID = bew.getRawTNameOrTVarOrParamzedTName();
+ logError(new EmfaticSemanticError.IllegalSuperClassKind(qualifiedID));
+ }
+ return false;
+ }
+
+ }).visit(classDecl.getSuperTypes());
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(Attribute attribute) {
+ String attrName = getIDText(attribute.getName());
+ EAttribute eAttr = (EAttribute) eClass.getEStructuralFeature(attrName);
+ doAttribute(attribute, eAttr, ePackage);
+ return false;
+ }
+
+ public boolean beginVisit(Reference reference) {
+ String refName = getIDText(reference.getName());
+ EReference eRef = (EReference) eClass.getEStructuralFeature(refName);
+ doReference(reference, eRef, ePackage);
+ return false;
+ }
+
+ public boolean beginVisit(Operation operation) {
+ String opName = getIDText(operation.getName());
+ EOperation eOp = getOperation(eClass, opName);
+ doOperation(operation, eOp, ePackage);
+ return false;
+ }
+
+ }).visit(classDecl.getClassMemberDecls());
+ }
+
+ private void addBoundsToTypeParams(final TypeParamsInfo tpi, final List<ETypeParameter> visibleTPs,
+ final EPackage ePackage) {
+ new EmfaticASTNodeVisitor() {
+ @Override
+ public boolean beginVisit(TypeParam tp) {
+ String tp2 = TokenText.Get(tp.getTypeVarName()).trim();
+ if (tp.getTypeBoundsInfo() != null) {
+ for (ASTNode tbN : tp.getTypeBoundsInfo().getOneOrMoreTypeParamBounds().getChildren()) {
+ if (tbN instanceof BoundExceptWildcard) {
+ BoundExceptWildcard bew = (BoundExceptWildcard) tbN;
+ EGenericType eTPBound = resolve(ePackage, bew, visibleTPs);
+ placeBewInBigMap(bew, eTPBound);
+ String tvName = getIDText(tp.getTypeVarName());
+ ETypeParameter eTP = lookup(tvName, visibleTPs);
+ eTP.getEBounds().add(eTPBound);
+ }
+ }
+ }
+ return false;
+ }
+ }.visit(tpi.getOneOrMoreTypeParams());
+ }
+
+ private void doMapEntry(MapEntryDecl mapEntryDecl, EClass eClass) {
+ doMapEntryPart("key", mapEntryDecl.getKey(), eClass);
+ doMapEntryPart("value", mapEntryDecl.getValue(), eClass);
+ }
+
+ private void doMapEntryPart(String partName, TypeWithMulti partTypeWithMulti, EClass eClass) {
+ QualifiedID qualifiedID = getQualifiedID(partTypeWithMulti);
+ Multiplicity multiplicity = partTypeWithMulti.getMultiplicity();
+ EClassifier refType = resolve(eClass.getEPackage(), qualifiedID);
+ BoundExceptWildcard bew = partTypeWithMulti.getName();
+ EGenericType eRefType = resolve(eClass.getEPackage(), bew, eClass.getETypeParameters());
+ if (refType != null) {
+ placeBewInBigMap(bew, eRefType);
+ if (refType instanceof EDataType) {
+ EAttribute eAttr = EcoreFactory.eINSTANCE.createEAttribute();
+ eAttr.setName(partName);
+ eAttr.setEGenericType(eRefType);
+ setMultiplicity(multiplicity, eAttr);
+ eClass.getEStructuralFeatures().add(eAttr);
+ /*
+ * this correspondence is necessary in addition to that for type
+ * of attr
+ */
+ cstDecl2EcoreAST.put(partTypeWithMulti.getParent(), eAttr);
+ } else {
+ EReference eRef = EcoreFactory.eINSTANCE.createEReference();
+ eRef.setName(partName);
+ eRef.setEGenericType(eRefType);
+ setMultiplicity(multiplicity, eRef);
+ eClass.getEStructuralFeatures().add(eRef);
+ /*
+ * this correspondence is necessary in addition to that for type
+ * of attr
+ */
+ cstDecl2EcoreAST.put(partTypeWithMulti.getParent(), eRef);
+ }
+ } else {
+ logError(new EmfaticSemanticError.IllegalAttributeKind(qualifiedID));
+ }
+ }
+
+ private QualifiedID getQualifiedID(TypeWithMulti twm) {
+ QualifiedID qualifiedID = twm.getName().getRawTNameOrTVarOrParamzedTName();
+ return qualifiedID;
+ }
+
+ private void doAttribute(Attribute attribute, EAttribute eAttr, EPackage ePackage) {
+ BoundExceptWildcard bew = attribute.getTypeWithMulti().getName();
+ List<ETypeParameter> visibleTPs = eAttr.getEContainingClass().getETypeParameters();
+ EGenericType refType = resolve(ePackage, bew, visibleTPs);
+ if (refType != null) {
+ EClassifier refedClassifier = refType.getEClassifier();
+ /*
+ * refType may refer to a type param. However if it refers to an
+ * EClassifier it better be an EDataType!
+ */
+ if ((refedClassifier != null) && !(refedClassifier instanceof EDataType)) {
+ QualifiedID qid = bew.getRawTNameOrTVarOrParamzedTName();
+ logError(new EmfaticSemanticError.IllegalAttributeKind(qid));
+ } else {
+ eAttr.setEGenericType(refType);
+ placeBewInBigMap(bew, refType);
+ }
+ }
+ String defaultValue = getValue(attribute.getDefaultValueExpr());
+ if (defaultValue != null)
+ eAttr.setDefaultValueLiteral(defaultValue);
+ }
+
+ private void doReference(Reference reference, EReference eRef, EPackage ePackage) {
+ BoundExceptWildcard bew = reference.getTypeWithMulti().getName();
+ List<ETypeParameter> visibleTPs = eRef.getEContainingClass().getETypeParameters();
+ EGenericType refType = resolve(ePackage, bew, visibleTPs);
+ QualifiedID qualifiedID = bew.getRawTNameOrTVarOrParamzedTName();
+ if (refType != null) {
+ placeBewInBigMap(bew, refType);
+ eRef.setEGenericType(refType);
+ // compute oppositeName if not pointing to a type param
+ EClassifier refedClassifier = refType.getEClassifier();
+ if ("val".equals(reference.getReferenceKind().getText())) {
+ eRef.setContainment(true);
+ }
+ if ((refedClassifier != null) && (refedClassifier instanceof EClass)) {
+ String oppositeName = null;
+ if (reference.getOppositeName() != null) {
+ oppositeName = getIDText(reference.getOppositeName());
+ EClass refTypeClass = (EClass) refedClassifier;
+ EReference opposite = (EReference) refTypeClass.getEStructuralFeature(oppositeName);
+ ecoreDecl2cstUse.put(opposite, reference.getOppositeName());
+ eRef.setEOpposite(opposite);
+ }
+ }
+ } else {
+ logError(new EmfaticSemanticError.NameResolutionFailure(qualifiedID));
+ }
+ }
+
+ private void doOperation(final Operation operation, final EOperation eOp, final EPackage ePackage) {
+
+ // resolve the bounds for each type param
+ if (operation.getTypeParamsInfo() != null) {
+ List<ETypeParameter> visibleTPs = visibleTypeParams(eOp);
+ addBoundsToTypeParams(operation.getTypeParamsInfo(), visibleTPs, ePackage);
+ }
+
+ ResultType t = operation.getResType();
+ if (t instanceof VoidContainer) {
+ // the return type of eOp is void
+ eOp.setEType(null);
+ } else {
+ TypeWithMulti twm = (TypeWithMulti) t;
+ BoundExceptWildcard bew = twm.getName();
+ List<ETypeParameter> visibleTPs = visibleTypeParams(eOp);
+ EGenericType refType = resolve(ePackage, bew, visibleTPs);
+ if (refType != null) {
+ placeBewInBigMap(bew, refType);
+ eOp.setEGenericType(refType);
+ }
+ }
+ if (operation.getParams() != null)
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(Param param) {
+ BoundExceptWildcard bew = param.getTypeWithMulti().getName();
+ List<ETypeParameter> visibleTPs = visibleTypeParams(eOp);
+ EGenericType paramRefType = resolve(ePackage, bew, visibleTPs);
+ if (paramRefType != null) {
+ placeBewInBigMap(bew, paramRefType);
+ String paramName = getIDText(param.getName());
+ EParameter eParam = getParam(eOp, paramName);
+ if (eParam != null)
+ eParam.setEGenericType(paramRefType);
+ }
+ return false;
+ }
+
+ }).visit(operation.getParams());
+ if (operation.getExceptions() != null)
+ (new EmfaticASTNodeVisitor() {
+
+ public boolean beginVisit(BoundExceptWildcard bew) {
+ List<ETypeParameter> visibleTPs = visibleTypeParams(eOp);
+ EGenericType exceptionType = resolve(ePackage, bew, visibleTPs);
+ if (exceptionType != null) {
+ placeBewInBigMap(bew, exceptionType);
+ eOp.getEGenericExceptions().add(exceptionType);
+ }
+ return false;
+ }
+
+ }).visit(operation.getExceptions());
+ }
+
+ /**
+ * (a) the type params declared for the operation plus (b) only those from
+ * the type params section of the class whose name is not among those in (a)
+ */
+ public static List<ETypeParameter> visibleTypeParams(EOperation eOp) {
+ List<ETypeParameter> visibleTPs = new LinkedList<ETypeParameter>();
+ visibleTPs.addAll(eOp.getETypeParameters());
+ for (ETypeParameter classTP : eOp.getEContainingClass().getETypeParameters()) {
+ boolean hiddenByOpLevelDecl = false;
+ for (ETypeParameter visibleTP : visibleTPs) {
+ if (visibleTP.getName().equals(classTP.getName())) {
+ hiddenByOpLevelDecl = true;
+ }
+ }
+ if (!hiddenByOpLevelDecl) {
+ visibleTPs.add(classTP);
+ }
+ }
+ return visibleTPs;
+ }
+
+ private EClassifier resolve(EPackage context, QualifiedID qualifiedID) {
+ String rawQIDText = TokenText.Get(qualifiedID);
+ EClassifier eClassifier = resolveHelper(context, qualifiedID);
+ if (eClassifier == null)
+ logError(new EmfaticSemanticError.NameResolutionFailure(qualifiedID));
+ return eClassifier;
+ }
+
+ private EClassifier resolveHelper(EPackage context, QualifiedID qualifiedID) {
+ String rawQIDText = TokenText.Get(qualifiedID);
+ if (rawQIDText.indexOf('.') == -1 && rawQIDText.indexOf('~') == -1) {
+ /*
+ * before looking among built-in types, we look for a classifier in
+ * the same package
+ */
+ EClassifier atSamePackage = context.getEClassifier(rawQIDText);
+ if (atSamePackage != null) {
+ return atSamePackage;
+ }
+
+ EClassifier basicType = EmfaticBasicTypes.LookupBasicType(rawQIDText);
+ if (basicType != null)
+ return basicType;
+ }
+ String qidText = getIDText(qualifiedID);
+ String idParts[] = qidText.split("\\.");
+ for (EPackage currentContext = context; currentContext != null; currentContext = currentContext
+ .getESuperPackage()) {
+ EClassifier eClassifier = resolveHelper(currentContext, idParts);
+ if (eClassifier != null)
+ return eClassifier;
+ }
+
+ for (Iterator<EPackage> i = _importedPackages.iterator(); i.hasNext();) {
+ EPackage importedPackage = i.next();
+ String importedPackageName = importedPackage.getName();
+ if (importedPackageName.length() < qidText.length()) {
+ String qidTextStart = qidText.substring(0, importedPackageName.length());
+ if (qidTextStart.equals(importedPackageName) && qidText.charAt(importedPackageName.length()) == '.') {
+ String qidTextEnd = qidText.substring(importedPackageName.length() + 1);
+ String qidTextEndParts[] = qidTextEnd.split("\\.");
+ EClassifier eClassifier = resolveHelper(importedPackage, qidTextEndParts);
+ if (eClassifier != null)
+ return eClassifier;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private EClassifier resolveHelper(EPackage context, String idParts[]) {
+ if (idParts.length == 1)
+ return context.getEClassifier(idParts[0]);
+ EPackage subPackage = getSubPackage(context, idParts[0]);
+ if (subPackage != null) {
+ String subParts[] = removeFirst(idParts);
+ return resolveHelper(subPackage, subParts);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * The production rule for BoundExceptWildcard (in Gymnast syntax) is:
+ *
+ * sequence boundExceptWildcard : rawTNameOrTVarOrParamzedTName=qualifiedID
+ * (LT oneOrMoreTypeArgs GT)? ;
+ *
+ * The qualified name may stand for a type variable, a reference to a
+ * non-generic type, a raw reference to a generic type, or a parameterized
+ * type. Scopes are to be searched in that order.
+ *
+ */
+ private EGenericType resolve(EPackage context, BoundExceptWildcard bew, List<ETypeParameter> typeParamsInScope) {
+ QualifiedID qualifiedID = bew.getRawTNameOrTVarOrParamzedTName();
+ String rawQIDText = TokenText.Get(qualifiedID);
+ if (bew.getOneOrMoreTypeArgs() == null) {
+ /*
+ * no type args: either a ref to a type var, ref to non-generic
+ * type, or raw reference to generic type
+ */
+ ETypeParameter refedTP = lookup(rawQIDText, typeParamsInScope);
+ if (refedTP != null) {
+ EGenericType egt = GenericsUtil.getRefToTypeParam(refedTP);
+ return egt;
+ }
+ // fall back to
+ EClassifier eClassifier = resolveHelper(context, qualifiedID);
+ if (eClassifier == null) {
+ logError(new EmfaticSemanticError.NameResolutionFailure(qualifiedID));
+ return null;
+ }
+ return GenericsUtil.getEGenericType(eClassifier);
+ } else {
+ // there are type args, it has to be a parameterized type
+ EClassifier eClassifier = resolveHelper(context, qualifiedID);
+ if (eClassifier == null) {
+ logError(new EmfaticSemanticError.NameResolutionFailure(qualifiedID));
+ return null;
+ } else {
+ EGenericType res = GenericsUtil.getEGenericType(eClassifier);
+ // make AST nodes for type args, wildcards are allowed
+ OneOrMoreTypeArgs oomtas = bew.getOneOrMoreTypeArgs();
+ for (ASTNode taN : oomtas.getChildren()) {
+ if (taN instanceof TypeArg) {
+ EGenericType newTypeArg = null;
+ if (taN instanceof BoundExceptWildcard) {
+ // recursive call
+ newTypeArg = resolve(context, (BoundExceptWildcard) taN, typeParamsInScope);
+ } else {
+ // not recursive call
+ newTypeArg = resolve(context, (Wildcard) taN, typeParamsInScope);
+ }
+ if (newTypeArg != null) {
+ res.getETypeArguments().add(newTypeArg);
+ }
+ }
+ }
+ return res;
+ }
+ }
+ }
+
+ private EGenericType resolve(EPackage context, Wildcard w, List<ETypeParameter> typeParamsInScope) {
+ EGenericType res = null;
+ if (w.getBoundExceptWildcard() == null) {
+ // unbounded wildcard
+ res = GenericsUtil.getUnboundedWildcard();
+ return res;
+ } else {
+ BoundExceptWildcard bew = w.getBoundExceptWildcard();
+ EGenericType b = resolve(context, bew, typeParamsInScope);
+ // in case b == null, error reporting already performed by resolve
+ if (b != null) {
+ String kw = w.getExtendsOrSuper().getText().toLowerCase().trim();
+ if (kw.equals("extends")) {
+ res = GenericsUtil.getUpperBoundedWildcard(b);
+ } else {
+ res = GenericsUtil.getLowerBoundedWildcard(b);
+ }
+ }
+ return res;
+ }
+ }
+
+ private String[] removeFirst(String idParts[]) {
+ String subParts[] = new String[idParts.length - 1];
+ for (int i = 0; i < subParts.length; i++)
+ subParts[i] = idParts[i + 1];
+
+ return subParts;
+ }
+
+ private ArrayList<EPackage> _importedPackages;
+
+ public static ETypeParameter lookup(String tvName, List<ETypeParameter> etps) {
+ for (ETypeParameter tp : etps) {
+ if (tp.getName().equals(tvName)) {
+ return tp;
+ }
+ }
+ return null;
+ }
+
+ private static boolean isClassifier(EGenericType egt) {
+ if (egt == null) {
+ return false;
+ }
+ boolean res = (egt.getEClassifier() != null) && (egt.getETypeArguments().size() == 0)
+ && (egt.getETypeParameter() == null);
+ return res;
+ }
+
+ private void placeBewInBigMap(final BoundExceptWildcard bew, final EGenericType gt) {
+ EObject ecoreDecl = getEcoreDeclForTypeRef(gt);
+ ecoreDecl2cstUse.put(ecoreDecl, bew.getRawTNameOrTVarOrParamzedTName());
+ /*
+ * doing the above is not enough as we want hyperlinks also to detect
+ * the nodes for (parts of) type arguments
+ */
+ if (bew.getOneOrMoreTypeArgs() == null) {
+ return;
+ }
+ int etaIndex = -1;
+ for (int i = 0; i < bew.getOneOrMoreTypeArgs().getChildren().length; i++) {
+ ASTNode taN = bew.getOneOrMoreTypeArgs().getChildren()[i];
+ if (taN instanceof TypeArg) {
+ etaIndex++;
+ EGenericType taE = gt.getETypeArguments().get(etaIndex);
+ if (taN instanceof Wildcard) {
+ Wildcard taWN = (Wildcard) taN;
+ BoundExceptWildcard bew2 = taWN.getBoundExceptWildcard();
+ if (bew2 != null) {
+ EGenericType taB = null;
+ if (taWN.getExtendsOrSuper().getText().trim().toLowerCase().equals("extends")) {
+ taB = taE.getEUpperBound();
+ } else {
+ taB = taE.getELowerBound();
+ }
+ placeBewInBigMap(bew2, taB);
+ }
+ } else {
+ BoundExceptWildcard taBewN = (BoundExceptWildcard) taN;
+ placeBewInBigMap(taBewN, taE);
+ }
+ }
+ }
+ }
+
+ public static EObject getEcoreDeclForTypeRef(EGenericType gt) {
+ EObject ecoreDecl = null;
+ if (GenericsUtil.isRefToClassifier(gt)) {
+ ecoreDecl = gt.getEClassifier();
+ } else {
+ ecoreDecl = gt.getETypeParameter();
+ }
+ return ecoreDecl;
+ }
+
+ private ASTNode getCstDeclForTypeRef(EGenericType gt) {
+ ASTNode cstDecl = null;
+ if (GenericsUtil.isRefToClassifier(gt)) {
+ EClassifier c = gt.getEClassifier();
+ cstDecl = cstDecl2EcoreAST.getInv(c);
+ } else {
+ ETypeParameter tp = gt.getETypeParameter();
+ cstDecl = cstDecl2EcoreAST.getInv(tp);
+ }
+ return cstDecl;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/EcoreGenerator.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/EcoreGenerator.java
new file mode 100644
index 0000000..c63592f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/EcoreGenerator.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generator.ecore;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.emfatic.core.lang.gen.parser.EmfaticParserDriver;
+import org.eclipse.gymnast.runtime.core.parser.ParseContext;
+import org.eclipse.gymnast.runtime.core.parser.ParseMessage;
+import org.eclipse.gymnast.runtime.core.util.MarkerUtil;
+
+/**
+ *
+ * @author cjdaly@us.ibm.com
+ */
+public class EcoreGenerator {
+
+ public EcoreGenerator() {
+ }
+
+ public void generate(IFile emfFile, IProgressMonitor monitor) {
+ generate(emfFile, true, monitor);
+ }
+
+ public void generate(IFile emfFile, boolean writeEcore, IProgressMonitor monitor) {
+ try {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(emfFile.getContents()));
+ EmfaticParserDriver parser = new EmfaticParserDriver();
+ ParseContext parseContext = parser.parse(reader);
+ String filePath = getEcoreFilePath(emfFile);
+ Resource resource = createResource(filePath);
+ Builder builder = new Builder();
+ builder.build(parseContext, resource, monitor);
+ if (!parseContext.hasErrors()) {
+ Connector connector = new Connector(builder);
+ connector.connect(parseContext, resource, monitor);
+ }
+ MarkerUtil.updateMarkers(emfFile, parseContext);
+
+ boolean showStopper = false;
+ /*
+ * we let ecores to be written as long as they contain only errors
+ * detected by EcoreValidatorDiagnostic, as such errors can be
+ * solved with Sample Ecore Editor
+ */
+ for (ParseMessage pm : parseContext.getMessages()) {
+ showStopper |= !(pm instanceof EmfaticSemanticWarning.EcoreValidatorDiagnostic);
+ }
+
+ if (!showStopper && writeEcore)
+ resource.save(null);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ private String getEcoreFilePath(IFile emfFile) {
+ String emfFileExt = emfFile.getFileExtension();
+ int extLen = emfFileExt != null ? emfFileExt.length() + 1 : 0;
+ String emfFileName = emfFile.getName();
+ String fileName = emfFileName.substring(0, emfFileName.length() - extLen);
+ fileName = fileName + ".ecore";
+ String filePath = emfFile.getFullPath().removeLastSegments(1).append(fileName).toString();
+ return filePath;
+ }
+
+ private Resource createResource(String filePath) {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ URI uri = URI.createPlatformResourceURI(filePath);
+ Resource resource = resourceSet.createResource(uri);
+ return resource;
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/EmfaticSemanticError.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/EmfaticSemanticError.java
new file mode 100644
index 0000000..c62ca55
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/EmfaticSemanticError.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generator.ecore;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticTokenNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ImportStmt;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.QualifiedID;
+import org.eclipse.gymnast.runtime.core.parser.ParseError;
+
+public abstract class EmfaticSemanticError extends ParseError
+{
+ public static class DuplicateTypeVariableName extends EmfaticSemanticError {
+ DuplicateTypeVariableName(EmfaticTokenNode nameTokenNode)
+ {
+ String nameText = TokenText.Get(nameTokenNode);
+ String message = "Duplicate type variable name: " + nameText;
+ int rangeStart = nameTokenNode.getRangeStart();
+ int rangeLength = nameTokenNode.getRangeLength();
+ init(message, rangeStart, rangeLength);
+ }
+ }
+
+ public static class ImportNotFound extends EmfaticSemanticError
+ {
+
+ ImportNotFound(ImportStmt importStmt)
+ {
+ String rawQIDText = TokenText.Get(importStmt.getUri());
+ String message = "Failed to load import model: " + rawQIDText;
+ init(message, importStmt.getRangeStart(), importStmt.getRangeLength());
+ }
+ }
+
+ public static class DuplicatePackageMemberDeclaration extends EmfaticSemanticError
+ {
+
+ DuplicatePackageMemberDeclaration(EmfaticTokenNode nameTokenNode)
+ {
+ String nameText = TokenText.Get(nameTokenNode);
+ String message = "Duplicate package member declaration: " + nameText;
+ int rangeStart = nameTokenNode.getRangeStart();
+ int rangeLength = nameTokenNode.getRangeLength();
+ init(message, rangeStart, rangeLength);
+ }
+ }
+
+ public static class DuplicateClassStructuralFeatureDeclaration extends EmfaticSemanticError
+ {
+
+ DuplicateClassStructuralFeatureDeclaration(EmfaticTokenNode nameTokenNode)
+ {
+ String nameText = TokenText.Get(nameTokenNode);
+ String message = "Duplicate class structural feature declaration: " + nameText;
+ int rangeStart = nameTokenNode.getRangeStart();
+ int rangeLength = nameTokenNode.getRangeLength();
+ init(message, rangeStart, rangeLength);
+ }
+ }
+
+ public static class NameResolutionFailure extends EmfaticSemanticError
+ {
+
+ NameResolutionFailure(QualifiedID qualifiedID)
+ {
+ String rawQIDText = TokenText.Get(qualifiedID);
+ String message = "Failed to resolve type: " + rawQIDText;
+ init(message, qualifiedID.getRangeStart(), qualifiedID.getRangeLength());
+ }
+ }
+
+ public static class IllegalSuperClassKind extends EmfaticSemanticError
+ {
+
+ IllegalSuperClassKind(QualifiedID qualifiedID)
+ {
+ String message = "Superclass must be an EClass!";
+ init(message, qualifiedID.getRangeStart(), qualifiedID.getRangeLength());
+ }
+ }
+
+ public static class IllegalAttributeKind extends EmfaticSemanticError
+ {
+
+ IllegalAttributeKind(QualifiedID qualifiedID)
+ {
+ String message = "Attribute type must be an EDataType!";
+ init(message, qualifiedID.getRangeStart(), qualifiedID.getRangeLength());
+ }
+ }
+
+ public static class IllegalReferenceKind extends EmfaticSemanticError
+ {
+
+ IllegalReferenceKind(QualifiedID qualifiedID)
+ {
+ String message = "Reference type must be an EClass!";
+ init(message, qualifiedID.getRangeStart(), qualifiedID.getRangeLength());
+ }
+ }
+
+ public EmfaticSemanticError()
+ {
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/EmfaticSemanticWarning.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/EmfaticSemanticWarning.java
new file mode 100644
index 0000000..3166b97
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/EmfaticSemanticWarning.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generator.ecore;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.KeyEqualsValue;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.parser.ParseWarning;
+
+
+/**
+ *
+ * @author cjdaly@us.ibm.com
+ */
+public abstract class EmfaticSemanticWarning extends ParseWarning {
+ public static class UnknownEPackageNamespaceAttributeKey extends EmfaticSemanticWarning {
+
+ UnknownEPackageNamespaceAttributeKey(KeyEqualsValue keyEqualsValue) {
+ String key = TokenText.Get(keyEqualsValue.getKey());
+ String message = "Ignoring unknown EPackage namespace annotation key: " + key
+ + ". (Use \"uri\" or \"prefix\" for keys here.)";
+ init(message, keyEqualsValue.getRangeStart(), keyEqualsValue.getRangeLength());
+ }
+ }
+
+ public static class UnknownAttributeImplicitKey extends EmfaticSemanticWarning {
+
+ UnknownAttributeImplicitKey(KeyEqualsValue keyEqualsValue, String generatedKey) {
+ String message = "Annotation with undefined implicit key name. Using key: " + generatedKey
+ + ". (See documentation for use of " + "EmfaticAnnotationMap" + " annotation)";
+ init(message, keyEqualsValue.getRangeStart(), keyEqualsValue.getRangeLength());
+ }
+ }
+
+ public static class AnnotationMappingProblem extends EmfaticSemanticWarning {
+
+ public AnnotationMappingProblem(KeyEqualsValue keyEqualsValue, String message) {
+ init(message, keyEqualsValue.getRangeStart(), keyEqualsValue.getRangeLength());
+ }
+ }
+
+ public static class EcoreValidatorDiagnostic extends EmfaticSemanticWarning {
+
+ public EcoreValidatorDiagnostic(ASTNode node, String message) {
+ init(message, node.getRangeStart(), node.getRangeLength());
+ }
+
+ public EcoreValidatorDiagnostic(String message, int rangeStart, int rangeLength) {
+ init(message, rangeStart, rangeLength);
+ }
+ }
+
+ public EmfaticSemanticWarning() {
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/GenerationPhase.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/GenerationPhase.java
new file mode 100644
index 0000000..5815b67
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/GenerationPhase.java
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generator.ecore;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.BoolExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.BoundExceptWildcard;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CharExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.DefaultValueExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticTokenNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.IntExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Multiplicity;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.MultiplicityExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.QualifiedID;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.QualifiedIDContainer;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.StringExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.StringLiteralContainer;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.StringLiteralOrQualifiedID;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeArg;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Wildcard;
+import org.eclipse.emf.emfatic.core.util.EmfaticKeywords;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.parser.ParseContext;
+
+/**
+ *
+ * @author cjdaly@us.ibm.com
+ * @author miguel.garcia@tuhh.de
+ */
+public abstract class GenerationPhase {
+
+ public GenerationPhase() {
+ }
+
+ protected void initParseContext(ParseContext parseContext) {
+ _parseContext = parseContext;
+ }
+
+ public void logError(EmfaticSemanticError error) {
+ _parseContext.addParseMessage(error);
+ }
+
+ public void logWarning(EmfaticSemanticWarning warning) {
+ _parseContext.addParseMessage(warning);
+ }
+
+ protected EPackage getSubPackage(EPackage ePackage, String name) {
+ for (Iterator<EPackage> ip = ePackage.getESubpackages().iterator(); ip.hasNext();) {
+ EPackage subPackage = ip.next();
+ if (name.equals(subPackage.getName()))
+ return subPackage;
+ }
+
+ return null;
+ }
+
+ protected EOperation getOperation(EClass eClass, String name) {
+ for (Iterator<EOperation> iop = eClass.getEOperations().iterator(); iop.hasNext();) {
+ EOperation eOp = iop.next();
+ if (name.equals(eOp.getName()))
+ return eOp;
+ }
+
+ return null;
+ }
+
+ protected EParameter getParam(EOperation eOp, String name) {
+ for (Iterator<EParameter> ip = eOp.getEParameters().iterator(); ip.hasNext();) {
+ EParameter param = ip.next();
+ if (name.equals(param.getName()))
+ return param;
+ }
+
+ return null;
+ }
+
+ protected String stripQuotes(String quotedString) {
+ return quotedString.substring(1, quotedString.length() - 1);
+ }
+
+ protected String getValue(StringLiteralOrQualifiedID literal) {
+ String value = null;
+ if (literal instanceof QualifiedIDContainer) {
+ QualifiedIDContainer qidContaier = (QualifiedIDContainer) literal;
+ value = getIDText(qidContaier.getQualifiedID());
+ } else if (literal instanceof StringLiteralContainer)
+ value = stripQuotes(TokenText.Get(literal));
+ return value;
+ }
+
+ protected String getValue(DefaultValueExpr defaultValueExpr) {
+ String value = null;
+ if (defaultValueExpr instanceof BoolExpr)
+ value = TokenText.Get(defaultValueExpr);
+ else if (defaultValueExpr instanceof IntExpr)
+ value = TokenText.Get(defaultValueExpr);
+ else if (defaultValueExpr instanceof StringExpr)
+ value = stripQuotes(TokenText.Get(defaultValueExpr));
+ else if (defaultValueExpr instanceof CharExpr)
+ value = stripQuotes(TokenText.Get(defaultValueExpr));
+ return value;
+ }
+
+ protected String getValue(BoundExceptWildcard nonWildBound) {
+ String value = null;
+ if (nonWildBound.getOneOrMoreTypeArgs() != null) {
+ value = getIDText(nonWildBound.getRawTNameOrTVarOrParamzedTName());
+ value += "<";
+ ASTNode[] tas = nonWildBound.getOneOrMoreTypeArgs().getChildren();
+ for (int i = 0; i < tas.length; i++) {
+ if (tas[i] instanceof TypeArg) {
+ TypeArg ta = (TypeArg) tas[i];
+ value += getValue(ta) + (i < tas.length ? ", " : "");
+ }
+ }
+ value += ">";
+ } else {
+ // must be a RawTypeOrTypeVar
+ value = unescape(TokenText.Get(nonWildBound));
+ }
+ return value;
+ }
+
+ protected String getValue(TypeArg ta) {
+ String value = "";
+ if (ta instanceof BoundExceptWildcard) {
+ value = getValue((BoundExceptWildcard) ta);
+ } else {
+ // must be a wildcard
+ // sequence wildcard : QMARK ( extendsOrSuper boundExceptWildcard )?
+ value = "?";
+ Wildcard w = (Wildcard) ta;
+ BoundExceptWildcard nonWildBound = w.getBoundExceptWildcard();
+ if (nonWildBound != null ) {
+ value += " " + getValue(nonWildBound);
+ }
+ }
+ return value;
+ }
+
+ public static String getIDText(EmfaticTokenNode idToken) {
+ return unescape(idToken.getText());
+ }
+
+ public static String getIDText(QualifiedID qualifiedID) {
+ return unescape(TokenText.Get(qualifiedID));
+ }
+
+ protected static String unescape(String id) {
+ return id.replaceAll(EmfaticKeywords.KEYWORD_ESCAPE_STRING, "");
+ }
+
+ protected void setMultiplicity(Multiplicity multiplicity, ETypedElement eTypedElement) {
+ if (multiplicity == null) {
+ eTypedElement.setLowerBound(0);
+ eTypedElement.setUpperBound(1);
+ return;
+ }
+ MultiplicityExpr mExpr = multiplicity.getMultiplicityExpr();
+ if (mExpr == null) {
+ eTypedElement.setLowerBound(0);
+ eTypedElement.setUpperBound(-1);
+ return;
+ }
+ String lowerBoundText = mExpr.getLowerBound().getText();
+ if (lowerBoundText.equals("?")) {
+ eTypedElement.setLowerBound(0);
+ eTypedElement.setUpperBound(1);
+ } else if (lowerBoundText.equals("*")) {
+ eTypedElement.setLowerBound(0);
+ eTypedElement.setUpperBound(-1);
+ } else if (lowerBoundText.equals("+")) {
+ eTypedElement.setLowerBound(1);
+ eTypedElement.setUpperBound(-1);
+ } else {
+ int lowerBound = Integer.parseInt(lowerBoundText);
+ eTypedElement.setLowerBound(lowerBound);
+ if (mExpr.getUpperBound() == null) {
+ eTypedElement.setUpperBound(lowerBound);
+ } else {
+ String upperBoundText = mExpr.getUpperBound().getText();
+ if (upperBoundText.equals("?"))
+ eTypedElement.setUpperBound(-2);
+ else if (upperBoundText.equals("*"))
+ eTypedElement.setUpperBound(-1);
+ else if (upperBoundText.equals("+")) {
+ eTypedElement.setUpperBound(-1);
+ } else {
+ int upperBound = Integer.parseInt(upperBoundText);
+ eTypedElement.setUpperBound(upperBound);
+ }
+ }
+ }
+ }
+
+ private ParseContext _parseContext;
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/TokenText.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/TokenText.java
new file mode 100644
index 0000000..b121f91
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/TokenText.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generator.ecore;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNodeVisitor;
+
+/**
+ *
+ * @author cjdaly@us.ibm.com
+ */
+public class TokenText extends EmfaticASTNodeVisitor {
+
+ private StringBuffer _buf = new StringBuffer();
+
+ public static String Get(EmfaticASTNode node) {
+ TokenText tt = new TokenText();
+ tt.visit(node);
+ return tt._buf.toString();
+ }
+
+ public boolean beginVisit(EmfaticASTNode node) {
+ String text = node.getText();
+ if (text != null) _buf.append(text);
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/TokenTextBlankSep.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/TokenTextBlankSep.java
new file mode 100644
index 0000000..7b1ef64
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/ecore/TokenTextBlankSep.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generator.ecore;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNodeVisitor;
+
+
+public class TokenTextBlankSep extends EmfaticASTNodeVisitor
+{
+
+ public TokenTextBlankSep()
+ {
+ _buf = new StringBuffer();
+ }
+
+ public static String Get(EmfaticASTNode node)
+ {
+ TokenTextBlankSep tt = new TokenTextBlankSep();
+ tt.visit(node);
+ return tt._buf.toString();
+ }
+
+ public boolean beginVisit(EmfaticASTNode node)
+ {
+ String text = node.getText();
+ if(text != null) {
+ String sepPre = "";
+ String sepPost = "";
+ String prevText = _buf.toString() + text;
+ if (prevText.endsWith("extends")
+ || prevText.endsWith("super")) {
+ sepPost = " ";
+ }
+ if (text.equals("extends") || text.equals("super") ) {
+ sepPre = " ";
+ }
+ _buf.append(sepPre + text + sepPost);
+ }
+ return true;
+ }
+
+ private StringBuffer _buf;
+
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/EmfaticGenerator.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/EmfaticGenerator.java
new file mode 100644
index 0000000..3ffdec4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/EmfaticGenerator.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generator.emfatic;
+
+import java.io.ByteArrayInputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+/**
+ *
+ * @author cjdaly@us.ibm.com
+ */
+public class EmfaticGenerator {
+
+ public EmfaticGenerator()
+ {
+ _resourceSet = new ResourceSetImpl();
+ }
+
+ public void generate(IFile ecoreFile, IProgressMonitor monitor)
+ {
+ try
+ {
+ String ecoreFilePath = ecoreFile.getFullPath().toString();
+ Resource ecoreResource = getResource(_resourceSet, ecoreFilePath);
+ String emfaticFilePath = getEmfaticFilePath(ecoreFile);
+ Writer writer = new Writer();
+ String emfaticText = writer.write(ecoreResource, monitor, ecoreFile);
+ writeEmfaticFile(emfaticFilePath, emfaticText.toString());
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+ private Resource getResource(ResourceSet resourceSet, String filePath)
+ {
+ URI uri = URI.createPlatformResourceURI(filePath);
+ Resource resource = resourceSet.getResource(uri, true);
+ return resource;
+ }
+
+ private void writeEmfaticFile(String emfaticFilePath, String fileText)
+ throws CoreException
+ {
+ IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+ IPath path = new Path(emfaticFilePath);
+ IFile emfaticFile = workspaceRoot.getFile(path);
+ java.io.InputStream in = new ByteArrayInputStream(fileText.getBytes());
+ if(emfaticFile.exists())
+ emfaticFile.setContents(in, true, false, null);
+ else
+ emfaticFile.create(in, true, null);
+ }
+
+ private String getEmfaticFilePath(IFile ecoreFile)
+ {
+ String ecoreFileExt = ecoreFile.getFileExtension();
+ int extLen = ecoreFileExt != null ? ecoreFileExt.length() + 1 : 0;
+ String ecoreFileName = ecoreFile.getName();
+ String fileName = ecoreFileName.substring(0, ecoreFileName.length() - extLen);
+ fileName = fileName + ".emf";
+ String filePath = ecoreFile.getFullPath().removeLastSegments(1).append(fileName).toString();
+ return filePath;
+ }
+
+ private ResourceSet _resourceSet;
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/Writer.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/Writer.java
new file mode 100644
index 0000000..395c5f1
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generator/emfatic/Writer.java
@@ -0,0 +1,820 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+
+package org.eclipse.emf.emfatic.core.generator.emfatic;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EGenericType;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypeParameter;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.emfatic.core.generics.util.GenericsUtil;
+import org.eclipse.emf.emfatic.core.util.EmfaticAnnotationMap;
+import org.eclipse.emf.emfatic.core.util.EmfaticBasicTypes;
+import org.eclipse.emf.emfatic.core.util.EmfaticKeywords;
+
+public class Writer {
+
+ public Writer() {
+ }
+
+ public String write(Resource ecoreResource, IProgressMonitor monitor,
+ IFile ecoreFile) {
+ _buf = new StringBuffer();
+
+ if (ecoreResource.getContents().size() > 1) {
+ final EPackage top = EcoreFactory.eINSTANCE.createEPackage();
+ top.setName("top");
+ top.setNsPrefix("top");
+ top.setNsURI("top");
+ for (EObject oldTop : ecoreResource.getContents()) {
+ if (oldTop instanceof EPackage) {
+ top.getESubpackages().add((EPackage) oldTop);
+ }
+ }
+ ecoreResource.getContents().clear();
+ ecoreResource.getContents().add(top);
+ }
+
+ EPackage mainPackage = (EPackage) ecoreResource.getContents().get(0);
+
+ _processingEcore = initProcessingEcore(mainPackage);
+ _annotationMap = new EmfaticAnnotationMap();
+ writeMainPackage(mainPackage);
+ return _buf.toString();
+ }
+
+ private boolean initProcessingEcore(EPackage mainPackage) {
+ EPackage ecore = EcorePackage.eINSTANCE;
+ if (!ecore.getName().equals(mainPackage.getName()))
+ return false;
+ if (!ecore.getNsPrefix().equals(mainPackage.getNsPrefix()))
+ return false;
+ return ecore.getNsURI().equals(mainPackage.getNsURI());
+ }
+
+ private void writeMainPackage(EPackage ePackage) {
+ String name = escape(ePackage.getName());
+ writeAnnotations(ePackage, 0, false);
+ writeNamespaceInfo(ePackage, 0);
+ writeln("package " + name + ";");
+ writeln();
+ writeImports(ePackage);
+ writePackageContents(ePackage, 0);
+ }
+
+ private void writeImports(EPackage ePackage) {
+ if (_processingEcore)
+ return;
+ Hashtable resourceTable = new Hashtable();
+ for (TreeIterator ti = ePackage.eAllContents(); ti.hasNext();) {
+ EObject eObject = (EObject) ti.next();
+ if (eObject instanceof ETypedElement) {
+ ETypedElement eTypedElement = (ETypedElement) eObject;
+ addExternalResource(eTypedElement.getEType(), ePackage,
+ resourceTable);
+ }
+ if (eObject instanceof EClass) {
+ EClass eClass = (EClass) eObject;
+ EClass superType;
+ for (Iterator i = eClass.getESuperTypes().iterator(); i
+ .hasNext(); addExternalResource(superType, ePackage,
+ resourceTable))
+ superType = (EClass) i.next();
+
+ }
+ if (eObject instanceof EOperation) {
+ EOperation eOperation = (EOperation) eObject;
+ EClassifier exceptionType;
+ for (Iterator i = eOperation.getEExceptions().iterator(); i
+ .hasNext(); addExternalResource(exceptionType,
+ ePackage, resourceTable))
+ exceptionType = (EClassifier) i.next();
+
+ }
+ }
+
+ String uri;
+ for (Iterator ri = resourceTable.values().iterator(); ri.hasNext(); writeln("import \""
+ + uri + "\";")) {
+ Resource resource = (Resource) ri.next();
+ uri = resource.getURI().toString();
+ }
+
+ if (resourceTable.size() > 0)
+ writeln();
+ }
+
+ private void addExternalResource(EClassifier referencedType,
+ EPackage localMainPackage, Hashtable resourceTable) {
+ if (referencedType == null)
+ return;
+ Resource resource = referencedType.eResource();
+ if (resource == null)
+ return;
+ if (localMainPackage.eResource().equals(resource))
+ return;
+ if (EcorePackage.eINSTANCE.equals(referencedType.getEPackage()))
+ return;
+ if (!resourceTable.containsKey(resource))
+ resourceTable.put(resource, resource);
+ }
+
+ private void writeSubPackage(EPackage ePackage, int indentLevel) {
+ String name = escape(ePackage.getName());
+ writeAnnotations(ePackage, indentLevel, false);
+ writeNamespaceInfo(ePackage, indentLevel);
+ writeln("package " + name + " {", indentLevel);
+ writePackageContents(ePackage, indentLevel + 1);
+ writeln("}", indentLevel);
+ writeln();
+ }
+
+ private void writeNamespaceInfo(EPackage ePackage, int indentLevel) {
+ if (ePackage.getNsURI() == null && ePackage.getNsPrefix() == null)
+ return;
+ write("@namespace(", indentLevel);
+ if (ePackage.getNsURI() != null) {
+ write("uri=\"" + ePackage.getNsURI() + "\"");
+ if (ePackage.getNsPrefix() != null)
+ write(", ");
+ }
+ if (ePackage.getNsPrefix() != null)
+ write("prefix=\"" + ePackage.getNsPrefix() + "\"");
+ writeln(")");
+ }
+
+ private void writePackageContents(EPackage ePackage, int indentLevel) {
+ for (Iterator ic = ePackage.getEClassifiers().iterator(); ic.hasNext();) {
+ Object o = ic.next();
+ if (o instanceof EClass) {
+ EClass eClass = (EClass) o;
+ writeClass(eClass, indentLevel);
+ } else if (o instanceof EEnum) {
+ EEnum eEnum = (EEnum) o;
+ writeEnum(eEnum, indentLevel);
+ } else if (o instanceof EDataType) {
+ EDataType eDataType = (EDataType) o;
+ writeDataType(eDataType, indentLevel);
+ }
+ }
+
+ EPackage subPackage;
+ for (Iterator ip = ePackage.getESubpackages().iterator(); ip.hasNext(); writeSubPackage(
+ subPackage, indentLevel))
+ subPackage = (EPackage) ip.next();
+
+ }
+
+ private void writeClass(EClass eClass, int indentLevel) {
+ writeAnnotations(eClass, indentLevel, false);
+ indent(indentLevel);
+ if (eClass.isAbstract())
+ write("abstract ");
+ if (eClass.isInterface())
+ write("interface ");
+ else
+ write("class ");
+ String name = escape(eClass.getName());
+ write(name);
+ boolean firstSuperType = true;
+
+ writeTypeParams(eClass.getETypeParameters(), eClass);
+
+ for (Iterator<EGenericType> ist = eClass.getEGenericSuperTypes()
+ .iterator(); ist.hasNext();) {
+ if (firstSuperType) {
+ write(" extends ");
+ firstSuperType = false;
+ } else {
+ write(", ");
+ }
+ EGenericType superType = ist.next();
+ String superTypeName = getTypeName(superType, eClass);
+ write(superTypeName);
+ }
+
+ if (eClass.getInstanceClassName() != null) {
+ String instanceClassName = quoteIfNecessary(eClass
+ .getInstanceClassName());
+ write(" : " + instanceClassName);
+ }
+ writeln(" {");
+ for (Iterator<EOperation> iop = eClass.getEOperations().iterator(); iop
+ .hasNext();) {
+ EOperation o = iop.next();
+ writeOperation(o, indentLevel + 1, eClass);
+ }
+
+ for (Iterator<EStructuralFeature> isf = eClass.getEStructuralFeatures()
+ .iterator(); isf.hasNext();) {
+ EStructuralFeature o2 = isf.next();
+ if (o2 instanceof EAttribute)
+ writeAttribute((EAttribute) o2, indentLevel + 1);
+ else if (o2 instanceof EReference)
+ writeReference((EReference) o2, indentLevel + 1);
+ }
+
+ writeln("}", indentLevel);
+ writeln();
+ }
+
+ private void writeTypeParams(EList<ETypeParameter> tps, EClass eClass) {
+ Iterator<ETypeParameter> tpsIter = tps.iterator();
+ if (tps.size() > 0) {
+ write(" <");
+ }
+ while (tpsIter.hasNext()) {
+ ETypeParameter etp = tpsIter.next();
+ write(getTypeName(etp, eClass));
+ if (tpsIter.hasNext()) {
+ write(", ");
+ }
+ }
+ if (tps.size() > 0) {
+ write("> ");
+ }
+ }
+
+ private String getTypeName(ETypeParameter etp, EClass context) {
+ String res = escape(etp.getName());
+ if (etp.getEBounds().size() > 0) {
+ res += " extends ";
+ Iterator<EGenericType> iterB = etp.getEBounds().iterator();
+ while (iterB.hasNext()) {
+ EGenericType b = iterB.next();
+ res += getTypeName(b, context);
+ if (iterB.hasNext()) {
+ res += " & ";
+ }
+ }
+ }
+ return res;
+ }
+
+ private void writeAttribute(EAttribute eAttr, int indentLevel) {
+ String name = escape(eAttr.getName());
+ String modifiers = getModifiers(eAttr);
+ String type = getTypeExpr(eAttr, eAttr.getEContainingClass());
+ String defaultValueExpr = "";
+ if (eAttr.getDefaultValueLiteral() != null)
+ if (EcorePackage.eINSTANCE.getEBoolean().equals(eAttr.getEType()))
+ defaultValueExpr = " = " + eAttr.getDefaultValueLiteral();
+ else if (EcorePackage.eINSTANCE.getEInt().equals(eAttr.getEType()))
+ defaultValueExpr = " = " + eAttr.getDefaultValueLiteral();
+ else if (EcorePackage.eINSTANCE.getEChar().equals(eAttr.getEType()))
+ defaultValueExpr = " = '" + eAttr.getDefaultValueLiteral()
+ + "'";
+ else
+ defaultValueExpr = " = \"" + eAttr.getDefaultValueLiteral()
+ + "\"";
+ writeAnnotations(eAttr, indentLevel, true);
+ writeln(modifiers + "attr " + type + " " + name + defaultValueExpr
+ + ";", indentLevel);
+ }
+
+ private void writeReference(EReference eRef, int indentLevel) {
+ String refKind;
+ if (eRef.isContainment())
+ refKind = "val ";
+ else if (eRef.isContainer())
+ refKind = "ref ";
+ else
+ refKind = "ref ";
+ String name = escape(eRef.getName());
+ String modifiers = getModifiers(eRef);
+ String type = getTypeExpr(eRef, eRef.getEContainingClass());
+ writeAnnotations(eRef, indentLevel, true);
+ writeln(modifiers + refKind + type + " " + name + ";", indentLevel);
+ }
+
+ private void writeOperation(EOperation eOp, int indentLevel, EClass context) {
+
+ String name = escape(eOp.getName());
+ String modifiers = getModifiers(eOp);
+ String type = "void";
+ if (eOp.getEGenericType() != null) {
+ type = getTypeExpr(eOp, eOp.getEContainingClass());
+ }
+ writeAnnotations(eOp, indentLevel, true);
+
+ write(modifiers + "op ", indentLevel);
+ writeTypeParams(eOp.getETypeParameters(), context);
+ write(type + " " + name + "(");
+ for (Iterator<EParameter> ip = eOp.getEParameters().iterator(); ip
+ .hasNext();) {
+ EParameter eParam = ip.next();
+ String paramDoc = EcoreUtil.getDocumentation(eParam);
+ if (paramDoc != null)
+ write("?\"" + paramDoc + "\" ");
+ String paramMods = getModifiers(eParam);
+ String paramName = escape(eParam.getName());
+ String paramType = getTypeExpr(eParam, eOp.getEContainingClass());
+ write(paramMods + paramType + " " + paramName);
+ if (ip.hasNext())
+ write(", ");
+ }
+
+ write(")");
+ Iterator<EGenericType> ie = eOp.getEGenericExceptions().iterator();
+ if (ie.hasNext()) {
+ write(" throws ");
+ while (ie.hasNext()) {
+ EGenericType exceptionType = ie.next();
+ String exceptionTypeName = getTypeName(exceptionType, eOp
+ .getEContainingClass());
+ write(exceptionTypeName);
+ if (ie.hasNext())
+ write(", ");
+ }
+ }
+ writeln(";");
+ }
+
+ private void writeEnum(EEnum eEnum, int indentLevel) {
+ // TODO can an enum declare type parameters
+ writeAnnotations(eEnum, indentLevel, false);
+ write("enum ", indentLevel);
+ String name = escape(eEnum.getName());
+ write(name);
+ writeln(" {");
+ for (Iterator iel = eEnum.getELiterals().iterator(); iel.hasNext(); writeln(";")) {
+ EEnumLiteral eLit = (EEnumLiteral) iel.next();
+ writeAnnotations(eLit, indentLevel + 1, true);
+ write(escape(eLit.getName()), indentLevel + 1);
+ write(" = ");
+ write(Integer.toString(eLit.getValue()));
+ }
+
+ writeln("}", indentLevel);
+ writeln();
+ }
+
+ private void writeDataType(EDataType eDataType, int indentLevel) {
+ // TODO can a datatype declare type parameters
+ writeAnnotations(eDataType, indentLevel, false);
+ indent(indentLevel);
+ if (!eDataType.isSerializable())
+ write("transient ");
+ write("datatype ");
+ String name = escape(eDataType.getName());
+ write(name);
+ write(" : ");
+ String instanceClassName = quoteIfNecessary(eDataType
+ .getInstanceClassName());
+ write(instanceClassName);
+ writeln(";");
+ writeln();
+ }
+
+ private void writeAnnotations(EModelElement eModelElement, int indentLevel,
+ boolean initialNewline) {
+ List annotations = eModelElement.getEAnnotations();
+ if (annotations.isEmpty())
+ return;
+ if (initialNewline)
+ writeln();
+ EAnnotation eAnnotation;
+ for (Iterator i = annotations.iterator(); i.hasNext(); writeAnnotation(
+ eAnnotation, indentLevel))
+ eAnnotation = (EAnnotation) i.next();
+
+ }
+
+ private void writeAnnotation(EAnnotation eAnnotation, int indentLevel) {
+ boolean firstDetail = true;
+ String sourceURI = eAnnotation.getSource();
+ int detailsCount = eAnnotation.getDetails().size();
+ String sourceLabel = _annotationMap.getLabelForSourceURI(sourceURI,
+ detailsCount);
+ String outputSourceURI = sourceLabel == null ? sourceURI : sourceLabel;
+ Iterator i = eAnnotation.getDetails().iterator();
+ if (!i.hasNext()) {
+ writeln("@" + quoteIfNecessary(outputSourceURI), indentLevel);
+ return;
+ }
+ write("@" + quoteIfNecessary(outputSourceURI) + "(", indentLevel);
+ int index = -1;
+ while (i.hasNext()) {
+ index++;
+ java.util.Map.Entry mapEntry = (java.util.Map.Entry) i.next();
+ String key = (String) mapEntry.getKey();
+ String value = (String) mapEntry.getValue();
+ String implicitKey = _annotationMap.getImplicitKeyName(sourceURI,
+ index, detailsCount);
+ String expr = null;
+ if (implicitKey != null)
+ expr = quote(value);
+ else
+ expr = quoteIfNecessary(key) + "=" + quote(value);
+ if (firstDetail) {
+ write(expr);
+ firstDetail = false;
+ } else {
+ write(", " + expr);
+ }
+ if ("http://www.eclipse.org/emf/2004/EmfaticAnnotationMap"
+ .equals(eAnnotation.getSource()))
+ _annotationMap.addMapping(key, value);
+ }
+ writeln(")");
+ }
+
+ private String getModifiers(ETypedElement eTypedElement) {
+ StringBuffer sb = new StringBuffer();
+ if (!eTypedElement.isUnique())
+ sb.append("!unique ");
+ if (!eTypedElement.isOrdered())
+ sb.append("!ordered ");
+ if (eTypedElement instanceof EStructuralFeature)
+ getModifiersHelper((EStructuralFeature) eTypedElement, sb);
+ return sb.toString();
+ }
+
+ private void getModifiersHelper(EStructuralFeature eStructuralFeature,
+ StringBuffer sb) {
+ if (!eStructuralFeature.isChangeable())
+ sb.append("readonly ");
+ if (eStructuralFeature.isVolatile())
+ sb.append("volatile ");
+ if (eStructuralFeature.isTransient())
+ sb.append("transient ");
+ if (eStructuralFeature.isUnsettable())
+ sb.append("unsettable ");
+ if (eStructuralFeature.isDerived())
+ sb.append("derived ");
+ if (eStructuralFeature instanceof EAttribute) {
+ EAttribute eAttr = (EAttribute) eStructuralFeature;
+ if (eAttr.isID())
+ sb.append("id ");
+ }
+ if (eStructuralFeature instanceof EReference) {
+ EReference eRef = (EReference) eStructuralFeature;
+ if (!eRef.isResolveProxies())
+ sb.append("!resolve ");
+ }
+ }
+
+ private String getTypeExpr(ETypedElement eTypedElement, EClass context) {
+ String typeName = getTypeName(eTypedElement.getEGenericType(), context);
+ String multiplicity = getMultiplicity(eTypedElement);
+ String oppositeName = "";
+ if (eTypedElement instanceof EReference) {
+ EReference eRef = (EReference) eTypedElement;
+ EReference opposite = eRef.getEOpposite();
+ if (opposite != null)
+ oppositeName = "#" + escape(opposite.getName());
+ }
+ return typeName + multiplicity + oppositeName;
+ }
+
+ private String getTypeName(EGenericType type, EClass context) {
+ if (type == null) {
+ return "null";
+ }
+ if (GenericsUtil.isRefToTypeParam(type)) {
+ String typeName = escape(type.getETypeParameter().getName());
+ return typeName;
+ }
+ if (GenericsUtil.isWildcard(type)) {
+ String res = "?";
+ if (GenericsUtil.isUnboundedWildcard(type)) {
+ return res;
+ }
+ if (GenericsUtil.isUpperBoundedWildcard(type)) {
+ EGenericType ub = type.getEUpperBound();
+ res += " extends " + getTypeName(ub, context);
+ } else {
+ EGenericType lb = type.getELowerBound();
+ res += " super " + getTypeName(lb, context);
+ }
+ return res;
+ }
+ /*
+ * now we know that type is either a parameterized type, a raw type
+ * reference, or a reference to a non-generic classifier
+ */
+ if (GenericsUtil.isParameterizedType(type)) {
+ String res = "";
+ res += getClassifierName(type.getEClassifier(), context);
+ res += "<";
+ Iterator<EGenericType> iterTA = type.getETypeArguments().iterator();
+ while (iterTA.hasNext()) {
+ EGenericType ta = iterTA.next();
+ res += getTypeName(ta, context);
+ if (iterTA.hasNext()) {
+ res += ", ";
+ }
+ }
+ res += ">";
+ return res;
+ }
+ String res = "";
+ res += getClassifierName(type.getEClassifier(), context);
+ return res;
+ }
+
+ private String getClassifierName(EClassifier type, EClass context) {
+ if (type == null)
+ return "null";
+ if (_processingEcore)
+ return type.getName();
+ String basicTypeName = EmfaticBasicTypes.LookupBasicTypeName(type);
+ if (basicTypeName != null)
+ return basicTypeName;
+ String qualifiedName = getQualifiedName(type, context);
+ if (qualifiedName == null)
+ return "null";
+ else
+ return escape(qualifiedName);
+ }
+
+ private String getQualifiedName(EClassifier type, EClass context) {
+ String qName = type.getName();
+ for (EPackage currPackage = type.getEPackage(); currPackage != null
+ && !EcoreUtil.isAncestor(currPackage, context); currPackage = currPackage
+ .getESuperPackage())
+ qName = currPackage.getName() + "." + qName;
+ return qName;
+ }
+
+ private String getMultiplicity(ETypedElement eTypedElement) {
+ int lowerBound = eTypedElement.getLowerBound();
+ int upperBound = eTypedElement.getUpperBound();
+ String multiplicity;
+ if (lowerBound == 0 && upperBound == -1)
+ multiplicity = "*";
+ else if (lowerBound == 0 && upperBound == 1)
+ multiplicity = null;
+ else if (lowerBound == 1 && upperBound == -1)
+ multiplicity = "+";
+ else if (lowerBound == upperBound)
+ multiplicity = getBoundString(lowerBound);
+ else
+ multiplicity = getBoundString(lowerBound) + ".."
+ + getBoundString(upperBound);
+ if (multiplicity == null)
+ multiplicity = "";
+ else
+ multiplicity = "[" + multiplicity + "]";
+ return multiplicity;
+ }
+
+ private String getBoundString(int multiplicityBound) {
+ if (multiplicityBound == -1)
+ return "*";
+ if (multiplicityBound == -2)
+ return "?";
+ else
+ return Integer.toString(multiplicityBound);
+ }
+
+ private static String escape(String identifier) {
+ return EmfaticKeywords.Escape(identifier);
+ }
+
+ private String quote(String s) {
+ if (_escapeQuotes == null)
+ _escapeQuotes = Pattern.compile("\"");
+ String s2 = _escapeQuotes.matcher(s).replaceAll("\\\\\"");
+ return '"' + s2 + '"';
+ }
+
+ private String quoteIfNecessary(String stringLiteralOrQualifiedID) {
+ if (stringLiteralOrQualifiedID == null
+ || stringLiteralOrQualifiedID.equals(""))
+ return "\"\"";
+ for (int i = 0; i < stringLiteralOrQualifiedID.length(); i++) {
+ char c = stringLiteralOrQualifiedID.charAt(i);
+ if (i == 0) {
+ if (!Character.isJavaIdentifierStart(c))
+ return quote(stringLiteralOrQualifiedID);
+ } else if (!Character.isJavaIdentifierPart(c) && c != '.')
+ return quote(stringLiteralOrQualifiedID);
+ }
+
+ if (EmfaticKeywords.IsKeyword(stringLiteralOrQualifiedID))
+ return quote(stringLiteralOrQualifiedID);
+ else
+ return stringLiteralOrQualifiedID;
+ }
+
+ private void writeln() {
+ writeln("");
+ }
+
+ private void writeln(String s) {
+ writeln(s, 0);
+ }
+
+ private void writeln(String s, int indentLevel) {
+ indent(indentLevel);
+ _buf.append(s + "\n");
+ }
+
+ private void write(String s) {
+ _buf.append(s);
+ }
+
+ private void write(String s, int indentLevel) {
+ indent(indentLevel);
+ _buf.append(s);
+ }
+
+ private void indent(int units) {
+ int spaces = units * 2;
+ StringBuffer sb = new StringBuffer(spaces);
+ for (int i = 0; i < spaces; i++)
+ sb.append(' ');
+
+ write(sb.toString());
+ }
+
+ private StringBuffer _buf;
+
+ private boolean _processingEcore;
+
+ private EmfaticAnnotationMap _annotationMap;
+
+ private Pattern _escapeQuotes;
+
+ public static String stringify(EObject ecoreDecl) {
+ Writer w = new Writer();
+ EPackage mainPackage = getRootEPackage(ecoreDecl);
+ if (mainPackage != null) {
+ w._processingEcore = w.initProcessingEcore(mainPackage);
+ }
+ w._annotationMap = new EmfaticAnnotationMap();
+ w._buf = new StringBuffer();
+ if (ecoreDecl instanceof EClass) {
+ w.writeClass((EClass) ecoreDecl, 0);
+ }
+ if (ecoreDecl instanceof EDataType) {
+ w.writeDataType((EDataType) ecoreDecl, 0);
+ }
+ if (ecoreDecl instanceof EEnum) {
+ w.writeEnum((EEnum) ecoreDecl, 0);
+ }
+ if (ecoreDecl instanceof EStructuralFeature) {
+ String res = stringify((EStructuralFeature) ecoreDecl);
+ return res;
+ }
+ if (ecoreDecl instanceof ETypeParameter) {
+ String res = GenericsUtil.getText((ETypeParameter) ecoreDecl);
+ return res;
+ }
+ if (ecoreDecl instanceof EOperation) {
+ EOperation eO = (EOperation) ecoreDecl;
+ w.writeOperation((EOperation) eO, 0, eO.getEContainingClass());
+ }
+ String res = w._buf.toString();
+ return res;
+ }
+
+ private static EPackage getRootEPackage(EObject eo) {
+ EPackage root = null;
+ if (eo instanceof EClassifier) {
+ root = ((EClassifier) eo).getEPackage();
+ }
+ if (eo instanceof EStructuralFeature) {
+ root = ((EStructuralFeature) eo).getEContainingClass()
+ .getEPackage();
+ }
+ if (eo instanceof ETypeParameter) {
+ eo = ((ETypeParameter) eo).eContainer();
+ root = getRootEPackage(eo);
+ return root;
+ }
+ if (root == null) {
+ return null;
+ }
+ while (root.getESuperPackage() != null) {
+ root = root.getESuperPackage();
+ }
+ return root;
+ }
+
+ public static String stringify(EStructuralFeature sf) {
+ Writer w = new Writer();
+ EPackage mainPackage = (EPackage) sf.getEContainingClass()
+ .getEPackage();
+ while (mainPackage.getESuperPackage() != null) {
+ mainPackage = mainPackage.getESuperPackage();
+ }
+ w._processingEcore = w.initProcessingEcore(mainPackage);
+ w._annotationMap = new EmfaticAnnotationMap();
+ w._buf = new StringBuffer();
+ if (sf instanceof EAttribute) {
+ w.writeAttribute((EAttribute) sf, 0);
+ }
+ if (sf instanceof EReference) {
+ w.writeReference((EReference) sf, 0);
+ }
+ String res = w._buf.toString();
+ return res;
+ }
+ public static String referenceEssentials(EReference eRef) {
+ Writer w = new Writer();
+ String name = escape(eRef.getName());
+ String type = w.getTypeExpr(eRef, eRef.getEContainingClass());
+ String res = type + " " + name ;
+ return res;
+ }
+
+ public static String attributeEssentials(EAttribute eAttr) {
+ Writer w = new Writer();
+ String name = escape(eAttr.getName());
+ String type = w.getTypeExpr(eAttr, eAttr.getEContainingClass());
+ String defaultValueExpr = "";
+ if (eAttr.getDefaultValueLiteral() != null)
+ if (EcorePackage.eINSTANCE.getEBoolean().equals(eAttr.getEType()))
+ defaultValueExpr = " = " + eAttr.getDefaultValueLiteral();
+ else if (EcorePackage.eINSTANCE.getEInt().equals(eAttr.getEType()))
+ defaultValueExpr = " = " + eAttr.getDefaultValueLiteral();
+ else if (EcorePackage.eINSTANCE.getEChar().equals(eAttr.getEType()))
+ defaultValueExpr = " = '" + eAttr.getDefaultValueLiteral()
+ + "'";
+ else
+ defaultValueExpr = " = \"" + eAttr.getDefaultValueLiteral()
+ + "\"";
+ String res = type + " " + name + defaultValueExpr ;
+ return res;
+ }
+
+ public static String operationEssentials(EOperation eOp) {
+ Writer w = new Writer();
+ w._buf = new StringBuffer();
+ String name = escape(eOp.getName());
+ String type = "void";
+ if (eOp.getEGenericType() != null) {
+ type = w.getTypeExpr(eOp, eOp.getEContainingClass());
+ }
+
+ w.writeTypeParams(eOp.getETypeParameters(), eOp.getEContainingClass());
+ w.write(type + " " + name + "(");
+ for (Iterator<EParameter> ip = eOp.getEParameters().iterator(); ip
+ .hasNext();) {
+ EParameter eParam = ip.next();
+ String paramDoc = EcoreUtil.getDocumentation(eParam);
+ if (paramDoc != null)
+ w.write("?\"" + paramDoc + "\" ");
+ String paramMods = w.getModifiers(eParam);
+ String paramName = escape(eParam.getName());
+ String paramType = w.getTypeExpr(eParam, eOp.getEContainingClass());
+ w.write(paramMods + paramType + " " + paramName);
+ if (ip.hasNext())
+ w.write(", ");
+ }
+
+ w.write(")");
+ Iterator<EGenericType> ie = eOp.getEGenericExceptions().iterator();
+ if (ie.hasNext()) {
+ w.write(" throws ");
+ while (ie.hasNext()) {
+ EGenericType exceptionType = ie.next();
+ String exceptionTypeName = w.getTypeName(exceptionType, eOp
+ .getEContainingClass());
+ w.write(exceptionTypeName);
+ if (ie.hasNext())
+ w.write(", ");
+ }
+ }
+ return w._buf.toString();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/BiMultiMap.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/BiMultiMap.java
new file mode 100644
index 0000000..fccf583
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/BiMultiMap.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generics.util;
+
+import java.util.Collection;
+import java.util.Set;
+
+public class BiMultiMap<K, V> {
+ private OneToManyMap<K, V> fst2snd = new OneToManyMap<K, V>();
+ private OneToManyMap<V, K> snd2fst = new OneToManyMap<V, K>();
+
+ /**
+ * only non-null args are stored
+ */
+ public void put(K fst, V snd) {
+ if (fst == null || snd == null) {
+ return;
+ }
+ fst2snd.put(fst, snd);
+ snd2fst.put(snd, fst);
+ }
+
+ /**
+ * never returns null but empty set
+ */
+ public Set<V> get(K k) {
+ return fst2snd.get(k);
+ }
+
+ /**
+ * never returns null but empty set
+ */
+ public Set<K> getInv(V v) {
+ return snd2fst.get(v);
+ }
+
+ public void clear() {
+ fst2snd.clear();
+ snd2fst.clear();
+ }
+
+ public Set<K> keySet() {
+ return fst2snd.keySet();
+ }
+
+ public Collection<V> values() {
+ return fst2snd.values();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/EcoreWalker.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/EcoreWalker.java
new file mode 100644
index 0000000..17931df
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/EcoreWalker.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generics.util;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.util.EcoreSwitch;
+
+/**
+ * An EcoreWalker navigates the full Ecore Abstract Syntax Tree (AST). It
+ * implements the <code>accept</code> operation of the Visitor pattern for an
+ * EModelElement object. In this way the <code>accept</code> operation need
+ * not be part of EModelElement
+ * <p>
+ * This walker navigates the Ecore AST pre-order: the current node is visited,
+ * then its children.
+ * <p>
+ * Users must subclass EcoreSwitch and call
+ * <code>walk(mainPackage, visitor)</code>.
+ * <p>
+ * Example usage:
+ * <p>
+ * class MyVisitor extends EcoreSwitch { .... }
+ * <p>
+ * MyVisitor v = new MyVisitor (); <br>
+ * EcoreWalker w = new EcoreWalker(); <br>
+ * Object result = w.walk(eP, v); <br>
+ *
+ * @see EcoreSwitch
+ */
+public class EcoreWalker {
+
+ /**
+ * Navigates the complete AST and ensures that each node is visited by
+ * <code>visitor</code>.
+ *
+ * @param eME
+ * the EModelElement to be visited
+ * @param visitor
+ * the visitor that should visit the expression
+ * @return
+ */
+ public EcoreSwitch walk(EModelElement eME, EcoreSwitch v) {
+ v.doSwitch(eME);
+ visitOwnedParts(eME, v);
+ return v;
+ }
+
+ private EcoreSwitch visitOwnedParts(EModelElement e, EcoreSwitch v) {
+ // the annotations
+ for (Object oa : e.getEAnnotations()) {
+ EAnnotation a = (EAnnotation) oa;
+ walk(a, v);
+ // don't return yet
+ }
+ // EPackage
+ if (e instanceof EPackage) {
+ EPackage eP = (EPackage) e;
+ // visit owned parts and only then return
+ // i.e. visit owned classifiers and visit subpackages
+ for (Object oC : eP.getEClassifiers()) {
+ EClassifier c = (EClassifier) oC;
+ walk(c, v);
+ }
+ for (Object osubP : eP.getESubpackages()) {
+ EPackage subP = (EPackage) osubP;
+ walk(subP, v);
+ }
+ return v;
+ }
+ // EClassifier can be EClass or EDataType (EDataType in turn can be
+ // EEnum)
+ if (e instanceof EClass) {
+ EClass eC = (EClass) e;
+ // visit the owned attributes
+ for (Object oA : eC.getEAttributes()) {
+ EAttribute a = (EAttribute) oA;
+ // an attribute has no owned parts, therefore don't walk it
+ v.doSwitch(a);
+ }
+ // visit the owned references
+ for (Object oR : eC.getEReferences()) {
+ EReference r = (EReference) oR;
+ v.doSwitch(r);
+ }
+ // visit the owned operations
+ for (Object oO : eC.getEOperations()) {
+ EOperation o = (EOperation) oO;
+ v.doSwitch(o);
+ // visit the owned formal parameters
+ for (Object op : o.getEParameters()) {
+ EParameter p = (EParameter) op;
+ v.doSwitch(p);
+ }
+ }
+ return v;
+ }
+ if (e instanceof EDataType) {
+ // handle EEnum
+ if (e instanceof EEnum) {
+ EEnum ee = (EEnum) e;
+ // the enum itself was already visited by virtue of it being an
+ // EClassifier
+ for (Object eL : ee.getELiterals()) {
+ EEnumLiteral eeL = (EEnumLiteral) eL;
+ v.doSwitch(eeL);
+ }
+ return v;
+ }
+ // it's a non-EEnum EDataType
+ EDataType eD = (EDataType) e;
+ // the datatype itself was already visited by virtue of it being an
+ // EClassifier
+ return v;
+ }
+ return v;
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/GenericsUtil.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/GenericsUtil.java
new file mode 100644
index 0000000..ecdb07d
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/GenericsUtil.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generics.util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EGenericType;
+import org.eclipse.emf.ecore.ETypeParameter;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.util.Diagnostician;
+
+public class GenericsUtil {
+
+ public static EGenericType getEGenericType(EClassifier resC) {
+ EGenericType resG = EcoreFactory.eINSTANCE.createEGenericType();
+ resG.setEClassifier(resC);
+ return resG;
+ }
+
+ public static EGenericType getEListOf(EClassifier elementType) {
+ EGenericType res = EcoreFactory.eINSTANCE.createEGenericType();
+ EDataType eL = EcorePackage.eINSTANCE.getEEList();
+ res.setEClassifier(eL);
+ EGenericType gtElementType = getEGenericType(elementType);
+ res.getETypeArguments().add(gtElementType);
+ return res;
+ }
+
+ public static EGenericType getEListOf(EGenericType elementType) {
+ EGenericType res = EcoreFactory.eINSTANCE.createEGenericType();
+ EDataType eL = EcorePackage.eINSTANCE.getEEList();
+ res.setEClassifier(eL);
+ res.getETypeArguments().add(elementType);
+ return res;
+ }
+
+ public static EGenericType getRefToTypeParam(ETypeParameter refedTP) {
+ EGenericType res = EcoreFactory.eINSTANCE.createEGenericType();
+ res.setETypeParameter(refedTP);
+ return res;
+ }
+
+ public static EGenericType getUnboundedWildcard() {
+ EGenericType res = EcoreFactory.eINSTANCE.createEGenericType();
+ return res;
+ }
+
+ public static EGenericType getUpperBoundedWildcard(EGenericType gt) {
+ EGenericType res = EcoreFactory.eINSTANCE.createEGenericType();
+ res.setEUpperBound(gt);
+ return res;
+ }
+
+ public static EGenericType getLowerBoundedWildcard(EGenericType gt) {
+ EGenericType res = EcoreFactory.eINSTANCE.createEGenericType();
+ res.setELowerBound(gt);
+ return res;
+ }
+
+ public static EGenericType getParameterizedType(EClassifier declaredType, List<EGenericType> typeArgs) {
+ EGenericType res = getEGenericType(declaredType);
+ res.getETypeArguments().addAll(typeArgs);
+ return res;
+ }
+
+ /**
+ * from org.eclipse.emf.ecore.provider.EGenericItemProvider
+ */
+ public static String getText(EGenericType eGenericType) {
+ ETypeParameter eTypeParameter = eGenericType.getETypeParameter();
+ if (eTypeParameter != null) {
+ String name = eTypeParameter.getName();
+ return name == null ? "null" : name;
+ } else {
+ EClassifier eClassifier = eGenericType.getEClassifier();
+ if (eClassifier != null) {
+ List<EGenericType> eTypeArguments = eGenericType.getETypeArguments();
+ if (eTypeArguments.isEmpty()) {
+ String name = eClassifier.getName();
+ return name == null ? "null" : name;
+ } else {
+ StringBuilder result = new StringBuilder();
+ result.append(eClassifier.getName());
+ result.append('<');
+ for (Iterator<EGenericType> i = eTypeArguments.iterator();;) {
+ result.append(getText(i.next()));
+ if (i.hasNext()) {
+ result.append(", ");
+ } else {
+ break;
+ }
+ }
+ result.append('>');
+ return result.toString();
+ }
+ } else {
+ EGenericType eUpperBound = eGenericType.getEUpperBound();
+ if (eUpperBound != null) {
+ return "? extends " + getText(eUpperBound);
+ } else {
+ EGenericType eLowerBound = eGenericType.getELowerBound();
+ if (eLowerBound != null) {
+ return "? super " + getText(eLowerBound);
+ } else {
+ return "?";
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * from org.eclipse.emf.ecore.provider.ETypeParameterItemProvider
+ */
+ public static String getText(ETypeParameter eTypeParameter) {
+ if (eTypeParameter.getEBounds().isEmpty()) {
+ String name = eTypeParameter.getName();
+ return name == null ? "null" : name;
+ } else {
+ StringBuilder result = new StringBuilder();
+ result.append(eTypeParameter.getName());
+ result.append(" extends ");
+ for (Iterator<EGenericType> i = eTypeParameter.getEBounds().iterator(); i.hasNext();) {
+ result.append(getText(i.next()));
+ if (i.hasNext()) {
+ result.append(" & ");
+ }
+ }
+ return result.toString();
+ }
+ }
+
+ public static boolean isRefToTypeParam(EGenericType type) {
+ boolean res = type.getEClassifier() == null;
+ res &= type.getETypeParameter() != null;
+ return res;
+ }
+
+ public static boolean isWildcard(EGenericType type) {
+ boolean res = type.getEClassifier() == null;
+ res &= type.getETypeParameter() == null;
+ return res;
+ }
+
+ public static boolean isParameterizedType(EGenericType type) {
+ boolean res = (type.getEClassifier() != null) && (type.getETypeArguments().size() > 0);
+ return res;
+ }
+
+ public static boolean isRefToClassifier(EGenericType type) {
+ boolean res = isParameterizedType(type) || isRefToNonGeneric(type) || isRawTypeReference(type);
+ return res;
+ }
+
+ public static boolean isRawTypeReference(EGenericType type) {
+ boolean res = (type.getEClassifier() != null) && (type.getETypeArguments().size() == 0)
+ && (type.getEClassifier().getETypeParameters().size() > 0);
+ return res;
+ }
+
+ public static boolean isRefToNonGeneric(EGenericType type) {
+ boolean res = (type.getEClassifier() != null) && (type.getEClassifier().getETypeParameters().size() == 0);
+ return res;
+ }
+
+ public static boolean isUnboundedWildcard(EGenericType type) {
+ boolean res = isWildcard(type) && (type.getEUpperBound() == null) && (type.getELowerBound() == null);
+ return res;
+ }
+
+ public static boolean isUpperBoundedWildcard(EGenericType type) {
+ boolean res = isWildcard(type) && (type.getEUpperBound() != null);
+ return res;
+ }
+
+ public static boolean isLowerBoundedWildcard(EGenericType type) {
+ boolean res = isWildcard(type) && (type.getELowerBound() != null);
+ return res;
+ }
+
+ public static boolean isWellFormed(EGenericType gt) {
+ Diagnostician diagnostician = new Diagnostician();
+ final Diagnostic diagnostic = diagnostician.validate(gt);
+ boolean res = (diagnostic.getSeverity() == Diagnostic.OK);
+ return res;
+ }
+
+ public static List<String> getDiagnosticMsgs(EGenericType gt) {
+ List<String> res = new ArrayList<String>();
+ Diagnostician diagnostician = new Diagnostician();
+ final Diagnostic diagnostic = diagnostician.validate(gt);
+ if (diagnostic.getSeverity() == Diagnostic.OK) {
+ return res;
+ }
+ for (Diagnostic childDiagnostic : diagnostic.getChildren()) {
+ String msg = childDiagnostic.getMessage();
+ res.add(msg);
+ }
+ return res;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToManyMap.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToManyMap.java
new file mode 100644
index 0000000..786aba6
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToManyMap.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generics.util;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class OneToManyMap<K, V> {
+
+ private Map<K, Set<V>> m = new HashMap<K, Set<V>>();
+ private Map<V, K> snd2fst = new HashMap<V, K>();
+
+ /**
+ * only non-null args are stored
+ */
+ public void put(K k, V v) {
+ if (k == null || v == null) {
+ return;
+ }
+ snd2fst.put(v,k);
+ Set<V> vs = m.get(k);
+ if (vs != null) {
+ vs.add(v);
+ } else {
+ vs = new HashSet<V>();
+ vs.add(v);
+ m.put(k, vs);
+ }
+ }
+
+ /**
+ * never returns null but empty set
+ */
+ public Set<V> get(K k) {
+ if (m.get(k) == null) {
+ return Collections.EMPTY_SET;
+ } else {
+ return m.get(k);
+ }
+ }
+
+ public K getInv(V v) {
+ return snd2fst.get(v);
+ }
+
+ public void clear() {
+ m.clear();
+ }
+
+ public Set<K> keySet() {
+ return m.keySet();
+ }
+
+ public Collection<V> values() {
+ Collection<Set<V>> csv = m.values();
+ Set<V> res = new HashSet<V>();
+ for (Set<V> vs : csv) {
+ res.addAll(vs);
+ }
+ return res;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToOneMap.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToOneMap.java
new file mode 100644
index 0000000..5ec1e63
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/generics/util/OneToOneMap.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.generics.util;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+public class OneToOneMap<K, V> {
+
+ private Map<K, V> fst2snd = new HashMap<K, V>();
+ private Map<V, K> snd2fst = new HashMap<V, K>();
+
+ /**
+ * only non-null args are stored
+ */
+ public void put(K fst, V snd) {
+ if (fst == null || snd == null) {
+ return;
+ }
+ fst2snd.put(fst, snd);
+ snd2fst.put(snd, fst);
+ }
+
+ public V get(K k) {
+ return fst2snd.get(k);
+ }
+
+ public K getInv(V v) {
+ return snd2fst.get(v);
+ }
+
+ public void clear() {
+ fst2snd.clear();
+ snd2fst.clear();
+ }
+
+ public Set<K> keySet() {
+ return fst2snd.keySet();
+ }
+
+ public Collection<V> values() {
+ return fst2snd.values();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/AbstractModifier.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/AbstractModifier.java
new file mode 100644
index 0000000..2705fa2
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/AbstractModifier.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class AbstractModifier extends EmfaticASTNode {
+
+ public static final String KW_ABSTRACT = "abstract";
+
+ private EmfaticTokenNode _abstract_KW;
+
+ public EmfaticTokenNode getAbstract_KW() {
+ return _abstract_KW;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_abstract_KW != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_abstract_KW != null) && (++count == index)) return _abstract_KW;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new AbstractModifier.
+ */
+ public AbstractModifier(
+ TokenInfo abstract_KW
+ ) {
+ super();
+
+ if (abstract_KW != null) {
+ _abstract_KW = new EmfaticTokenNode(abstract_KW);
+ if (_abstract_KW._parent != null) throw new RuntimeException();
+ _abstract_KW._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Annotation.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Annotation.java
new file mode 100644
index 0000000..45988b1
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Annotation.java
@@ -0,0 +1,118 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Annotation extends EmfaticASTNode {
+
+
+ private EmfaticTokenNode _at;
+ private StringLiteralOrQualifiedID _source;
+ private EmfaticTokenNode _lparen;
+ private KeyEqualsValueList _keyEqualsValueList;
+ private EmfaticTokenNode _rparen;
+
+ public EmfaticTokenNode getAt() {
+ return _at;
+ }
+ public StringLiteralOrQualifiedID getSource() {
+ return _source;
+ }
+ public EmfaticTokenNode getLparen() {
+ return _lparen;
+ }
+ public KeyEqualsValueList getKeyEqualsValueList() {
+ return _keyEqualsValueList;
+ }
+ public EmfaticTokenNode getRparen() {
+ return _rparen;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_at != null) count++;
+ if (_source != null) count++;
+ if (_lparen != null) count++;
+ if (_keyEqualsValueList != null) count++;
+ if (_rparen != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_at != null) && (++count == index)) return _at;
+ if ((_source != null) && (++count == index)) return _source;
+ if ((_lparen != null) && (++count == index)) return _lparen;
+ if ((_keyEqualsValueList != null) && (++count == index)) return _keyEqualsValueList;
+ if ((_rparen != null) && (++count == index)) return _rparen;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new Annotation.
+ */
+ public Annotation(
+ TokenInfo at,
+ StringLiteralOrQualifiedID source,
+ TokenInfo lparen,
+ KeyEqualsValueList keyEqualsValueList,
+ TokenInfo rparen
+ ) {
+ super();
+
+ if (at != null) {
+ _at = new EmfaticTokenNode(at);
+ if (_at._parent != null) throw new RuntimeException();
+ _at._parent = this;
+ }
+ if (source != null) {
+ _source = source;
+ if (_source._parent != null) throw new RuntimeException();
+ _source._parent = this;
+ }
+ if (lparen != null) {
+ _lparen = new EmfaticTokenNode(lparen);
+ if (_lparen._parent != null) throw new RuntimeException();
+ _lparen._parent = this;
+ }
+ if (keyEqualsValueList != null) {
+ _keyEqualsValueList = keyEqualsValueList;
+ if (_keyEqualsValueList._parent != null) throw new RuntimeException();
+ _keyEqualsValueList._parent = this;
+ }
+ if (rparen != null) {
+ _rparen = new EmfaticTokenNode(rparen);
+ if (_rparen._parent != null) throw new RuntimeException();
+ _rparen._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Annotations.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Annotations.java
new file mode 100644
index 0000000..8d0512a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Annotations.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Annotations extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new Annotations.
+ */
+ public Annotations() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Attribute.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Attribute.java
new file mode 100644
index 0000000..41b1794
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Attribute.java
@@ -0,0 +1,155 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Attribute extends ClassMemberDecl {
+
+ public static final String KW_ATTR = "attr";
+
+ private Annotations _annotations;
+ private Modifiers _modifiers;
+ private EmfaticTokenNode _attr_KW;
+ private TypeWithMulti _typeWithMulti;
+ private EmfaticTokenNode _name;
+ private EmfaticTokenNode _equals;
+ private DefaultValueExpr _defaultValueExpr;
+ private EmfaticTokenNode _semi;
+
+ public Annotations getAnnotations() {
+ return _annotations;
+ }
+ public Modifiers getModifiers() {
+ return _modifiers;
+ }
+ public EmfaticTokenNode getAttr_KW() {
+ return _attr_KW;
+ }
+ public TypeWithMulti getTypeWithMulti() {
+ return _typeWithMulti;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public EmfaticTokenNode getEquals() {
+ return _equals;
+ }
+ public DefaultValueExpr getDefaultValueExpr() {
+ return _defaultValueExpr;
+ }
+ public EmfaticTokenNode getSemi() {
+ return _semi;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_annotations != null) count++;
+ if (_modifiers != null) count++;
+ if (_attr_KW != null) count++;
+ if (_typeWithMulti != null) count++;
+ if (_name != null) count++;
+ if (_equals != null) count++;
+ if (_defaultValueExpr != null) count++;
+ if (_semi != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_annotations != null) && (++count == index)) return _annotations;
+ if ((_modifiers != null) && (++count == index)) return _modifiers;
+ if ((_attr_KW != null) && (++count == index)) return _attr_KW;
+ if ((_typeWithMulti != null) && (++count == index)) return _typeWithMulti;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_equals != null) && (++count == index)) return _equals;
+ if ((_defaultValueExpr != null) && (++count == index)) return _defaultValueExpr;
+ if ((_semi != null) && (++count == index)) return _semi;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new Attribute.
+ */
+ public Attribute(
+ Annotations annotations,
+ Modifiers modifiers,
+ TokenInfo attr_KW,
+ TypeWithMulti typeWithMulti,
+ TokenInfo name,
+ TokenInfo equals,
+ DefaultValueExpr defaultValueExpr,
+ TokenInfo semi
+ ) {
+ super();
+
+ if (annotations != null) {
+ _annotations = annotations;
+ if (_annotations._parent != null) throw new RuntimeException();
+ _annotations._parent = this;
+ }
+ if (modifiers != null) {
+ _modifiers = modifiers;
+ if (_modifiers._parent != null) throw new RuntimeException();
+ _modifiers._parent = this;
+ }
+ if (attr_KW != null) {
+ _attr_KW = new EmfaticTokenNode(attr_KW);
+ if (_attr_KW._parent != null) throw new RuntimeException();
+ _attr_KW._parent = this;
+ }
+ if (typeWithMulti != null) {
+ _typeWithMulti = typeWithMulti;
+ if (_typeWithMulti._parent != null) throw new RuntimeException();
+ _typeWithMulti._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (equals != null) {
+ _equals = new EmfaticTokenNode(equals);
+ if (_equals._parent != null) throw new RuntimeException();
+ _equals._parent = this;
+ }
+ if (defaultValueExpr != null) {
+ _defaultValueExpr = defaultValueExpr;
+ if (_defaultValueExpr._parent != null) throw new RuntimeException();
+ _defaultValueExpr._parent = this;
+ }
+ if (semi != null) {
+ _semi = new EmfaticTokenNode(semi);
+ if (_semi._parent != null) throw new RuntimeException();
+ _semi._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/BoolExpr.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/BoolExpr.java
new file mode 100644
index 0000000..c3bf353
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/BoolExpr.java
@@ -0,0 +1,69 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class BoolExpr extends DefaultValueExpr {
+
+
+ private TrueOrFalse _trueOrFalse;
+
+ public TrueOrFalse getTrueOrFalse() {
+ return _trueOrFalse;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_trueOrFalse != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_trueOrFalse != null) && (++count == index)) return _trueOrFalse;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new BoolExpr.
+ */
+ public BoolExpr(
+ TrueOrFalse trueOrFalse
+ ) {
+ super();
+
+ if (trueOrFalse != null) {
+ _trueOrFalse = trueOrFalse;
+ if (_trueOrFalse._parent != null) throw new RuntimeException();
+ _trueOrFalse._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/BoundExceptWildcard.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/BoundExceptWildcard.java
new file mode 100644
index 0000000..e6033d8
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/BoundExceptWildcard.java
@@ -0,0 +1,106 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class BoundExceptWildcard extends TypeArg {
+
+
+ private QualifiedID _rawTNameOrTVarOrParamzedTName;
+ private EmfaticTokenNode _lt;
+ private OneOrMoreTypeArgs _oneOrMoreTypeArgs;
+ private EmfaticTokenNode _gt;
+
+ public QualifiedID getRawTNameOrTVarOrParamzedTName() {
+ return _rawTNameOrTVarOrParamzedTName;
+ }
+ public EmfaticTokenNode getLt() {
+ return _lt;
+ }
+ public OneOrMoreTypeArgs getOneOrMoreTypeArgs() {
+ return _oneOrMoreTypeArgs;
+ }
+ public EmfaticTokenNode getGt() {
+ return _gt;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_rawTNameOrTVarOrParamzedTName != null) count++;
+ if (_lt != null) count++;
+ if (_oneOrMoreTypeArgs != null) count++;
+ if (_gt != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_rawTNameOrTVarOrParamzedTName != null) && (++count == index)) return _rawTNameOrTVarOrParamzedTName;
+ if ((_lt != null) && (++count == index)) return _lt;
+ if ((_oneOrMoreTypeArgs != null) && (++count == index)) return _oneOrMoreTypeArgs;
+ if ((_gt != null) && (++count == index)) return _gt;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new BoundExceptWildcard.
+ */
+ public BoundExceptWildcard(
+ QualifiedID rawTNameOrTVarOrParamzedTName,
+ TokenInfo lt,
+ OneOrMoreTypeArgs oneOrMoreTypeArgs,
+ TokenInfo gt
+ ) {
+ super();
+
+ if (rawTNameOrTVarOrParamzedTName != null) {
+ _rawTNameOrTVarOrParamzedTName = rawTNameOrTVarOrParamzedTName;
+ if (_rawTNameOrTVarOrParamzedTName._parent != null) throw new RuntimeException();
+ _rawTNameOrTVarOrParamzedTName._parent = this;
+ }
+ if (lt != null) {
+ _lt = new EmfaticTokenNode(lt);
+ if (_lt._parent != null) throw new RuntimeException();
+ _lt._parent = this;
+ }
+ if (oneOrMoreTypeArgs != null) {
+ _oneOrMoreTypeArgs = oneOrMoreTypeArgs;
+ if (_oneOrMoreTypeArgs._parent != null) throw new RuntimeException();
+ _oneOrMoreTypeArgs._parent = this;
+ }
+ if (gt != null) {
+ _gt = new EmfaticTokenNode(gt);
+ if (_gt._parent != null) throw new RuntimeException();
+ _gt._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/CharExpr.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/CharExpr.java
new file mode 100644
index 0000000..6a523b2
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/CharExpr.java
@@ -0,0 +1,70 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class CharExpr extends DefaultValueExpr {
+
+
+ private EmfaticTokenNode _char_literal;
+
+ public EmfaticTokenNode getChar_literal() {
+ return _char_literal;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_char_literal != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_char_literal != null) && (++count == index)) return _char_literal;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new CharExpr.
+ */
+ public CharExpr(
+ TokenInfo char_literal
+ ) {
+ super();
+
+ if (char_literal != null) {
+ _char_literal = new EmfaticTokenNode(char_literal);
+ if (_char_literal._parent != null) throw new RuntimeException();
+ _char_literal._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassDecl.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassDecl.java
new file mode 100644
index 0000000..1358769
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassDecl.java
@@ -0,0 +1,203 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class ClassDecl extends TopLevelDecl {
+
+ public static final String KW_EXTENDS = "extends";
+
+ private Annotations _annotations;
+ private AbstractModifier _abstractModifier;
+ private ClassKind _classKind;
+ private EmfaticTokenNode _name;
+ private TypeParamsInfo _typeParamsInfo;
+ private EmfaticTokenNode _extends_KW;
+ private CommaListBoundExceptWild _superTypes;
+ private EmfaticTokenNode _colon;
+ private BoundExceptWildcard _instClassName;
+ private EmfaticTokenNode _lcurly;
+ private ClassMemberDecls _classMemberDecls;
+ private EmfaticTokenNode _rcurly;
+
+ public Annotations getAnnotations() {
+ return _annotations;
+ }
+ public AbstractModifier getAbstractModifier() {
+ return _abstractModifier;
+ }
+ public ClassKind getClassKind() {
+ return _classKind;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public TypeParamsInfo getTypeParamsInfo() {
+ return _typeParamsInfo;
+ }
+ public EmfaticTokenNode getExtends_KW() {
+ return _extends_KW;
+ }
+ public CommaListBoundExceptWild getSuperTypes() {
+ return _superTypes;
+ }
+ public EmfaticTokenNode getColon() {
+ return _colon;
+ }
+ public BoundExceptWildcard getInstClassName() {
+ return _instClassName;
+ }
+ public EmfaticTokenNode getLcurly() {
+ return _lcurly;
+ }
+ public ClassMemberDecls getClassMemberDecls() {
+ return _classMemberDecls;
+ }
+ public EmfaticTokenNode getRcurly() {
+ return _rcurly;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_annotations != null) count++;
+ if (_abstractModifier != null) count++;
+ if (_classKind != null) count++;
+ if (_name != null) count++;
+ if (_typeParamsInfo != null) count++;
+ if (_extends_KW != null) count++;
+ if (_superTypes != null) count++;
+ if (_colon != null) count++;
+ if (_instClassName != null) count++;
+ if (_lcurly != null) count++;
+ if (_classMemberDecls != null) count++;
+ if (_rcurly != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_annotations != null) && (++count == index)) return _annotations;
+ if ((_abstractModifier != null) && (++count == index)) return _abstractModifier;
+ if ((_classKind != null) && (++count == index)) return _classKind;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_typeParamsInfo != null) && (++count == index)) return _typeParamsInfo;
+ if ((_extends_KW != null) && (++count == index)) return _extends_KW;
+ if ((_superTypes != null) && (++count == index)) return _superTypes;
+ if ((_colon != null) && (++count == index)) return _colon;
+ if ((_instClassName != null) && (++count == index)) return _instClassName;
+ if ((_lcurly != null) && (++count == index)) return _lcurly;
+ if ((_classMemberDecls != null) && (++count == index)) return _classMemberDecls;
+ if ((_rcurly != null) && (++count == index)) return _rcurly;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new ClassDecl.
+ */
+ public ClassDecl(
+ Annotations annotations,
+ AbstractModifier abstractModifier,
+ ClassKind classKind,
+ TokenInfo name,
+ TypeParamsInfo typeParamsInfo,
+ TokenInfo extends_KW,
+ CommaListBoundExceptWild superTypes,
+ TokenInfo colon,
+ BoundExceptWildcard instClassName,
+ TokenInfo lcurly,
+ ClassMemberDecls classMemberDecls,
+ TokenInfo rcurly
+ ) {
+ super();
+
+ if (annotations != null) {
+ _annotations = annotations;
+ if (_annotations._parent != null) throw new RuntimeException();
+ _annotations._parent = this;
+ }
+ if (abstractModifier != null) {
+ _abstractModifier = abstractModifier;
+ if (_abstractModifier._parent != null) throw new RuntimeException();
+ _abstractModifier._parent = this;
+ }
+ if (classKind != null) {
+ _classKind = classKind;
+ if (_classKind._parent != null) throw new RuntimeException();
+ _classKind._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (typeParamsInfo != null) {
+ _typeParamsInfo = typeParamsInfo;
+ if (_typeParamsInfo._parent != null) throw new RuntimeException();
+ _typeParamsInfo._parent = this;
+ }
+ if (extends_KW != null) {
+ _extends_KW = new EmfaticTokenNode(extends_KW);
+ if (_extends_KW._parent != null) throw new RuntimeException();
+ _extends_KW._parent = this;
+ }
+ if (superTypes != null) {
+ _superTypes = superTypes;
+ if (_superTypes._parent != null) throw new RuntimeException();
+ _superTypes._parent = this;
+ }
+ if (colon != null) {
+ _colon = new EmfaticTokenNode(colon);
+ if (_colon._parent != null) throw new RuntimeException();
+ _colon._parent = this;
+ }
+ if (instClassName != null) {
+ _instClassName = instClassName;
+ if (_instClassName._parent != null) throw new RuntimeException();
+ _instClassName._parent = this;
+ }
+ if (lcurly != null) {
+ _lcurly = new EmfaticTokenNode(lcurly);
+ if (_lcurly._parent != null) throw new RuntimeException();
+ _lcurly._parent = this;
+ }
+ if (classMemberDecls != null) {
+ _classMemberDecls = classMemberDecls;
+ if (_classMemberDecls._parent != null) throw new RuntimeException();
+ _classMemberDecls._parent = this;
+ }
+ if (rcurly != null) {
+ _rcurly = new EmfaticTokenNode(rcurly);
+ if (_rcurly._parent != null) throw new RuntimeException();
+ _rcurly._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassKind.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassKind.java
new file mode 100644
index 0000000..57d69bd
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassKind.java
@@ -0,0 +1,34 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class ClassKind extends EmfaticTokenNode {
+
+ public static final String KW_CLASS = "class";
+ public static final String KW_INTERFACE = "interface";
+
+
+ /**
+ * Construct a new ClassKind.
+ */
+ public ClassKind(TokenInfo tokenInfo) {
+ super(tokenInfo);
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassMemberDecl.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassMemberDecl.java
new file mode 100644
index 0000000..3c5b16a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassMemberDecl.java
@@ -0,0 +1,27 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public abstract class ClassMemberDecl extends EmfaticASTNode {
+ /**
+ * Construct a new ClassMemberDecl.
+ */
+ public ClassMemberDecl() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassMemberDecls.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassMemberDecls.java
new file mode 100644
index 0000000..2fd0cbc
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ClassMemberDecls.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class ClassMemberDecls extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new ClassMemberDecls.
+ */
+ public ClassMemberDecls() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/CommaListBoundExceptWild.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/CommaListBoundExceptWild.java
new file mode 100644
index 0000000..6ff8a1a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/CommaListBoundExceptWild.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class CommaListBoundExceptWild extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new CommaListBoundExceptWild.
+ */
+ public CommaListBoundExceptWild() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/CompUnit.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/CompUnit.java
new file mode 100644
index 0000000..ca9e1fa
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/CompUnit.java
@@ -0,0 +1,157 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.emfatic.core.generics.util.OneToManyMap;
+import org.eclipse.emf.emfatic.core.generics.util.OneToOneMap;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class CompUnit extends EmfaticASTNode {
+
+ private PackageDecl _packageDecl;
+ private ImportStmts _importStmts;
+ private TopLevelDecls _topLevelDecls;
+
+ public PackageDecl getPackageDecl() {
+ return _packageDecl;
+ }
+
+ public ImportStmts getImportStmts() {
+ return _importStmts;
+ }
+
+ public TopLevelDecls getTopLevelDecls() {
+ return _topLevelDecls;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_packageDecl != null) count++;
+ if (_importStmts != null) count++;
+ if (_topLevelDecls != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_packageDecl != null) && (++count == index)) return _packageDecl;
+ if ((_importStmts != null) && (++count == index)) return _importStmts;
+ if ((_topLevelDecls != null) && (++count == index)) return _topLevelDecls;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new CompUnit.
+ */
+ public CompUnit(
+ PackageDecl packageDecl,
+ ImportStmts importStmts,
+ TopLevelDecls topLevelDecls
+ ) {
+ super();
+
+ if (packageDecl != null) {
+ _packageDecl = packageDecl;
+ if (_packageDecl._parent != null) throw new RuntimeException();
+ _packageDecl._parent = this;
+ }
+ if (importStmts != null) {
+ _importStmts = importStmts;
+ if (_importStmts._parent != null) throw new RuntimeException();
+ _importStmts._parent = this;
+ }
+ if (topLevelDecls != null) {
+ _topLevelDecls = topLevelDecls;
+ if (_topLevelDecls._parent != null) throw new RuntimeException();
+ _topLevelDecls._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+ public void setAST(EPackage rootPackage) {
+ ast = rootPackage;
+ }
+
+ public EPackage getAST() {
+ return ast;
+ }
+
+ EPackage ast = null;
+ /**
+ * The contents of the map cst2outline are as follows:
+ *
+ *
+ * Attribute at -> new OutlineNode(at.getName(), ...
+ *
+ * Reference c -> new OutlineNode(c.getName(), ...
+ *
+ * Annotation astAnn -> new OutlineNode(astAnn, ...
+ *
+ * kv instanceof KeyEqualsValue -> new OutlineNode(kv, ...
+ *
+ * Operation o -> new OutlineNode(o.getName(), ...
+ *
+ * TypeParam tp -> new OutlineNode(tp, ...
+ *
+ * BoundExceptWildcard bound -> new OutlineNode(bound, ...
+ *
+ * Param p -> new OutlineNode(p, ...
+ *
+ */
+ public void setCst2Outline(Map<ASTNode, OutlineNode> cst2outline) {
+ this.cst2outline = cst2outline;
+ }
+
+ public Map<ASTNode, OutlineNode> getCst2Outline() {
+ return cst2outline;
+ }
+
+ public void setMaps(OneToOneMap<ASTNode, EObject> cstDecl2EcoreAST, OneToManyMap<EObject, ASTNode> ecoreDecl2cstUse) {
+ this.cstDecl2EcoreAST = cstDecl2EcoreAST;
+ this.ecoreDecl2cstUse = ecoreDecl2cstUse;
+ }
+
+ private OneToOneMap<ASTNode, EObject> cstDecl2EcoreAST = null;
+ private OneToManyMap<EObject, ASTNode> ecoreDecl2cstUse = null;
+ private Map<ASTNode, OutlineNode> cst2outline = null;
+
+ public OneToOneMap<ASTNode, EObject> getCstDecl2EcoreAST() {
+ return cstDecl2EcoreAST;
+ }
+
+ public OneToManyMap<EObject, ASTNode> getEcoreDecl2CstUse() {
+ return ecoreDecl2cstUse;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/DataTypeDecl.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/DataTypeDecl.java
new file mode 100644
index 0000000..f41d315
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/DataTypeDecl.java
@@ -0,0 +1,143 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class DataTypeDecl extends TopLevelDecl {
+
+ public static final String KW_DATATYPE = "datatype";
+
+ private Annotations _annotations;
+ private TransientModifier _transientModifier;
+ private EmfaticTokenNode _datatype_KW;
+ private EmfaticTokenNode _name;
+ private EmfaticTokenNode _colon;
+ private StringLiteralOrQualifiedID _instClassName;
+ private EmfaticTokenNode _semi;
+
+ public Annotations getAnnotations() {
+ return _annotations;
+ }
+ public TransientModifier getTransientModifier() {
+ return _transientModifier;
+ }
+ public EmfaticTokenNode getDatatype_KW() {
+ return _datatype_KW;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public EmfaticTokenNode getColon() {
+ return _colon;
+ }
+ public StringLiteralOrQualifiedID getInstClassName() {
+ return _instClassName;
+ }
+ public EmfaticTokenNode getSemi() {
+ return _semi;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_annotations != null) count++;
+ if (_transientModifier != null) count++;
+ if (_datatype_KW != null) count++;
+ if (_name != null) count++;
+ if (_colon != null) count++;
+ if (_instClassName != null) count++;
+ if (_semi != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_annotations != null) && (++count == index)) return _annotations;
+ if ((_transientModifier != null) && (++count == index)) return _transientModifier;
+ if ((_datatype_KW != null) && (++count == index)) return _datatype_KW;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_colon != null) && (++count == index)) return _colon;
+ if ((_instClassName != null) && (++count == index)) return _instClassName;
+ if ((_semi != null) && (++count == index)) return _semi;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new DataTypeDecl.
+ */
+ public DataTypeDecl(
+ Annotations annotations,
+ TransientModifier transientModifier,
+ TokenInfo datatype_KW,
+ TokenInfo name,
+ TokenInfo colon,
+ StringLiteralOrQualifiedID instClassName,
+ TokenInfo semi
+ ) {
+ super();
+
+ if (annotations != null) {
+ _annotations = annotations;
+ if (_annotations._parent != null) throw new RuntimeException();
+ _annotations._parent = this;
+ }
+ if (transientModifier != null) {
+ _transientModifier = transientModifier;
+ if (_transientModifier._parent != null) throw new RuntimeException();
+ _transientModifier._parent = this;
+ }
+ if (datatype_KW != null) {
+ _datatype_KW = new EmfaticTokenNode(datatype_KW);
+ if (_datatype_KW._parent != null) throw new RuntimeException();
+ _datatype_KW._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (colon != null) {
+ _colon = new EmfaticTokenNode(colon);
+ if (_colon._parent != null) throw new RuntimeException();
+ _colon._parent = this;
+ }
+ if (instClassName != null) {
+ _instClassName = instClassName;
+ if (_instClassName._parent != null) throw new RuntimeException();
+ _instClassName._parent = this;
+ }
+ if (semi != null) {
+ _semi = new EmfaticTokenNode(semi);
+ if (_semi._parent != null) throw new RuntimeException();
+ _semi._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/DefaultValueExpr.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/DefaultValueExpr.java
new file mode 100644
index 0000000..2f8f124
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/DefaultValueExpr.java
@@ -0,0 +1,27 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public abstract class DefaultValueExpr extends EmfaticASTNode {
+ /**
+ * Construct a new DefaultValueExpr.
+ */
+ public DefaultValueExpr() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EmfaticASTNode.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EmfaticASTNode.java
new file mode 100644
index 0000000..69d95c7
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EmfaticASTNode.java
@@ -0,0 +1,78 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.ASTNodeImpl;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ * The superclass of all ASTNodes for language Emfatic.
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public abstract class EmfaticASTNode extends ASTNodeImpl {
+
+ protected EmfaticASTNode _parent;
+
+ /**
+ * @return the parent of this ASTNode or null if this is the root node of a tree
+ */
+ public ASTNode getParent() {
+ return _parent;
+ }
+
+ /**
+ * Construct a new EmfaticASTNode.
+ */
+ public EmfaticASTNode() {
+ super();
+ }
+
+ /**
+ * Construct a new EmfaticASTNode.
+ *
+ * @param token a Token to initialize the offset and text for this node.
+ */
+ public EmfaticASTNode(TokenInfo tokenInfo) {
+ super(tokenInfo);
+ }
+
+ /**
+ * The external entry point used to initiate the visitor on this node.
+ *
+ * @param visitor the Visitor to visit this node tree
+ */
+ public final void accept(EmfaticASTNodeVisitor visitor) {
+ visitor.preVisit(this);
+ acceptImpl(visitor);
+ visitor.postVisit(this);
+ }
+
+ /**
+ * This method can be overridden by subclasses which should provide exactly
+ * the same implementation. Here <code>this</code> refers to the generic node
+ * class, but in the subclass implementations <code>this</code> will refer to
+ * the specific subclass type. Thus the correct specific <code>beginVisit</code>
+ * and <code>endVisit</code> methods will be invoked for each subclass and the
+ * generic methods will be invoked for subclasses that don't need specific visitor
+ * behavior.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+ /**
+ * Iterate through the children of this node and accept the visitor on each.
+ */
+ protected void visitChildren(EmfaticASTNodeVisitor visitor) {
+ for (int i = 0; i < getChildCount(); i++) {
+ ASTNode child = getChild(i);
+ if (child instanceof EmfaticASTNode) {
+ EmfaticASTNode c = (EmfaticASTNode)child;
+ c.accept(visitor);
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EmfaticASTNodeVisitor.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EmfaticASTNodeVisitor.java
new file mode 100644
index 0000000..7b6430a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EmfaticASTNodeVisitor.java
@@ -0,0 +1,1626 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+/**
+ * A Visitor pattern stub implementation for language Emfatic.
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class EmfaticASTNodeVisitor {
+
+ /**
+ * The external entry point used to perform a visit beginning at the given node.
+ *
+ * @param node the EmfaticASTNode to visit
+ */
+ public final void visit(EmfaticASTNode node) {
+ node.accept(this);
+ }
+
+ /**
+ * Called just before <code>beginVisit</code> for each node being visited.
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param node the EmfaticASTNode currently being visited
+ */
+ public void preVisit(EmfaticASTNode node) {
+ }
+
+ /**
+ * Called just after <code>endVisit</code> for each node being visited.
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param node the EmfaticASTNode currently being visited
+ */
+ public void postVisit(EmfaticASTNode node) {
+ }
+
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the generic one called for node types that
+ * don't provide a specific overloaded form of <code>beginVisit</code>.
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param node the EmfaticASTNode currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(EmfaticASTNode node) {
+ return true;
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the generic one called for node types that
+ * don't provide a specific overloaded form of <code>endVisit</code>.
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param node the EmfaticASTNode currently being visited
+ */
+ public void endVisit(EmfaticASTNode node) {
+ }
+
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>EmfaticTokenNode</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param tokenNode the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(EmfaticTokenNode tokenNode) {
+ return beginVisit((EmfaticASTNode)tokenNode);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>EmfaticTokenNode</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param tokenNode the node currently being visited
+ */
+ public void endVisit(EmfaticTokenNode tokenNode) {
+ endVisit((EmfaticASTNode)tokenNode);
+ }
+
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>CompUnit</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param compUnit the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(CompUnit compUnit) {
+ return beginVisit((EmfaticASTNode)compUnit);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>CompUnit</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param compUnit the node currently being visited
+ */
+ public void endVisit(CompUnit compUnit) {
+ endVisit((EmfaticASTNode)compUnit);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>PackageDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param packageDecl the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(PackageDecl packageDecl) {
+ return beginVisit((EmfaticASTNode)packageDecl);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>PackageDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param packageDecl the node currently being visited
+ */
+ public void endVisit(PackageDecl packageDecl) {
+ endVisit((EmfaticASTNode)packageDecl);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>QualifiedID</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param qualifiedID the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(QualifiedID qualifiedID) {
+ return beginVisit((EmfaticASTNode)qualifiedID);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>QualifiedID</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param qualifiedID the node currently being visited
+ */
+ public void endVisit(QualifiedID qualifiedID) {
+ endVisit((EmfaticASTNode)qualifiedID);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>QidSeparator</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param qidSeparator the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(QidSeparator qidSeparator) {
+ return beginVisit((EmfaticTokenNode)qidSeparator);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>QidSeparator</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param qidSeparator the node currently being visited
+ */
+ public void endVisit(QidSeparator qidSeparator) {
+ endVisit((EmfaticTokenNode)qidSeparator);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>StringLiteralOrQualifiedID</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param stringLiteralOrQualifiedID the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(StringLiteralOrQualifiedID stringLiteralOrQualifiedID) {
+ return beginVisit((EmfaticASTNode)stringLiteralOrQualifiedID);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>StringLiteralOrQualifiedID</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param stringLiteralOrQualifiedID the node currently being visited
+ */
+ public void endVisit(StringLiteralOrQualifiedID stringLiteralOrQualifiedID) {
+ endVisit((EmfaticASTNode)stringLiteralOrQualifiedID);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>StringLiteralContainer</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param stringLiteralContainer the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(StringLiteralContainer stringLiteralContainer) {
+ return beginVisit((StringLiteralOrQualifiedID)stringLiteralContainer);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>StringLiteralContainer</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param stringLiteralContainer the node currently being visited
+ */
+ public void endVisit(StringLiteralContainer stringLiteralContainer) {
+ endVisit((StringLiteralOrQualifiedID)stringLiteralContainer);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>QualifiedIDContainer</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param qualifiedIDContainer the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(QualifiedIDContainer qualifiedIDContainer) {
+ return beginVisit((StringLiteralOrQualifiedID)qualifiedIDContainer);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>QualifiedIDContainer</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param qualifiedIDContainer the node currently being visited
+ */
+ public void endVisit(QualifiedIDContainer qualifiedIDContainer) {
+ endVisit((StringLiteralOrQualifiedID)qualifiedIDContainer);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Annotations</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param annotations the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Annotations annotations) {
+ return beginVisit((EmfaticASTNode)annotations);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Annotations</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param annotations the node currently being visited
+ */
+ public void endVisit(Annotations annotations) {
+ endVisit((EmfaticASTNode)annotations);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Annotation</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param annotation the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Annotation annotation) {
+ return beginVisit((EmfaticASTNode)annotation);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Annotation</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param annotation the node currently being visited
+ */
+ public void endVisit(Annotation annotation) {
+ endVisit((EmfaticASTNode)annotation);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>KeyEqualsValueList</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param keyEqualsValueList the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(KeyEqualsValueList keyEqualsValueList) {
+ return beginVisit((EmfaticASTNode)keyEqualsValueList);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>KeyEqualsValueList</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param keyEqualsValueList the node currently being visited
+ */
+ public void endVisit(KeyEqualsValueList keyEqualsValueList) {
+ endVisit((EmfaticASTNode)keyEqualsValueList);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>KeyEqualsValue</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param keyEqualsValue the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(KeyEqualsValue keyEqualsValue) {
+ return beginVisit((EmfaticASTNode)keyEqualsValue);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>KeyEqualsValue</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param keyEqualsValue the node currently being visited
+ */
+ public void endVisit(KeyEqualsValue keyEqualsValue) {
+ endVisit((EmfaticASTNode)keyEqualsValue);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>ImportStmts</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param importStmts the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(ImportStmts importStmts) {
+ return beginVisit((EmfaticASTNode)importStmts);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>ImportStmts</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param importStmts the node currently being visited
+ */
+ public void endVisit(ImportStmts importStmts) {
+ endVisit((EmfaticASTNode)importStmts);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>ImportStmt</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param importStmt the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(ImportStmt importStmt) {
+ return beginVisit((EmfaticASTNode)importStmt);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>ImportStmt</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param importStmt the node currently being visited
+ */
+ public void endVisit(ImportStmt importStmt) {
+ endVisit((EmfaticASTNode)importStmt);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>TopLevelDecls</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param topLevelDecls the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(TopLevelDecls topLevelDecls) {
+ return beginVisit((EmfaticASTNode)topLevelDecls);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>TopLevelDecls</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param topLevelDecls the node currently being visited
+ */
+ public void endVisit(TopLevelDecls topLevelDecls) {
+ endVisit((EmfaticASTNode)topLevelDecls);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>TopLevelDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param topLevelDecl the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(TopLevelDecl topLevelDecl) {
+ return beginVisit((EmfaticASTNode)topLevelDecl);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>TopLevelDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param topLevelDecl the node currently being visited
+ */
+ public void endVisit(TopLevelDecl topLevelDecl) {
+ endVisit((EmfaticASTNode)topLevelDecl);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>SubPackageDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param subPackageDecl the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(SubPackageDecl subPackageDecl) {
+ return beginVisit((TopLevelDecl)subPackageDecl);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>SubPackageDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param subPackageDecl the node currently being visited
+ */
+ public void endVisit(SubPackageDecl subPackageDecl) {
+ endVisit((TopLevelDecl)subPackageDecl);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>ClassDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param classDecl the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(ClassDecl classDecl) {
+ return beginVisit((TopLevelDecl)classDecl);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>ClassDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param classDecl the node currently being visited
+ */
+ public void endVisit(ClassDecl classDecl) {
+ endVisit((TopLevelDecl)classDecl);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>CommaListBoundExceptWild</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param commaListBoundExceptWild the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(CommaListBoundExceptWild commaListBoundExceptWild) {
+ return beginVisit((EmfaticASTNode)commaListBoundExceptWild);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>CommaListBoundExceptWild</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param commaListBoundExceptWild the node currently being visited
+ */
+ public void endVisit(CommaListBoundExceptWild commaListBoundExceptWild) {
+ endVisit((EmfaticASTNode)commaListBoundExceptWild);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>AbstractModifier</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param abstractModifier the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(AbstractModifier abstractModifier) {
+ return beginVisit((EmfaticASTNode)abstractModifier);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>AbstractModifier</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param abstractModifier the node currently being visited
+ */
+ public void endVisit(AbstractModifier abstractModifier) {
+ endVisit((EmfaticASTNode)abstractModifier);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>ClassKind</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param classKind the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(ClassKind classKind) {
+ return beginVisit((EmfaticTokenNode)classKind);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>ClassKind</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param classKind the node currently being visited
+ */
+ public void endVisit(ClassKind classKind) {
+ endVisit((EmfaticTokenNode)classKind);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>TypeParamsInfo</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeParamsInfo the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(TypeParamsInfo typeParamsInfo) {
+ return beginVisit((EmfaticASTNode)typeParamsInfo);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>TypeParamsInfo</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeParamsInfo the node currently being visited
+ */
+ public void endVisit(TypeParamsInfo typeParamsInfo) {
+ endVisit((EmfaticASTNode)typeParamsInfo);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>OneOrMoreTypeParams</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param oneOrMoreTypeParams the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(OneOrMoreTypeParams oneOrMoreTypeParams) {
+ return beginVisit((EmfaticASTNode)oneOrMoreTypeParams);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>OneOrMoreTypeParams</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param oneOrMoreTypeParams the node currently being visited
+ */
+ public void endVisit(OneOrMoreTypeParams oneOrMoreTypeParams) {
+ endVisit((EmfaticASTNode)oneOrMoreTypeParams);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>TypeParam</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeParam the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(TypeParam typeParam) {
+ return beginVisit((EmfaticASTNode)typeParam);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>TypeParam</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeParam the node currently being visited
+ */
+ public void endVisit(TypeParam typeParam) {
+ endVisit((EmfaticASTNode)typeParam);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>TypeBoundsInfo</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeBoundsInfo the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(TypeBoundsInfo typeBoundsInfo) {
+ return beginVisit((EmfaticASTNode)typeBoundsInfo);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>TypeBoundsInfo</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeBoundsInfo the node currently being visited
+ */
+ public void endVisit(TypeBoundsInfo typeBoundsInfo) {
+ endVisit((EmfaticASTNode)typeBoundsInfo);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>OneOrMoreTypeParamBounds</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param oneOrMoreTypeParamBounds the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds) {
+ return beginVisit((EmfaticASTNode)oneOrMoreTypeParamBounds);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>OneOrMoreTypeParamBounds</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param oneOrMoreTypeParamBounds the node currently being visited
+ */
+ public void endVisit(OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds) {
+ endVisit((EmfaticASTNode)oneOrMoreTypeParamBounds);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>BoundExceptWildcard</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param boundExceptWildcard the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(BoundExceptWildcard boundExceptWildcard) {
+ return beginVisit((TypeArg)boundExceptWildcard);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>BoundExceptWildcard</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param boundExceptWildcard the node currently being visited
+ */
+ public void endVisit(BoundExceptWildcard boundExceptWildcard) {
+ endVisit((TypeArg)boundExceptWildcard);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>OneOrMoreTypeArgs</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param oneOrMoreTypeArgs the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(OneOrMoreTypeArgs oneOrMoreTypeArgs) {
+ return beginVisit((EmfaticASTNode)oneOrMoreTypeArgs);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>OneOrMoreTypeArgs</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param oneOrMoreTypeArgs the node currently being visited
+ */
+ public void endVisit(OneOrMoreTypeArgs oneOrMoreTypeArgs) {
+ endVisit((EmfaticASTNode)oneOrMoreTypeArgs);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>TypeArg</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeArg the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(TypeArg typeArg) {
+ return beginVisit((EmfaticASTNode)typeArg);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>TypeArg</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeArg the node currently being visited
+ */
+ public void endVisit(TypeArg typeArg) {
+ endVisit((EmfaticASTNode)typeArg);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Wildcard</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param wildcard the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Wildcard wildcard) {
+ return beginVisit((TypeArg)wildcard);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Wildcard</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param wildcard the node currently being visited
+ */
+ public void endVisit(Wildcard wildcard) {
+ endVisit((TypeArg)wildcard);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>ExtendsOrSuper</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param extendsOrSuper the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(ExtendsOrSuper extendsOrSuper) {
+ return beginVisit((EmfaticTokenNode)extendsOrSuper);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>ExtendsOrSuper</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param extendsOrSuper the node currently being visited
+ */
+ public void endVisit(ExtendsOrSuper extendsOrSuper) {
+ endVisit((EmfaticTokenNode)extendsOrSuper);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>ClassMemberDecls</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param classMemberDecls the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(ClassMemberDecls classMemberDecls) {
+ return beginVisit((EmfaticASTNode)classMemberDecls);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>ClassMemberDecls</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param classMemberDecls the node currently being visited
+ */
+ public void endVisit(ClassMemberDecls classMemberDecls) {
+ endVisit((EmfaticASTNode)classMemberDecls);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>ClassMemberDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param classMemberDecl the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(ClassMemberDecl classMemberDecl) {
+ return beginVisit((EmfaticASTNode)classMemberDecl);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>ClassMemberDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param classMemberDecl the node currently being visited
+ */
+ public void endVisit(ClassMemberDecl classMemberDecl) {
+ endVisit((EmfaticASTNode)classMemberDecl);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Attribute</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param attribute the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Attribute attribute) {
+ return beginVisit((ClassMemberDecl)attribute);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Attribute</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param attribute the node currently being visited
+ */
+ public void endVisit(Attribute attribute) {
+ endVisit((ClassMemberDecl)attribute);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>TypeWithMulti</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeWithMulti the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(TypeWithMulti typeWithMulti) {
+ return beginVisit((ResultType)typeWithMulti);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>TypeWithMulti</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param typeWithMulti the node currently being visited
+ */
+ public void endVisit(TypeWithMulti typeWithMulti) {
+ endVisit((ResultType)typeWithMulti);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Multiplicity</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param multiplicity the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Multiplicity multiplicity) {
+ return beginVisit((EmfaticASTNode)multiplicity);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Multiplicity</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param multiplicity the node currently being visited
+ */
+ public void endVisit(Multiplicity multiplicity) {
+ endVisit((EmfaticASTNode)multiplicity);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>MultiplicityExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param multiplicityExpr the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(MultiplicityExpr multiplicityExpr) {
+ return beginVisit((EmfaticASTNode)multiplicityExpr);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>MultiplicityExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param multiplicityExpr the node currently being visited
+ */
+ public void endVisit(MultiplicityExpr multiplicityExpr) {
+ endVisit((EmfaticASTNode)multiplicityExpr);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>SimpleMultiplicityExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param simpleMultiplicityExpr the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(SimpleMultiplicityExpr simpleMultiplicityExpr) {
+ return beginVisit((EmfaticTokenNode)simpleMultiplicityExpr);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>SimpleMultiplicityExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param simpleMultiplicityExpr the node currently being visited
+ */
+ public void endVisit(SimpleMultiplicityExpr simpleMultiplicityExpr) {
+ endVisit((EmfaticTokenNode)simpleMultiplicityExpr);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Reference</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param reference the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Reference reference) {
+ return beginVisit((ClassMemberDecl)reference);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Reference</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param reference the node currently being visited
+ */
+ public void endVisit(Reference reference) {
+ endVisit((ClassMemberDecl)reference);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>ReferenceKind</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param referenceKind the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(ReferenceKind referenceKind) {
+ return beginVisit((EmfaticTokenNode)referenceKind);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>ReferenceKind</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param referenceKind the node currently being visited
+ */
+ public void endVisit(ReferenceKind referenceKind) {
+ endVisit((EmfaticTokenNode)referenceKind);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Modifiers</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param modifiers the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Modifiers modifiers) {
+ return beginVisit((EmfaticASTNode)modifiers);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Modifiers</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param modifiers the node currently being visited
+ */
+ public void endVisit(Modifiers modifiers) {
+ endVisit((EmfaticASTNode)modifiers);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>OptNegatedModifier</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param optNegatedModifier the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(OptNegatedModifier optNegatedModifier) {
+ return beginVisit((EmfaticASTNode)optNegatedModifier);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>OptNegatedModifier</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param optNegatedModifier the node currently being visited
+ */
+ public void endVisit(OptNegatedModifier optNegatedModifier) {
+ endVisit((EmfaticASTNode)optNegatedModifier);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Modifier</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param modifier the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Modifier modifier) {
+ return beginVisit((EmfaticTokenNode)modifier);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Modifier</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param modifier the node currently being visited
+ */
+ public void endVisit(Modifier modifier) {
+ endVisit((EmfaticTokenNode)modifier);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>DefaultValueExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param defaultValueExpr the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(DefaultValueExpr defaultValueExpr) {
+ return beginVisit((EmfaticASTNode)defaultValueExpr);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>DefaultValueExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param defaultValueExpr the node currently being visited
+ */
+ public void endVisit(DefaultValueExpr defaultValueExpr) {
+ endVisit((EmfaticASTNode)defaultValueExpr);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>BoolExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param boolExpr the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(BoolExpr boolExpr) {
+ return beginVisit((DefaultValueExpr)boolExpr);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>BoolExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param boolExpr the node currently being visited
+ */
+ public void endVisit(BoolExpr boolExpr) {
+ endVisit((DefaultValueExpr)boolExpr);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>TrueOrFalse</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param trueOrFalse the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(TrueOrFalse trueOrFalse) {
+ return beginVisit((EmfaticTokenNode)trueOrFalse);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>TrueOrFalse</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param trueOrFalse the node currently being visited
+ */
+ public void endVisit(TrueOrFalse trueOrFalse) {
+ endVisit((EmfaticTokenNode)trueOrFalse);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>IntExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param intExpr the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(IntExpr intExpr) {
+ return beginVisit((DefaultValueExpr)intExpr);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>IntExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param intExpr the node currently being visited
+ */
+ public void endVisit(IntExpr intExpr) {
+ endVisit((DefaultValueExpr)intExpr);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>StringExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param stringExpr the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(StringExpr stringExpr) {
+ return beginVisit((DefaultValueExpr)stringExpr);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>StringExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param stringExpr the node currently being visited
+ */
+ public void endVisit(StringExpr stringExpr) {
+ endVisit((DefaultValueExpr)stringExpr);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>CharExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param charExpr the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(CharExpr charExpr) {
+ return beginVisit((DefaultValueExpr)charExpr);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>CharExpr</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param charExpr the node currently being visited
+ */
+ public void endVisit(CharExpr charExpr) {
+ endVisit((DefaultValueExpr)charExpr);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Operation</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param operation the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Operation operation) {
+ return beginVisit((ClassMemberDecl)operation);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Operation</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param operation the node currently being visited
+ */
+ public void endVisit(Operation operation) {
+ endVisit((ClassMemberDecl)operation);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>ResultType</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param resultType the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(ResultType resultType) {
+ return beginVisit((EmfaticASTNode)resultType);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>ResultType</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param resultType the node currently being visited
+ */
+ public void endVisit(ResultType resultType) {
+ endVisit((EmfaticASTNode)resultType);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>VoidContainer</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param voidContainer the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(VoidContainer voidContainer) {
+ return beginVisit((ResultType)voidContainer);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>VoidContainer</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param voidContainer the node currently being visited
+ */
+ public void endVisit(VoidContainer voidContainer) {
+ endVisit((ResultType)voidContainer);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Params</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param params the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Params params) {
+ return beginVisit((EmfaticASTNode)params);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Params</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param params the node currently being visited
+ */
+ public void endVisit(Params params) {
+ endVisit((EmfaticASTNode)params);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>Param</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param param the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(Param param) {
+ return beginVisit((EmfaticASTNode)param);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>Param</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param param the node currently being visited
+ */
+ public void endVisit(Param param) {
+ endVisit((EmfaticASTNode)param);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>DataTypeDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param dataTypeDecl the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(DataTypeDecl dataTypeDecl) {
+ return beginVisit((TopLevelDecl)dataTypeDecl);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>DataTypeDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param dataTypeDecl the node currently being visited
+ */
+ public void endVisit(DataTypeDecl dataTypeDecl) {
+ endVisit((TopLevelDecl)dataTypeDecl);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>TransientModifier</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param transientModifier the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(TransientModifier transientModifier) {
+ return beginVisit((EmfaticASTNode)transientModifier);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>TransientModifier</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param transientModifier the node currently being visited
+ */
+ public void endVisit(TransientModifier transientModifier) {
+ endVisit((EmfaticASTNode)transientModifier);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>EnumDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param enumDecl the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(EnumDecl enumDecl) {
+ return beginVisit((TopLevelDecl)enumDecl);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>EnumDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param enumDecl the node currently being visited
+ */
+ public void endVisit(EnumDecl enumDecl) {
+ endVisit((TopLevelDecl)enumDecl);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>EnumLiterals</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param enumLiterals the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(EnumLiterals enumLiterals) {
+ return beginVisit((EmfaticASTNode)enumLiterals);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>EnumLiterals</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param enumLiterals the node currently being visited
+ */
+ public void endVisit(EnumLiterals enumLiterals) {
+ endVisit((EmfaticASTNode)enumLiterals);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>EnumLiteral</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param enumLiteral the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(EnumLiteral enumLiteral) {
+ return beginVisit((EmfaticASTNode)enumLiteral);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>EnumLiteral</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param enumLiteral the node currently being visited
+ */
+ public void endVisit(EnumLiteral enumLiteral) {
+ endVisit((EmfaticASTNode)enumLiteral);
+ }
+ /**
+ * This is called, for each node being visited, just after <code>preVisit</code> and
+ * before (optionally) visiting the children of the node.
+ * This <code>beginVisit</code> method is the specific one called for nodes
+ * of type <code>MapEntryDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param mapEntryDecl the node currently being visited
+ * @return true to visit the children of the node, false to prevent visiting the children of the node
+ */
+ public boolean beginVisit(MapEntryDecl mapEntryDecl) {
+ return beginVisit((TopLevelDecl)mapEntryDecl);
+ }
+
+ /**
+ * This is called, for each node being visited, after <code>beginVisit</code> and
+ * (optionally) visiting the children of the node and before <code>postVisit</code>.
+ * This <code>endVisit</code> method is the specific one called for nodes
+ * of type <code>MapEntryDecl</code>
+ * This may be overridden to provide special behavior at that point in processing.
+ *
+ * @param mapEntryDecl the node currently being visited
+ */
+ public void endVisit(MapEntryDecl mapEntryDecl) {
+ endVisit((TopLevelDecl)mapEntryDecl);
+ }
+
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EmfaticTokenNode.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EmfaticTokenNode.java
new file mode 100644
index 0000000..78eb953
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EmfaticTokenNode.java
@@ -0,0 +1,51 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ * Represents a token in the language grammar.
+ * Can be subclassed to represent specific token subgroups.
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class EmfaticTokenNode extends EmfaticASTNode {
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public final int getChildCount() {
+ // token rules cannot have children!
+ return 0;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public final ASTNode getChild(int index) {
+ // token rules cannot have children!
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new EmfaticTokenNode
+ */
+ public EmfaticTokenNode(TokenInfo tokenInfo) {
+ super(tokenInfo);
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EnumDecl.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EnumDecl.java
new file mode 100644
index 0000000..e9faebe
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EnumDecl.java
@@ -0,0 +1,131 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class EnumDecl extends TopLevelDecl {
+
+ public static final String KW_ENUM = "enum";
+
+ private Annotations _annotations;
+ private EmfaticTokenNode _enum_KW;
+ private EmfaticTokenNode _name;
+ private EmfaticTokenNode _lcurly;
+ private EnumLiterals _enumLiterals;
+ private EmfaticTokenNode _rcurly;
+
+ public Annotations getAnnotations() {
+ return _annotations;
+ }
+ public EmfaticTokenNode getEnum_KW() {
+ return _enum_KW;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public EmfaticTokenNode getLcurly() {
+ return _lcurly;
+ }
+ public EnumLiterals getEnumLiterals() {
+ return _enumLiterals;
+ }
+ public EmfaticTokenNode getRcurly() {
+ return _rcurly;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_annotations != null) count++;
+ if (_enum_KW != null) count++;
+ if (_name != null) count++;
+ if (_lcurly != null) count++;
+ if (_enumLiterals != null) count++;
+ if (_rcurly != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_annotations != null) && (++count == index)) return _annotations;
+ if ((_enum_KW != null) && (++count == index)) return _enum_KW;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_lcurly != null) && (++count == index)) return _lcurly;
+ if ((_enumLiterals != null) && (++count == index)) return _enumLiterals;
+ if ((_rcurly != null) && (++count == index)) return _rcurly;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new EnumDecl.
+ */
+ public EnumDecl(
+ Annotations annotations,
+ TokenInfo enum_KW,
+ TokenInfo name,
+ TokenInfo lcurly,
+ EnumLiterals enumLiterals,
+ TokenInfo rcurly
+ ) {
+ super();
+
+ if (annotations != null) {
+ _annotations = annotations;
+ if (_annotations._parent != null) throw new RuntimeException();
+ _annotations._parent = this;
+ }
+ if (enum_KW != null) {
+ _enum_KW = new EmfaticTokenNode(enum_KW);
+ if (_enum_KW._parent != null) throw new RuntimeException();
+ _enum_KW._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (lcurly != null) {
+ _lcurly = new EmfaticTokenNode(lcurly);
+ if (_lcurly._parent != null) throw new RuntimeException();
+ _lcurly._parent = this;
+ }
+ if (enumLiterals != null) {
+ _enumLiterals = enumLiterals;
+ if (_enumLiterals._parent != null) throw new RuntimeException();
+ _enumLiterals._parent = this;
+ }
+ if (rcurly != null) {
+ _rcurly = new EmfaticTokenNode(rcurly);
+ if (_rcurly._parent != null) throw new RuntimeException();
+ _rcurly._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EnumLiteral.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EnumLiteral.java
new file mode 100644
index 0000000..8d53c4c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EnumLiteral.java
@@ -0,0 +1,130 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class EnumLiteral extends EmfaticASTNode {
+
+
+ private Annotations _leadingAnnotations;
+ private EmfaticTokenNode _name;
+ private EmfaticTokenNode _equals;
+ private EmfaticTokenNode _val;
+ private Annotations _trailingAnnotations;
+ private EmfaticTokenNode _semi;
+
+ public Annotations getLeadingAnnotations() {
+ return _leadingAnnotations;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public EmfaticTokenNode getEquals() {
+ return _equals;
+ }
+ public EmfaticTokenNode getVal() {
+ return _val;
+ }
+ public Annotations getTrailingAnnotations() {
+ return _trailingAnnotations;
+ }
+ public EmfaticTokenNode getSemi() {
+ return _semi;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_leadingAnnotations != null) count++;
+ if (_name != null) count++;
+ if (_equals != null) count++;
+ if (_val != null) count++;
+ if (_trailingAnnotations != null) count++;
+ if (_semi != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_leadingAnnotations != null) && (++count == index)) return _leadingAnnotations;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_equals != null) && (++count == index)) return _equals;
+ if ((_val != null) && (++count == index)) return _val;
+ if ((_trailingAnnotations != null) && (++count == index)) return _trailingAnnotations;
+ if ((_semi != null) && (++count == index)) return _semi;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new EnumLiteral.
+ */
+ public EnumLiteral(
+ Annotations leadingAnnotations,
+ TokenInfo name,
+ TokenInfo equals,
+ TokenInfo val,
+ Annotations trailingAnnotations,
+ TokenInfo semi
+ ) {
+ super();
+
+ if (leadingAnnotations != null) {
+ _leadingAnnotations = leadingAnnotations;
+ if (_leadingAnnotations._parent != null) throw new RuntimeException();
+ _leadingAnnotations._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (equals != null) {
+ _equals = new EmfaticTokenNode(equals);
+ if (_equals._parent != null) throw new RuntimeException();
+ _equals._parent = this;
+ }
+ if (val != null) {
+ _val = new EmfaticTokenNode(val);
+ if (_val._parent != null) throw new RuntimeException();
+ _val._parent = this;
+ }
+ if (trailingAnnotations != null) {
+ _trailingAnnotations = trailingAnnotations;
+ if (_trailingAnnotations._parent != null) throw new RuntimeException();
+ _trailingAnnotations._parent = this;
+ }
+ if (semi != null) {
+ _semi = new EmfaticTokenNode(semi);
+ if (_semi._parent != null) throw new RuntimeException();
+ _semi._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EnumLiterals.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EnumLiterals.java
new file mode 100644
index 0000000..fa5f95c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/EnumLiterals.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class EnumLiterals extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new EnumLiterals.
+ */
+ public EnumLiterals() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ExtendsOrSuper.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ExtendsOrSuper.java
new file mode 100644
index 0000000..408192b
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ExtendsOrSuper.java
@@ -0,0 +1,34 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class ExtendsOrSuper extends EmfaticTokenNode {
+
+ public static final String KW_EXTENDS = "extends";
+ public static final String KW_SUPER = "super";
+
+
+ /**
+ * Construct a new ExtendsOrSuper.
+ */
+ public ExtendsOrSuper(TokenInfo tokenInfo) {
+ super(tokenInfo);
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ImportStmt.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ImportStmt.java
new file mode 100644
index 0000000..f5789e4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ImportStmt.java
@@ -0,0 +1,119 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class ImportStmt extends EmfaticASTNode {
+
+ public static final String KW_IMPORT = "import";
+
+ private EmfaticTokenNode _import_KW;
+ private EmfaticTokenNode _alias;
+ private EmfaticTokenNode _equals;
+ private StringLiteralOrQualifiedID _uri;
+ private EmfaticTokenNode _semi;
+
+ public EmfaticTokenNode getImport_KW() {
+ return _import_KW;
+ }
+ public EmfaticTokenNode getAlias() {
+ return _alias;
+ }
+ public EmfaticTokenNode getEquals() {
+ return _equals;
+ }
+ public StringLiteralOrQualifiedID getUri() {
+ return _uri;
+ }
+ public EmfaticTokenNode getSemi() {
+ return _semi;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_import_KW != null) count++;
+ if (_alias != null) count++;
+ if (_equals != null) count++;
+ if (_uri != null) count++;
+ if (_semi != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_import_KW != null) && (++count == index)) return _import_KW;
+ if ((_alias != null) && (++count == index)) return _alias;
+ if ((_equals != null) && (++count == index)) return _equals;
+ if ((_uri != null) && (++count == index)) return _uri;
+ if ((_semi != null) && (++count == index)) return _semi;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new ImportStmt.
+ */
+ public ImportStmt(
+ TokenInfo import_KW,
+ TokenInfo alias,
+ TokenInfo equals,
+ StringLiteralOrQualifiedID uri,
+ TokenInfo semi
+ ) {
+ super();
+
+ if (import_KW != null) {
+ _import_KW = new EmfaticTokenNode(import_KW);
+ if (_import_KW._parent != null) throw new RuntimeException();
+ _import_KW._parent = this;
+ }
+ if (alias != null) {
+ _alias = new EmfaticTokenNode(alias);
+ if (_alias._parent != null) throw new RuntimeException();
+ _alias._parent = this;
+ }
+ if (equals != null) {
+ _equals = new EmfaticTokenNode(equals);
+ if (_equals._parent != null) throw new RuntimeException();
+ _equals._parent = this;
+ }
+ if (uri != null) {
+ _uri = uri;
+ if (_uri._parent != null) throw new RuntimeException();
+ _uri._parent = this;
+ }
+ if (semi != null) {
+ _semi = new EmfaticTokenNode(semi);
+ if (_semi._parent != null) throw new RuntimeException();
+ _semi._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ImportStmts.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ImportStmts.java
new file mode 100644
index 0000000..6a6463b
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ImportStmts.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class ImportStmts extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new ImportStmts.
+ */
+ public ImportStmts() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/IntExpr.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/IntExpr.java
new file mode 100644
index 0000000..2eaa4f0
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/IntExpr.java
@@ -0,0 +1,82 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class IntExpr extends DefaultValueExpr {
+
+
+ private EmfaticTokenNode _minus;
+ private EmfaticTokenNode _int_literal;
+
+ public EmfaticTokenNode getMinus() {
+ return _minus;
+ }
+ public EmfaticTokenNode getInt_literal() {
+ return _int_literal;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_minus != null) count++;
+ if (_int_literal != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_minus != null) && (++count == index)) return _minus;
+ if ((_int_literal != null) && (++count == index)) return _int_literal;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new IntExpr.
+ */
+ public IntExpr(
+ TokenInfo minus,
+ TokenInfo int_literal
+ ) {
+ super();
+
+ if (minus != null) {
+ _minus = new EmfaticTokenNode(minus);
+ if (_minus._parent != null) throw new RuntimeException();
+ _minus._parent = this;
+ }
+ if (int_literal != null) {
+ _int_literal = new EmfaticTokenNode(int_literal);
+ if (_int_literal._parent != null) throw new RuntimeException();
+ _int_literal._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/KeyEqualsValue.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/KeyEqualsValue.java
new file mode 100644
index 0000000..8f0505a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/KeyEqualsValue.java
@@ -0,0 +1,94 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class KeyEqualsValue extends EmfaticASTNode {
+
+
+ private StringLiteralOrQualifiedID _key;
+ private EmfaticTokenNode _equals;
+ private StringLiteralOrQualifiedID _value;
+
+ public StringLiteralOrQualifiedID getKey() {
+ return _key;
+ }
+ public EmfaticTokenNode getEquals() {
+ return _equals;
+ }
+ public StringLiteralOrQualifiedID getValue() {
+ return _value;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_key != null) count++;
+ if (_equals != null) count++;
+ if (_value != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_key != null) && (++count == index)) return _key;
+ if ((_equals != null) && (++count == index)) return _equals;
+ if ((_value != null) && (++count == index)) return _value;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new KeyEqualsValue.
+ */
+ public KeyEqualsValue(
+ StringLiteralOrQualifiedID key,
+ TokenInfo equals,
+ StringLiteralOrQualifiedID value
+ ) {
+ super();
+
+ if (key != null) {
+ _key = key;
+ if (_key._parent != null) throw new RuntimeException();
+ _key._parent = this;
+ }
+ if (equals != null) {
+ _equals = new EmfaticTokenNode(equals);
+ if (_equals._parent != null) throw new RuntimeException();
+ _equals._parent = this;
+ }
+ if (value != null) {
+ _value = value;
+ if (_value._parent != null) throw new RuntimeException();
+ _value._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/KeyEqualsValueList.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/KeyEqualsValueList.java
new file mode 100644
index 0000000..bfee403
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/KeyEqualsValueList.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class KeyEqualsValueList extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new KeyEqualsValueList.
+ */
+ public KeyEqualsValueList() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/MapEntryDecl.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/MapEntryDecl.java
new file mode 100644
index 0000000..967ff9c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/MapEntryDecl.java
@@ -0,0 +1,155 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class MapEntryDecl extends TopLevelDecl {
+
+ public static final String KW_MAPENTRY = "mapentry";
+
+ private Annotations _annotations;
+ private EmfaticTokenNode _mapentry_KW;
+ private EmfaticTokenNode _name;
+ private EmfaticTokenNode _colon;
+ private TypeWithMulti _key;
+ private EmfaticTokenNode _minus_gt;
+ private TypeWithMulti _value;
+ private EmfaticTokenNode _semi;
+
+ public Annotations getAnnotations() {
+ return _annotations;
+ }
+ public EmfaticTokenNode getMapentry_KW() {
+ return _mapentry_KW;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public EmfaticTokenNode getColon() {
+ return _colon;
+ }
+ public TypeWithMulti getKey() {
+ return _key;
+ }
+ public EmfaticTokenNode getMinus_gt() {
+ return _minus_gt;
+ }
+ public TypeWithMulti getValue() {
+ return _value;
+ }
+ public EmfaticTokenNode getSemi() {
+ return _semi;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_annotations != null) count++;
+ if (_mapentry_KW != null) count++;
+ if (_name != null) count++;
+ if (_colon != null) count++;
+ if (_key != null) count++;
+ if (_minus_gt != null) count++;
+ if (_value != null) count++;
+ if (_semi != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_annotations != null) && (++count == index)) return _annotations;
+ if ((_mapentry_KW != null) && (++count == index)) return _mapentry_KW;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_colon != null) && (++count == index)) return _colon;
+ if ((_key != null) && (++count == index)) return _key;
+ if ((_minus_gt != null) && (++count == index)) return _minus_gt;
+ if ((_value != null) && (++count == index)) return _value;
+ if ((_semi != null) && (++count == index)) return _semi;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new MapEntryDecl.
+ */
+ public MapEntryDecl(
+ Annotations annotations,
+ TokenInfo mapentry_KW,
+ TokenInfo name,
+ TokenInfo colon,
+ TypeWithMulti key,
+ TokenInfo minus_gt,
+ TypeWithMulti value,
+ TokenInfo semi
+ ) {
+ super();
+
+ if (annotations != null) {
+ _annotations = annotations;
+ if (_annotations._parent != null) throw new RuntimeException();
+ _annotations._parent = this;
+ }
+ if (mapentry_KW != null) {
+ _mapentry_KW = new EmfaticTokenNode(mapentry_KW);
+ if (_mapentry_KW._parent != null) throw new RuntimeException();
+ _mapentry_KW._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (colon != null) {
+ _colon = new EmfaticTokenNode(colon);
+ if (_colon._parent != null) throw new RuntimeException();
+ _colon._parent = this;
+ }
+ if (key != null) {
+ _key = key;
+ if (_key._parent != null) throw new RuntimeException();
+ _key._parent = this;
+ }
+ if (minus_gt != null) {
+ _minus_gt = new EmfaticTokenNode(minus_gt);
+ if (_minus_gt._parent != null) throw new RuntimeException();
+ _minus_gt._parent = this;
+ }
+ if (value != null) {
+ _value = value;
+ if (_value._parent != null) throw new RuntimeException();
+ _value._parent = this;
+ }
+ if (semi != null) {
+ _semi = new EmfaticTokenNode(semi);
+ if (_semi._parent != null) throw new RuntimeException();
+ _semi._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Modifier.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Modifier.java
new file mode 100644
index 0000000..06029b8
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Modifier.java
@@ -0,0 +1,41 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Modifier extends EmfaticTokenNode {
+
+ public static final String KW_READONLY = "readonly";
+ public static final String KW_VOLATILE = "volatile";
+ public static final String KW_TRANSIENT = "transient";
+ public static final String KW_UNSETTABLE = "unsettable";
+ public static final String KW_DERIVED = "derived";
+ public static final String KW_UNIQUE = "unique";
+ public static final String KW_ORDERED = "ordered";
+ public static final String KW_RESOLVE = "resolve";
+ public static final String KW_ID = "id";
+
+
+ /**
+ * Construct a new Modifier.
+ */
+ public Modifier(TokenInfo tokenInfo) {
+ super(tokenInfo);
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Modifiers.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Modifiers.java
new file mode 100644
index 0000000..7fdab55
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Modifiers.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Modifiers extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new Modifiers.
+ */
+ public Modifiers() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Multiplicity.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Multiplicity.java
new file mode 100644
index 0000000..71aeced
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Multiplicity.java
@@ -0,0 +1,94 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Multiplicity extends EmfaticASTNode {
+
+
+ private EmfaticTokenNode _lsquare;
+ private MultiplicityExpr _multiplicityExpr;
+ private EmfaticTokenNode _rsquare;
+
+ public EmfaticTokenNode getLsquare() {
+ return _lsquare;
+ }
+ public MultiplicityExpr getMultiplicityExpr() {
+ return _multiplicityExpr;
+ }
+ public EmfaticTokenNode getRsquare() {
+ return _rsquare;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_lsquare != null) count++;
+ if (_multiplicityExpr != null) count++;
+ if (_rsquare != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_lsquare != null) && (++count == index)) return _lsquare;
+ if ((_multiplicityExpr != null) && (++count == index)) return _multiplicityExpr;
+ if ((_rsquare != null) && (++count == index)) return _rsquare;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new Multiplicity.
+ */
+ public Multiplicity(
+ TokenInfo lsquare,
+ MultiplicityExpr multiplicityExpr,
+ TokenInfo rsquare
+ ) {
+ super();
+
+ if (lsquare != null) {
+ _lsquare = new EmfaticTokenNode(lsquare);
+ if (_lsquare._parent != null) throw new RuntimeException();
+ _lsquare._parent = this;
+ }
+ if (multiplicityExpr != null) {
+ _multiplicityExpr = multiplicityExpr;
+ if (_multiplicityExpr._parent != null) throw new RuntimeException();
+ _multiplicityExpr._parent = this;
+ }
+ if (rsquare != null) {
+ _rsquare = new EmfaticTokenNode(rsquare);
+ if (_rsquare._parent != null) throw new RuntimeException();
+ _rsquare._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/MultiplicityExpr.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/MultiplicityExpr.java
new file mode 100644
index 0000000..1b74479
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/MultiplicityExpr.java
@@ -0,0 +1,94 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class MultiplicityExpr extends EmfaticASTNode {
+
+
+ private SimpleMultiplicityExpr _lowerBound;
+ private EmfaticTokenNode _dot_dot;
+ private SimpleMultiplicityExpr _upperBound;
+
+ public SimpleMultiplicityExpr getLowerBound() {
+ return _lowerBound;
+ }
+ public EmfaticTokenNode getDot_dot() {
+ return _dot_dot;
+ }
+ public SimpleMultiplicityExpr getUpperBound() {
+ return _upperBound;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_lowerBound != null) count++;
+ if (_dot_dot != null) count++;
+ if (_upperBound != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_lowerBound != null) && (++count == index)) return _lowerBound;
+ if ((_dot_dot != null) && (++count == index)) return _dot_dot;
+ if ((_upperBound != null) && (++count == index)) return _upperBound;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new MultiplicityExpr.
+ */
+ public MultiplicityExpr(
+ SimpleMultiplicityExpr lowerBound,
+ TokenInfo dot_dot,
+ SimpleMultiplicityExpr upperBound
+ ) {
+ super();
+
+ if (lowerBound != null) {
+ _lowerBound = lowerBound;
+ if (_lowerBound._parent != null) throw new RuntimeException();
+ _lowerBound._parent = this;
+ }
+ if (dot_dot != null) {
+ _dot_dot = new EmfaticTokenNode(dot_dot);
+ if (_dot_dot._parent != null) throw new RuntimeException();
+ _dot_dot._parent = this;
+ }
+ if (upperBound != null) {
+ _upperBound = upperBound;
+ if (_upperBound._parent != null) throw new RuntimeException();
+ _upperBound._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OneOrMoreTypeArgs.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OneOrMoreTypeArgs.java
new file mode 100644
index 0000000..41227d5
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OneOrMoreTypeArgs.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class OneOrMoreTypeArgs extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new OneOrMoreTypeArgs.
+ */
+ public OneOrMoreTypeArgs() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OneOrMoreTypeParamBounds.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OneOrMoreTypeParamBounds.java
new file mode 100644
index 0000000..a57956b
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OneOrMoreTypeParamBounds.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class OneOrMoreTypeParamBounds extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new OneOrMoreTypeParamBounds.
+ */
+ public OneOrMoreTypeParamBounds() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OneOrMoreTypeParams.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OneOrMoreTypeParams.java
new file mode 100644
index 0000000..f837e49
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OneOrMoreTypeParams.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class OneOrMoreTypeParams extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new OneOrMoreTypeParams.
+ */
+ public OneOrMoreTypeParams() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Operation.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Operation.java
new file mode 100644
index 0000000..77b9758
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Operation.java
@@ -0,0 +1,204 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Operation extends ClassMemberDecl {
+
+ public static final String KW_OP = "op";
+ public static final String KW_THROWS = "throws";
+
+ private Annotations _annotations;
+ private Modifiers _modifiers;
+ private EmfaticTokenNode _op_KW;
+ private TypeParamsInfo _typeParamsInfo;
+ private ResultType _resType;
+ private EmfaticTokenNode _name;
+ private EmfaticTokenNode _lparen;
+ private Params _params;
+ private EmfaticTokenNode _rparen;
+ private EmfaticTokenNode _throws_KW;
+ private CommaListBoundExceptWild _exceptions;
+ private EmfaticTokenNode _semi;
+
+ public Annotations getAnnotations() {
+ return _annotations;
+ }
+ public Modifiers getModifiers() {
+ return _modifiers;
+ }
+ public EmfaticTokenNode getOp_KW() {
+ return _op_KW;
+ }
+ public TypeParamsInfo getTypeParamsInfo() {
+ return _typeParamsInfo;
+ }
+ public ResultType getResType() {
+ return _resType;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public EmfaticTokenNode getLparen() {
+ return _lparen;
+ }
+ public Params getParams() {
+ return _params;
+ }
+ public EmfaticTokenNode getRparen() {
+ return _rparen;
+ }
+ public EmfaticTokenNode getThrows_KW() {
+ return _throws_KW;
+ }
+ public CommaListBoundExceptWild getExceptions() {
+ return _exceptions;
+ }
+ public EmfaticTokenNode getSemi() {
+ return _semi;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_annotations != null) count++;
+ if (_modifiers != null) count++;
+ if (_op_KW != null) count++;
+ if (_typeParamsInfo != null) count++;
+ if (_resType != null) count++;
+ if (_name != null) count++;
+ if (_lparen != null) count++;
+ if (_params != null) count++;
+ if (_rparen != null) count++;
+ if (_throws_KW != null) count++;
+ if (_exceptions != null) count++;
+ if (_semi != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_annotations != null) && (++count == index)) return _annotations;
+ if ((_modifiers != null) && (++count == index)) return _modifiers;
+ if ((_op_KW != null) && (++count == index)) return _op_KW;
+ if ((_typeParamsInfo != null) && (++count == index)) return _typeParamsInfo;
+ if ((_resType != null) && (++count == index)) return _resType;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_lparen != null) && (++count == index)) return _lparen;
+ if ((_params != null) && (++count == index)) return _params;
+ if ((_rparen != null) && (++count == index)) return _rparen;
+ if ((_throws_KW != null) && (++count == index)) return _throws_KW;
+ if ((_exceptions != null) && (++count == index)) return _exceptions;
+ if ((_semi != null) && (++count == index)) return _semi;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new Operation.
+ */
+ public Operation(
+ Annotations annotations,
+ Modifiers modifiers,
+ TokenInfo op_KW,
+ TypeParamsInfo typeParamsInfo,
+ ResultType resType,
+ TokenInfo name,
+ TokenInfo lparen,
+ Params params,
+ TokenInfo rparen,
+ TokenInfo throws_KW,
+ CommaListBoundExceptWild exceptions,
+ TokenInfo semi
+ ) {
+ super();
+
+ if (annotations != null) {
+ _annotations = annotations;
+ if (_annotations._parent != null) throw new RuntimeException();
+ _annotations._parent = this;
+ }
+ if (modifiers != null) {
+ _modifiers = modifiers;
+ if (_modifiers._parent != null) throw new RuntimeException();
+ _modifiers._parent = this;
+ }
+ if (op_KW != null) {
+ _op_KW = new EmfaticTokenNode(op_KW);
+ if (_op_KW._parent != null) throw new RuntimeException();
+ _op_KW._parent = this;
+ }
+ if (typeParamsInfo != null) {
+ _typeParamsInfo = typeParamsInfo;
+ if (_typeParamsInfo._parent != null) throw new RuntimeException();
+ _typeParamsInfo._parent = this;
+ }
+ if (resType != null) {
+ _resType = resType;
+ if (_resType._parent != null) throw new RuntimeException();
+ _resType._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (lparen != null) {
+ _lparen = new EmfaticTokenNode(lparen);
+ if (_lparen._parent != null) throw new RuntimeException();
+ _lparen._parent = this;
+ }
+ if (params != null) {
+ _params = params;
+ if (_params._parent != null) throw new RuntimeException();
+ _params._parent = this;
+ }
+ if (rparen != null) {
+ _rparen = new EmfaticTokenNode(rparen);
+ if (_rparen._parent != null) throw new RuntimeException();
+ _rparen._parent = this;
+ }
+ if (throws_KW != null) {
+ _throws_KW = new EmfaticTokenNode(throws_KW);
+ if (_throws_KW._parent != null) throw new RuntimeException();
+ _throws_KW._parent = this;
+ }
+ if (exceptions != null) {
+ _exceptions = exceptions;
+ if (_exceptions._parent != null) throw new RuntimeException();
+ _exceptions._parent = this;
+ }
+ if (semi != null) {
+ _semi = new EmfaticTokenNode(semi);
+ if (_semi._parent != null) throw new RuntimeException();
+ _semi._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OptNegatedModifier.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OptNegatedModifier.java
new file mode 100644
index 0000000..20b522c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/OptNegatedModifier.java
@@ -0,0 +1,82 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class OptNegatedModifier extends EmfaticASTNode {
+
+
+ private EmfaticTokenNode _bang;
+ private Modifier _modifier;
+
+ public EmfaticTokenNode getBang() {
+ return _bang;
+ }
+ public Modifier getModifier() {
+ return _modifier;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_bang != null) count++;
+ if (_modifier != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_bang != null) && (++count == index)) return _bang;
+ if ((_modifier != null) && (++count == index)) return _modifier;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new OptNegatedModifier.
+ */
+ public OptNegatedModifier(
+ TokenInfo bang,
+ Modifier modifier
+ ) {
+ super();
+
+ if (bang != null) {
+ _bang = new EmfaticTokenNode(bang);
+ if (_bang._parent != null) throw new RuntimeException();
+ _bang._parent = this;
+ }
+ if (modifier != null) {
+ _modifier = modifier;
+ if (_modifier._parent != null) throw new RuntimeException();
+ _modifier._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/PackageDecl.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/PackageDecl.java
new file mode 100644
index 0000000..35b5635
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/PackageDecl.java
@@ -0,0 +1,107 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class PackageDecl extends EmfaticASTNode {
+
+ public static final String KW_PACKAGE = "package";
+
+ private Annotations _annotations;
+ private EmfaticTokenNode _package_KW;
+ private QualifiedID _name;
+ private EmfaticTokenNode _semi;
+
+ public Annotations getAnnotations() {
+ return _annotations;
+ }
+ public EmfaticTokenNode getPackage_KW() {
+ return _package_KW;
+ }
+ public QualifiedID getName() {
+ return _name;
+ }
+ public EmfaticTokenNode getSemi() {
+ return _semi;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_annotations != null) count++;
+ if (_package_KW != null) count++;
+ if (_name != null) count++;
+ if (_semi != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_annotations != null) && (++count == index)) return _annotations;
+ if ((_package_KW != null) && (++count == index)) return _package_KW;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_semi != null) && (++count == index)) return _semi;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new PackageDecl.
+ */
+ public PackageDecl(
+ Annotations annotations,
+ TokenInfo package_KW,
+ QualifiedID name,
+ TokenInfo semi
+ ) {
+ super();
+
+ if (annotations != null) {
+ _annotations = annotations;
+ if (_annotations._parent != null) throw new RuntimeException();
+ _annotations._parent = this;
+ }
+ if (package_KW != null) {
+ _package_KW = new EmfaticTokenNode(package_KW);
+ if (_package_KW._parent != null) throw new RuntimeException();
+ _package_KW._parent = this;
+ }
+ if (name != null) {
+ _name = name;
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (semi != null) {
+ _semi = new EmfaticTokenNode(semi);
+ if (_semi._parent != null) throw new RuntimeException();
+ _semi._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Param.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Param.java
new file mode 100644
index 0000000..fff3fda
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Param.java
@@ -0,0 +1,118 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Param extends EmfaticASTNode {
+
+
+ private Annotations _leadingAnnotations;
+ private Modifiers _modifiers;
+ private TypeWithMulti _typeWithMulti;
+ private EmfaticTokenNode _name;
+ private Annotations _trailingAnnotations;
+
+ public Annotations getLeadingAnnotations() {
+ return _leadingAnnotations;
+ }
+ public Modifiers getModifiers() {
+ return _modifiers;
+ }
+ public TypeWithMulti getTypeWithMulti() {
+ return _typeWithMulti;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public Annotations getTrailingAnnotations() {
+ return _trailingAnnotations;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_leadingAnnotations != null) count++;
+ if (_modifiers != null) count++;
+ if (_typeWithMulti != null) count++;
+ if (_name != null) count++;
+ if (_trailingAnnotations != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_leadingAnnotations != null) && (++count == index)) return _leadingAnnotations;
+ if ((_modifiers != null) && (++count == index)) return _modifiers;
+ if ((_typeWithMulti != null) && (++count == index)) return _typeWithMulti;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_trailingAnnotations != null) && (++count == index)) return _trailingAnnotations;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new Param.
+ */
+ public Param(
+ Annotations leadingAnnotations,
+ Modifiers modifiers,
+ TypeWithMulti typeWithMulti,
+ TokenInfo name,
+ Annotations trailingAnnotations
+ ) {
+ super();
+
+ if (leadingAnnotations != null) {
+ _leadingAnnotations = leadingAnnotations;
+ if (_leadingAnnotations._parent != null) throw new RuntimeException();
+ _leadingAnnotations._parent = this;
+ }
+ if (modifiers != null) {
+ _modifiers = modifiers;
+ if (_modifiers._parent != null) throw new RuntimeException();
+ _modifiers._parent = this;
+ }
+ if (typeWithMulti != null) {
+ _typeWithMulti = typeWithMulti;
+ if (_typeWithMulti._parent != null) throw new RuntimeException();
+ _typeWithMulti._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (trailingAnnotations != null) {
+ _trailingAnnotations = trailingAnnotations;
+ if (_trailingAnnotations._parent != null) throw new RuntimeException();
+ _trailingAnnotations._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Params.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Params.java
new file mode 100644
index 0000000..3c7e84e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Params.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Params extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new Params.
+ */
+ public Params() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/QidSeparator.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/QidSeparator.java
new file mode 100644
index 0000000..392bcf4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/QidSeparator.java
@@ -0,0 +1,32 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class QidSeparator extends EmfaticTokenNode {
+
+
+
+ /**
+ * Construct a new QidSeparator.
+ */
+ public QidSeparator(TokenInfo tokenInfo) {
+ super(tokenInfo);
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/QualifiedID.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/QualifiedID.java
new file mode 100644
index 0000000..6cb0473
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/QualifiedID.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class QualifiedID extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new QualifiedID.
+ */
+ public QualifiedID() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/QualifiedIDContainer.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/QualifiedIDContainer.java
new file mode 100644
index 0000000..ed277b4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/QualifiedIDContainer.java
@@ -0,0 +1,69 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class QualifiedIDContainer extends StringLiteralOrQualifiedID {
+
+
+ private QualifiedID _qualifiedID;
+
+ public QualifiedID getQualifiedID() {
+ return _qualifiedID;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_qualifiedID != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_qualifiedID != null) && (++count == index)) return _qualifiedID;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new QualifiedIDContainer.
+ */
+ public QualifiedIDContainer(
+ QualifiedID qualifiedID
+ ) {
+ super();
+
+ if (qualifiedID != null) {
+ _qualifiedID = qualifiedID;
+ if (_qualifiedID._parent != null) throw new RuntimeException();
+ _qualifiedID._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Reference.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Reference.java
new file mode 100644
index 0000000..e9dd7d5
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Reference.java
@@ -0,0 +1,154 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Reference extends ClassMemberDecl {
+
+
+ private Annotations _annotations;
+ private Modifiers _modifiers;
+ private ReferenceKind _referenceKind;
+ private TypeWithMulti _typeWithMulti;
+ private EmfaticTokenNode _hash;
+ private EmfaticTokenNode _oppositeName;
+ private EmfaticTokenNode _name;
+ private EmfaticTokenNode _semi;
+
+ public Annotations getAnnotations() {
+ return _annotations;
+ }
+ public Modifiers getModifiers() {
+ return _modifiers;
+ }
+ public ReferenceKind getReferenceKind() {
+ return _referenceKind;
+ }
+ public TypeWithMulti getTypeWithMulti() {
+ return _typeWithMulti;
+ }
+ public EmfaticTokenNode getHash() {
+ return _hash;
+ }
+ public EmfaticTokenNode getOppositeName() {
+ return _oppositeName;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public EmfaticTokenNode getSemi() {
+ return _semi;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_annotations != null) count++;
+ if (_modifiers != null) count++;
+ if (_referenceKind != null) count++;
+ if (_typeWithMulti != null) count++;
+ if (_hash != null) count++;
+ if (_oppositeName != null) count++;
+ if (_name != null) count++;
+ if (_semi != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_annotations != null) && (++count == index)) return _annotations;
+ if ((_modifiers != null) && (++count == index)) return _modifiers;
+ if ((_referenceKind != null) && (++count == index)) return _referenceKind;
+ if ((_typeWithMulti != null) && (++count == index)) return _typeWithMulti;
+ if ((_hash != null) && (++count == index)) return _hash;
+ if ((_oppositeName != null) && (++count == index)) return _oppositeName;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_semi != null) && (++count == index)) return _semi;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new Reference.
+ */
+ public Reference(
+ Annotations annotations,
+ Modifiers modifiers,
+ ReferenceKind referenceKind,
+ TypeWithMulti typeWithMulti,
+ TokenInfo hash,
+ TokenInfo oppositeName,
+ TokenInfo name,
+ TokenInfo semi
+ ) {
+ super();
+
+ if (annotations != null) {
+ _annotations = annotations;
+ if (_annotations._parent != null) throw new RuntimeException();
+ _annotations._parent = this;
+ }
+ if (modifiers != null) {
+ _modifiers = modifiers;
+ if (_modifiers._parent != null) throw new RuntimeException();
+ _modifiers._parent = this;
+ }
+ if (referenceKind != null) {
+ _referenceKind = referenceKind;
+ if (_referenceKind._parent != null) throw new RuntimeException();
+ _referenceKind._parent = this;
+ }
+ if (typeWithMulti != null) {
+ _typeWithMulti = typeWithMulti;
+ if (_typeWithMulti._parent != null) throw new RuntimeException();
+ _typeWithMulti._parent = this;
+ }
+ if (hash != null) {
+ _hash = new EmfaticTokenNode(hash);
+ if (_hash._parent != null) throw new RuntimeException();
+ _hash._parent = this;
+ }
+ if (oppositeName != null) {
+ _oppositeName = new EmfaticTokenNode(oppositeName);
+ if (_oppositeName._parent != null) throw new RuntimeException();
+ _oppositeName._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (semi != null) {
+ _semi = new EmfaticTokenNode(semi);
+ if (_semi._parent != null) throw new RuntimeException();
+ _semi._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ReferenceKind.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ReferenceKind.java
new file mode 100644
index 0000000..cf97bd6
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ReferenceKind.java
@@ -0,0 +1,34 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class ReferenceKind extends EmfaticTokenNode {
+
+ public static final String KW_REF = "ref";
+ public static final String KW_VAL = "val";
+
+
+ /**
+ * Construct a new ReferenceKind.
+ */
+ public ReferenceKind(TokenInfo tokenInfo) {
+ super(tokenInfo);
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ResultType.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ResultType.java
new file mode 100644
index 0000000..905ffb7
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/ResultType.java
@@ -0,0 +1,27 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public abstract class ResultType extends EmfaticASTNode {
+ /**
+ * Construct a new ResultType.
+ */
+ public ResultType() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/SimpleMultiplicityExpr.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/SimpleMultiplicityExpr.java
new file mode 100644
index 0000000..bab7275
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/SimpleMultiplicityExpr.java
@@ -0,0 +1,32 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class SimpleMultiplicityExpr extends EmfaticTokenNode {
+
+
+
+ /**
+ * Construct a new SimpleMultiplicityExpr.
+ */
+ public SimpleMultiplicityExpr(TokenInfo tokenInfo) {
+ super(tokenInfo);
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/StringExpr.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/StringExpr.java
new file mode 100644
index 0000000..782422e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/StringExpr.java
@@ -0,0 +1,70 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class StringExpr extends DefaultValueExpr {
+
+
+ private EmfaticTokenNode _string_literal;
+
+ public EmfaticTokenNode getString_literal() {
+ return _string_literal;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_string_literal != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_string_literal != null) && (++count == index)) return _string_literal;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new StringExpr.
+ */
+ public StringExpr(
+ TokenInfo string_literal
+ ) {
+ super();
+
+ if (string_literal != null) {
+ _string_literal = new EmfaticTokenNode(string_literal);
+ if (_string_literal._parent != null) throw new RuntimeException();
+ _string_literal._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/StringLiteralContainer.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/StringLiteralContainer.java
new file mode 100644
index 0000000..1830b90
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/StringLiteralContainer.java
@@ -0,0 +1,70 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class StringLiteralContainer extends StringLiteralOrQualifiedID {
+
+
+ private EmfaticTokenNode _string_literal;
+
+ public EmfaticTokenNode getString_literal() {
+ return _string_literal;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_string_literal != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_string_literal != null) && (++count == index)) return _string_literal;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new StringLiteralContainer.
+ */
+ public StringLiteralContainer(
+ TokenInfo string_literal
+ ) {
+ super();
+
+ if (string_literal != null) {
+ _string_literal = new EmfaticTokenNode(string_literal);
+ if (_string_literal._parent != null) throw new RuntimeException();
+ _string_literal._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/StringLiteralOrQualifiedID.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/StringLiteralOrQualifiedID.java
new file mode 100644
index 0000000..21b1782
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/StringLiteralOrQualifiedID.java
@@ -0,0 +1,27 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public abstract class StringLiteralOrQualifiedID extends EmfaticASTNode {
+ /**
+ * Construct a new StringLiteralOrQualifiedID.
+ */
+ public StringLiteralOrQualifiedID() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/SubPackageDecl.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/SubPackageDecl.java
new file mode 100644
index 0000000..9853319
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/SubPackageDecl.java
@@ -0,0 +1,131 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class SubPackageDecl extends TopLevelDecl {
+
+ public static final String KW_PACKAGE = "package";
+
+ private Annotations _annotations;
+ private EmfaticTokenNode _package_KW;
+ private EmfaticTokenNode _name;
+ private EmfaticTokenNode _lcurly;
+ private TopLevelDecls _topLevelDecls;
+ private EmfaticTokenNode _rcurly;
+
+ public Annotations getAnnotations() {
+ return _annotations;
+ }
+ public EmfaticTokenNode getPackage_KW() {
+ return _package_KW;
+ }
+ public EmfaticTokenNode getName() {
+ return _name;
+ }
+ public EmfaticTokenNode getLcurly() {
+ return _lcurly;
+ }
+ public TopLevelDecls getTopLevelDecls() {
+ return _topLevelDecls;
+ }
+ public EmfaticTokenNode getRcurly() {
+ return _rcurly;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_annotations != null) count++;
+ if (_package_KW != null) count++;
+ if (_name != null) count++;
+ if (_lcurly != null) count++;
+ if (_topLevelDecls != null) count++;
+ if (_rcurly != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_annotations != null) && (++count == index)) return _annotations;
+ if ((_package_KW != null) && (++count == index)) return _package_KW;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_lcurly != null) && (++count == index)) return _lcurly;
+ if ((_topLevelDecls != null) && (++count == index)) return _topLevelDecls;
+ if ((_rcurly != null) && (++count == index)) return _rcurly;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new SubPackageDecl.
+ */
+ public SubPackageDecl(
+ Annotations annotations,
+ TokenInfo package_KW,
+ TokenInfo name,
+ TokenInfo lcurly,
+ TopLevelDecls topLevelDecls,
+ TokenInfo rcurly
+ ) {
+ super();
+
+ if (annotations != null) {
+ _annotations = annotations;
+ if (_annotations._parent != null) throw new RuntimeException();
+ _annotations._parent = this;
+ }
+ if (package_KW != null) {
+ _package_KW = new EmfaticTokenNode(package_KW);
+ if (_package_KW._parent != null) throw new RuntimeException();
+ _package_KW._parent = this;
+ }
+ if (name != null) {
+ _name = new EmfaticTokenNode(name);
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (lcurly != null) {
+ _lcurly = new EmfaticTokenNode(lcurly);
+ if (_lcurly._parent != null) throw new RuntimeException();
+ _lcurly._parent = this;
+ }
+ if (topLevelDecls != null) {
+ _topLevelDecls = topLevelDecls;
+ if (_topLevelDecls._parent != null) throw new RuntimeException();
+ _topLevelDecls._parent = this;
+ }
+ if (rcurly != null) {
+ _rcurly = new EmfaticTokenNode(rcurly);
+ if (_rcurly._parent != null) throw new RuntimeException();
+ _rcurly._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TopLevelDecl.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TopLevelDecl.java
new file mode 100644
index 0000000..f548fa9
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TopLevelDecl.java
@@ -0,0 +1,27 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public abstract class TopLevelDecl extends EmfaticASTNode {
+ /**
+ * Construct a new TopLevelDecl.
+ */
+ public TopLevelDecl() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TopLevelDecls.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TopLevelDecls.java
new file mode 100644
index 0000000..eb41a12
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TopLevelDecls.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import java.util.ArrayList;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class TopLevelDecls extends EmfaticASTNode {
+
+ private ArrayList _children = new ArrayList();
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ return _children.size();
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ return (ASTNode)_children.get(index);
+ }
+
+ /**
+ * Add a child to this list.
+ */
+ public void addChild(EmfaticASTNode child) {
+ if (child == null) return;
+ if (child._parent != null) throw new RuntimeException();
+ _children.add(child);
+ child._parent = this;
+ }
+
+ /**
+ * Wrap the provided Token in a EmfaticTokenNode
+ * and add it as a child of this node.
+ *
+ * @param token the Token to be added as a child of this node
+ */
+ public void addChild(TokenInfo tokenInfo) {
+ addChild(new EmfaticTokenNode(tokenInfo));
+ }
+
+ /**
+ * Construct a new TopLevelDecls.
+ */
+ public TopLevelDecls() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TransientModifier.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TransientModifier.java
new file mode 100644
index 0000000..3081d58
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TransientModifier.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class TransientModifier extends EmfaticASTNode {
+
+ public static final String KW_TRANSIENT = "transient";
+
+ private EmfaticTokenNode _transient_KW;
+
+ public EmfaticTokenNode getTransient_KW() {
+ return _transient_KW;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_transient_KW != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_transient_KW != null) && (++count == index)) return _transient_KW;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new TransientModifier.
+ */
+ public TransientModifier(
+ TokenInfo transient_KW
+ ) {
+ super();
+
+ if (transient_KW != null) {
+ _transient_KW = new EmfaticTokenNode(transient_KW);
+ if (_transient_KW._parent != null) throw new RuntimeException();
+ _transient_KW._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TrueOrFalse.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TrueOrFalse.java
new file mode 100644
index 0000000..5da4be8
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TrueOrFalse.java
@@ -0,0 +1,34 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class TrueOrFalse extends EmfaticTokenNode {
+
+ public static final String KW_TRUE = "true";
+ public static final String KW_FALSE = "false";
+
+
+ /**
+ * Construct a new TrueOrFalse.
+ */
+ public TrueOrFalse(TokenInfo tokenInfo) {
+ super(tokenInfo);
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeArg.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeArg.java
new file mode 100644
index 0000000..b40bcfc
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeArg.java
@@ -0,0 +1,27 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public abstract class TypeArg extends EmfaticASTNode {
+ /**
+ * Construct a new TypeArg.
+ */
+ public TypeArg() {
+ super();
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeBoundsInfo.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeBoundsInfo.java
new file mode 100644
index 0000000..9e3c2e4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeBoundsInfo.java
@@ -0,0 +1,83 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class TypeBoundsInfo extends EmfaticASTNode {
+
+ public static final String KW_EXTENDS = "extends";
+
+ private EmfaticTokenNode _extends_KW;
+ private OneOrMoreTypeParamBounds _oneOrMoreTypeParamBounds;
+
+ public EmfaticTokenNode getExtends_KW() {
+ return _extends_KW;
+ }
+ public OneOrMoreTypeParamBounds getOneOrMoreTypeParamBounds() {
+ return _oneOrMoreTypeParamBounds;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_extends_KW != null) count++;
+ if (_oneOrMoreTypeParamBounds != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_extends_KW != null) && (++count == index)) return _extends_KW;
+ if ((_oneOrMoreTypeParamBounds != null) && (++count == index)) return _oneOrMoreTypeParamBounds;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new TypeBoundsInfo.
+ */
+ public TypeBoundsInfo(
+ TokenInfo extends_KW,
+ OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds
+ ) {
+ super();
+
+ if (extends_KW != null) {
+ _extends_KW = new EmfaticTokenNode(extends_KW);
+ if (_extends_KW._parent != null) throw new RuntimeException();
+ _extends_KW._parent = this;
+ }
+ if (oneOrMoreTypeParamBounds != null) {
+ _oneOrMoreTypeParamBounds = oneOrMoreTypeParamBounds;
+ if (_oneOrMoreTypeParamBounds._parent != null) throw new RuntimeException();
+ _oneOrMoreTypeParamBounds._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeParam.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeParam.java
new file mode 100644
index 0000000..7820c07
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeParam.java
@@ -0,0 +1,82 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class TypeParam extends EmfaticASTNode {
+
+
+ private EmfaticTokenNode _typeVarName;
+ private TypeBoundsInfo _typeBoundsInfo;
+
+ public EmfaticTokenNode getTypeVarName() {
+ return _typeVarName;
+ }
+ public TypeBoundsInfo getTypeBoundsInfo() {
+ return _typeBoundsInfo;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_typeVarName != null) count++;
+ if (_typeBoundsInfo != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_typeVarName != null) && (++count == index)) return _typeVarName;
+ if ((_typeBoundsInfo != null) && (++count == index)) return _typeBoundsInfo;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new TypeParam.
+ */
+ public TypeParam(
+ TokenInfo typeVarName,
+ TypeBoundsInfo typeBoundsInfo
+ ) {
+ super();
+
+ if (typeVarName != null) {
+ _typeVarName = new EmfaticTokenNode(typeVarName);
+ if (_typeVarName._parent != null) throw new RuntimeException();
+ _typeVarName._parent = this;
+ }
+ if (typeBoundsInfo != null) {
+ _typeBoundsInfo = typeBoundsInfo;
+ if (_typeBoundsInfo._parent != null) throw new RuntimeException();
+ _typeBoundsInfo._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeParamsInfo.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeParamsInfo.java
new file mode 100644
index 0000000..7b08c3e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeParamsInfo.java
@@ -0,0 +1,94 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class TypeParamsInfo extends EmfaticASTNode {
+
+
+ private EmfaticTokenNode _lt;
+ private OneOrMoreTypeParams _oneOrMoreTypeParams;
+ private EmfaticTokenNode _gt;
+
+ public EmfaticTokenNode getLt() {
+ return _lt;
+ }
+ public OneOrMoreTypeParams getOneOrMoreTypeParams() {
+ return _oneOrMoreTypeParams;
+ }
+ public EmfaticTokenNode getGt() {
+ return _gt;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_lt != null) count++;
+ if (_oneOrMoreTypeParams != null) count++;
+ if (_gt != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_lt != null) && (++count == index)) return _lt;
+ if ((_oneOrMoreTypeParams != null) && (++count == index)) return _oneOrMoreTypeParams;
+ if ((_gt != null) && (++count == index)) return _gt;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new TypeParamsInfo.
+ */
+ public TypeParamsInfo(
+ TokenInfo lt,
+ OneOrMoreTypeParams oneOrMoreTypeParams,
+ TokenInfo gt
+ ) {
+ super();
+
+ if (lt != null) {
+ _lt = new EmfaticTokenNode(lt);
+ if (_lt._parent != null) throw new RuntimeException();
+ _lt._parent = this;
+ }
+ if (oneOrMoreTypeParams != null) {
+ _oneOrMoreTypeParams = oneOrMoreTypeParams;
+ if (_oneOrMoreTypeParams._parent != null) throw new RuntimeException();
+ _oneOrMoreTypeParams._parent = this;
+ }
+ if (gt != null) {
+ _gt = new EmfaticTokenNode(gt);
+ if (_gt._parent != null) throw new RuntimeException();
+ _gt._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeWithMulti.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeWithMulti.java
new file mode 100644
index 0000000..87e4884
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/TypeWithMulti.java
@@ -0,0 +1,81 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class TypeWithMulti extends ResultType {
+
+
+ private BoundExceptWildcard _name;
+ private Multiplicity _multiplicity;
+
+ public BoundExceptWildcard getName() {
+ return _name;
+ }
+ public Multiplicity getMultiplicity() {
+ return _multiplicity;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_name != null) count++;
+ if (_multiplicity != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_name != null) && (++count == index)) return _name;
+ if ((_multiplicity != null) && (++count == index)) return _multiplicity;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new TypeWithMulti.
+ */
+ public TypeWithMulti(
+ BoundExceptWildcard name,
+ Multiplicity multiplicity
+ ) {
+ super();
+
+ if (name != null) {
+ _name = name;
+ if (_name._parent != null) throw new RuntimeException();
+ _name._parent = this;
+ }
+ if (multiplicity != null) {
+ _multiplicity = multiplicity;
+ if (_multiplicity._parent != null) throw new RuntimeException();
+ _multiplicity._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/VoidContainer.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/VoidContainer.java
new file mode 100644
index 0000000..7cd484c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/VoidContainer.java
@@ -0,0 +1,71 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class VoidContainer extends ResultType {
+
+ public static final String KW_VOID = "void";
+
+ private EmfaticTokenNode _void_KW;
+
+ public EmfaticTokenNode getVoid_KW() {
+ return _void_KW;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_void_KW != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_void_KW != null) && (++count == index)) return _void_KW;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new VoidContainer.
+ */
+ public VoidContainer(
+ TokenInfo void_KW
+ ) {
+ super();
+
+ if (void_KW != null) {
+ _void_KW = new EmfaticTokenNode(void_KW);
+ if (_void_KW._parent != null) throw new RuntimeException();
+ _void_KW._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Wildcard.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Wildcard.java
new file mode 100644
index 0000000..85bc078
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/ast/Wildcard.java
@@ -0,0 +1,94 @@
+package org.eclipse.emf.emfatic.core.lang.gen.ast;
+
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+/**
+ *
+ * @generated by Gymnast from Emfatic.ast on 06.02.2007 17:57:34
+ */
+public class Wildcard extends TypeArg {
+
+
+ private EmfaticTokenNode _qmark;
+ private ExtendsOrSuper _extendsOrSuper;
+ private BoundExceptWildcard _boundExceptWildcard;
+
+ public EmfaticTokenNode getQmark() {
+ return _qmark;
+ }
+ public ExtendsOrSuper getExtendsOrSuper() {
+ return _extendsOrSuper;
+ }
+ public BoundExceptWildcard getBoundExceptWildcard() {
+ return _boundExceptWildcard;
+ }
+
+
+ /**
+ * @return the number of children of this ASTNode
+ */
+ public int getChildCount() {
+ int count = 0;
+ if (_qmark != null) count++;
+ if (_extendsOrSuper != null) count++;
+ if (_boundExceptWildcard != null) count++;
+
+ return count;
+ }
+
+ /**
+ * @param index the index of a child ASTNode to get
+ * @return the child ASTNode at the given index
+ * @throws IndexOutOfBoundsException when the index is out of bounds
+ */
+ public ASTNode getChild(int index) {
+ int count = -1;
+ if ((_qmark != null) && (++count == index)) return _qmark;
+ if ((_extendsOrSuper != null) && (++count == index)) return _extendsOrSuper;
+ if ((_boundExceptWildcard != null) && (++count == index)) return _boundExceptWildcard;
+
+ throw new IndexOutOfBoundsException();
+ }
+
+ /**
+ * Construct a new Wildcard.
+ */
+ public Wildcard(
+ TokenInfo qmark,
+ ExtendsOrSuper extendsOrSuper,
+ BoundExceptWildcard boundExceptWildcard
+ ) {
+ super();
+
+ if (qmark != null) {
+ _qmark = new EmfaticTokenNode(qmark);
+ if (_qmark._parent != null) throw new RuntimeException();
+ _qmark._parent = this;
+ }
+ if (extendsOrSuper != null) {
+ _extendsOrSuper = extendsOrSuper;
+ if (_extendsOrSuper._parent != null) throw new RuntimeException();
+ _extendsOrSuper._parent = this;
+ }
+ if (boundExceptWildcard != null) {
+ _boundExceptWildcard = boundExceptWildcard;
+ if (_boundExceptWildcard._parent != null) throw new RuntimeException();
+ _boundExceptWildcard._parent = this;
+ }
+
+ }
+
+ /**
+ * This method overrides the superclass <code>acceptImpl</code> providing
+ * the same implementation. Here <code>this</code> refers to this specific node
+ * class, so the <code>beginVisit</code> and <code>endVisit</code> methods
+ * specific to this type in the visitor will be invoked.
+ */
+ public void acceptImpl(EmfaticASTNodeVisitor visitor) {
+ boolean visitChildren = visitor.beginVisit(this);
+ if (visitChildren) visitChildren(visitor);
+ visitor.endVisit(this);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/Emfatic2.jj b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/Emfatic2.jj
new file mode 100644
index 0000000..701a5a8
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/Emfatic2.jj
@@ -0,0 +1,716 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+options {
+ JDK_VERSION = "1.5";
+ STATIC = false ;
+ LOOKAHEAD=4;
+ FORCE_LA_CHECK = true;
+}
+
+PARSER_BEGIN(EmfaticParser)
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.*;
+import org.eclipse.gymnast.runtime.core.ast.*;
+
+public class EmfaticParser {
+
+ public TokenInfo createTokenInfo(Token tok) {
+ if (!(tok instanceof ExtToken)) return null;
+
+ ExtToken extToken = (ExtToken) tok;
+ return new TokenInfo(tok.image, extToken.tokenOffset, tok.kind);
+ }
+
+}
+PARSER_END(EmfaticParser)
+
+SKIP :
+{
+ < SINGLELINECOMMENT : <DOUBLESLASH> (~["\n","\r"])* ("\n"|"\r\n")>
+| < WS : ([" ", "\t", "\f", "\r", "\n"])+ >
+| "/*" : WithinComment
+}
+<WithinComment> SKIP :
+{
+ "*/" : DEFAULT
+}
+<WithinComment> MORE :
+{
+ < ~[] >
+}
+
+TOKEN :
+{
+ < PACKAGEKW : "package" >
+| < CLASSKW : "class" >
+| < IMPORTKW : "import" >
+| < ABSTRACTKW : "abstract" >
+| < INTERFACEKW : "interface" >
+| < EXTENDSKW : "extends" >
+| < SUPERKW : "super" >
+| < ATTRKW : "attr" >
+| < REFKW : "ref" >
+| < VALKW : "val" >
+| < READONLYKW : "readonly" >
+| < VOLATILEKW : "volatile" >
+| < TRANSIENTKW : "transient" >
+| < UNSETTABLEKW : "unsettable" >
+| < DERIVEDKW : "derived" >
+| < UNIQUEKW : "unique" >
+| < ORDEREDKW : "ordered" >
+| < RESOLVEKW : "resolve" >
+| < IDKW : "id" >
+| < TRUEKW : "true" >
+| < FALSEKW : "false" >
+| < OPKW : "op" >
+| < VOIDKW : "void" >
+| < DATATYPEKW : "datatype" >
+| < ENUMKW : "enum" >
+| < MAPENTRYKW : "mapentry" >
+| < THROWSKW : "throws" >
+
+| < #DOUBLESLASH : "//" >
+| < #DOUBLEQUOTE : "\"" >
+| < #SINGLEQUOTE : "'" >
+| < #BACKSLASH : "\\" >
+
+| < LCURLY : "{" >
+| < RCURLY : "}" >
+| < LSQUARE : "[" >
+| < RSQUARE : "]" >
+| < LPAREN : "(" >
+| < RPAREN : ")" >
+
+| < DOT : ".">
+| < COMMA : ",">
+| < COLON : ":">
+| < SEMI : ";">
+
+| < STAR : "*">
+| < PLUS : "+">
+| < MINUS : "-">
+| < EQUALS : "=">
+
+| < QMARK : "?">
+| < BANG : "!">
+| < DOLLAR : "$">
+| < HASH : "#">
+| < AT : "@">
+
+| < DOT_DOT : "..">
+| < MINUS_GT : "->">
+| < GT_LT : "><">
+| < LT_GT : "<>">
+
+| < AMP : "&" >
+| < LT : "<" >
+| < GT : ">" >
+
+| < STRING_LITERAL : <DOUBLEQUOTE> (<ESC> | ~["\""])* <DOUBLEQUOTE> >
+| < CHAR_LITERAL : <SINGLEQUOTE> (<ESC> | (~["'"])) <SINGLEQUOTE> >
+
+| < #LETTERORUNDERSCORE : ["a"-"z", "A"-"Z", "_"] >
+| < #LETTERORUNDERSCOREORDIGIT : ( <LETTERORUNDERSCORE> | <DIGIT> ) >
+
+| < INT_LITERAL : (<DIGIT>)+ >
+
+| < #DIGIT : ["0"-"9"] >
+
+// TODO: The <DIGITDIGITDIGIT> is cheesy it should be something like
+// ( options { warnWhenFollowAmbig = false; } : (DIGIT)+ )
+// but I don't want to deal with parsing that yet.
+| < #ESC : <BACKSLASH> ("t" | "f" | "r" | "n" | <DOUBLEQUOTE> | <SINGLEQUOTE> | <BACKSLASH> | <DIGITDIGITDIGIT> ) >
+| < #DIGITDIGITDIGIT : <DIGIT> <DIGIT> <DIGIT> >
+}
+
+TOKEN :
+{
+ < ID : ("~")? <LETTERORUNDERSCORE> (<LETTERORUNDERSCOREORDIGIT>)* >
+}
+
+
+CompUnit compUnit() :
+{ CompUnit retVal = null;
+ PackageDecl packageDecl = null;
+ ImportStmts importStmts = null;
+ TopLevelDecls topLevelDecls = null; }
+{
+packageDecl=packageDecl() importStmts=importStmts() topLevelDecls=topLevelDecls() <EOF>
+ { retVal = new CompUnit(packageDecl, importStmts, topLevelDecls);
+ return retVal; }
+}
+
+PackageDecl packageDecl() :
+{ PackageDecl retVal = null;
+ Annotations annotations = null;
+ Token package_KW = null;
+ QualifiedID name = null;
+ Token semi = null; }
+{
+annotations=annotations() package_KW=<PACKAGEKW> name=qualifiedID() semi=<SEMI>
+ { retVal = new PackageDecl(annotations, createTokenInfo(package_KW), name, createTokenInfo(semi));
+ return retVal; }
+}
+
+QualifiedID qualifiedID() :
+{ QualifiedID retVal = new QualifiedID();
+ Token id1 = null;
+ QidSeparator qidSeparator = null;
+ Token idn = null; }
+{ ( id1=<ID> { retVal.addChild(createTokenInfo(id1)); } )
+ ( qidSeparator=qidSeparator() idn=<ID> { retVal.addChild(qidSeparator); retVal.addChild(createTokenInfo(idn)); } )* { return retVal; } }
+
+QidSeparator qidSeparator() :
+{ Token tok; }
+{ tok=<DOT> { return new QidSeparator (createTokenInfo(tok)); }
+| tok=<DOLLAR> { return new QidSeparator (createTokenInfo(tok)); }
+}
+
+StringLiteralOrQualifiedID stringLiteralOrQualifiedID() :
+{ StringLiteralOrQualifiedID retVal = null; }
+{
+ ( retVal=stringLiteralContainer() { return retVal; }
+ | retVal=qualifiedIDContainer() { return retVal; }
+ )
+}
+
+StringLiteralContainer stringLiteralContainer() :
+{ StringLiteralContainer retVal = null;
+ Token string_literal = null; }
+{
+string_literal=<STRING_LITERAL>
+ { retVal = new StringLiteralContainer(createTokenInfo(string_literal));
+ return retVal; }
+}
+
+QualifiedIDContainer qualifiedIDContainer() :
+{ QualifiedIDContainer retVal = null;
+ QualifiedID qualifiedID = null; }
+{
+qualifiedID=qualifiedID()
+ { retVal = new QualifiedIDContainer(qualifiedID);
+ return retVal; }
+}
+
+Annotations annotations() :
+{ Annotations retVal = new Annotations();
+ Annotation annotation = null; }
+{ ( annotation=annotation() { retVal.addChild(annotation); } )* { return retVal; } }
+
+Annotation annotation() :
+{ Annotation retVal = null;
+ Token at = null;
+ StringLiteralOrQualifiedID source = null;
+ Token lparen = null;
+ KeyEqualsValueList keyEqualsValueList = null;
+ Token rparen = null; }
+{
+at=<AT> source=stringLiteralOrQualifiedID() lparen=<LPAREN> keyEqualsValueList=keyEqualsValueList() rparen=<RPAREN>
+ { retVal = new Annotation(createTokenInfo(at), source, createTokenInfo(lparen), keyEqualsValueList, createTokenInfo(rparen));
+ return retVal; }
+}
+
+KeyEqualsValueList keyEqualsValueList() :
+{ KeyEqualsValueList retVal = new KeyEqualsValueList();
+ KeyEqualsValue kv1 = null;
+ Token comma = null;
+ KeyEqualsValue kvn = null; }
+{ ( kv1=keyEqualsValue() { retVal.addChild(kv1); } )
+ ( comma=<COMMA> kvn=keyEqualsValue() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(kvn); } )* { return retVal; } }
+
+KeyEqualsValue keyEqualsValue() :
+{ KeyEqualsValue retVal = null;
+ StringLiteralOrQualifiedID key = null;
+ Token equals = null;
+ StringLiteralOrQualifiedID value = null; }
+{
+key=stringLiteralOrQualifiedID() equals=<EQUALS> value=stringLiteralOrQualifiedID()
+ { retVal = new KeyEqualsValue(key, createTokenInfo(equals), value);
+ return retVal; }
+}
+
+ImportStmts importStmts() :
+{ ImportStmts retVal = new ImportStmts();
+ ImportStmt importStmt = null; }
+{ ( importStmt=importStmt() { retVal.addChild(importStmt); } )* { return retVal; } }
+
+ImportStmt importStmt() :
+
+{ ImportStmt retVal = null;
+ Token import_KW = null;
+ Token alias = null;
+ Token equals = null;
+ StringLiteralOrQualifiedID uri = null;
+ Token semi = null; }
+{
+import_KW=<IMPORTKW> ( alias=<ID> equals=<EQUALS> )? uri=stringLiteralOrQualifiedID() semi=<SEMI>
+ { retVal = new ImportStmt(createTokenInfo(import_KW), createTokenInfo(alias), createTokenInfo(equals), uri, createTokenInfo(semi));
+ return retVal; }
+}
+
+TopLevelDecls topLevelDecls() :
+{ TopLevelDecls retVal = new TopLevelDecls();
+ TopLevelDecl topLevelDecl = null; }
+{ ( topLevelDecl=topLevelDecl() { retVal.addChild(topLevelDecl); } )* { return retVal; } }
+
+TopLevelDecl topLevelDecl() :
+{ TopLevelDecl retVal = null;
+ Annotations annotations = null; }
+{
+annotations=annotations()
+ ( retVal=subPackageDecl(annotations) { return retVal; }
+ | retVal=classDecl(annotations) { return retVal; }
+ | retVal=dataTypeDecl(annotations) { return retVal; }
+ | retVal=enumDecl(annotations) { return retVal; }
+ | retVal=mapEntryDecl(annotations) { return retVal; }
+ )
+}
+
+SubPackageDecl subPackageDecl(Annotations annotations) :
+{ SubPackageDecl retVal = null;
+ Token package_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ TopLevelDecls topLevelDecls = null;
+ Token rcurly = null; }
+{
+package_KW=<PACKAGEKW> name=<ID> lcurly=<LCURLY> topLevelDecls=topLevelDecls() rcurly=<RCURLY>
+ { retVal = new SubPackageDecl(annotations, createTokenInfo(package_KW), createTokenInfo(name), createTokenInfo(lcurly), topLevelDecls, createTokenInfo(rcurly));
+ return retVal; }
+}
+
+ClassDecl classDecl(Annotations annotations) :
+{ ClassDecl retVal = null;
+ AbstractModifier abstractModifier = null;
+ ClassKind classKind = null;
+ Token name = null;
+ TypeParamsInfo typeParamsInfo = null;
+ Token extends_KW = null;
+ CommaListBoundExceptWild superTypes = null;
+ Token colon = null;
+ BoundExceptWildcard instClassName = null;
+ Token lcurly = null;
+ ClassMemberDecls classMemberDecls = null;
+ Token rcurly = null; }
+{
+( abstractModifier=abstractModifier() )? classKind=classKind() name=<ID> ( typeParamsInfo=typeParamsInfo() )? ( extends_KW="extends" superTypes=commaListBoundExceptWild() )? ( colon=<COLON> instClassName=boundExceptWildcard() )? lcurly=<LCURLY> classMemberDecls=classMemberDecls() rcurly=<RCURLY>
+ { retVal = new ClassDecl(annotations, abstractModifier, classKind, createTokenInfo(name), typeParamsInfo, createTokenInfo(extends_KW), superTypes, createTokenInfo(colon), instClassName, createTokenInfo(lcurly), classMemberDecls, createTokenInfo(rcurly));
+ return retVal; }
+}
+
+CommaListBoundExceptWild commaListBoundExceptWild() :
+{ CommaListBoundExceptWild retVal = new CommaListBoundExceptWild();
+ BoundExceptWildcard tb1 = null;
+ Token comma = null;
+ BoundExceptWildcard tbn = null; }
+{ ( tb1=boundExceptWildcard() { retVal.addChild(tb1); } )
+ ( comma=<COMMA> tbn=boundExceptWildcard() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(tbn); } )* { return retVal; } }
+
+AbstractModifier abstractModifier() :
+{ AbstractModifier retVal = null;
+ Token abstract_KW = null; }
+{
+abstract_KW=<ABSTRACTKW>
+ { retVal = new AbstractModifier(createTokenInfo(abstract_KW));
+ return retVal; }
+}
+
+ClassKind classKind() :
+{ Token tok; }
+{ tok=<CLASSKW> { return new ClassKind (createTokenInfo(tok)); }
+| tok=<INTERFACEKW> { return new ClassKind (createTokenInfo(tok)); }
+}
+
+TypeParamsInfo typeParamsInfo() :
+{ TypeParamsInfo retVal = null;
+ Token lt = null;
+ OneOrMoreTypeParams oneOrMoreTypeParams = null;
+ Token gt = null; }
+{
+lt=<LT> oneOrMoreTypeParams=oneOrMoreTypeParams() gt=<GT>
+ { retVal = new TypeParamsInfo(createTokenInfo(lt), oneOrMoreTypeParams, createTokenInfo(gt));
+ return retVal; }
+}
+
+OneOrMoreTypeParams oneOrMoreTypeParams() :
+{ OneOrMoreTypeParams retVal = new OneOrMoreTypeParams();
+ TypeParam tp1 = null;
+ Token comma = null;
+ TypeParam tpn = null; }
+{ ( tp1=typeParam() { retVal.addChild(tp1); } )
+ ( comma=<COMMA> tpn=typeParam() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(tpn); } )* { return retVal; } }
+
+TypeParam typeParam() :
+{ TypeParam retVal = null;
+ Token typeVarName = null;
+ TypeBoundsInfo typeBoundsInfo = null; }
+{
+typeVarName=<ID> ( typeBoundsInfo=typeBoundsInfo() )?
+ { retVal = new TypeParam(createTokenInfo(typeVarName), typeBoundsInfo);
+ return retVal; }
+}
+
+TypeBoundsInfo typeBoundsInfo() :
+{ TypeBoundsInfo retVal = null;
+ Token extends_KW = null;
+ OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds = null; }
+{
+extends_KW=<EXTENDSKW> oneOrMoreTypeParamBounds=oneOrMoreTypeParamBounds()
+ { retVal = new TypeBoundsInfo(createTokenInfo(extends_KW), oneOrMoreTypeParamBounds);
+ return retVal; }
+}
+
+OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds() :
+{ OneOrMoreTypeParamBounds retVal = new OneOrMoreTypeParamBounds();
+ BoundExceptWildcard tb1 = null;
+ Token amp = null;
+ BoundExceptWildcard tbn = null; }
+{ ( tb1=boundExceptWildcard() { retVal.addChild(tb1); } )
+ ( amp=<AMP> tbn=boundExceptWildcard() { retVal.addChild(createTokenInfo(amp)); retVal.addChild(tbn); } )* { return retVal; } }
+
+BoundExceptWildcard boundExceptWildcard() :
+{ BoundExceptWildcard retVal = null;
+ QualifiedID rawTNameOrTVarOrParamzedTName = null;
+ Token lt = null;
+ OneOrMoreTypeArgs oneOrMoreTypeArgs = null;
+ Token gt = null; }
+{
+rawTNameOrTVarOrParamzedTName=qualifiedID() ( lt=<LT> oneOrMoreTypeArgs=oneOrMoreTypeArgs() gt=<GT> )?
+ { retVal = new BoundExceptWildcard(rawTNameOrTVarOrParamzedTName, createTokenInfo(lt), oneOrMoreTypeArgs, createTokenInfo(gt));
+ return retVal; }
+}
+
+OneOrMoreTypeArgs oneOrMoreTypeArgs() :
+{ OneOrMoreTypeArgs retVal = new OneOrMoreTypeArgs();
+ TypeArg ta1 = null;
+ Token comma = null;
+ TypeArg tan = null; }
+{ ( ta1=typeArg() { retVal.addChild(ta1); } )
+ ( comma=<COMMA> tan=typeArg() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(tan); } )* { return retVal; } }
+
+TypeArg typeArg() :
+{ TypeArg retVal = null; }
+{
+ ( retVal=boundExceptWildcard() { return retVal; }
+ | retVal=wildcard() { return retVal; }
+ )
+}
+
+Wildcard wildcard() :
+{ Wildcard retVal = null;
+ Token qmark = null;
+ ExtendsOrSuper extendsOrSuper = null;
+ BoundExceptWildcard boundExceptWildcard = null; }
+{
+qmark=<QMARK> ( extendsOrSuper=extendsOrSuper() boundExceptWildcard=boundExceptWildcard() )?
+ { retVal = new Wildcard(createTokenInfo(qmark), extendsOrSuper, boundExceptWildcard);
+ return retVal; }
+}
+
+ExtendsOrSuper extendsOrSuper() :
+{ Token tok; }
+{ tok=<EXTENDSKW> { return new ExtendsOrSuper (createTokenInfo(tok)); }
+| tok=<SUPERKW> { return new ExtendsOrSuper (createTokenInfo(tok)); }
+}
+
+ClassMemberDecls classMemberDecls() :
+{ ClassMemberDecls retVal = new ClassMemberDecls();
+ ClassMemberDecl classMemberDecl = null; }
+{ ( classMemberDecl=classMemberDecl() { retVal.addChild(classMemberDecl); } )* { return retVal; } }
+
+ClassMemberDecl classMemberDecl() :
+{ ClassMemberDecl retVal = null;
+ Annotations annotations = null;
+ Modifiers modifiers = null; }
+{
+annotations=annotations() modifiers=modifiers()
+ ( retVal=attribute(annotations, modifiers) { return retVal; }
+ | retVal=reference(annotations, modifiers) { return retVal; }
+ | retVal=operation(annotations, modifiers) { return retVal; }
+ )
+}
+
+Attribute attribute(Annotations annotations, Modifiers modifiers) :
+{ Attribute retVal = null;
+ Token attr_KW = null;
+ TypeWithMulti typeWithMulti = null;
+ Token name = null;
+ Token equals = null;
+ DefaultValueExpr defaultValueExpr = null;
+ Token semi = null; }
+{
+attr_KW=<ATTRKW> typeWithMulti=typeWithMulti() name=<ID> ( equals=<EQUALS> defaultValueExpr=defaultValueExpr() )? semi=<SEMI>
+ { retVal = new Attribute(annotations, modifiers, createTokenInfo(attr_KW), typeWithMulti, createTokenInfo(name), createTokenInfo(equals), defaultValueExpr, createTokenInfo(semi));
+ return retVal; }
+}
+
+TypeWithMulti typeWithMulti() :
+{ TypeWithMulti retVal = null;
+ BoundExceptWildcard name = null;
+ Multiplicity multiplicity = null; }
+{
+name=boundExceptWildcard() ( multiplicity=multiplicity() )?
+ { retVal = new TypeWithMulti(name, multiplicity);
+ return retVal; }
+}
+
+Multiplicity multiplicity() :
+{ Multiplicity retVal = null;
+ Token lsquare = null;
+ MultiplicityExpr multiplicityExpr = null;
+ Token rsquare = null; }
+{
+lsquare=<LSQUARE> ( multiplicityExpr=multiplicityExpr() )? rsquare=<RSQUARE>
+ { retVal = new Multiplicity(createTokenInfo(lsquare), multiplicityExpr, createTokenInfo(rsquare));
+ return retVal; }
+}
+
+MultiplicityExpr multiplicityExpr() :
+{ MultiplicityExpr retVal = null;
+ SimpleMultiplicityExpr lowerBound = null;
+ Token dot_dot = null;
+ SimpleMultiplicityExpr upperBound = null; }
+{
+lowerBound=simpleMultiplicityExpr() ( dot_dot=<DOT_DOT> upperBound=simpleMultiplicityExpr() )?
+ { retVal = new MultiplicityExpr(lowerBound, createTokenInfo(dot_dot), upperBound);
+ return retVal; }
+}
+
+SimpleMultiplicityExpr simpleMultiplicityExpr() :
+{ Token tok; }
+{ tok=<STAR> { return new SimpleMultiplicityExpr (createTokenInfo(tok)); }
+| tok=<PLUS> { return new SimpleMultiplicityExpr (createTokenInfo(tok)); }
+| tok=<QMARK> { return new SimpleMultiplicityExpr (createTokenInfo(tok)); }
+| tok=<INT_LITERAL> { return new SimpleMultiplicityExpr (createTokenInfo(tok)); }
+}
+
+Reference reference(Annotations annotations, Modifiers modifiers) :
+{ Reference retVal = null;
+ ReferenceKind referenceKind = null;
+ TypeWithMulti typeWithMulti = null;
+ Token hash = null;
+ Token oppositeName = null;
+ Token name = null;
+ Token semi = null; }
+{
+referenceKind=referenceKind() typeWithMulti=typeWithMulti() ( hash=<HASH> oppositeName=<ID> )? name=<ID> semi=<SEMI>
+ { retVal = new Reference(annotations, modifiers, referenceKind, typeWithMulti, createTokenInfo(hash), createTokenInfo(oppositeName), createTokenInfo(name), createTokenInfo(semi));
+ return retVal; }
+}
+
+ReferenceKind referenceKind() :
+{ Token tok; }
+{ tok=<REFKW> { return new ReferenceKind (createTokenInfo(tok)); }
+| tok=<VALKW> { return new ReferenceKind (createTokenInfo(tok)); }
+}
+
+Modifiers modifiers() :
+{ Modifiers retVal = new Modifiers();
+ OptNegatedModifier optNegatedModifier = null; }
+{ ( optNegatedModifier=optNegatedModifier() { retVal.addChild(optNegatedModifier); } )* { return retVal; } }
+
+OptNegatedModifier optNegatedModifier() :
+{ OptNegatedModifier retVal = null;
+ Token bang = null;
+ Modifier modifier = null; }
+{
+( bang=<BANG> )? modifier=modifier()
+ { retVal = new OptNegatedModifier(createTokenInfo(bang), modifier);
+ return retVal; }
+}
+
+Modifier modifier() :
+{ Token tok; }
+{ tok=<READONLYKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<VOLATILEKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<TRANSIENTKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<UNSETTABLEKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<DERIVEDKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<UNIQUEKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<ORDEREDKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<RESOLVEKW> { return new Modifier (createTokenInfo(tok)); }
+| tok=<IDKW> { return new Modifier (createTokenInfo(tok)); }
+}
+
+DefaultValueExpr defaultValueExpr() :
+{ DefaultValueExpr retVal = null; }
+{
+ ( retVal=boolExpr() { return retVal; }
+ | retVal=intExpr() { return retVal; }
+ | retVal=stringExpr() { return retVal; }
+ | retVal=charExpr() { return retVal; }
+ )
+}
+
+BoolExpr boolExpr() :
+{ BoolExpr retVal = null;
+ TrueOrFalse trueOrFalse = null; }
+{
+trueOrFalse=trueOrFalse()
+ { retVal = new BoolExpr(trueOrFalse);
+ return retVal; }
+}
+
+TrueOrFalse trueOrFalse() :
+{ Token tok; }
+{ tok=<TRUEKW> { return new TrueOrFalse (createTokenInfo(tok)); }
+| tok=<FALSEKW> { return new TrueOrFalse (createTokenInfo(tok)); }
+}
+
+IntExpr intExpr() :
+{ IntExpr retVal = null;
+ Token minus = null;
+ Token int_literal = null; }
+{
+( minus=<MINUS> )? int_literal=<INT_LITERAL>
+ { retVal = new IntExpr(createTokenInfo(minus), createTokenInfo(int_literal));
+ return retVal; }
+}
+
+StringExpr stringExpr() :
+{ StringExpr retVal = null;
+ Token string_literal = null; }
+{
+string_literal=<STRING_LITERAL>
+ { retVal = new StringExpr(createTokenInfo(string_literal));
+ return retVal; }
+}
+
+CharExpr charExpr() :
+{ CharExpr retVal = null;
+ Token char_literal = null; }
+{
+char_literal=<CHAR_LITERAL>
+ { retVal = new CharExpr(createTokenInfo(char_literal));
+ return retVal; }
+}
+
+Operation operation(Annotations annotations, Modifiers modifiers) :
+{ Operation retVal = null;
+ Token op_KW = null;
+ TypeParamsInfo typeParamsInfo = null;
+ ResultType resType = null;
+ Token name = null;
+ Token lparen = null;
+ Params params = null;
+ Token rparen = null;
+ Token throws_KW = null;
+ CommaListBoundExceptWild exceptions = null;
+ Token semi = null; }
+{
+op_KW=<OPKW> ( typeParamsInfo=typeParamsInfo() )? resType=resultType() name=<ID> lparen=<LPAREN> ( params=params() )? rparen=<RPAREN> ( throws_KW=<THROWSKW> exceptions=commaListBoundExceptWild() )? semi=<SEMI>
+ { retVal = new Operation(annotations, modifiers, createTokenInfo(op_KW), typeParamsInfo, resType, createTokenInfo(name), createTokenInfo(lparen), params, createTokenInfo(rparen), createTokenInfo(throws_KW), exceptions, createTokenInfo(semi));
+ return retVal; }
+}
+
+ResultType resultType() :
+{ ResultType retVal = null; }
+{
+ ( retVal=typeWithMulti() { return retVal; }
+ | retVal=voidContainer() { return retVal; }
+ )
+}
+
+VoidContainer voidContainer() :
+{ VoidContainer retVal = null;
+ Token void_KW = null; }
+{
+void_KW=<VOIDKW>
+ { retVal = new VoidContainer(createTokenInfo(void_KW));
+ return retVal; }
+}
+
+Params params() :
+{ Params retVal = new Params();
+ Param p1 = null;
+ Token comma = null;
+ Param pn = null; }
+{ ( p1=param() { retVal.addChild(p1); } )
+ ( comma=<COMMA> pn=param() { retVal.addChild(createTokenInfo(comma)); retVal.addChild(pn); } )* { return retVal; } }
+
+Param param() :
+{ Param retVal = null;
+ Annotations leadingAnnotations = null;
+ Modifiers modifiers = null;
+ TypeWithMulti typeWithMulti = null;
+ Token name = null;
+ Annotations trailingAnnotations = null; }
+{
+leadingAnnotations=annotations() modifiers=modifiers() typeWithMulti=typeWithMulti() name=<ID> trailingAnnotations=annotations()
+ { retVal = new Param(leadingAnnotations, modifiers, typeWithMulti, createTokenInfo(name), trailingAnnotations);
+ return retVal; }
+}
+
+DataTypeDecl dataTypeDecl(Annotations annotations) :
+{ DataTypeDecl retVal = null;
+ TransientModifier transientModifier = null;
+ Token datatype_KW = null;
+ Token name = null;
+ Token colon = null;
+ StringLiteralOrQualifiedID instClassName = null;
+ Token semi = null; }
+{
+( transientModifier=transientModifier() )? datatype_KW=<DATATYPEKW> name=<ID> colon=<COLON> instClassName=stringLiteralOrQualifiedID() semi=<SEMI>
+ { retVal = new DataTypeDecl(annotations, transientModifier, createTokenInfo(datatype_KW), createTokenInfo(name), createTokenInfo(colon), instClassName, createTokenInfo(semi));
+ return retVal; }
+}
+
+TransientModifier transientModifier() :
+{ TransientModifier retVal = null;
+ Token transient_KW = null; }
+{
+transient_KW=<TRANSIENTKW>
+ { retVal = new TransientModifier(createTokenInfo(transient_KW));
+ return retVal; }
+}
+
+EnumDecl enumDecl(Annotations annotations) :
+{ EnumDecl retVal = null;
+ Token enum_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ EnumLiterals enumLiterals = null;
+ Token rcurly = null; }
+{
+enum_KW=<ENUMKW> name=<ID> lcurly=<LCURLY> enumLiterals=enumLiterals() rcurly=<RCURLY>
+ { retVal = new EnumDecl(annotations, createTokenInfo(enum_KW), createTokenInfo(name), createTokenInfo(lcurly), enumLiterals, createTokenInfo(rcurly));
+ return retVal; }
+}
+
+EnumLiterals enumLiterals() :
+{ EnumLiterals retVal = new EnumLiterals();
+ EnumLiteral enumLiteral = null; }
+{ ( enumLiteral=enumLiteral() { retVal.addChild(enumLiteral); } )* { return retVal; } }
+
+EnumLiteral enumLiteral() :
+{ EnumLiteral retVal = null;
+ Annotations leadingAnnotations = null;
+ Token name = null;
+ Token equals = null;
+ Token val = null;
+ Annotations trailingAnnotations = null;
+ Token semi = null; }
+{
+leadingAnnotations=annotations() name=<ID> ( equals=<EQUALS> val=<INT_LITERAL> )? trailingAnnotations=annotations() semi=<SEMI>
+ { retVal = new EnumLiteral(leadingAnnotations, createTokenInfo(name), createTokenInfo(equals), createTokenInfo(val), trailingAnnotations, createTokenInfo(semi));
+ return retVal; }
+}
+
+MapEntryDecl mapEntryDecl(Annotations annotations) :
+{ MapEntryDecl retVal = null;
+ Token mapentry_KW = null;
+ Token name = null;
+ Token colon = null;
+ TypeWithMulti key = null;
+ Token minus_gt = null;
+ TypeWithMulti value = null;
+ Token semi = null; }
+{
+mapentry_KW=<MAPENTRYKW> name=<ID> colon=<COLON> key=typeWithMulti() minus_gt=<MINUS_GT> value=typeWithMulti() semi=<SEMI>
+ { retVal = new MapEntryDecl(annotations, createTokenInfo(mapentry_KW), createTokenInfo(name), createTokenInfo(colon), key, createTokenInfo(minus_gt), value, createTokenInfo(semi));
+ return retVal; }
+}
+
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParser.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParser.java
new file mode 100644
index 0000000..90b2696
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParser.java
@@ -0,0 +1,2931 @@
+/* Generated By:JavaCC: Do not edit this line. EmfaticParser.java */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.AbstractModifier;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Annotation;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Annotations;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Attribute;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.BoolExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.BoundExceptWildcard;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CharExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassKind;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassMemberDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassMemberDecls;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CommaListBoundExceptWild;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.DataTypeDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.DefaultValueExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EnumDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EnumLiteral;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EnumLiterals;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ExtendsOrSuper;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ImportStmt;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ImportStmts;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.IntExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.KeyEqualsValue;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.KeyEqualsValueList;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.MapEntryDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Modifier;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Modifiers;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Multiplicity;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.MultiplicityExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.OneOrMoreTypeArgs;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.OneOrMoreTypeParamBounds;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.OneOrMoreTypeParams;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Operation;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.OptNegatedModifier;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.PackageDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Param;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Params;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.QidSeparator;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.QualifiedID;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.QualifiedIDContainer;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Reference;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ReferenceKind;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ResultType;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.SimpleMultiplicityExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.StringExpr;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.StringLiteralContainer;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.StringLiteralOrQualifiedID;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.SubPackageDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TopLevelDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TopLevelDecls;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TransientModifier;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TrueOrFalse;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeArg;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeBoundsInfo;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeParam;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeParamsInfo;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeWithMulti;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.VoidContainer;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Wildcard;
+import org.eclipse.gymnast.runtime.core.ast.TokenInfo;
+
+public class EmfaticParser implements EmfaticParserConstants {
+
+ public TokenInfo createTokenInfo(Token tok) {
+ if (!(tok instanceof ExtToken)) return null;
+
+ ExtToken extToken = (ExtToken) tok;
+ return new TokenInfo(tok.image, extToken.tokenOffset, tok.kind);
+ }
+
+ final public CompUnit compUnit() throws ParseException {
+ CompUnit retVal = null;
+ PackageDecl packageDecl = null;
+ ImportStmts importStmts = null;
+ TopLevelDecls topLevelDecls = null;
+ packageDecl = packageDecl();
+ importStmts = importStmts();
+ topLevelDecls = topLevelDecls();
+ jj_consume_token(0);
+ retVal = new CompUnit(packageDecl, importStmts, topLevelDecls);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public PackageDecl packageDecl() throws ParseException {
+ PackageDecl retVal = null;
+ Annotations annotations = null;
+ Token package_KW = null;
+ QualifiedID name = null;
+ Token semi = null;
+ annotations = annotations();
+ package_KW = jj_consume_token(PACKAGEKW);
+ name = qualifiedID();
+ semi = jj_consume_token(SEMI);
+ retVal = new PackageDecl(annotations, createTokenInfo(package_KW), name, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public QualifiedID qualifiedID() throws ParseException {
+ QualifiedID retVal = new QualifiedID();
+ Token id1 = null;
+ QidSeparator qidSeparator = null;
+ Token idn = null;
+ id1 = jj_consume_token(ID);
+ retVal.addChild(createTokenInfo(id1));
+ label_1:
+ while (true) {
+ if (jj_2_1(4)) {
+ ;
+ } else {
+ break label_1;
+ }
+ qidSeparator = qidSeparator();
+ idn = jj_consume_token(ID);
+ retVal.addChild(qidSeparator); retVal.addChild(createTokenInfo(idn));
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public QidSeparator qidSeparator() throws ParseException {
+ Token tok;
+ if (jj_2_2(4)) {
+ tok = jj_consume_token(DOT);
+ {if (true) return new QidSeparator (createTokenInfo(tok));}
+ } else if (jj_2_3(4)) {
+ tok = jj_consume_token(DOLLAR);
+ {if (true) return new QidSeparator (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public StringLiteralOrQualifiedID stringLiteralOrQualifiedID() throws ParseException {
+ StringLiteralOrQualifiedID retVal = null;
+ if (jj_2_4(4)) {
+ retVal = stringLiteralContainer();
+ {if (true) return retVal;}
+ } else if (jj_2_5(4)) {
+ retVal = qualifiedIDContainer();
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public StringLiteralContainer stringLiteralContainer() throws ParseException {
+ StringLiteralContainer retVal = null;
+ Token string_literal = null;
+ string_literal = jj_consume_token(STRING_LITERAL);
+ retVal = new StringLiteralContainer(createTokenInfo(string_literal));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public QualifiedIDContainer qualifiedIDContainer() throws ParseException {
+ QualifiedIDContainer retVal = null;
+ QualifiedID qualifiedID = null;
+ qualifiedID = qualifiedID();
+ retVal = new QualifiedIDContainer(qualifiedID);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Annotations annotations() throws ParseException {
+ Annotations retVal = new Annotations();
+ Annotation annotation = null;
+ label_2:
+ while (true) {
+ if (jj_2_6(4)) {
+ ;
+ } else {
+ break label_2;
+ }
+ annotation = annotation();
+ retVal.addChild(annotation);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Annotation annotation() throws ParseException {
+ Annotation retVal = null;
+ Token at = null;
+ StringLiteralOrQualifiedID source = null;
+ Token lparen = null;
+ KeyEqualsValueList keyEqualsValueList = null;
+ Token rparen = null;
+ at = jj_consume_token(AT);
+ source = stringLiteralOrQualifiedID();
+ lparen = jj_consume_token(LPAREN);
+ keyEqualsValueList = keyEqualsValueList();
+ rparen = jj_consume_token(RPAREN);
+ retVal = new Annotation(createTokenInfo(at), source, createTokenInfo(lparen), keyEqualsValueList, createTokenInfo(rparen));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public KeyEqualsValueList keyEqualsValueList() throws ParseException {
+ KeyEqualsValueList retVal = new KeyEqualsValueList();
+ KeyEqualsValue kv1 = null;
+ Token comma = null;
+ KeyEqualsValue kvn = null;
+ kv1 = keyEqualsValue();
+ retVal.addChild(kv1);
+ label_3:
+ while (true) {
+ if (jj_2_7(4)) {
+ ;
+ } else {
+ break label_3;
+ }
+ comma = jj_consume_token(COMMA);
+ kvn = keyEqualsValue();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(kvn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public KeyEqualsValue keyEqualsValue() throws ParseException {
+ KeyEqualsValue retVal = null;
+ StringLiteralOrQualifiedID key = null;
+ Token equals = null;
+ StringLiteralOrQualifiedID value = null;
+ key = stringLiteralOrQualifiedID();
+ equals = jj_consume_token(EQUALS);
+ value = stringLiteralOrQualifiedID();
+ retVal = new KeyEqualsValue(key, createTokenInfo(equals), value);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ImportStmts importStmts() throws ParseException {
+ ImportStmts retVal = new ImportStmts();
+ ImportStmt importStmt = null;
+ label_4:
+ while (true) {
+ if (jj_2_8(4)) {
+ ;
+ } else {
+ break label_4;
+ }
+ importStmt = importStmt();
+ retVal.addChild(importStmt);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ImportStmt importStmt() throws ParseException {
+ ImportStmt retVal = null;
+ Token import_KW = null;
+ Token alias = null;
+ Token equals = null;
+ StringLiteralOrQualifiedID uri = null;
+ Token semi = null;
+ import_KW = jj_consume_token(IMPORTKW);
+ if (jj_2_9(4)) {
+ alias = jj_consume_token(ID);
+ equals = jj_consume_token(EQUALS);
+ } else {
+ ;
+ }
+ uri = stringLiteralOrQualifiedID();
+ semi = jj_consume_token(SEMI);
+ retVal = new ImportStmt(createTokenInfo(import_KW), createTokenInfo(alias), createTokenInfo(equals), uri, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TopLevelDecls topLevelDecls() throws ParseException {
+ TopLevelDecls retVal = new TopLevelDecls();
+ TopLevelDecl topLevelDecl = null;
+ label_5:
+ while (true) {
+ if (jj_2_10(4)) {
+ ;
+ } else {
+ break label_5;
+ }
+ topLevelDecl = topLevelDecl();
+ retVal.addChild(topLevelDecl);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TopLevelDecl topLevelDecl() throws ParseException {
+ TopLevelDecl retVal = null;
+ Annotations annotations = null;
+ annotations = annotations();
+ if (jj_2_11(4)) {
+ retVal = subPackageDecl(annotations);
+ {if (true) return retVal;}
+ } else if (jj_2_12(4)) {
+ retVal = classDecl(annotations);
+ {if (true) return retVal;}
+ } else if (jj_2_13(4)) {
+ retVal = dataTypeDecl(annotations);
+ {if (true) return retVal;}
+ } else if (jj_2_14(4)) {
+ retVal = enumDecl(annotations);
+ {if (true) return retVal;}
+ } else if (jj_2_15(4)) {
+ retVal = mapEntryDecl(annotations);
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public SubPackageDecl subPackageDecl(Annotations annotations) throws ParseException {
+ SubPackageDecl retVal = null;
+ Token package_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ TopLevelDecls topLevelDecls = null;
+ Token rcurly = null;
+ package_KW = jj_consume_token(PACKAGEKW);
+ name = jj_consume_token(ID);
+ lcurly = jj_consume_token(LCURLY);
+ topLevelDecls = topLevelDecls();
+ rcurly = jj_consume_token(RCURLY);
+ retVal = new SubPackageDecl(annotations, createTokenInfo(package_KW), createTokenInfo(name), createTokenInfo(lcurly), topLevelDecls, createTokenInfo(rcurly));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ClassDecl classDecl(Annotations annotations) throws ParseException {
+ ClassDecl retVal = null;
+ AbstractModifier abstractModifier = null;
+ ClassKind classKind = null;
+ Token name = null;
+ TypeParamsInfo typeParamsInfo = null;
+ Token extends_KW = null;
+ CommaListBoundExceptWild superTypes = null;
+ Token colon = null;
+ BoundExceptWildcard instClassName = null;
+ Token lcurly = null;
+ ClassMemberDecls classMemberDecls = null;
+ Token rcurly = null;
+ if (jj_2_16(4)) {
+ abstractModifier = abstractModifier();
+ } else {
+ ;
+ }
+ classKind = classKind();
+ name = jj_consume_token(ID);
+ if (jj_2_17(4)) {
+ typeParamsInfo = typeParamsInfo();
+ } else {
+ ;
+ }
+ if (jj_2_18(4)) {
+ extends_KW = jj_consume_token(EXTENDSKW);
+ superTypes = commaListBoundExceptWild();
+ } else {
+ ;
+ }
+ if (jj_2_19(4)) {
+ colon = jj_consume_token(COLON);
+ instClassName = boundExceptWildcard();
+ } else {
+ ;
+ }
+ lcurly = jj_consume_token(LCURLY);
+ classMemberDecls = classMemberDecls();
+ rcurly = jj_consume_token(RCURLY);
+ retVal = new ClassDecl(annotations, abstractModifier, classKind, createTokenInfo(name), typeParamsInfo, createTokenInfo(extends_KW), superTypes, createTokenInfo(colon), instClassName, createTokenInfo(lcurly), classMemberDecls, createTokenInfo(rcurly));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public CommaListBoundExceptWild commaListBoundExceptWild() throws ParseException {
+ CommaListBoundExceptWild retVal = new CommaListBoundExceptWild();
+ BoundExceptWildcard tb1 = null;
+ Token comma = null;
+ BoundExceptWildcard tbn = null;
+ tb1 = boundExceptWildcard();
+ retVal.addChild(tb1);
+ label_6:
+ while (true) {
+ if (jj_2_20(4)) {
+ ;
+ } else {
+ break label_6;
+ }
+ comma = jj_consume_token(COMMA);
+ tbn = boundExceptWildcard();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(tbn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public AbstractModifier abstractModifier() throws ParseException {
+ AbstractModifier retVal = null;
+ Token abstract_KW = null;
+ abstract_KW = jj_consume_token(ABSTRACTKW);
+ retVal = new AbstractModifier(createTokenInfo(abstract_KW));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ClassKind classKind() throws ParseException {
+ Token tok;
+ if (jj_2_21(4)) {
+ tok = jj_consume_token(CLASSKW);
+ {if (true) return new ClassKind (createTokenInfo(tok));}
+ } else if (jj_2_22(4)) {
+ tok = jj_consume_token(INTERFACEKW);
+ {if (true) return new ClassKind (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeParamsInfo typeParamsInfo() throws ParseException {
+ TypeParamsInfo retVal = null;
+ Token lt = null;
+ OneOrMoreTypeParams oneOrMoreTypeParams = null;
+ Token gt = null;
+ lt = jj_consume_token(LT);
+ oneOrMoreTypeParams = oneOrMoreTypeParams();
+ gt = jj_consume_token(GT);
+ retVal = new TypeParamsInfo(createTokenInfo(lt), oneOrMoreTypeParams, createTokenInfo(gt));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public OneOrMoreTypeParams oneOrMoreTypeParams() throws ParseException {
+ OneOrMoreTypeParams retVal = new OneOrMoreTypeParams();
+ TypeParam tp1 = null;
+ Token comma = null;
+ TypeParam tpn = null;
+ tp1 = typeParam();
+ retVal.addChild(tp1);
+ label_7:
+ while (true) {
+ if (jj_2_23(4)) {
+ ;
+ } else {
+ break label_7;
+ }
+ comma = jj_consume_token(COMMA);
+ tpn = typeParam();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(tpn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeParam typeParam() throws ParseException {
+ TypeParam retVal = null;
+ Token typeVarName = null;
+ TypeBoundsInfo typeBoundsInfo = null;
+ typeVarName = jj_consume_token(ID);
+ if (jj_2_24(4)) {
+ typeBoundsInfo = typeBoundsInfo();
+ } else {
+ ;
+ }
+ retVal = new TypeParam(createTokenInfo(typeVarName), typeBoundsInfo);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeBoundsInfo typeBoundsInfo() throws ParseException {
+ TypeBoundsInfo retVal = null;
+ Token extends_KW = null;
+ OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds = null;
+ extends_KW = jj_consume_token(EXTENDSKW);
+ oneOrMoreTypeParamBounds = oneOrMoreTypeParamBounds();
+ retVal = new TypeBoundsInfo(createTokenInfo(extends_KW), oneOrMoreTypeParamBounds);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public OneOrMoreTypeParamBounds oneOrMoreTypeParamBounds() throws ParseException {
+ OneOrMoreTypeParamBounds retVal = new OneOrMoreTypeParamBounds();
+ BoundExceptWildcard tb1 = null;
+ Token amp = null;
+ BoundExceptWildcard tbn = null;
+ tb1 = boundExceptWildcard();
+ retVal.addChild(tb1);
+ label_8:
+ while (true) {
+ if (jj_2_25(4)) {
+ ;
+ } else {
+ break label_8;
+ }
+ amp = jj_consume_token(AMP);
+ tbn = boundExceptWildcard();
+ retVal.addChild(createTokenInfo(amp)); retVal.addChild(tbn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public BoundExceptWildcard boundExceptWildcard() throws ParseException {
+ BoundExceptWildcard retVal = null;
+ QualifiedID rawTNameOrTVarOrParamzedTName = null;
+ Token lt = null;
+ OneOrMoreTypeArgs oneOrMoreTypeArgs = null;
+ Token gt = null;
+ rawTNameOrTVarOrParamzedTName = qualifiedID();
+ if (jj_2_26(4)) {
+ lt = jj_consume_token(LT);
+ oneOrMoreTypeArgs = oneOrMoreTypeArgs();
+ gt = jj_consume_token(GT);
+ } else {
+ ;
+ }
+ retVal = new BoundExceptWildcard(rawTNameOrTVarOrParamzedTName, createTokenInfo(lt), oneOrMoreTypeArgs, createTokenInfo(gt));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public OneOrMoreTypeArgs oneOrMoreTypeArgs() throws ParseException {
+ OneOrMoreTypeArgs retVal = new OneOrMoreTypeArgs();
+ TypeArg ta1 = null;
+ Token comma = null;
+ TypeArg tan = null;
+ ta1 = typeArg();
+ retVal.addChild(ta1);
+ label_9:
+ while (true) {
+ if (jj_2_27(4)) {
+ ;
+ } else {
+ break label_9;
+ }
+ comma = jj_consume_token(COMMA);
+ tan = typeArg();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(tan);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeArg typeArg() throws ParseException {
+ TypeArg retVal = null;
+ if (jj_2_28(4)) {
+ retVal = boundExceptWildcard();
+ {if (true) return retVal;}
+ } else if (jj_2_29(4)) {
+ retVal = wildcard();
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Wildcard wildcard() throws ParseException {
+ Wildcard retVal = null;
+ Token qmark = null;
+ ExtendsOrSuper extendsOrSuper = null;
+ BoundExceptWildcard boundExceptWildcard = null;
+ qmark = jj_consume_token(QMARK);
+ if (jj_2_30(4)) {
+ extendsOrSuper = extendsOrSuper();
+ boundExceptWildcard = boundExceptWildcard();
+ } else {
+ ;
+ }
+ retVal = new Wildcard(createTokenInfo(qmark), extendsOrSuper, boundExceptWildcard);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ExtendsOrSuper extendsOrSuper() throws ParseException {
+ Token tok;
+ if (jj_2_31(4)) {
+ tok = jj_consume_token(EXTENDSKW);
+ {if (true) return new ExtendsOrSuper (createTokenInfo(tok));}
+ } else if (jj_2_32(4)) {
+ tok = jj_consume_token(SUPERKW);
+ {if (true) return new ExtendsOrSuper (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ClassMemberDecls classMemberDecls() throws ParseException {
+ ClassMemberDecls retVal = new ClassMemberDecls();
+ ClassMemberDecl classMemberDecl = null;
+ label_10:
+ while (true) {
+ if (jj_2_33(4)) {
+ ;
+ } else {
+ break label_10;
+ }
+ classMemberDecl = classMemberDecl();
+ retVal.addChild(classMemberDecl);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ClassMemberDecl classMemberDecl() throws ParseException {
+ ClassMemberDecl retVal = null;
+ Annotations annotations = null;
+ Modifiers modifiers = null;
+ annotations = annotations();
+ modifiers = modifiers();
+ if (jj_2_34(4)) {
+ retVal = attribute(annotations, modifiers);
+ {if (true) return retVal;}
+ } else if (jj_2_35(4)) {
+ retVal = reference(annotations, modifiers);
+ {if (true) return retVal;}
+ } else if (jj_2_36(4)) {
+ retVal = operation(annotations, modifiers);
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Attribute attribute(Annotations annotations, Modifiers modifiers) throws ParseException {
+ Attribute retVal = null;
+ Token attr_KW = null;
+ TypeWithMulti typeWithMulti = null;
+ Token name = null;
+ Token equals = null;
+ DefaultValueExpr defaultValueExpr = null;
+ Token semi = null;
+ attr_KW = jj_consume_token(ATTRKW);
+ typeWithMulti = typeWithMulti();
+ name = jj_consume_token(ID);
+ if (jj_2_37(4)) {
+ equals = jj_consume_token(EQUALS);
+ defaultValueExpr = defaultValueExpr();
+ } else {
+ ;
+ }
+ semi = jj_consume_token(SEMI);
+ retVal = new Attribute(annotations, modifiers, createTokenInfo(attr_KW), typeWithMulti, createTokenInfo(name), createTokenInfo(equals), defaultValueExpr, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TypeWithMulti typeWithMulti() throws ParseException {
+ TypeWithMulti retVal = null;
+ BoundExceptWildcard name = null;
+ Multiplicity multiplicity = null;
+ name = boundExceptWildcard();
+ if (jj_2_38(4)) {
+ multiplicity = multiplicity();
+ } else {
+ ;
+ }
+ retVal = new TypeWithMulti(name, multiplicity);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Multiplicity multiplicity() throws ParseException {
+ Multiplicity retVal = null;
+ Token lsquare = null;
+ MultiplicityExpr multiplicityExpr = null;
+ Token rsquare = null;
+ lsquare = jj_consume_token(LSQUARE);
+ if (jj_2_39(4)) {
+ multiplicityExpr = multiplicityExpr();
+ } else {
+ ;
+ }
+ rsquare = jj_consume_token(RSQUARE);
+ retVal = new Multiplicity(createTokenInfo(lsquare), multiplicityExpr, createTokenInfo(rsquare));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public MultiplicityExpr multiplicityExpr() throws ParseException {
+ MultiplicityExpr retVal = null;
+ SimpleMultiplicityExpr lowerBound = null;
+ Token dot_dot = null;
+ SimpleMultiplicityExpr upperBound = null;
+ lowerBound = simpleMultiplicityExpr();
+ if (jj_2_40(4)) {
+ dot_dot = jj_consume_token(DOT_DOT);
+ upperBound = simpleMultiplicityExpr();
+ } else {
+ ;
+ }
+ retVal = new MultiplicityExpr(lowerBound, createTokenInfo(dot_dot), upperBound);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public SimpleMultiplicityExpr simpleMultiplicityExpr() throws ParseException {
+ Token tok;
+ if (jj_2_41(4)) {
+ tok = jj_consume_token(STAR);
+ {if (true) return new SimpleMultiplicityExpr (createTokenInfo(tok));}
+ } else if (jj_2_42(4)) {
+ tok = jj_consume_token(PLUS);
+ {if (true) return new SimpleMultiplicityExpr (createTokenInfo(tok));}
+ } else if (jj_2_43(4)) {
+ tok = jj_consume_token(QMARK);
+ {if (true) return new SimpleMultiplicityExpr (createTokenInfo(tok));}
+ } else if (jj_2_44(4)) {
+ tok = jj_consume_token(INT_LITERAL);
+ {if (true) return new SimpleMultiplicityExpr (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Reference reference(Annotations annotations, Modifiers modifiers) throws ParseException {
+ Reference retVal = null;
+ ReferenceKind referenceKind = null;
+ TypeWithMulti typeWithMulti = null;
+ Token hash = null;
+ Token oppositeName = null;
+ Token name = null;
+ Token semi = null;
+ referenceKind = referenceKind();
+ typeWithMulti = typeWithMulti();
+ if (jj_2_45(4)) {
+ hash = jj_consume_token(HASH);
+ oppositeName = jj_consume_token(ID);
+ } else {
+ ;
+ }
+ name = jj_consume_token(ID);
+ semi = jj_consume_token(SEMI);
+ retVal = new Reference(annotations, modifiers, referenceKind, typeWithMulti, createTokenInfo(hash), createTokenInfo(oppositeName), createTokenInfo(name), createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ReferenceKind referenceKind() throws ParseException {
+ Token tok;
+ if (jj_2_46(4)) {
+ tok = jj_consume_token(REFKW);
+ {if (true) return new ReferenceKind (createTokenInfo(tok));}
+ } else if (jj_2_47(4)) {
+ tok = jj_consume_token(VALKW);
+ {if (true) return new ReferenceKind (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Modifiers modifiers() throws ParseException {
+ Modifiers retVal = new Modifiers();
+ OptNegatedModifier optNegatedModifier = null;
+ label_11:
+ while (true) {
+ if (jj_2_48(4)) {
+ ;
+ } else {
+ break label_11;
+ }
+ optNegatedModifier = optNegatedModifier();
+ retVal.addChild(optNegatedModifier);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public OptNegatedModifier optNegatedModifier() throws ParseException {
+ OptNegatedModifier retVal = null;
+ Token bang = null;
+ Modifier modifier = null;
+ if (jj_2_49(4)) {
+ bang = jj_consume_token(BANG);
+ } else {
+ ;
+ }
+ modifier = modifier();
+ retVal = new OptNegatedModifier(createTokenInfo(bang), modifier);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Modifier modifier() throws ParseException {
+ Token tok;
+ if (jj_2_50(4)) {
+ tok = jj_consume_token(READONLYKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_51(4)) {
+ tok = jj_consume_token(VOLATILEKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_52(4)) {
+ tok = jj_consume_token(TRANSIENTKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_53(4)) {
+ tok = jj_consume_token(UNSETTABLEKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_54(4)) {
+ tok = jj_consume_token(DERIVEDKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_55(4)) {
+ tok = jj_consume_token(UNIQUEKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_56(4)) {
+ tok = jj_consume_token(ORDEREDKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_57(4)) {
+ tok = jj_consume_token(RESOLVEKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else if (jj_2_58(4)) {
+ tok = jj_consume_token(IDKW);
+ {if (true) return new Modifier (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public DefaultValueExpr defaultValueExpr() throws ParseException {
+ DefaultValueExpr retVal = null;
+ if (jj_2_59(4)) {
+ retVal = boolExpr();
+ {if (true) return retVal;}
+ } else if (jj_2_60(4)) {
+ retVal = intExpr();
+ {if (true) return retVal;}
+ } else if (jj_2_61(4)) {
+ retVal = stringExpr();
+ {if (true) return retVal;}
+ } else if (jj_2_62(4)) {
+ retVal = charExpr();
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public BoolExpr boolExpr() throws ParseException {
+ BoolExpr retVal = null;
+ TrueOrFalse trueOrFalse = null;
+ trueOrFalse = trueOrFalse();
+ retVal = new BoolExpr(trueOrFalse);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TrueOrFalse trueOrFalse() throws ParseException {
+ Token tok;
+ if (jj_2_63(4)) {
+ tok = jj_consume_token(TRUEKW);
+ {if (true) return new TrueOrFalse (createTokenInfo(tok));}
+ } else if (jj_2_64(4)) {
+ tok = jj_consume_token(FALSEKW);
+ {if (true) return new TrueOrFalse (createTokenInfo(tok));}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public IntExpr intExpr() throws ParseException {
+ IntExpr retVal = null;
+ Token minus = null;
+ Token int_literal = null;
+ if (jj_2_65(4)) {
+ minus = jj_consume_token(MINUS);
+ } else {
+ ;
+ }
+ int_literal = jj_consume_token(INT_LITERAL);
+ retVal = new IntExpr(createTokenInfo(minus), createTokenInfo(int_literal));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public StringExpr stringExpr() throws ParseException {
+ StringExpr retVal = null;
+ Token string_literal = null;
+ string_literal = jj_consume_token(STRING_LITERAL);
+ retVal = new StringExpr(createTokenInfo(string_literal));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public CharExpr charExpr() throws ParseException {
+ CharExpr retVal = null;
+ Token char_literal = null;
+ char_literal = jj_consume_token(CHAR_LITERAL);
+ retVal = new CharExpr(createTokenInfo(char_literal));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Operation operation(Annotations annotations, Modifiers modifiers) throws ParseException {
+ Operation retVal = null;
+ Token op_KW = null;
+ TypeParamsInfo typeParamsInfo = null;
+ ResultType resType = null;
+ Token name = null;
+ Token lparen = null;
+ Params params = null;
+ Token rparen = null;
+ Token throws_KW = null;
+ CommaListBoundExceptWild exceptions = null;
+ Token semi = null;
+ op_KW = jj_consume_token(OPKW);
+ if (jj_2_66(4)) {
+ typeParamsInfo = typeParamsInfo();
+ } else {
+ ;
+ }
+ resType = resultType();
+ name = jj_consume_token(ID);
+ lparen = jj_consume_token(LPAREN);
+ if (jj_2_67(4)) {
+ params = params();
+ } else {
+ ;
+ }
+ rparen = jj_consume_token(RPAREN);
+ if (jj_2_68(4)) {
+ throws_KW = jj_consume_token(THROWSKW);
+ exceptions = commaListBoundExceptWild();
+ } else {
+ ;
+ }
+ semi = jj_consume_token(SEMI);
+ retVal = new Operation(annotations, modifiers, createTokenInfo(op_KW), typeParamsInfo, resType, createTokenInfo(name), createTokenInfo(lparen), params, createTokenInfo(rparen), createTokenInfo(throws_KW), exceptions, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public ResultType resultType() throws ParseException {
+ ResultType retVal = null;
+ if (jj_2_69(4)) {
+ retVal = typeWithMulti();
+ {if (true) return retVal;}
+ } else if (jj_2_70(4)) {
+ retVal = voidContainer();
+ {if (true) return retVal;}
+ } else {
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public VoidContainer voidContainer() throws ParseException {
+ VoidContainer retVal = null;
+ Token void_KW = null;
+ void_KW = jj_consume_token(VOIDKW);
+ retVal = new VoidContainer(createTokenInfo(void_KW));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Params params() throws ParseException {
+ Params retVal = new Params();
+ Param p1 = null;
+ Token comma = null;
+ Param pn = null;
+ p1 = param();
+ retVal.addChild(p1);
+ label_12:
+ while (true) {
+ if (jj_2_71(4)) {
+ ;
+ } else {
+ break label_12;
+ }
+ comma = jj_consume_token(COMMA);
+ pn = param();
+ retVal.addChild(createTokenInfo(comma)); retVal.addChild(pn);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Param param() throws ParseException {
+ Param retVal = null;
+ Annotations leadingAnnotations = null;
+ Modifiers modifiers = null;
+ TypeWithMulti typeWithMulti = null;
+ Token name = null;
+ Annotations trailingAnnotations = null;
+ leadingAnnotations = annotations();
+ modifiers = modifiers();
+ typeWithMulti = typeWithMulti();
+ name = jj_consume_token(ID);
+ trailingAnnotations = annotations();
+ retVal = new Param(leadingAnnotations, modifiers, typeWithMulti, createTokenInfo(name), trailingAnnotations);
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public DataTypeDecl dataTypeDecl(Annotations annotations) throws ParseException {
+ DataTypeDecl retVal = null;
+ TransientModifier transientModifier = null;
+ Token datatype_KW = null;
+ Token name = null;
+ Token colon = null;
+ StringLiteralOrQualifiedID instClassName = null;
+ Token semi = null;
+ if (jj_2_72(4)) {
+ transientModifier = transientModifier();
+ } else {
+ ;
+ }
+ datatype_KW = jj_consume_token(DATATYPEKW);
+ name = jj_consume_token(ID);
+ colon = jj_consume_token(COLON);
+ instClassName = stringLiteralOrQualifiedID();
+ semi = jj_consume_token(SEMI);
+ retVal = new DataTypeDecl(annotations, transientModifier, createTokenInfo(datatype_KW), createTokenInfo(name), createTokenInfo(colon), instClassName, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public TransientModifier transientModifier() throws ParseException {
+ TransientModifier retVal = null;
+ Token transient_KW = null;
+ transient_KW = jj_consume_token(TRANSIENTKW);
+ retVal = new TransientModifier(createTokenInfo(transient_KW));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public EnumDecl enumDecl(Annotations annotations) throws ParseException {
+ EnumDecl retVal = null;
+ Token enum_KW = null;
+ Token name = null;
+ Token lcurly = null;
+ EnumLiterals enumLiterals = null;
+ Token rcurly = null;
+ enum_KW = jj_consume_token(ENUMKW);
+ name = jj_consume_token(ID);
+ lcurly = jj_consume_token(LCURLY);
+ enumLiterals = enumLiterals();
+ rcurly = jj_consume_token(RCURLY);
+ retVal = new EnumDecl(annotations, createTokenInfo(enum_KW), createTokenInfo(name), createTokenInfo(lcurly), enumLiterals, createTokenInfo(rcurly));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public EnumLiterals enumLiterals() throws ParseException {
+ EnumLiterals retVal = new EnumLiterals();
+ EnumLiteral enumLiteral = null;
+ label_13:
+ while (true) {
+ if (jj_2_73(4)) {
+ ;
+ } else {
+ break label_13;
+ }
+ enumLiteral = enumLiteral();
+ retVal.addChild(enumLiteral);
+ }
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public EnumLiteral enumLiteral() throws ParseException {
+ EnumLiteral retVal = null;
+ Annotations leadingAnnotations = null;
+ Token name = null;
+ Token equals = null;
+ Token val = null;
+ Annotations trailingAnnotations = null;
+ Token semi = null;
+ leadingAnnotations = annotations();
+ name = jj_consume_token(ID);
+ if (jj_2_74(4)) {
+ equals = jj_consume_token(EQUALS);
+ val = jj_consume_token(INT_LITERAL);
+ } else {
+ ;
+ }
+ trailingAnnotations = annotations();
+ semi = jj_consume_token(SEMI);
+ retVal = new EnumLiteral(leadingAnnotations, createTokenInfo(name), createTokenInfo(equals), createTokenInfo(val), trailingAnnotations, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public MapEntryDecl mapEntryDecl(Annotations annotations) throws ParseException {
+ MapEntryDecl retVal = null;
+ Token mapentry_KW = null;
+ Token name = null;
+ Token colon = null;
+ TypeWithMulti key = null;
+ Token minus_gt = null;
+ TypeWithMulti value = null;
+ Token semi = null;
+ mapentry_KW = jj_consume_token(MAPENTRYKW);
+ name = jj_consume_token(ID);
+ colon = jj_consume_token(COLON);
+ key = typeWithMulti();
+ minus_gt = jj_consume_token(MINUS_GT);
+ value = typeWithMulti();
+ semi = jj_consume_token(SEMI);
+ retVal = new MapEntryDecl(annotations, createTokenInfo(mapentry_KW), createTokenInfo(name), createTokenInfo(colon), key, createTokenInfo(minus_gt), value, createTokenInfo(semi));
+ {if (true) return retVal;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final private boolean jj_2_1(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_1(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(0, xla); }
+ }
+
+ final private boolean jj_2_2(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_2(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(1, xla); }
+ }
+
+ final private boolean jj_2_3(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_3(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(2, xla); }
+ }
+
+ final private boolean jj_2_4(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_4(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(3, xla); }
+ }
+
+ final private boolean jj_2_5(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_5(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(4, xla); }
+ }
+
+ final private boolean jj_2_6(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_6(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(5, xla); }
+ }
+
+ final private boolean jj_2_7(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_7(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(6, xla); }
+ }
+
+ final private boolean jj_2_8(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_8(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(7, xla); }
+ }
+
+ final private boolean jj_2_9(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_9(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(8, xla); }
+ }
+
+ final private boolean jj_2_10(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_10(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(9, xla); }
+ }
+
+ final private boolean jj_2_11(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_11(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(10, xla); }
+ }
+
+ final private boolean jj_2_12(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_12(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(11, xla); }
+ }
+
+ final private boolean jj_2_13(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_13(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(12, xla); }
+ }
+
+ final private boolean jj_2_14(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_14(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(13, xla); }
+ }
+
+ final private boolean jj_2_15(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_15(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(14, xla); }
+ }
+
+ final private boolean jj_2_16(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_16(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(15, xla); }
+ }
+
+ final private boolean jj_2_17(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_17(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(16, xla); }
+ }
+
+ final private boolean jj_2_18(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_18(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(17, xla); }
+ }
+
+ final private boolean jj_2_19(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_19(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(18, xla); }
+ }
+
+ final private boolean jj_2_20(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_20(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(19, xla); }
+ }
+
+ final private boolean jj_2_21(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_21(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(20, xla); }
+ }
+
+ final private boolean jj_2_22(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_22(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(21, xla); }
+ }
+
+ final private boolean jj_2_23(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_23(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(22, xla); }
+ }
+
+ final private boolean jj_2_24(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_24(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(23, xla); }
+ }
+
+ final private boolean jj_2_25(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_25(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(24, xla); }
+ }
+
+ final private boolean jj_2_26(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_26(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(25, xla); }
+ }
+
+ final private boolean jj_2_27(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_27(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(26, xla); }
+ }
+
+ final private boolean jj_2_28(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_28(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(27, xla); }
+ }
+
+ final private boolean jj_2_29(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_29(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(28, xla); }
+ }
+
+ final private boolean jj_2_30(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_30(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(29, xla); }
+ }
+
+ final private boolean jj_2_31(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_31(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(30, xla); }
+ }
+
+ final private boolean jj_2_32(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_32(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(31, xla); }
+ }
+
+ final private boolean jj_2_33(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_33(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(32, xla); }
+ }
+
+ final private boolean jj_2_34(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_34(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(33, xla); }
+ }
+
+ final private boolean jj_2_35(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_35(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(34, xla); }
+ }
+
+ final private boolean jj_2_36(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_36(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(35, xla); }
+ }
+
+ final private boolean jj_2_37(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_37(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(36, xla); }
+ }
+
+ final private boolean jj_2_38(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_38(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(37, xla); }
+ }
+
+ final private boolean jj_2_39(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_39(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(38, xla); }
+ }
+
+ final private boolean jj_2_40(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_40(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(39, xla); }
+ }
+
+ final private boolean jj_2_41(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_41(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(40, xla); }
+ }
+
+ final private boolean jj_2_42(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_42(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(41, xla); }
+ }
+
+ final private boolean jj_2_43(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_43(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(42, xla); }
+ }
+
+ final private boolean jj_2_44(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_44(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(43, xla); }
+ }
+
+ final private boolean jj_2_45(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_45(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(44, xla); }
+ }
+
+ final private boolean jj_2_46(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_46(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(45, xla); }
+ }
+
+ final private boolean jj_2_47(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_47(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(46, xla); }
+ }
+
+ final private boolean jj_2_48(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_48(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(47, xla); }
+ }
+
+ final private boolean jj_2_49(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_49(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(48, xla); }
+ }
+
+ final private boolean jj_2_50(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_50(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(49, xla); }
+ }
+
+ final private boolean jj_2_51(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_51(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(50, xla); }
+ }
+
+ final private boolean jj_2_52(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_52(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(51, xla); }
+ }
+
+ final private boolean jj_2_53(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_53(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(52, xla); }
+ }
+
+ final private boolean jj_2_54(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_54(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(53, xla); }
+ }
+
+ final private boolean jj_2_55(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_55(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(54, xla); }
+ }
+
+ final private boolean jj_2_56(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_56(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(55, xla); }
+ }
+
+ final private boolean jj_2_57(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_57(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(56, xla); }
+ }
+
+ final private boolean jj_2_58(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_58(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(57, xla); }
+ }
+
+ final private boolean jj_2_59(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_59(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(58, xla); }
+ }
+
+ final private boolean jj_2_60(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_60(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(59, xla); }
+ }
+
+ final private boolean jj_2_61(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_61(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(60, xla); }
+ }
+
+ final private boolean jj_2_62(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_62(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(61, xla); }
+ }
+
+ final private boolean jj_2_63(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_63(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(62, xla); }
+ }
+
+ final private boolean jj_2_64(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_64(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(63, xla); }
+ }
+
+ final private boolean jj_2_65(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_65(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(64, xla); }
+ }
+
+ final private boolean jj_2_66(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_66(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(65, xla); }
+ }
+
+ final private boolean jj_2_67(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_67(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(66, xla); }
+ }
+
+ final private boolean jj_2_68(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_68(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(67, xla); }
+ }
+
+ final private boolean jj_2_69(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_69(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(68, xla); }
+ }
+
+ final private boolean jj_2_70(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_70(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(69, xla); }
+ }
+
+ final private boolean jj_2_71(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_71(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(70, xla); }
+ }
+
+ final private boolean jj_2_72(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_72(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(71, xla); }
+ }
+
+ final private boolean jj_2_73(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_73(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(72, xla); }
+ }
+
+ final private boolean jj_2_74(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_74(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(73, xla); }
+ }
+
+ final private boolean jj_3_65() {
+ if (jj_scan_token(MINUS)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_46() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_65()) jj_scanpos = xsp;
+ if (jj_scan_token(INT_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_25() {
+ if (jj_scan_token(AMP)) return true;
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_15() {
+ if (jj_scan_token(STRING_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_17() {
+ if (jj_3R_27()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_64() {
+ if (jj_3R_29()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_25()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_5() {
+ if (jj_3R_16()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_64() {
+ if (jj_scan_token(FALSEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_69() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_63()) {
+ jj_scanpos = xsp;
+ if (jj_3_64()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_4() {
+ if (jj_3R_15()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_24() {
+ if (jj_3R_31()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_45() {
+ if (jj_scan_token(HASH)) return true;
+ if (jj_scan_token(ID)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_63() {
+ if (jj_scan_token(TRUEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_56() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_4()) {
+ jj_scanpos = xsp;
+ if (jj_3_5()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_3() {
+ if (jj_scan_token(DOLLAR)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_45() {
+ if (jj_3R_69()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_31() {
+ if (jj_scan_token(EXTENDSKW)) return true;
+ if (jj_3R_64()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_14() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_2()) {
+ jj_scanpos = xsp;
+ if (jj_3_3()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_2() {
+ if (jj_scan_token(DOT)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_74() {
+ if (jj_scan_token(EQUALS)) return true;
+ if (jj_scan_token(INT_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_1() {
+ if (jj_3R_14()) return true;
+ if (jj_scan_token(ID)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_68() {
+ if (jj_scan_token(THROWSKW)) return true;
+ if (jj_3R_28()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_62() {
+ if (jj_3R_48()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_55() {
+ if (jj_scan_token(ID)) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_1()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_61() {
+ if (jj_3R_47()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_60() {
+ if (jj_3R_46()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_59() {
+ if (jj_3R_45()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_40() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_59()) {
+ jj_scanpos = xsp;
+ if (jj_3_60()) {
+ jj_scanpos = xsp;
+ if (jj_3_61()) {
+ jj_scanpos = xsp;
+ if (jj_3_62()) return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_30() {
+ if (jj_scan_token(ID)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_24()) jj_scanpos = xsp;
+ return false;
+ }
+
+ final private boolean jj_3_23() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_30()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_58() {
+ if (jj_scan_token(IDKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_63() {
+ if (jj_3R_30()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_23()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_57() {
+ if (jj_scan_token(RESOLVEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_56() {
+ if (jj_scan_token(ORDEREDKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_55() {
+ if (jj_scan_token(UNIQUEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_54() {
+ if (jj_scan_token(DERIVEDKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_53() {
+ if (jj_scan_token(UNSETTABLEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_52() {
+ if (jj_scan_token(TRANSIENTKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_51() {
+ if (jj_scan_token(VOLATILEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_68() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_50()) {
+ jj_scanpos = xsp;
+ if (jj_3_51()) {
+ jj_scanpos = xsp;
+ if (jj_3_52()) {
+ jj_scanpos = xsp;
+ if (jj_3_53()) {
+ jj_scanpos = xsp;
+ if (jj_3_54()) {
+ jj_scanpos = xsp;
+ if (jj_3_55()) {
+ jj_scanpos = xsp;
+ if (jj_3_56()) {
+ jj_scanpos = xsp;
+ if (jj_3_57()) {
+ jj_scanpos = xsp;
+ if (jj_3_58()) return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_50() {
+ if (jj_scan_token(READONLYKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_27() {
+ if (jj_scan_token(LT)) return true;
+ if (jj_3R_63()) return true;
+ if (jj_scan_token(GT)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_49() {
+ if (jj_scan_token(BANG)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_25() {
+ if (jj_scan_token(MAPENTRYKW)) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(COLON)) return true;
+ if (jj_3R_50()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_44() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_49()) jj_scanpos = xsp;
+ if (jj_3R_68()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_22() {
+ if (jj_scan_token(INTERFACEKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_48() {
+ if (jj_3R_44()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_60() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_21()) {
+ jj_scanpos = xsp;
+ if (jj_3_22()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_21() {
+ if (jj_scan_token(CLASSKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_65() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_48()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_40() {
+ if (jj_scan_token(DOT_DOT)) return true;
+ if (jj_3R_43()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_67() {
+ if (jj_3R_49()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_47() {
+ if (jj_scan_token(VALKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_66() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_46()) {
+ jj_scanpos = xsp;
+ if (jj_3_47()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_46() {
+ if (jj_scan_token(REFKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_26() {
+ if (jj_scan_token(ABSTRACTKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_54() {
+ if (jj_3R_58()) return true;
+ if (jj_scan_token(ID)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_74()) jj_scanpos = xsp;
+ if (jj_3R_58()) return true;
+ if (jj_scan_token(SEMI)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_20() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_37() {
+ if (jj_scan_token(EQUALS)) return true;
+ if (jj_3R_40()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_28() {
+ if (jj_3R_29()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_20()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_38() {
+ if (jj_3R_66()) return true;
+ if (jj_3R_50()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_45()) jj_scanpos = xsp;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(SEMI)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_73() {
+ if (jj_3R_54()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_62() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_73()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_16() {
+ if (jj_3R_26()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_22() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_16()) jj_scanpos = xsp;
+ if (jj_3R_60()) return true;
+ if (jj_scan_token(ID)) return true;
+ xsp = jj_scanpos;
+ if (jj_3_17()) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_3_18()) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_3_19()) jj_scanpos = xsp;
+ if (jj_scan_token(LCURLY)) return true;
+ if (jj_3R_61()) return true;
+ if (jj_scan_token(RCURLY)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_44() {
+ if (jj_scan_token(INT_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_43() {
+ if (jj_scan_token(QMARK)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_24() {
+ if (jj_scan_token(ENUMKW)) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(LCURLY)) return true;
+ if (jj_3R_62()) return true;
+ if (jj_scan_token(RCURLY)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_42() {
+ if (jj_scan_token(PLUS)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_43() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_41()) {
+ jj_scanpos = xsp;
+ if (jj_3_42()) {
+ jj_scanpos = xsp;
+ if (jj_3_43()) {
+ jj_scanpos = xsp;
+ if (jj_3_44()) return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_39() {
+ if (jj_3R_42()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_41() {
+ if (jj_scan_token(STAR)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_38() {
+ if (jj_3R_41()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_42() {
+ if (jj_3R_43()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_40()) jj_scanpos = xsp;
+ return false;
+ }
+
+ final private boolean jj_3_19() {
+ if (jj_scan_token(COLON)) return true;
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_53() {
+ if (jj_scan_token(TRANSIENTKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_21() {
+ if (jj_scan_token(PACKAGEKW)) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(LCURLY)) return true;
+ if (jj_3R_59()) return true;
+ if (jj_scan_token(RCURLY)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_72() {
+ if (jj_3R_53()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_41() {
+ if (jj_scan_token(LSQUARE)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_39()) jj_scanpos = xsp;
+ if (jj_scan_token(RSQUARE)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_23() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_72()) jj_scanpos = xsp;
+ if (jj_scan_token(DATATYPEKW)) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(COLON)) return true;
+ if (jj_3R_56()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_9() {
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(EQUALS)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_15() {
+ if (jj_3R_25()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_14() {
+ if (jj_3R_24()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_13() {
+ if (jj_3R_23()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_12() {
+ if (jj_3R_22()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_11() {
+ if (jj_3R_21()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_50() {
+ if (jj_3R_29()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_38()) jj_scanpos = xsp;
+ return false;
+ }
+
+ final private boolean jj_3R_20() {
+ if (jj_3R_58()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_11()) {
+ jj_scanpos = xsp;
+ if (jj_3_12()) {
+ jj_scanpos = xsp;
+ if (jj_3_13()) {
+ jj_scanpos = xsp;
+ if (jj_3_14()) {
+ jj_scanpos = xsp;
+ if (jj_3_15()) return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_10() {
+ if (jj_3R_20()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_52() {
+ if (jj_3R_58()) return true;
+ if (jj_3R_65()) return true;
+ if (jj_3R_50()) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_3R_58()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_59() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_10()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_37() {
+ if (jj_scan_token(ATTRKW)) return true;
+ if (jj_3R_50()) return true;
+ if (jj_scan_token(ID)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_37()) jj_scanpos = xsp;
+ if (jj_scan_token(SEMI)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_71() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_52()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_49() {
+ if (jj_3R_52()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_71()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_19() {
+ if (jj_scan_token(IMPORTKW)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_9()) jj_scanpos = xsp;
+ if (jj_3R_56()) return true;
+ if (jj_scan_token(SEMI)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_36() {
+ if (jj_3R_39()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_35() {
+ if (jj_3R_38()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_34() {
+ if (jj_3R_37()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_8() {
+ if (jj_3R_19()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_51() {
+ if (jj_scan_token(VOIDKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_36() {
+ if (jj_3R_58()) return true;
+ if (jj_3R_65()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_34()) {
+ jj_scanpos = xsp;
+ if (jj_3_35()) {
+ jj_scanpos = xsp;
+ if (jj_3_36()) return true;
+ }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_66() {
+ if (jj_3R_27()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_26() {
+ if (jj_scan_token(LT)) return true;
+ if (jj_3R_32()) return true;
+ if (jj_scan_token(GT)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_33() {
+ if (jj_3R_36()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_70() {
+ if (jj_3R_51()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_69() {
+ if (jj_3R_50()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_61() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_33()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3_30() {
+ if (jj_3R_35()) return true;
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_67() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_69()) {
+ jj_scanpos = xsp;
+ if (jj_3_70()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_18() {
+ if (jj_3R_56()) return true;
+ if (jj_scan_token(EQUALS)) return true;
+ if (jj_3R_56()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_32() {
+ if (jj_scan_token(SUPERKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_35() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_31()) {
+ jj_scanpos = xsp;
+ if (jj_3_32()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_7() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_18()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_31() {
+ if (jj_scan_token(EXTENDSKW)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_57() {
+ if (jj_3R_18()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_39() {
+ if (jj_scan_token(OPKW)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_66()) jj_scanpos = xsp;
+ if (jj_3R_67()) return true;
+ if (jj_scan_token(ID)) return true;
+ if (jj_scan_token(LPAREN)) return true;
+ return false;
+ }
+
+ final private boolean jj_3_18() {
+ if (jj_scan_token(EXTENDSKW)) return true;
+ if (jj_3R_28()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_34() {
+ if (jj_scan_token(QMARK)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_30()) jj_scanpos = xsp;
+ return false;
+ }
+
+ final private boolean jj_3R_17() {
+ if (jj_scan_token(AT)) return true;
+ if (jj_3R_56()) return true;
+ if (jj_scan_token(LPAREN)) return true;
+ if (jj_3R_57()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_29() {
+ if (jj_3R_34()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_28() {
+ if (jj_3R_29()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_33() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_28()) {
+ jj_scanpos = xsp;
+ if (jj_3_29()) return true;
+ }
+ return false;
+ }
+
+ final private boolean jj_3_6() {
+ if (jj_3R_17()) return true;
+ return false;
+ }
+
+ final private boolean jj_3_27() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_33()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_48() {
+ if (jj_scan_token(CHAR_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_58() {
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_6()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_32() {
+ if (jj_3R_33()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_27()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ final private boolean jj_3R_47() {
+ if (jj_scan_token(STRING_LITERAL)) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_16() {
+ if (jj_3R_55()) return true;
+ return false;
+ }
+
+ final private boolean jj_3R_29() {
+ if (jj_3R_55()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_26()) jj_scanpos = xsp;
+ return false;
+ }
+
+ public EmfaticParserTokenManager token_source;
+ SimpleCharStream jj_input_stream;
+ public Token token, jj_nt;
+ private int jj_ntk;
+ private Token jj_scanpos, jj_lastpos;
+ private int jj_la;
+ public boolean lookingAhead = false;
+ private boolean jj_semLA;
+ private int jj_gen;
+ final private int[] jj_la1 = new int[0];
+ static private int[] jj_la1_0;
+ static private int[] jj_la1_1;
+ static private int[] jj_la1_2;
+ static {
+ jj_la1_0();
+ jj_la1_1();
+ jj_la1_2();
+ }
+ private static void jj_la1_0() {
+ jj_la1_0 = new int[] {};
+ }
+ private static void jj_la1_1() {
+ jj_la1_1 = new int[] {};
+ }
+ private static void jj_la1_2() {
+ jj_la1_2 = new int[] {};
+ }
+ final private JJCalls[] jj_2_rtns = new JJCalls[74];
+ private boolean jj_rescan = false;
+ private int jj_gc = 0;
+
+ public EmfaticParser(java.io.InputStream stream) {
+ this(stream, null);
+ }
+ public EmfaticParser(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source = new EmfaticParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public void ReInit(java.io.InputStream stream) {
+ ReInit(stream, null);
+ }
+ public void ReInit(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public EmfaticParser(java.io.Reader stream) {
+ jj_input_stream = new SimpleCharStream(stream, 1, 1);
+ token_source = new EmfaticParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public void ReInit(java.io.Reader stream) {
+ jj_input_stream.ReInit(stream, 1, 1);
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public EmfaticParser(EmfaticParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ public void ReInit(EmfaticParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 0; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ final private Token jj_consume_token(int kind) throws ParseException {
+ Token oldToken;
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ if (token.kind == kind) {
+ jj_gen++;
+ if (++jj_gc > 100) {
+ jj_gc = 0;
+ for (int i = 0; i < jj_2_rtns.length; i++) {
+ JJCalls c = jj_2_rtns[i];
+ while (c != null) {
+ if (c.gen < jj_gen) c.first = null;
+ c = c.next;
+ }
+ }
+ }
+ return token;
+ }
+ token = oldToken;
+ jj_kind = kind;
+ throw generateParseException();
+ }
+
+ static private final class LookaheadSuccess extends java.lang.Error { }
+ final private LookaheadSuccess jj_ls = new LookaheadSuccess();
+ final private boolean jj_scan_token(int kind) {
+ if (jj_scanpos == jj_lastpos) {
+ jj_la--;
+ if (jj_scanpos.next == null) {
+ jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
+ } else {
+ jj_lastpos = jj_scanpos = jj_scanpos.next;
+ }
+ } else {
+ jj_scanpos = jj_scanpos.next;
+ }
+ if (jj_rescan) {
+ int i = 0; Token tok = token;
+ while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
+ if (tok != null) jj_add_error_token(kind, i);
+ }
+ if (jj_scanpos.kind != kind) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
+ return false;
+ }
+
+ final public Token getNextToken() {
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ jj_gen++;
+ return token;
+ }
+
+ final public Token getToken(int index) {
+ Token t = lookingAhead ? jj_scanpos : token;
+ for (int i = 0; i < index; i++) {
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
+ }
+ return t;
+ }
+
+ final private int jj_ntk() {
+ if ((jj_nt=token.next) == null)
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+ else
+ return (jj_ntk = jj_nt.kind);
+ }
+
+ private java.util.Vector<int[]> jj_expentries = new java.util.Vector<int[]>();
+ private int[] jj_expentry;
+ private int jj_kind = -1;
+ private int[] jj_lasttokens = new int[100];
+ private int jj_endpos;
+
+ private void jj_add_error_token(int kind, int pos) {
+ if (pos >= 100) return;
+ if (pos == jj_endpos + 1) {
+ jj_lasttokens[jj_endpos++] = kind;
+ } else if (jj_endpos != 0) {
+ jj_expentry = new int[jj_endpos];
+ for (int i = 0; i < jj_endpos; i++) {
+ jj_expentry[i] = jj_lasttokens[i];
+ }
+ boolean exists = false;
+ for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
+ int[] oldentry = (int[])(e.nextElement());
+ if (oldentry.length == jj_expentry.length) {
+ exists = true;
+ for (int i = 0; i < jj_expentry.length; i++) {
+ if (oldentry[i] != jj_expentry[i]) {
+ exists = false;
+ break;
+ }
+ }
+ if (exists) break;
+ }
+ }
+ if (!exists) jj_expentries.addElement(jj_expentry);
+ if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
+ }
+ }
+
+ public ParseException generateParseException() {
+ jj_expentries.removeAllElements();
+ boolean[] la1tokens = new boolean[72];
+ for (int i = 0; i < 72; i++) {
+ la1tokens[i] = false;
+ }
+ if (jj_kind >= 0) {
+ la1tokens[jj_kind] = true;
+ jj_kind = -1;
+ }
+ for (int i = 0; i < 0; i++) {
+ if (jj_la1[i] == jj_gen) {
+ for (int j = 0; j < 32; j++) {
+ if ((jj_la1_0[i] & (1<<j)) != 0) {
+ la1tokens[j] = true;
+ }
+ if ((jj_la1_1[i] & (1<<j)) != 0) {
+ la1tokens[32+j] = true;
+ }
+ if ((jj_la1_2[i] & (1<<j)) != 0) {
+ la1tokens[64+j] = true;
+ }
+ }
+ }
+ }
+ for (int i = 0; i < 72; i++) {
+ if (la1tokens[i]) {
+ jj_expentry = new int[1];
+ jj_expentry[0] = i;
+ jj_expentries.addElement(jj_expentry);
+ }
+ }
+ jj_endpos = 0;
+ jj_rescan_token();
+ jj_add_error_token(0, 0);
+ int[][] exptokseq = new int[jj_expentries.size()][];
+ for (int i = 0; i < jj_expentries.size(); i++) {
+ exptokseq[i] = (int[])jj_expentries.elementAt(i);
+ }
+ return new ParseException(token, exptokseq, tokenImage);
+ }
+
+ final public void enable_tracing() {
+ }
+
+ final public void disable_tracing() {
+ }
+
+ final private void jj_rescan_token() {
+ jj_rescan = true;
+ for (int i = 0; i < 74; i++) {
+ try {
+ JJCalls p = jj_2_rtns[i];
+ do {
+ if (p.gen > jj_gen) {
+ jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
+ switch (i) {
+ case 0: jj_3_1(); break;
+ case 1: jj_3_2(); break;
+ case 2: jj_3_3(); break;
+ case 3: jj_3_4(); break;
+ case 4: jj_3_5(); break;
+ case 5: jj_3_6(); break;
+ case 6: jj_3_7(); break;
+ case 7: jj_3_8(); break;
+ case 8: jj_3_9(); break;
+ case 9: jj_3_10(); break;
+ case 10: jj_3_11(); break;
+ case 11: jj_3_12(); break;
+ case 12: jj_3_13(); break;
+ case 13: jj_3_14(); break;
+ case 14: jj_3_15(); break;
+ case 15: jj_3_16(); break;
+ case 16: jj_3_17(); break;
+ case 17: jj_3_18(); break;
+ case 18: jj_3_19(); break;
+ case 19: jj_3_20(); break;
+ case 20: jj_3_21(); break;
+ case 21: jj_3_22(); break;
+ case 22: jj_3_23(); break;
+ case 23: jj_3_24(); break;
+ case 24: jj_3_25(); break;
+ case 25: jj_3_26(); break;
+ case 26: jj_3_27(); break;
+ case 27: jj_3_28(); break;
+ case 28: jj_3_29(); break;
+ case 29: jj_3_30(); break;
+ case 30: jj_3_31(); break;
+ case 31: jj_3_32(); break;
+ case 32: jj_3_33(); break;
+ case 33: jj_3_34(); break;
+ case 34: jj_3_35(); break;
+ case 35: jj_3_36(); break;
+ case 36: jj_3_37(); break;
+ case 37: jj_3_38(); break;
+ case 38: jj_3_39(); break;
+ case 39: jj_3_40(); break;
+ case 40: jj_3_41(); break;
+ case 41: jj_3_42(); break;
+ case 42: jj_3_43(); break;
+ case 43: jj_3_44(); break;
+ case 44: jj_3_45(); break;
+ case 45: jj_3_46(); break;
+ case 46: jj_3_47(); break;
+ case 47: jj_3_48(); break;
+ case 48: jj_3_49(); break;
+ case 49: jj_3_50(); break;
+ case 50: jj_3_51(); break;
+ case 51: jj_3_52(); break;
+ case 52: jj_3_53(); break;
+ case 53: jj_3_54(); break;
+ case 54: jj_3_55(); break;
+ case 55: jj_3_56(); break;
+ case 56: jj_3_57(); break;
+ case 57: jj_3_58(); break;
+ case 58: jj_3_59(); break;
+ case 59: jj_3_60(); break;
+ case 60: jj_3_61(); break;
+ case 61: jj_3_62(); break;
+ case 62: jj_3_63(); break;
+ case 63: jj_3_64(); break;
+ case 64: jj_3_65(); break;
+ case 65: jj_3_66(); break;
+ case 66: jj_3_67(); break;
+ case 67: jj_3_68(); break;
+ case 68: jj_3_69(); break;
+ case 69: jj_3_70(); break;
+ case 70: jj_3_71(); break;
+ case 71: jj_3_72(); break;
+ case 72: jj_3_73(); break;
+ case 73: jj_3_74(); break;
+ }
+ }
+ p = p.next;
+ } while (p != null);
+ } catch(LookaheadSuccess ls) { }
+ }
+ jj_rescan = false;
+ }
+
+ final private void jj_save(int index, int xla) {
+ JJCalls p = jj_2_rtns[index];
+ while (p.gen > jj_gen) {
+ if (p.next == null) { p = p.next = new JJCalls(); break; }
+ p = p.next;
+ }
+ p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
+ }
+
+ static final class JJCalls {
+ int gen;
+ Token first;
+ int arg;
+ JJCalls next;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParserConstants.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParserConstants.java
new file mode 100644
index 0000000..da8ee99
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParserConstants.java
@@ -0,0 +1,154 @@
+/* Generated By:JavaCC: Do not edit this line. EmfaticParserConstants.java */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public interface EmfaticParserConstants {
+
+ int EOF = 0;
+ int SINGLELINECOMMENT = 1;
+ int WS = 2;
+ int PACKAGEKW = 6;
+ int CLASSKW = 7;
+ int IMPORTKW = 8;
+ int ABSTRACTKW = 9;
+ int INTERFACEKW = 10;
+ int EXTENDSKW = 11;
+ int SUPERKW = 12;
+ int ATTRKW = 13;
+ int REFKW = 14;
+ int VALKW = 15;
+ int READONLYKW = 16;
+ int VOLATILEKW = 17;
+ int TRANSIENTKW = 18;
+ int UNSETTABLEKW = 19;
+ int DERIVEDKW = 20;
+ int UNIQUEKW = 21;
+ int ORDEREDKW = 22;
+ int RESOLVEKW = 23;
+ int IDKW = 24;
+ int TRUEKW = 25;
+ int FALSEKW = 26;
+ int OPKW = 27;
+ int VOIDKW = 28;
+ int DATATYPEKW = 29;
+ int ENUMKW = 30;
+ int MAPENTRYKW = 31;
+ int THROWSKW = 32;
+ int DOUBLESLASH = 33;
+ int DOUBLEQUOTE = 34;
+ int SINGLEQUOTE = 35;
+ int BACKSLASH = 36;
+ int LCURLY = 37;
+ int RCURLY = 38;
+ int LSQUARE = 39;
+ int RSQUARE = 40;
+ int LPAREN = 41;
+ int RPAREN = 42;
+ int DOT = 43;
+ int COMMA = 44;
+ int COLON = 45;
+ int SEMI = 46;
+ int STAR = 47;
+ int PLUS = 48;
+ int MINUS = 49;
+ int EQUALS = 50;
+ int QMARK = 51;
+ int BANG = 52;
+ int DOLLAR = 53;
+ int HASH = 54;
+ int AT = 55;
+ int DOT_DOT = 56;
+ int MINUS_GT = 57;
+ int GT_LT = 58;
+ int LT_GT = 59;
+ int AMP = 60;
+ int LT = 61;
+ int GT = 62;
+ int STRING_LITERAL = 63;
+ int CHAR_LITERAL = 64;
+ int LETTERORUNDERSCORE = 65;
+ int LETTERORUNDERSCOREORDIGIT = 66;
+ int INT_LITERAL = 67;
+ int DIGIT = 68;
+ int ESC = 69;
+ int DIGITDIGITDIGIT = 70;
+ int ID = 71;
+
+ int DEFAULT = 0;
+ int WithinComment = 1;
+
+ String[] tokenImage = {
+ "<EOF>",
+ "<SINGLELINECOMMENT>",
+ "<WS>",
+ "\"/*\"",
+ "\"*/\"",
+ "<token of kind 5>",
+ "\"package\"",
+ "\"class\"",
+ "\"import\"",
+ "\"abstract\"",
+ "\"interface\"",
+ "\"extends\"",
+ "\"super\"",
+ "\"attr\"",
+ "\"ref\"",
+ "\"val\"",
+ "\"readonly\"",
+ "\"volatile\"",
+ "\"transient\"",
+ "\"unsettable\"",
+ "\"derived\"",
+ "\"unique\"",
+ "\"ordered\"",
+ "\"resolve\"",
+ "\"id\"",
+ "\"true\"",
+ "\"false\"",
+ "\"op\"",
+ "\"void\"",
+ "\"datatype\"",
+ "\"enum\"",
+ "\"mapentry\"",
+ "\"throws\"",
+ "\"//\"",
+ "\"\\\"\"",
+ "\"\\\'\"",
+ "\"\\\\\"",
+ "\"{\"",
+ "\"}\"",
+ "\"[\"",
+ "\"]\"",
+ "\"(\"",
+ "\")\"",
+ "\".\"",
+ "\",\"",
+ "\":\"",
+ "\";\"",
+ "\"*\"",
+ "\"+\"",
+ "\"-\"",
+ "\"=\"",
+ "\"?\"",
+ "\"!\"",
+ "\"$\"",
+ "\"#\"",
+ "\"@\"",
+ "\"..\"",
+ "\"->\"",
+ "\"><\"",
+ "\"<>\"",
+ "\"&\"",
+ "\"<\"",
+ "\">\"",
+ "<STRING_LITERAL>",
+ "<CHAR_LITERAL>",
+ "<LETTERORUNDERSCORE>",
+ "<LETTERORUNDERSCOREORDIGIT>",
+ "<INT_LITERAL>",
+ "<DIGIT>",
+ "<ESC>",
+ "<DIGITDIGITDIGIT>",
+ "<ID>",
+ };
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParserDriver.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParserDriver.java
new file mode 100644
index 0000000..bdefb25
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParserDriver.java
@@ -0,0 +1,141 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.emfatic.core.generator.ecore.Builder;
+import org.eclipse.emf.emfatic.core.generator.ecore.Connector;
+import org.eclipse.emf.emfatic.core.generator.ecore.EmfaticSemanticWarning;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.parser.IParser;
+import org.eclipse.gymnast.runtime.core.parser.ParseContext;
+import org.eclipse.gymnast.runtime.core.parser.ParseError;
+import org.eclipse.gymnast.runtime.core.parser.ParseMessage;
+
+public class EmfaticParserDriver implements IParser {
+
+ public ParseContext parse(Reader input) {
+
+ ExtSimpleCharStream stream = new ExtSimpleCharStream(input);
+ ExtEmfaticParserTokenManager tokenManager = new ExtEmfaticParserTokenManager(stream);
+ EmfaticParser parser = new EmfaticParser(tokenManager);
+ ParseContext parseContext = new ParseContext();
+ CompUnit compUnit = parseCompUnit(parser, parseContext);
+ if (compUnit != null) {
+ EPackage rootPackage = addErrorsFromAST(parseContext);
+ // for consumption by change listeners (notified by the editor)
+ compUnit.setAST(rootPackage);
+ }
+
+ if (parseContext.getMessageCount() == 0) {
+ System.out.println("Parse OK!");
+ }
+ else {
+ ParseMessage[] msgs = parseContext.getMessages();
+ for (int i = 0; i < msgs.length; i++) {
+ // System.err.println(msgs[i].getMessage());
+ }
+ }
+
+ return parseContext;
+ }
+
+ private EPackage addErrorsFromAST(ParseContext parseContext) {
+ EPackage rootPackage = null;
+ // warnigns and errors computed not from the CST but from the AST
+ Builder builder = new Builder();
+ NullProgressMonitor npm = new NullProgressMonitor();
+ ResourceSet resourceSet = new ResourceSetImpl();
+ URI uri = URI.createPlatformResourceURI("dummy");
+ Resource resource = resourceSet.createResource(uri);
+ try {
+ builder.build(parseContext, resource, npm);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (!parseContext.hasErrors()) {
+ Connector connector = new Connector(builder);
+ connector.connect(parseContext, resource, npm);
+ rootPackage = (EPackage) resource.getContents().get(0);
+ if (rootPackage != null) {
+ // invoke EcoreValidator
+ Diagnostician diagnostician = new Diagnostician();
+ final Diagnostic diagnostic = diagnostician.validate(rootPackage);
+ if (diagnostic.getSeverity() == Diagnostic.OK) {
+ return rootPackage;
+ }
+ /*
+ * A tutorial on markers:
+ *
+ * http://www.eclipse.org/articles/Article-Mark%20My%20Words/mark-my-words.html
+ *
+ */
+
+ CompUnit compUnit = (CompUnit) parseContext.getParseRoot();
+ for (Diagnostic childDiagnostic : diagnostic.getChildren()) {
+ Set<ASTNode> problemNodes = new HashSet<ASTNode>();
+ String dMsg = childDiagnostic.getMessage();
+ if (childDiagnostic.getData().size() > 0) {
+ Object primarySourceOfProblem = childDiagnostic.getData().get(0);
+ if (primarySourceOfProblem != null && primarySourceOfProblem instanceof EObject) {
+ Set<ASTNode> cstUses = compUnit.getEcoreDecl2CstUse().get((EObject) primarySourceOfProblem);
+ problemNodes.addAll(cstUses);
+ if (problemNodes.size() == 0) {
+ problemNodes.add(compUnit.getPackageDecl());
+ }
+ }
+ }
+ for (ASTNode problemNode : problemNodes) {
+ ParseMessage pMsg = new EmfaticSemanticWarning.EcoreValidatorDiagnostic(problemNode, dMsg);
+ parseContext.addParseMessage(pMsg);
+ }
+ }
+ }
+ }
+ return rootPackage;
+ }
+
+ private CompUnit parseCompUnit(EmfaticParser parser, ParseContext parseContext) {
+ try {
+ CompUnit compUnit = parser.compUnit();
+ parseContext.setParseRoot(compUnit);
+ return compUnit;
+ } catch (ParseException ex) {
+ ParseError parseError;
+ Token token = ex.currentToken;
+ if (token instanceof ExtToken) {
+ ExtToken extToken = (ExtToken) token;
+ int offset = extToken.tokenOffset;
+ String tokenText = token.image;
+ int length = (tokenText == null) ? 0 : tokenText.length();
+ parseError = new ParseError(ex.getMessage(), offset, length);
+ }
+ else {
+ parseError = new ParseError(ex.getMessage(), 1);
+ }
+ parseContext.addParseMessage(parseError);
+ }
+ catch (TokenMgrError ex) {
+ ParseError parseError = new ParseError(ex.getMessage(), 1);
+ parseContext.addParseMessage(parseError);
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParserTokenManager.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParserTokenManager.java
new file mode 100644
index 0000000..cb9fea8
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/EmfaticParserTokenManager.java
@@ -0,0 +1,1055 @@
+/* Generated By:JavaCC: Do not edit this line. EmfaticParserTokenManager.java */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public class EmfaticParserTokenManager implements EmfaticParserConstants
+{
+ public java.io.PrintStream debugStream = System.out;
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private final int jjStopStringLiteralDfa_0(int pos, long active0)
+{
+ switch (pos)
+ {
+ case 0:
+ if ((active0 & 0x8L) != 0L)
+ return 0;
+ if ((active0 & 0x1ffffffc0L) != 0L)
+ {
+ jjmatchedKind = 71;
+ return 26;
+ }
+ return -1;
+ case 1:
+ if ((active0 & 0x9000000L) != 0L)
+ return 26;
+ if ((active0 & 0x1f6ffffc0L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 1;
+ return 26;
+ }
+ return -1;
+ case 2:
+ if ((active0 & 0xc000L) != 0L)
+ return 26;
+ if ((active0 & 0x1f6ff3fc0L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 2;
+ return 26;
+ }
+ return -1;
+ case 3:
+ if ((active0 & 0x52002000L) != 0L)
+ return 26;
+ if ((active0 & 0x1a4ff1fc0L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 3;
+ return 26;
+ }
+ return -1;
+ case 4:
+ if ((active0 & 0x4001080L) != 0L)
+ return 26;
+ if ((active0 & 0x1a0ff0f40L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 4;
+ return 26;
+ }
+ return -1;
+ case 5:
+ if ((active0 & 0x100200100L) != 0L)
+ return 26;
+ if ((active0 & 0xa0df0e40L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 5;
+ return 26;
+ }
+ return -1;
+ case 6:
+ if ((active0 & 0xa00f0600L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 6;
+ return 26;
+ }
+ if ((active0 & 0xd00840L) != 0L)
+ return 26;
+ return -1;
+ case 7:
+ if ((active0 & 0xa0030200L) != 0L)
+ return 26;
+ if ((active0 & 0xc0400L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 7;
+ return 26;
+ }
+ return -1;
+ case 8:
+ if ((active0 & 0x40400L) != 0L)
+ return 26;
+ if ((active0 & 0x80000L) != 0L)
+ {
+ jjmatchedKind = 71;
+ jjmatchedPos = 8;
+ return 26;
+ }
+ return -1;
+ default :
+ return -1;
+ }
+}
+private final int jjStartNfa_0(int pos, long active0)
+{
+ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
+}
+private final int jjStopAtPos(int pos, int kind)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ return pos + 1;
+}
+private final int jjStartNfaWithStates_0(int pos, int kind, int state)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return pos + 1; }
+ return jjMoveNfa_0(state, pos + 1);
+}
+private final int jjMoveStringLiteralDfa0_0()
+{
+ switch(curChar)
+ {
+ case 33:
+ return jjStopAtPos(0, 52);
+ case 35:
+ return jjStopAtPos(0, 54);
+ case 36:
+ return jjStopAtPos(0, 53);
+ case 38:
+ return jjStopAtPos(0, 60);
+ case 40:
+ return jjStopAtPos(0, 41);
+ case 41:
+ return jjStopAtPos(0, 42);
+ case 42:
+ return jjStopAtPos(0, 47);
+ case 43:
+ return jjStopAtPos(0, 48);
+ case 44:
+ return jjStopAtPos(0, 44);
+ case 45:
+ jjmatchedKind = 49;
+ return jjMoveStringLiteralDfa1_0(0x200000000000000L);
+ case 46:
+ jjmatchedKind = 43;
+ return jjMoveStringLiteralDfa1_0(0x100000000000000L);
+ case 47:
+ return jjMoveStringLiteralDfa1_0(0x8L);
+ case 58:
+ return jjStopAtPos(0, 45);
+ case 59:
+ return jjStopAtPos(0, 46);
+ case 60:
+ jjmatchedKind = 61;
+ return jjMoveStringLiteralDfa1_0(0x800000000000000L);
+ case 61:
+ return jjStopAtPos(0, 50);
+ case 62:
+ jjmatchedKind = 62;
+ return jjMoveStringLiteralDfa1_0(0x400000000000000L);
+ case 63:
+ return jjStopAtPos(0, 51);
+ case 64:
+ return jjStopAtPos(0, 55);
+ case 91:
+ return jjStopAtPos(0, 39);
+ case 93:
+ return jjStopAtPos(0, 40);
+ case 97:
+ return jjMoveStringLiteralDfa1_0(0x2200L);
+ case 99:
+ return jjMoveStringLiteralDfa1_0(0x80L);
+ case 100:
+ return jjMoveStringLiteralDfa1_0(0x20100000L);
+ case 101:
+ return jjMoveStringLiteralDfa1_0(0x40000800L);
+ case 102:
+ return jjMoveStringLiteralDfa1_0(0x4000000L);
+ case 105:
+ return jjMoveStringLiteralDfa1_0(0x1000500L);
+ case 109:
+ return jjMoveStringLiteralDfa1_0(0x80000000L);
+ case 111:
+ return jjMoveStringLiteralDfa1_0(0x8400000L);
+ case 112:
+ return jjMoveStringLiteralDfa1_0(0x40L);
+ case 114:
+ return jjMoveStringLiteralDfa1_0(0x814000L);
+ case 115:
+ return jjMoveStringLiteralDfa1_0(0x1000L);
+ case 116:
+ return jjMoveStringLiteralDfa1_0(0x102040000L);
+ case 117:
+ return jjMoveStringLiteralDfa1_0(0x280000L);
+ case 118:
+ return jjMoveStringLiteralDfa1_0(0x10028000L);
+ case 123:
+ return jjStopAtPos(0, 37);
+ case 125:
+ return jjStopAtPos(0, 38);
+ default :
+ return jjMoveNfa_0(5, 0);
+ }
+}
+private final int jjMoveStringLiteralDfa1_0(long active0)
+{
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(0, active0);
+ return 1;
+ }
+ switch(curChar)
+ {
+ case 42:
+ if ((active0 & 0x8L) != 0L)
+ return jjStopAtPos(1, 3);
+ break;
+ case 46:
+ if ((active0 & 0x100000000000000L) != 0L)
+ return jjStopAtPos(1, 56);
+ break;
+ case 60:
+ if ((active0 & 0x400000000000000L) != 0L)
+ return jjStopAtPos(1, 58);
+ break;
+ case 62:
+ if ((active0 & 0x200000000000000L) != 0L)
+ return jjStopAtPos(1, 57);
+ else if ((active0 & 0x800000000000000L) != 0L)
+ return jjStopAtPos(1, 59);
+ break;
+ case 97:
+ return jjMoveStringLiteralDfa2_0(active0, 0xa4008040L);
+ case 98:
+ return jjMoveStringLiteralDfa2_0(active0, 0x200L);
+ case 100:
+ if ((active0 & 0x1000000L) != 0L)
+ return jjStartNfaWithStates_0(1, 24, 26);
+ break;
+ case 101:
+ return jjMoveStringLiteralDfa2_0(active0, 0x914000L);
+ case 104:
+ return jjMoveStringLiteralDfa2_0(active0, 0x100000000L);
+ case 108:
+ return jjMoveStringLiteralDfa2_0(active0, 0x80L);
+ case 109:
+ return jjMoveStringLiteralDfa2_0(active0, 0x100L);
+ case 110:
+ return jjMoveStringLiteralDfa2_0(active0, 0x40280400L);
+ case 111:
+ return jjMoveStringLiteralDfa2_0(active0, 0x10020000L);
+ case 112:
+ if ((active0 & 0x8000000L) != 0L)
+ return jjStartNfaWithStates_0(1, 27, 26);
+ break;
+ case 114:
+ return jjMoveStringLiteralDfa2_0(active0, 0x2440000L);
+ case 116:
+ return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
+ case 117:
+ return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
+ case 120:
+ return jjMoveStringLiteralDfa2_0(active0, 0x800L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(0, active0);
+}
+private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(0, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(1, active0);
+ return 2;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa3_0(active0, 0x50080L);
+ case 99:
+ return jjMoveStringLiteralDfa3_0(active0, 0x40L);
+ case 100:
+ return jjMoveStringLiteralDfa3_0(active0, 0x400000L);
+ case 102:
+ if ((active0 & 0x4000L) != 0L)
+ return jjStartNfaWithStates_0(2, 14, 26);
+ break;
+ case 105:
+ return jjMoveStringLiteralDfa3_0(active0, 0x10200000L);
+ case 108:
+ if ((active0 & 0x8000L) != 0L)
+ return jjStartNfaWithStates_0(2, 15, 26);
+ return jjMoveStringLiteralDfa3_0(active0, 0x4020000L);
+ case 112:
+ return jjMoveStringLiteralDfa3_0(active0, 0x80001100L);
+ case 114:
+ return jjMoveStringLiteralDfa3_0(active0, 0x100100000L);
+ case 115:
+ return jjMoveStringLiteralDfa3_0(active0, 0x880200L);
+ case 116:
+ return jjMoveStringLiteralDfa3_0(active0, 0x20002c00L);
+ case 117:
+ return jjMoveStringLiteralDfa3_0(active0, 0x42000000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(1, active0);
+}
+private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(1, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(2, active0);
+ return 3;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa4_0(active0, 0x20020000L);
+ case 100:
+ if ((active0 & 0x10000000L) != 0L)
+ return jjStartNfaWithStates_0(3, 28, 26);
+ return jjMoveStringLiteralDfa4_0(active0, 0x10000L);
+ case 101:
+ if ((active0 & 0x2000000L) != 0L)
+ return jjStartNfaWithStates_0(3, 25, 26);
+ return jjMoveStringLiteralDfa4_0(active0, 0x80481c00L);
+ case 105:
+ return jjMoveStringLiteralDfa4_0(active0, 0x100000L);
+ case 107:
+ return jjMoveStringLiteralDfa4_0(active0, 0x40L);
+ case 109:
+ if ((active0 & 0x40000000L) != 0L)
+ return jjStartNfaWithStates_0(3, 30, 26);
+ break;
+ case 110:
+ return jjMoveStringLiteralDfa4_0(active0, 0x40000L);
+ case 111:
+ return jjMoveStringLiteralDfa4_0(active0, 0x100800100L);
+ case 113:
+ return jjMoveStringLiteralDfa4_0(active0, 0x200000L);
+ case 114:
+ if ((active0 & 0x2000L) != 0L)
+ return jjStartNfaWithStates_0(3, 13, 26);
+ break;
+ case 115:
+ return jjMoveStringLiteralDfa4_0(active0, 0x4000080L);
+ case 116:
+ return jjMoveStringLiteralDfa4_0(active0, 0x200L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(2, active0);
+}
+private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(2, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(3, active0);
+ return 4;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa5_0(active0, 0x40L);
+ case 101:
+ if ((active0 & 0x4000000L) != 0L)
+ return jjStartNfaWithStates_0(4, 26, 26);
+ break;
+ case 108:
+ return jjMoveStringLiteralDfa5_0(active0, 0x800000L);
+ case 110:
+ return jjMoveStringLiteralDfa5_0(active0, 0x80000800L);
+ case 111:
+ return jjMoveStringLiteralDfa5_0(active0, 0x10000L);
+ case 114:
+ if ((active0 & 0x1000L) != 0L)
+ return jjStartNfaWithStates_0(4, 12, 26);
+ return jjMoveStringLiteralDfa5_0(active0, 0x400700L);
+ case 115:
+ if ((active0 & 0x80L) != 0L)
+ return jjStartNfaWithStates_0(4, 7, 26);
+ return jjMoveStringLiteralDfa5_0(active0, 0x40000L);
+ case 116:
+ return jjMoveStringLiteralDfa5_0(active0, 0x200a0000L);
+ case 117:
+ return jjMoveStringLiteralDfa5_0(active0, 0x200000L);
+ case 118:
+ return jjMoveStringLiteralDfa5_0(active0, 0x100000L);
+ case 119:
+ return jjMoveStringLiteralDfa5_0(active0, 0x100000000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(3, active0);
+}
+private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(3, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(4, active0);
+ return 5;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa6_0(active0, 0x200L);
+ case 100:
+ return jjMoveStringLiteralDfa6_0(active0, 0x800L);
+ case 101:
+ if ((active0 & 0x200000L) != 0L)
+ return jjStartNfaWithStates_0(5, 21, 26);
+ return jjMoveStringLiteralDfa6_0(active0, 0x500000L);
+ case 102:
+ return jjMoveStringLiteralDfa6_0(active0, 0x400L);
+ case 103:
+ return jjMoveStringLiteralDfa6_0(active0, 0x40L);
+ case 105:
+ return jjMoveStringLiteralDfa6_0(active0, 0x60000L);
+ case 110:
+ return jjMoveStringLiteralDfa6_0(active0, 0x10000L);
+ case 115:
+ if ((active0 & 0x100000000L) != 0L)
+ return jjStartNfaWithStates_0(5, 32, 26);
+ break;
+ case 116:
+ if ((active0 & 0x100L) != 0L)
+ return jjStartNfaWithStates_0(5, 8, 26);
+ return jjMoveStringLiteralDfa6_0(active0, 0x80080000L);
+ case 118:
+ return jjMoveStringLiteralDfa6_0(active0, 0x800000L);
+ case 121:
+ return jjMoveStringLiteralDfa6_0(active0, 0x20000000L);
+ default :
+ break;
+ }
+ return jjStartNfa_0(4, active0);
+}
+private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(4, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(5, active0);
+ return 6;
+ }
+ switch(curChar)
+ {
+ case 97:
+ return jjMoveStringLiteralDfa7_0(active0, 0x80400L);
+ case 99:
+ return jjMoveStringLiteralDfa7_0(active0, 0x200L);
+ case 100:
+ if ((active0 & 0x100000L) != 0L)
+ return jjStartNfaWithStates_0(6, 20, 26);
+ else if ((active0 & 0x400000L) != 0L)
+ return jjStartNfaWithStates_0(6, 22, 26);
+ break;
+ case 101:
+ if ((active0 & 0x40L) != 0L)
+ return jjStartNfaWithStates_0(6, 6, 26);
+ else if ((active0 & 0x800000L) != 0L)
+ return jjStartNfaWithStates_0(6, 23, 26);
+ return jjMoveStringLiteralDfa7_0(active0, 0x40000L);
+ case 108:
+ return jjMoveStringLiteralDfa7_0(active0, 0x30000L);
+ case 112:
+ return jjMoveStringLiteralDfa7_0(active0, 0x20000000L);
+ case 114:
+ return jjMoveStringLiteralDfa7_0(active0, 0x80000000L);
+ case 115:
+ if ((active0 & 0x800L) != 0L)
+ return jjStartNfaWithStates_0(6, 11, 26);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(5, active0);
+}
+private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(5, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(6, active0);
+ return 7;
+ }
+ switch(curChar)
+ {
+ case 98:
+ return jjMoveStringLiteralDfa8_0(active0, 0x80000L);
+ case 99:
+ return jjMoveStringLiteralDfa8_0(active0, 0x400L);
+ case 101:
+ if ((active0 & 0x20000L) != 0L)
+ return jjStartNfaWithStates_0(7, 17, 26);
+ else if ((active0 & 0x20000000L) != 0L)
+ return jjStartNfaWithStates_0(7, 29, 26);
+ break;
+ case 110:
+ return jjMoveStringLiteralDfa8_0(active0, 0x40000L);
+ case 116:
+ if ((active0 & 0x200L) != 0L)
+ return jjStartNfaWithStates_0(7, 9, 26);
+ break;
+ case 121:
+ if ((active0 & 0x10000L) != 0L)
+ return jjStartNfaWithStates_0(7, 16, 26);
+ else if ((active0 & 0x80000000L) != 0L)
+ return jjStartNfaWithStates_0(7, 31, 26);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(6, active0);
+}
+private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(6, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(7, active0);
+ return 8;
+ }
+ switch(curChar)
+ {
+ case 101:
+ if ((active0 & 0x400L) != 0L)
+ return jjStartNfaWithStates_0(8, 10, 26);
+ break;
+ case 108:
+ return jjMoveStringLiteralDfa9_0(active0, 0x80000L);
+ case 116:
+ if ((active0 & 0x40000L) != 0L)
+ return jjStartNfaWithStates_0(8, 18, 26);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(7, active0);
+}
+private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjStartNfa_0(7, old0);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ jjStopStringLiteralDfa_0(8, active0);
+ return 9;
+ }
+ switch(curChar)
+ {
+ case 101:
+ if ((active0 & 0x80000L) != 0L)
+ return jjStartNfaWithStates_0(9, 19, 26);
+ break;
+ default :
+ break;
+ }
+ return jjStartNfa_0(8, active0);
+}
+private final void jjCheckNAdd(int state)
+{
+ if (jjrounds[state] != jjround)
+ {
+ jjstateSet[jjnewStateCnt++] = state;
+ jjrounds[state] = jjround;
+ }
+}
+private final void jjAddStates(int start, int end)
+{
+ do {
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+ } while (start++ != end);
+}
+private final void jjCheckNAddTwoStates(int state1, int state2)
+{
+ jjCheckNAdd(state1);
+ jjCheckNAdd(state2);
+}
+private final void jjCheckNAddStates(int start, int end)
+{
+ do {
+ jjCheckNAdd(jjnextStates[start]);
+ } while (start++ != end);
+}
+private final void jjCheckNAddStates(int start)
+{
+ jjCheckNAdd(jjnextStates[start]);
+ jjCheckNAdd(jjnextStates[start + 1]);
+}
+static final long[] jjbitVec0 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+private final int jjMoveNfa_0(int startState, int curPos)
+{
+ int[] nextStates;
+ int startsAt = 0;
+ jjnewStateCnt = 27;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int j, kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 5:
+ if ((0x3ff000000000000L & l) != 0L)
+ {
+ if (kind > 67)
+ kind = 67;
+ jjCheckNAdd(23);
+ }
+ else if ((0x100003600L & l) != 0L)
+ {
+ if (kind > 2)
+ kind = 2;
+ jjCheckNAdd(6);
+ }
+ else if (curChar == 39)
+ jjAddStates(0, 1);
+ else if (curChar == 34)
+ jjCheckNAddStates(2, 4);
+ else if (curChar == 47)
+ jjstateSet[jjnewStateCnt++] = 0;
+ break;
+ case 0:
+ if (curChar == 47)
+ jjCheckNAddStates(5, 7);
+ break;
+ case 1:
+ if ((0xffffffffffffdbffL & l) != 0L)
+ jjCheckNAddStates(5, 7);
+ break;
+ case 2:
+ case 3:
+ if (curChar == 10 && kind > 1)
+ kind = 1;
+ break;
+ case 4:
+ if (curChar == 13)
+ jjstateSet[jjnewStateCnt++] = 3;
+ break;
+ case 6:
+ if ((0x100003600L & l) == 0L)
+ break;
+ if (kind > 2)
+ kind = 2;
+ jjCheckNAdd(6);
+ break;
+ case 7:
+ if (curChar == 34)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 9:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 10:
+ if ((0xfffffffbffffffffL & l) != 0L)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 11:
+ if (curChar == 34 && kind > 63)
+ kind = 63;
+ break;
+ case 12:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 13;
+ break;
+ case 13:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 14;
+ break;
+ case 14:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 15:
+ if (curChar == 39)
+ jjAddStates(0, 1);
+ break;
+ case 17:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAdd(18);
+ break;
+ case 18:
+ if (curChar == 39 && kind > 64)
+ kind = 64;
+ break;
+ case 19:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 20;
+ break;
+ case 20:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjstateSet[jjnewStateCnt++] = 21;
+ break;
+ case 21:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAdd(18);
+ break;
+ case 22:
+ if ((0xffffff7fffffffffL & l) != 0L)
+ jjCheckNAdd(18);
+ break;
+ case 23:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 67)
+ kind = 67;
+ jjCheckNAdd(23);
+ break;
+ case 26:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 71)
+ kind = 71;
+ jjstateSet[jjnewStateCnt++] = 26;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 5:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ {
+ if (kind > 71)
+ kind = 71;
+ jjCheckNAdd(26);
+ }
+ else if (curChar == 126)
+ jjstateSet[jjnewStateCnt++] = 25;
+ break;
+ case 1:
+ jjAddStates(5, 7);
+ break;
+ case 8:
+ if (curChar == 92)
+ jjAddStates(8, 9);
+ break;
+ case 9:
+ if ((0x14404010000000L & l) != 0L)
+ jjCheckNAddStates(2, 4);
+ break;
+ case 10:
+ jjCheckNAddStates(2, 4);
+ break;
+ case 16:
+ if (curChar == 92)
+ jjAddStates(10, 11);
+ break;
+ case 17:
+ if ((0x14404010000000L & l) != 0L)
+ jjCheckNAdd(18);
+ break;
+ case 22:
+ jjCheckNAdd(18);
+ break;
+ case 24:
+ if (curChar == 126)
+ jjstateSet[jjnewStateCnt++] = 25;
+ break;
+ case 25:
+ case 26:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 71)
+ kind = 71;
+ jjCheckNAdd(26);
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ MatchLoop: do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 1:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjAddStates(5, 7);
+ break;
+ case 10:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjAddStates(2, 4);
+ break;
+ case 22:
+ if ((jjbitVec0[i2] & l2) != 0L)
+ jjstateSet[jjnewStateCnt++] = 18;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 27 - (jjnewStateCnt = startsAt)))
+ return curPos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return curPos; }
+ }
+}
+private final int jjMoveStringLiteralDfa0_1()
+{
+ switch(curChar)
+ {
+ case 42:
+ return jjMoveStringLiteralDfa1_1(0x10L);
+ default :
+ return 1;
+ }
+}
+private final int jjMoveStringLiteralDfa1_1(long active0)
+{
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return 1;
+ }
+ switch(curChar)
+ {
+ case 47:
+ if ((active0 & 0x10L) != 0L)
+ return jjStopAtPos(1, 4);
+ break;
+ default :
+ return 2;
+ }
+ return 2;
+}
+static final int[] jjnextStates = {
+ 16, 22, 8, 10, 11, 1, 2, 4, 9, 12, 17, 19,
+};
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, "\160\141\143\153\141\147\145",
+"\143\154\141\163\163", "\151\155\160\157\162\164", "\141\142\163\164\162\141\143\164",
+"\151\156\164\145\162\146\141\143\145", "\145\170\164\145\156\144\163", "\163\165\160\145\162", "\141\164\164\162",
+"\162\145\146", "\166\141\154", "\162\145\141\144\157\156\154\171",
+"\166\157\154\141\164\151\154\145", "\164\162\141\156\163\151\145\156\164",
+"\165\156\163\145\164\164\141\142\154\145", "\144\145\162\151\166\145\144", "\165\156\151\161\165\145",
+"\157\162\144\145\162\145\144", "\162\145\163\157\154\166\145", "\151\144", "\164\162\165\145",
+"\146\141\154\163\145", "\157\160", "\166\157\151\144", "\144\141\164\141\164\171\160\145",
+"\145\156\165\155", "\155\141\160\145\156\164\162\171", "\164\150\162\157\167\163", null, null,
+null, null, "\173", "\175", "\133", "\135", "\50", "\51", "\56", "\54", "\72",
+"\73", "\52", "\53", "\55", "\75", "\77", "\41", "\44", "\43", "\100", "\56\56",
+"\55\76", "\76\74", "\74\76", "\46", "\74", "\76", null, null, null, null, null, null,
+null, null, null, };
+public static final String[] lexStateNames = {
+ "DEFAULT",
+ "WithinComment",
+};
+public static final int[] jjnewLexState = {
+ -1, -1, -1, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+};
+static final long[] jjtoToken = {
+ 0xffffffe1ffffffc1L, 0x89L,
+};
+static final long[] jjtoSkip = {
+ 0x1eL, 0x0L,
+};
+static final long[] jjtoMore = {
+ 0x20L, 0x0L,
+};
+protected SimpleCharStream input_stream;
+private final int[] jjrounds = new int[27];
+private final int[] jjstateSet = new int[54];
+protected char curChar;
+public EmfaticParserTokenManager(SimpleCharStream stream){
+ if (SimpleCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+ input_stream = stream;
+}
+public EmfaticParserTokenManager(SimpleCharStream stream, int lexState){
+ this(stream);
+ SwitchTo(lexState);
+}
+public void ReInit(SimpleCharStream stream)
+{
+ jjmatchedPos = jjnewStateCnt = 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+}
+private final void ReInitRounds()
+{
+ int i;
+ jjround = 0x80000001;
+ for (i = 27; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+}
+public void ReInit(SimpleCharStream stream, int lexState)
+{
+ ReInit(stream);
+ SwitchTo(lexState);
+}
+public void SwitchTo(int lexState)
+{
+ if (lexState >= 2 || lexState < 0)
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+ else
+ curLexState = lexState;
+}
+
+protected Token jjFillToken()
+{
+ Token t = Token.newToken(jjmatchedKind);
+ t.kind = jjmatchedKind;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ t.image = (im == null) ? input_stream.GetImage() : im;
+ t.beginLine = input_stream.getBeginLine();
+ t.beginColumn = input_stream.getBeginColumn();
+ t.endLine = input_stream.getEndLine();
+ t.endColumn = input_stream.getEndColumn();
+ return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+public Token getNextToken()
+{
+ int kind;
+ Token specialToken = null;
+ Token matchedToken;
+ int curPos = 0;
+
+ EOFLoop :
+ for (;;)
+ {
+ try
+ {
+ curChar = input_stream.BeginToken();
+ }
+ catch(java.io.IOException e)
+ {
+ jjmatchedKind = 0;
+ matchedToken = jjFillToken();
+ return matchedToken;
+ }
+
+ for (;;)
+ {
+ switch(curLexState)
+ {
+ case 0:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_0();
+ break;
+ case 1:
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_1();
+ if (jjmatchedPos == 0 && jjmatchedKind > 5)
+ {
+ jjmatchedKind = 5;
+ }
+ break;
+ }
+ if (jjmatchedKind != 0x7fffffff)
+ {
+ if (jjmatchedPos + 1 < curPos)
+ input_stream.backup(curPos - jjmatchedPos - 1);
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ matchedToken = jjFillToken();
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ return matchedToken;
+ }
+ else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ continue EOFLoop;
+ }
+ if (jjnewLexState[jjmatchedKind] != -1)
+ curLexState = jjnewLexState[jjmatchedKind];
+ curPos = 0;
+ jjmatchedKind = 0x7fffffff;
+ try {
+ curChar = input_stream.readChar();
+ continue;
+ }
+ catch (java.io.IOException e1) { }
+ }
+ int error_line = input_stream.getEndLine();
+ int error_column = input_stream.getEndColumn();
+ String error_after = null;
+ boolean EOFSeen = false;
+ try { input_stream.readChar(); input_stream.backup(1); }
+ catch (java.io.IOException e1) {
+ EOFSeen = true;
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ if (curChar == '\n' || curChar == '\r') {
+ error_line++;
+ error_column = 0;
+ }
+ else
+ error_column++;
+ }
+ if (!EOFSeen) {
+ input_stream.backup(1);
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ }
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+ }
+ }
+}
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ExtEmfaticParserTokenManager.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ExtEmfaticParserTokenManager.java
new file mode 100644
index 0000000..66a219f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ExtEmfaticParserTokenManager.java
@@ -0,0 +1,29 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public class ExtEmfaticParserTokenManager extends EmfaticParserTokenManager {
+
+ private final ExtSimpleCharStream _stream;
+
+ public ExtEmfaticParserTokenManager(ExtSimpleCharStream stream) {
+ super(stream);
+ _stream = stream;
+ }
+
+ protected Token jjFillToken() {
+ ExtToken t = new ExtToken();
+ t.kind = jjmatchedKind;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ t.image = (im == null) ? input_stream.GetImage() : im;
+ t.beginLine = input_stream.getBeginLine();
+ t.beginColumn = input_stream.getBeginColumn();
+ t.endLine = input_stream.getEndLine();
+ t.endColumn = input_stream.getEndColumn();
+ t.tokenOffset = _stream.tokenBeginOffset;
+ return t;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ExtSimpleCharStream.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ExtSimpleCharStream.java
new file mode 100644
index 0000000..c7d94a2
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ExtSimpleCharStream.java
@@ -0,0 +1,41 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public class ExtSimpleCharStream extends SimpleCharStream {
+
+ /**
+ * The current character position in the input stream.
+ */
+ public int inputOffset = -1;
+
+ /**
+ * The start position of the current token in the input stream.
+ */
+ public int tokenBeginOffset;
+
+
+ public ExtSimpleCharStream(java.io.Reader dstream) {
+ super(dstream);
+ }
+
+ public char BeginToken() throws java.io.IOException {
+ tokenBegin = -1;
+ tokenBeginOffset = -1;
+
+ char c = readChar();
+
+ tokenBegin = bufpos;
+ tokenBeginOffset = inputOffset;
+
+ return c;
+ }
+
+ protected void UpdateLineColumn(char c) {
+ inputOffset++;
+ super.UpdateLineColumn(c);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ExtToken.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ExtToken.java
new file mode 100644
index 0000000..3eb547d
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ExtToken.java
@@ -0,0 +1,14 @@
+/**
+ * @generated by Gymnast from Emfatic.ast on 09.02.2007 13:03:05
+ */
+
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public class ExtToken extends Token {
+
+ /**
+ * The start position of the token in the input stream.
+ */
+ public int tokenOffset;
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ParseException.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ParseException.java
new file mode 100644
index 0000000..8a43495
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/ParseException.java
@@ -0,0 +1,192 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+/**
+ * This exception is thrown when parse errors are encountered.
+ * You can explicitly create objects of this exception type by
+ * calling the method generateParseException in the generated
+ * parser.
+ *
+ * You can modify this class to customize your error reporting
+ * mechanisms so long as you retain the public fields.
+ */
+public class ParseException extends Exception {
+
+ /**
+ * This constructor is used by the method "generateParseException"
+ * in the generated parser. Calling this constructor generates
+ * a new object of this type with the fields "currentToken",
+ * "expectedTokenSequences", and "tokenImage" set. The boolean
+ * flag "specialConstructor" is also set to true to indicate that
+ * this constructor was used to create this object.
+ * This constructor calls its super class with the empty string
+ * to force the "toString" method of parent class "Throwable" to
+ * print the error message in the form:
+ * ParseException: <result of getMessage>
+ */
+ public ParseException(Token currentTokenVal,
+ int[][] expectedTokenSequencesVal,
+ String[] tokenImageVal
+ )
+ {
+ super("");
+ specialConstructor = true;
+ currentToken = currentTokenVal;
+ expectedTokenSequences = expectedTokenSequencesVal;
+ tokenImage = tokenImageVal;
+ }
+
+ /**
+ * The following constructors are for use by you for whatever
+ * purpose you can think of. Constructing the exception in this
+ * manner makes the exception behave in the normal way - i.e., as
+ * documented in the class "Throwable". The fields "errorToken",
+ * "expectedTokenSequences", and "tokenImage" do not contain
+ * relevant information. The JavaCC generated code does not use
+ * these constructors.
+ */
+
+ public ParseException() {
+ super();
+ specialConstructor = false;
+ }
+
+ public ParseException(String message) {
+ super(message);
+ specialConstructor = false;
+ }
+
+ /**
+ * This variable determines which constructor was used to create
+ * this object and thereby affects the semantics of the
+ * "getMessage" method (see below).
+ */
+ protected boolean specialConstructor;
+
+ /**
+ * This is the last token that has been consumed successfully. If
+ * this object has been created due to a parse error, the token
+ * followng this token will (therefore) be the first error token.
+ */
+ public Token currentToken;
+
+ /**
+ * Each entry in this array is an array of integers. Each array
+ * of integers represents a sequence of tokens (by their ordinal
+ * values) that is expected at this point of the parse.
+ */
+ public int[][] expectedTokenSequences;
+
+ /**
+ * This is a reference to the "tokenImage" array of the generated
+ * parser within which the parse error occurred. This array is
+ * defined in the generated ...Constants interface.
+ */
+ public String[] tokenImage;
+
+ /**
+ * This method has the standard behavior when this object has been
+ * created using the standard constructors. Otherwise, it uses
+ * "currentToken" and "expectedTokenSequences" to generate a parse
+ * error message and returns it. If this object has been created
+ * due to a parse error, and you do not catch it (it gets thrown
+ * from the parser), then this method is called during the printing
+ * of the final stack trace, and hence the correct error message
+ * gets displayed.
+ */
+ public String getMessage() {
+ if (!specialConstructor) {
+ return super.getMessage();
+ }
+ StringBuffer expected = new StringBuffer();
+ int maxSize = 0;
+ for (int i = 0; i < expectedTokenSequences.length; i++) {
+ if (maxSize < expectedTokenSequences[i].length) {
+ maxSize = expectedTokenSequences[i].length;
+ }
+ for (int j = 0; j < expectedTokenSequences[i].length; j++) {
+ expected.append(tokenImage[expectedTokenSequences[i][j]]).append(" ");
+ }
+ if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
+ expected.append("...");
+ }
+ expected.append(eol).append(" ");
+ }
+ String retval = "Encountered \"";
+ Token tok = currentToken.next;
+ for (int i = 0; i < maxSize; i++) {
+ if (i != 0) retval += " ";
+ if (tok.kind == 0) {
+ retval += tokenImage[0];
+ break;
+ }
+ retval += add_escapes(tok.image);
+ tok = tok.next;
+ }
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+ retval += "." + eol;
+ if (expectedTokenSequences.length == 1) {
+ retval += "Was expecting:" + eol + " ";
+ } else {
+ retval += "Was expecting one of:" + eol + " ";
+ }
+ retval += expected.toString();
+ return retval;
+ }
+
+ /**
+ * The end of line string for this machine.
+ */
+ protected String eol = System.getProperty("line.separator", "\n");
+
+ /**
+ * Used to convert raw characters to their escaped version
+ * when these raw version cannot be used as part of an ASCII
+ * string literal.
+ */
+ protected String add_escapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/SimpleCharStream.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/SimpleCharStream.java
new file mode 100644
index 0000000..1ae5816
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/SimpleCharStream.java
@@ -0,0 +1,439 @@
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.0 */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+/**
+ * An implementation of interface CharStream, where the stream is assumed to
+ * contain only ASCII characters (without unicode processing).
+ */
+
+public class SimpleCharStream
+{
+ public static final boolean staticFlag = false;
+ int bufsize;
+ int available;
+ int tokenBegin;
+ public int bufpos = -1;
+ protected int bufline[];
+ protected int bufcolumn[];
+
+ protected int column = 0;
+ protected int line = 1;
+
+ protected boolean prevCharIsCR = false;
+ protected boolean prevCharIsLF = false;
+
+ protected java.io.Reader inputStream;
+
+ protected char[] buffer;
+ protected int maxNextCharInd = 0;
+ protected int inBuf = 0;
+ protected int tabSize = 8;
+
+ protected void setTabSize(int i) { tabSize = i; }
+ protected int getTabSize(int i) { return tabSize; }
+
+
+ protected void ExpandBuff(boolean wrapAround)
+ {
+ char[] newbuffer = new char[bufsize + 2048];
+ int newbufline[] = new int[bufsize + 2048];
+ int newbufcolumn[] = new int[bufsize + 2048];
+
+ try
+ {
+ if (wrapAround)
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ System.arraycopy(buffer, 0, newbuffer,
+ bufsize - tokenBegin, bufpos);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+ }
+ else
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ buffer = newbuffer;
+
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ bufline = newbufline;
+
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ bufcolumn = newbufcolumn;
+
+ maxNextCharInd = (bufpos -= tokenBegin);
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new Error(t.getMessage());
+ }
+
+
+ bufsize += 2048;
+ available = bufsize;
+ tokenBegin = 0;
+ }
+
+ protected void FillBuff() throws java.io.IOException
+ {
+ if (maxNextCharInd == available)
+ {
+ if (available == bufsize)
+ {
+ if (tokenBegin > 2048)
+ {
+ bufpos = maxNextCharInd = 0;
+ available = tokenBegin;
+ }
+ else if (tokenBegin < 0)
+ bufpos = maxNextCharInd = 0;
+ else
+ ExpandBuff(false);
+ }
+ else if (available > tokenBegin)
+ available = bufsize;
+ else if ((tokenBegin - available) < 2048)
+ ExpandBuff(true);
+ else
+ available = tokenBegin;
+ }
+
+ int i;
+ try {
+ if ((i = inputStream.read(buffer, maxNextCharInd,
+ available - maxNextCharInd)) == -1)
+ {
+ inputStream.close();
+ throw new java.io.IOException();
+ }
+ else
+ maxNextCharInd += i;
+ return;
+ }
+ catch(java.io.IOException e) {
+ --bufpos;
+ backup(0);
+ if (tokenBegin == -1)
+ tokenBegin = bufpos;
+ throw e;
+ }
+ }
+
+ public char BeginToken() throws java.io.IOException
+ {
+ tokenBegin = -1;
+ char c = readChar();
+ tokenBegin = bufpos;
+
+ return c;
+ }
+
+ protected void UpdateLineColumn(char c)
+ {
+ column++;
+
+ if (prevCharIsLF)
+ {
+ prevCharIsLF = false;
+ line += (column = 1);
+ }
+ else if (prevCharIsCR)
+ {
+ prevCharIsCR = false;
+ if (c == '\n')
+ {
+ prevCharIsLF = true;
+ }
+ else
+ line += (column = 1);
+ }
+
+ switch (c)
+ {
+ case '\r' :
+ prevCharIsCR = true;
+ break;
+ case '\n' :
+ prevCharIsLF = true;
+ break;
+ case '\t' :
+ column--;
+ column += (tabSize - (column % tabSize));
+ break;
+ default :
+ break;
+ }
+
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
+ }
+
+ public char readChar() throws java.io.IOException
+ {
+ if (inBuf > 0)
+ {
+ --inBuf;
+
+ if (++bufpos == bufsize)
+ bufpos = 0;
+
+ return buffer[bufpos];
+ }
+
+ if (++bufpos >= maxNextCharInd)
+ FillBuff();
+
+ char c = buffer[bufpos];
+
+ UpdateLineColumn(c);
+ return (c);
+ }
+
+ /**
+ * @deprecated
+ * @see #getEndColumn
+ */
+
+ public int getColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ /**
+ * @deprecated
+ * @see #getEndLine
+ */
+
+ public int getLine() {
+ return bufline[bufpos];
+ }
+
+ public int getEndColumn() {
+ return bufcolumn[bufpos];
+ }
+
+ public int getEndLine() {
+ return bufline[bufpos];
+ }
+
+ public int getBeginColumn() {
+ return bufcolumn[tokenBegin];
+ }
+
+ public int getBeginLine() {
+ return bufline[tokenBegin];
+ }
+
+ public void backup(int amount) {
+
+ inBuf += amount;
+ if ((bufpos -= amount) < 0)
+ bufpos += bufsize;
+ }
+
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+
+ public SimpleCharStream(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.Reader dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ inputStream = dstream;
+ line = startline;
+ column = startcolumn - 1;
+
+ if (buffer == null || buffersize != buffer.length)
+ {
+ available = bufsize = buffersize;
+ buffer = new char[buffersize];
+ bufline = new int[buffersize];
+ bufcolumn = new int[buffersize];
+ }
+ prevCharIsLF = prevCharIsCR = false;
+ tokenBegin = inBuf = maxNextCharInd = 0;
+ bufpos = -1;
+ }
+
+ public void ReInit(java.io.Reader dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+
+ public void ReInit(java.io.Reader dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ this(dstream, startline, startcolumn, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ this(dstream, encoding, 1, 1, 4096);
+ }
+
+ public SimpleCharStream(java.io.InputStream dstream)
+ {
+ this(dstream, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn, int buffersize)
+ {
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ }
+
+ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, 1, 1, 4096);
+ }
+
+ public void ReInit(java.io.InputStream dstream)
+ {
+ ReInit(dstream, 1, 1, 4096);
+ }
+ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
+ int startcolumn) throws java.io.UnsupportedEncodingException
+ {
+ ReInit(dstream, encoding, startline, startcolumn, 4096);
+ }
+ public void ReInit(java.io.InputStream dstream, int startline,
+ int startcolumn)
+ {
+ ReInit(dstream, startline, startcolumn, 4096);
+ }
+ public String GetImage()
+ {
+ if (bufpos >= tokenBegin)
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+ else
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+ new String(buffer, 0, bufpos + 1);
+ }
+
+ public char[] GetSuffix(int len)
+ {
+ char[] ret = new char[len];
+
+ if ((bufpos + 1) >= len)
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+ else
+ {
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+ len - bufpos - 1);
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+ }
+
+ return ret;
+ }
+
+ public void Done()
+ {
+ buffer = null;
+ bufline = null;
+ bufcolumn = null;
+ }
+
+ /**
+ * Method to adjust line and column numbers for the start of a token.
+ */
+ public void adjustBeginLineColumn(int newLine, int newCol)
+ {
+ int start = tokenBegin;
+ int len;
+
+ if (bufpos >= tokenBegin)
+ {
+ len = bufpos - tokenBegin + inBuf + 1;
+ }
+ else
+ {
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+ }
+
+ int i = 0, j = 0, k = 0;
+ int nextColDiff = 0, columnDiff = 0;
+
+ while (i < len &&
+ bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
+ {
+ bufline[j] = newLine;
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+ bufcolumn[j] = newCol + columnDiff;
+ columnDiff = nextColDiff;
+ i++;
+ }
+
+ if (i < len)
+ {
+ bufline[j] = newLine++;
+ bufcolumn[j] = newCol + columnDiff;
+
+ while (i++ < len)
+ {
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ bufline[j] = newLine++;
+ else
+ bufline[j] = newLine;
+ }
+ }
+
+ line = bufline[j];
+ column = bufcolumn[j];
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/Token.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/Token.java
new file mode 100644
index 0000000..c1b2351
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/Token.java
@@ -0,0 +1,81 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+/**
+ * Describes the input token stream.
+ */
+
+public class Token {
+
+ /**
+ * An integer that describes the kind of this token. This numbering
+ * system is determined by JavaCCParser, and a table of these numbers is
+ * stored in the file ...Constants.java.
+ */
+ public int kind;
+
+ /**
+ * beginLine and beginColumn describe the position of the first character
+ * of this token; endLine and endColumn describe the position of the
+ * last character of this token.
+ */
+ public int beginLine, beginColumn, endLine, endColumn;
+
+ /**
+ * The string image of the token.
+ */
+ public String image;
+
+ /**
+ * A reference to the next regular (non-special) token from the input
+ * stream. If this is the last token from the input stream, or if the
+ * token manager has not read tokens beyond this one, this field is
+ * set to null. This is true only if this token is also a regular
+ * token. Otherwise, see below for a description of the contents of
+ * this field.
+ */
+ public Token next;
+
+ /**
+ * This field is used to access special tokens that occur prior to this
+ * token, but after the immediately preceding regular (non-special) token.
+ * If there are no such special tokens, this field is set to null.
+ * When there are more than one such special token, this field refers
+ * to the last of these special tokens, which in turn refers to the next
+ * previous special token through its specialToken field, and so on
+ * until the first special token (whose specialToken field is null).
+ * The next fields of special tokens refer to other special tokens that
+ * immediately follow it (without an intervening regular token). If there
+ * is no such token, this field is null.
+ */
+ public Token specialToken;
+
+ /**
+ * Returns the image.
+ */
+ public String toString()
+ {
+ return image;
+ }
+
+ /**
+ * Returns a new Token object, by default. However, if you want, you
+ * can create and return subclass objects based on the value of ofKind.
+ * Simply add the cases to the switch for all those special cases.
+ * For example, if you have a subclass of Token called IDToken that
+ * you want to create if ofKind is ID, simlpy add something like :
+ *
+ * case MyParserConstants.ID : return new IDToken();
+ *
+ * to the following switch statement. Then you can cast matchedToken
+ * variable to the appropriate type and use it in your lexical actions.
+ */
+ public static final Token newToken(int ofKind)
+ {
+ switch(ofKind)
+ {
+ default : return new Token();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/TokenMgrError.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/TokenMgrError.java
new file mode 100644
index 0000000..2641d3b
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/lang/gen/parser/TokenMgrError.java
@@ -0,0 +1,133 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
+package org.eclipse.emf.emfatic.core.lang.gen.parser;
+
+public class TokenMgrError extends Error
+{
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
+
+ /**
+ * Lexical error occured.
+ */
+ static final int LEXICAL_ERROR = 0;
+
+ /**
+ * An attempt wass made to create a second instance of a static token manager.
+ */
+ static final int STATIC_LEXER_ERROR = 1;
+
+ /**
+ * Tried to change to an invalid lexical state.
+ */
+ static final int INVALID_LEXICAL_STATE = 2;
+
+ /**
+ * Detected (and bailed out of) an infinite loop in the token manager.
+ */
+ static final int LOOP_DETECTED = 3;
+
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+
+ /**
+ * Replaces unprintable characters by their espaced (or unicode escaped)
+ * equivalents in the given string
+ */
+ protected static final String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
+ }
+ }
+ return retval.toString();
+ }
+
+ /**
+ * Returns a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ * Parameters :
+ * EOFSeen : indicates if EOF caused the lexicl error
+ * curLexState : lexical state in which this error occured
+ * errorLine : line number when the error occured
+ * errorColumn : column number when the error occured
+ * errorAfter : prefix that was seen before this error occured
+ * curchar : the offending character
+ * Note: You can customize the lexical error message by modifying this method.
+ */
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ return("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
+ }
+
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ *
+ * "Internal Error : Please file a bug report .... "
+ *
+ * from this method for such cases in the release version of your parser.
+ */
+ public String getMessage() {
+ return super.getMessage();
+ }
+
+ /*
+ * Constructors of various flavors follow.
+ */
+
+ public TokenMgrError() {
+ }
+
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
+
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticAnnotationMap.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticAnnotationMap.java
new file mode 100644
index 0000000..22aeb48
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticAnnotationMap.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.util;
+
+import java.util.Hashtable;
+
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.emfatic.core.generator.ecore.EmfaticSemanticWarning;
+import org.eclipse.emf.emfatic.core.generator.ecore.GenerationPhase;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.KeyEqualsValue;
+
+
+/**
+ *
+ * @author cjdaly@us.ibm.com
+ */
+public class EmfaticAnnotationMap {
+
+ //
+ // values for special @namespace faux annotation
+ //
+
+ public static final String EPACKAGE_NAMESPACE_ANNOTATION = "namespace";
+ public static final String EPACKAGE_NSPREFIX_KEY = "prefix";
+ public static final String EPACKAGE_NSURI_KEY = "uri";
+
+ //
+ //
+
+ public static final String EMFATIC_ANNOTATION_MAP_LABEL = "EmfaticAnnotationMap";
+ public static final String EMFATIC_ANNOTATION_MAP_NS_URI = "http://www.eclipse.org/emf/2004/" + EMFATIC_ANNOTATION_MAP_LABEL;
+
+
+ // TODO: copied from EcoreUtil protected member. Is this in a public place?
+ private static final String GEN_MODEL_PACKAGE_LABEL = "GenModel";
+ private static final String GEN_MODEL_PACKAGE_NS_URI = "http://www.eclipse.org/emf/2002/GenModel";
+
+ private static final String ECORE_PACKAGE_LABEL = "Ecore";
+
+ private static final String EXTENDED_META_DATA_LABEL = "ExtendedMetaData";
+
+ //
+ //
+ //
+
+ private Hashtable _keyToSourceURI;
+ private Hashtable _sourceURIToDetails;
+
+ public EmfaticAnnotationMap() {
+ _keyToSourceURI = new Hashtable();
+ _sourceURIToDetails = new Hashtable();
+
+ initPredefinedMappings();
+ }
+
+ private void initPredefinedMappings() {
+ addMapping(GEN_MODEL_PACKAGE_LABEL, GEN_MODEL_PACKAGE_NS_URI);
+ addMapping(ECORE_PACKAGE_LABEL, EcorePackage.eNS_URI);
+ addMapping(EXTENDED_META_DATA_LABEL, ExtendedMetaData.ANNOTATION_URI);
+ addMapping(EMFATIC_ANNOTATION_MAP_LABEL, EMFATIC_ANNOTATION_MAP_NS_URI);
+ }
+
+ public String addMapping(String labelDecl, String sourceURI) {
+ return addMapping(labelDecl, sourceURI, null, null);
+ }
+
+ public String addMapping(String labelDecl, String sourceURI, KeyEqualsValue keyEqualsValue, GenerationPhase reporter) {
+ // System.out.println("addMapping: " + labelDecl + ", " + sourceURI);
+
+ LabelMapping labelMapping = new LabelMapping(labelDecl);
+ if (!labelMapping.isWellFormed()) {
+ reportAddMappingProblem("label not well formed!", keyEqualsValue, reporter);
+ return null;
+ }
+ String label = labelMapping.getLabel();
+ String key = labelMapping.getKey();
+
+ if (sourceURI == null) sourceURI = label;
+
+ boolean newSourceURI = false;
+
+ SourceURIDetails details = (SourceURIDetails)_sourceURIToDetails.get(sourceURI);
+ if (details == null) {
+ details = new SourceURIDetails(sourceURI);
+ newSourceURI = true;
+ }
+
+ if (details.hasMapping(labelMapping.getImplicitKeyCount())) {
+ String m2 = details.getMapping(labelMapping.getImplicitKeyCount()).toString();
+ reportAddMappingProblem("mapping already exists: " + m2, keyEqualsValue, reporter);
+ return null;
+ }
+
+ String sourceURICheck = (String)_keyToSourceURI.get(key);
+ if (sourceURICheck == null) {
+ _keyToSourceURI.put(key, sourceURI);
+ }
+ else if (!sourceURICheck.equals(sourceURI)) {
+ reportAddMappingProblem("label aready in use for sourceURI: " + sourceURICheck, keyEqualsValue, reporter);
+ return null;
+ }
+
+ if (newSourceURI) {
+ _sourceURIToDetails.put(sourceURI, details);
+ }
+
+ details.addMapping(labelMapping);
+
+ return label;
+ }
+
+ private void reportAddMappingProblem(String message, KeyEqualsValue keyEqualsValue, GenerationPhase reporter) {
+ if ((keyEqualsValue != null) && (reporter != null)) {
+ reporter.logWarning(new EmfaticSemanticWarning.AnnotationMappingProblem(keyEqualsValue, message));
+ }
+ else {
+ System.out.println(message);
+ }
+ }
+
+ public String getLabelForSourceURI(String sourceURI, int paramCount) {
+ SourceURIDetails details = (SourceURIDetails)_sourceURIToDetails.get(sourceURI);
+ if (details == null) return null;
+
+ LabelMapping labelMapping = details.getMapping(paramCount);
+ if (labelMapping != null) return labelMapping.getLabel();
+
+ // See if there's a "default" label
+ labelMapping = details.getMapping(0);
+ if (labelMapping != null) return labelMapping.getLabel();
+
+ return null;
+ }
+
+ public String mapSourceURI(String literalSourceUriText) {
+ return (String)_keyToSourceURI.get(literalSourceUriText.toLowerCase());
+ }
+
+ public String getImplicitKeyName(String sourceURI, int paramIndex, int totalParamCount) {
+ SourceURIDetails details = (SourceURIDetails)_sourceURIToDetails.get(sourceURI);
+ if (details == null) return null;
+ LabelMapping labelMapping = details.getMapping(totalParamCount);
+ if (labelMapping == null) return null;
+ return labelMapping.getImplicitKey(paramIndex);
+ }
+
+ private static class SourceURIDetails {
+ private String _sourceURI;
+ private Hashtable _keyCountToLabelMapping;
+
+ public SourceURIDetails(String sourceURI) {
+ _sourceURI = sourceURI;
+ _keyCountToLabelMapping = new Hashtable();
+ }
+
+ public String getSourceURI() {
+ return _sourceURI;
+ }
+
+ public LabelMapping addMapping(LabelMapping mapping) {
+ Integer keyCount = new Integer(mapping.getImplicitKeyCount());
+ _keyCountToLabelMapping.put(keyCount, mapping);
+ return mapping;
+ }
+
+ public LabelMapping getMapping(int keyCount) {
+ Integer keyCountInt = new Integer(keyCount);
+ LabelMapping mapping = (LabelMapping)_keyCountToLabelMapping.get(keyCountInt);
+ return mapping;
+ }
+
+ public boolean hasMapping(String label, int keyCount) {
+ LabelMapping mapping = getMapping(keyCount);
+ if (mapping == null) return false;
+ return mapping.getKey().equals(label.toLowerCase());
+ }
+
+ public boolean hasMapping(int keyCount) {
+ LabelMapping mapping = getMapping(keyCount);
+ return mapping != null;
+ }
+ }
+
+ private static class LabelMapping {
+ private String _origLabel;
+ private String _label;
+ private String[] _implicitKeys;
+ private boolean _isWellFormed = true;
+
+ public LabelMapping(String label) {
+ _origLabel = label;
+ try {
+ init(label);
+ }
+ catch (Exception ex) {
+ _isWellFormed = false;
+ }
+ }
+ private void init(String label) {
+ int lParenPos = label.indexOf('(');
+ if (lParenPos == -1) {
+ _label = label;
+ _implicitKeys = new String[0];
+ }
+ else {
+ String implicitKeyText = label.substring(lParenPos+1, label.length());
+ _label = label.substring(0, lParenPos);
+ implicitKeyText = implicitKeyText.replace(')', ' ');
+ _implicitKeys = implicitKeyText.split(",");
+ for (int i = 0; i < _implicitKeys.length; i++) {
+ String implicitKey = _implicitKeys[i].trim();
+ if ((implicitKey == null) || ("".equals(implicitKey))) {
+ _implicitKeys[i] = "_undef" + Integer.toString(i);
+ _isWellFormed = false;
+ }
+ else _implicitKeys[i] = implicitKey;
+ }
+ }
+ }
+
+ public boolean isWellFormed() {
+ return _isWellFormed;
+ }
+
+ public String getLabel() {
+ return _label;
+ }
+
+ public String getKey() {
+ return _label.toLowerCase();
+ }
+
+ public int getImplicitKeyCount() {
+ return _implicitKeys.length;
+ }
+
+ public String getImplicitKey(int index) {
+ if (index >= _implicitKeys.length) return null;
+ else return _implicitKeys[index];
+ }
+
+ public String toString() {
+ return _origLabel;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticBasicTypes.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticBasicTypes.java
new file mode 100644
index 0000000..402f1aa
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticBasicTypes.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.util;
+
+import java.util.Hashtable;
+
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EcorePackage;
+
+public class EmfaticBasicTypes {
+
+ public EmfaticBasicTypes() {
+ }
+
+ private static void initBasicTypes() {
+ _nameToType = new Hashtable();
+ _typeToName = new Hashtable();
+
+
+
+ EcorePackage ecore = EcorePackage.eINSTANCE;
+
+ /*
+ * alternate notation , will be understood when given in .emf however
+ * when importing from .ecore the Emfatic-preferred names will be
+ * generated (see below). This because the entries in the map _typeToName are
+ * overwritten (same keys)
+ */
+ add("EBoolean", ecore.getEBoolean());
+ add("EByte", ecore.getEByte());
+ add("EChar", ecore.getEChar());
+ add("EDouble", ecore.getEDouble());
+ add("EFloat", ecore.getEFloat());
+ add("EInt", ecore.getEInt());
+ add("ELong", ecore.getELong());
+ add("EShort", ecore.getEShort());
+ add("EBooleanObject", ecore.getEBooleanObject());
+ add("EByteObject", ecore.getEByteObject());
+ add("ECharacterObject", ecore.getECharacterObject());
+ add("EDoubleObject", ecore.getEDoubleObject());
+ add("EFloatObject", ecore.getEFloatObject());
+ add("EIntegerObject", ecore.getEIntegerObject());
+ add("ELongObject", ecore.getELongObject());
+ add("EShortObject", ecore.getEShortObject());
+ add("EDate", ecore.getEDate());
+ add("EString", ecore.getEString());
+ add("EJavaClass", ecore.getEJavaClass());
+
+
+ add("boolean", ecore.getEBoolean());
+ add("byte", ecore.getEByte());
+ add("char", ecore.getEChar());
+ add("double", ecore.getEDouble());
+ add("float", ecore.getEFloat());
+ add("int", ecore.getEInt());
+ add("long", ecore.getELong());
+ add("short", ecore.getEShort());
+ add("Boolean", ecore.getEBooleanObject());
+ add("Byte", ecore.getEByteObject());
+ add("Character", ecore.getECharacterObject());
+ add("Double", ecore.getEDoubleObject());
+ add("Float", ecore.getEFloatObject());
+ add("Integer", ecore.getEIntegerObject());
+ add("Long", ecore.getELongObject());
+ add("Short", ecore.getEShortObject());
+ add("Date", ecore.getEDate());
+ add("String", ecore.getEString());
+ add("Object", ecore.getEJavaObject());
+ add("Class", ecore.getEJavaClass());
+ add("EObject", ecore.getEObject());
+ add("EClass", ecore.getEClass());
+
+ // External types defined by Ecore
+ add("EDate", ecore.getEDate());
+ add("EBigInteger", ecore.getEBigInteger());
+ add("EBigDecimal", ecore.getEBigDecimal());
+ add("EResource", ecore.getEResource());
+ add("EResourceSet", ecore.getEResourceSet());
+ add("EEnumerator", ecore.getEEnumerator());
+ add("EEList", ecore.getEEList());
+ add("ETreeIterator", ecore.getETreeIterator());
+ add("EJavaObject", ecore.getEJavaObject());
+
+
+ _array = (String[]) _typeToName.values().toArray(new String[_typeToName.size()]);
+ _isInitialized = true;
+ }
+
+ private static void add(String name, EClassifier type) {
+ _nameToType.put(name, type);
+ _typeToName.put(type, name);
+ }
+
+ public static String[] GetBasicTypeNames() {
+ if (!_isInitialized)
+ initBasicTypes();
+ return (String[]) _array.clone();
+ }
+
+ public static EClassifier LookupBasicType(String name) {
+ if (!_isInitialized)
+ initBasicTypes();
+ return (EClassifier) _nameToType.get(name);
+ }
+
+ public static String LookupBasicTypeName(EClassifier eClassifier) {
+ if (!_isInitialized)
+ initBasicTypes();
+ return (String) _typeToName.get(eClassifier);
+ }
+
+ private static boolean _isInitialized = false;
+ private static Hashtable _nameToType;
+ private static Hashtable _typeToName;
+ private static String _array[];
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticKeywords.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticKeywords.java
new file mode 100644
index 0000000..2b83df3
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticKeywords.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.util;
+
+import java.util.Hashtable;
+
+public class EmfaticKeywords
+{
+
+ public EmfaticKeywords()
+ {
+ }
+
+ private static void initKeywords()
+ {
+ _allKeywordsTable = new Hashtable();
+ _normalKeywordsTable = new Hashtable();
+ _specialKeywordsTable = new Hashtable();
+ _hoverTextTable = new Hashtable();
+ add("abstract", "EClass.isAbstract() == <T>");
+ add("attr", true);
+ add("class", true);
+ add("datatype", true);
+ add("derived", "EStructuralFeature.isDerived() == <T>");
+ add("enum", true);
+ add("extends");
+ add("super");
+ add("false");
+ add("id", "EAttribute.isID() == <T>");
+ add("import", true);
+ add("interface", true, "EClass.isInterface() == <T>");
+ add("mapentry", true);
+ add("op", true);
+ add("ordered", "ETypedElement.isOrdered() == <T>");
+ add("package", true);
+ add("readonly", "EStructuralFeature.isChangeable() == <F>");
+ add("ref", true, "EReference.isContainment() == <F>");
+ add("resolve", "EReference.isResolveProxies() == <T>");
+ add("throws");
+ add("transient", "EStructuralFeature.isTransient() == <T>");
+ add("true");
+ add("unique", "ETypedElement.isUnique() == <T>");
+ add("unsettable", "EStructuralFeature.isUnsettable() == <T>");
+ add("val", true, "EReference.isContainment() == <T>");
+ add("void");
+ add("volatile", "EStructuralFeature.isVolatile() == <T>");
+ _allKeywords = (String[])_allKeywordsTable.values().toArray(new String[_allKeywordsTable.size()]);
+ _normalKeywords = (String[])_normalKeywordsTable.values().toArray(new String[_normalKeywordsTable.size()]);
+ _specialKeywords = (String[])_specialKeywordsTable.values().toArray(new String[_specialKeywordsTable.size()]);
+ _isInitialized = true;
+ }
+
+ private static void add(String keyword)
+ {
+ add(keyword, false, null);
+ }
+
+ private static void add(String keyword, boolean isSpecial)
+ {
+ add(keyword, isSpecial, null);
+ }
+
+ private static void add(String keyword, String hoverText)
+ {
+ add(keyword, false, hoverText);
+ }
+
+ private static void add(String keyword, boolean isSpecial, String hoverText)
+ {
+ _allKeywordsTable.put(keyword, keyword);
+ if(isSpecial)
+ _specialKeywordsTable.put(keyword, keyword);
+ else
+ _normalKeywordsTable.put(keyword, keyword);
+ if(hoverText != null)
+ _hoverTextTable.put(keyword, hoverText);
+ }
+
+ public static String[] GetKeywords()
+ {
+ if(!_isInitialized)
+ initKeywords();
+ return (String[])_allKeywords.clone();
+ }
+
+ public static String[] GetNormalKeywords()
+ {
+ if(!_isInitialized)
+ initKeywords();
+ return (String[])_normalKeywords.clone();
+ }
+
+ public static String[] GetSpecialKeywords()
+ {
+ if(!_isInitialized)
+ initKeywords();
+ return (String[])_specialKeywords.clone();
+ }
+
+ public static boolean IsKeyword(String id)
+ {
+ if(!_isInitialized)
+ initKeywords();
+ return _allKeywordsTable.containsKey(id);
+ }
+
+ public static String GetHoverText(String id)
+ {
+ if(!_isInitialized)
+ initKeywords();
+ return (String)_hoverTextTable.get(id);
+ }
+
+ public static String Escape(String id)
+ {
+ if(!_isInitialized)
+ initKeywords();
+ String ids[] = id.split("\\.");
+ StringBuffer sb = new StringBuffer();
+ for(int i = 0; i < ids.length; i++)
+ {
+ if(IsKeyword(ids[i]))
+ sb.append(KEYWORD_ESCAPE_STRING + ids[i]);
+ else
+ sb.append(ids[i]);
+ if(i + 1 < ids.length)
+ sb.append(".");
+ }
+
+ return sb.toString();
+ }
+
+ public static final char KEYWORD_ESCAPE_CHAR = 126;
+ public static final String KEYWORD_ESCAPE_STRING = String.valueOf('~');
+ private static boolean _isInitialized = false;
+ private static Hashtable _allKeywordsTable;
+ private static Hashtable _normalKeywordsTable;
+ private static Hashtable _specialKeywordsTable;
+ private static Hashtable _hoverTextTable;
+ private static String _allKeywords[];
+ private static String _normalKeywords[];
+ private static String _specialKeywords[];
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticOutlineBuilder.java b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticOutlineBuilder.java
new file mode 100644
index 0000000..5469a2a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.core/src/org/eclipse/emf/emfatic/core/util/EmfaticOutlineBuilder.java
@@ -0,0 +1,449 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.core.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
+import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedImage;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.emf.emfatic.core.generator.ecore.GenerationPhase;
+import org.eclipse.emf.emfatic.core.generator.ecore.TokenText;
+import org.eclipse.emf.emfatic.core.generator.ecore.TokenTextBlankSep;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Annotation;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Attribute;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.BoundExceptWildcard;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassMemberDecls;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CommaListBoundExceptWild;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.DataTypeDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNodeVisitor;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EnumDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.KeyEqualsValue;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Operation;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Param;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Params;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Reference;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.SubPackageDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TopLevelDecls;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeParam;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeParamsInfo;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.IOutlineBuilder;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+import org.eclipse.swt.graphics.Image;
+
+
+public class EmfaticOutlineBuilder implements IOutlineBuilder {
+
+ CompUnit compUnit = null;
+ Map<ASTNode, OutlineNode> a2o = new HashMap<ASTNode, OutlineNode>();
+
+ public EmfaticOutlineBuilder() {
+ }
+
+ public OutlineNode[] buildOutline(ASTNode parseRoot) {
+ a2o.clear();
+ if (parseRoot instanceof CompUnit) {
+ if (parseRoot != null && ((CompUnit) parseRoot).getPackageDecl() != null) {
+ compUnit = (CompUnit) parseRoot;
+ Image image = getPackageImage();
+ String packageName = GenerationPhase.getIDText(compUnit.getPackageDecl().getName());
+ OutlineNode outlineNode = new OutlineNode(compUnit.getPackageDecl(), packageName, image);
+ a2o.put(compUnit.getPackageDecl().getName(), outlineNode);
+ a2o.put(compUnit.getPackageDecl().getPackage_KW(), outlineNode);
+ a2o.put(compUnit.getPackageDecl().getSemi(), outlineNode);
+ doPackageContents(outlineNode, compUnit.getTopLevelDecls());
+ compUnit.setCst2Outline(a2o);
+ OutlineNode[] outlineNodes = new OutlineNode[] { outlineNode };
+ return outlineNodes;
+ }
+ }
+ return null;
+ }
+
+ private void doPackageContents(final OutlineNode parentNode, TopLevelDecls topLevelDecls) {
+ (new EmfaticASTNodeVisitor() {
+
+ // TODO MapEntryDecl is not being shown in outline
+
+ private void addAttribute(Attribute c, OutlineNode outlineNode) {
+ Attribute at = (Attribute) c;
+ String strTypeWithMulti = TokenTextBlankSep.Get(c.getTypeWithMulti());
+ String strName = GenerationPhase.getIDText(at.getName());
+ OutlineNode n = new OutlineNode(at.getName(), strName + " : " + strTypeWithMulti, EmfaticOutlineBuilder
+ .getAttributeImage());
+ a2o.put(at, n);
+ ASTNode[] atAnns = at.getAnnotations().getChildren();
+ annotate(atAnns, n);
+ outlineNode.addChild(n);
+ }
+
+ private void addClassDeclMembers(ClassDecl classDecl, OutlineNode outlineNode) {
+ ClassMemberDecls ms = classDecl.getClassMemberDecls();
+
+ ASTNode[] ans = classDecl.getAnnotations().getChildren();
+ annotate(ans, outlineNode);
+
+ for (ASTNode c : ms.getChildren()) {
+ if (c instanceof Attribute) {
+ addAttribute((Attribute) c, outlineNode);
+ }
+ if (c instanceof Reference) {
+ addReference((Reference) c, outlineNode);
+ }
+ if (c instanceof Operation) {
+ addOperation((Operation) c, outlineNode);
+ }
+ }
+ }
+
+ private void addOperation(Operation c, OutlineNode outlineNode) {
+ Operation o = (Operation) c;
+ String strResultType = TokenTextBlankSep.Get(o.getResType());
+ String strName = GenerationPhase.getIDText(o.getName());
+ OutlineNode n = new OutlineNode(o.getName(), strName + " : " + strResultType, EmfaticOutlineBuilder
+ .getOperationImage());
+ a2o.put(o, n);
+ ASTNode[] oAnns = o.getAnnotations().getChildren();
+ annotate(oAnns, n);
+ outlineNode.addChild(n);
+ // eGenericExceptionTypes
+ CommaListBoundExceptWild excs = c.getExceptions();
+ addExceptions(excs, n);
+ // TODO add eGenericReturnType
+ TypeParamsInfo tpi = c.getTypeParamsInfo();
+ addTypeParams(tpi, n);
+ addParams(o.getParams(), n);
+ }
+
+ private void addExceptions(CommaListBoundExceptWild excs, OutlineNode n) {
+ if (excs == null) {
+ return;
+ }
+ for (ASTNode en : excs.getChildren()) {
+ if (en instanceof BoundExceptWildcard) {
+ BoundExceptWildcard bew = (BoundExceptWildcard) en;
+ OutlineNode e = null;
+ String strText = TokenText.Get(bew);
+ if (bew.getOneOrMoreTypeArgs() != null) {
+ // generic exception
+ e = new OutlineNode(en, strText, getGenericExceptionImage());
+ } else {
+ e = new OutlineNode(en, strText);
+ }
+ a2o.put(bew, e);
+ n.addChild(e);
+ }
+ }
+ }
+
+ private void addParams(Params params, OutlineNode on) {
+ if (params == null) {
+ return;
+ }
+ ASTNode[] ps = params.getChildren();
+ for (ASTNode pn : ps) {
+ if (pn instanceof Param) {
+ Param p = (Param) pn;
+ String strTypeWithMulti = TokenTextBlankSep.Get(p.getTypeWithMulti());
+ String strName = GenerationPhase.getIDText(p.getName());
+ OutlineNode n = new OutlineNode(p, strName + " : " + strTypeWithMulti, EmfaticOutlineBuilder
+ .getParamImage());
+ a2o.put(p, n);
+ on.addChild(n);
+ }
+ }
+ }
+
+ private void addReference(Reference c, OutlineNode outlineNode) {
+ Reference r = (Reference) c;
+ String strTypeWithMulti = TokenTextBlankSep.Get(c.getTypeWithMulti());
+ String strName = GenerationPhase.getIDText(r.getName());
+ OutlineNode n = new OutlineNode(r.getName(), strName + " : " + strTypeWithMulti, EmfaticOutlineBuilder
+ .getReferenceImage());
+ a2o.put(r, n);
+ ASTNode[] rAnns = r.getAnnotations().getChildren();
+ annotate(rAnns, n);
+ outlineNode.addChild(n);
+ }
+
+ private void addTypeParams(TypeParamsInfo tpi, OutlineNode outlineNode) {
+ if (tpi == null || tpi.getOneOrMoreTypeParams() == null) {
+ return;
+ }
+ ASTNode[] tps = tpi.getOneOrMoreTypeParams().getChildren();
+ for (ASTNode tpn : tps) {
+ if (tpn instanceof TypeParam) {
+ TypeParam tp = (TypeParam) tpn;
+ String strTypeVarName = GenerationPhase.getIDText(tp.getTypeVarName());
+ OutlineNode n = new OutlineNode(tp, strTypeVarName, EmfaticOutlineBuilder.getTypeParamImage());
+ a2o.put(tp, n);
+ outlineNode.addChild(n);
+ // add bounds as children of the node for the type param
+ if (tp.getTypeBoundsInfo() != null
+ && tp.getTypeBoundsInfo().getOneOrMoreTypeParamBounds() != null) {
+ ASTNode[] boundNodes = tp.getTypeBoundsInfo().getOneOrMoreTypeParamBounds().getChildren();
+ for (ASTNode bound : boundNodes) {
+ String boundLabel = TokenTextBlankSep.Get((EmfaticASTNode) bound);
+ OutlineNode n2 = new OutlineNode(bound, boundLabel);
+ a2o.put(bound, n2);
+ n.addChild(n2);
+ }
+ }
+ }
+ }
+
+ }
+
+ private void annotate(ASTNode[] as, OutlineNode on) {
+ // each annotation will be added as a child
+ for (ASTNode astNode : as) {
+ Annotation astAnn = (Annotation) astNode;
+ String strSource = TokenText.Get(astAnn.getSource());
+ OutlineNode n = new OutlineNode(astNode, strSource, EmfaticOutlineBuilder.getAnnotationImage());
+ a2o.put(astAnn, n);
+ for (ASTNode kv : astAnn.getKeyEqualsValueList().getChildren()) {
+ if (kv instanceof KeyEqualsValue) {
+ String strKey = kv.getChild(0).getChild(0).getFirstChild().getText();
+ String strValue = kv.getChild(2).getChild(0).getText();
+ String strKV = strKey + " = " + strValue;
+ OutlineNode n2 = new OutlineNode(kv, strKV, null);
+ a2o.put(kv, n2);
+ n.addChild(n2);
+ }
+ }
+ on.addChild(n);
+ }
+ }
+
+ public boolean beginVisit(ClassDecl classDecl) {
+ String name = classDecl.getName().getText();
+ Image image = EmfaticOutlineBuilder.getClassImage();
+ OutlineNode outlineNode = new OutlineNode(classDecl, name, image);
+ a2o.put(classDecl, outlineNode);
+ addTypeParams(classDecl.getTypeParamsInfo(), outlineNode);
+ addClassDeclMembers(classDecl, outlineNode);
+ // TODO decide whether to add supertypes
+ parentNode.addChild(outlineNode);
+ return false;
+ }
+
+ public boolean beginVisit(DataTypeDecl dataTypeDecl) {
+ String name = dataTypeDecl.getName().getText();
+ Image image = EmfaticOutlineBuilder.getDataTypeImage();
+ OutlineNode outlineNode = new OutlineNode(dataTypeDecl, name, image);
+ a2o.put(dataTypeDecl, outlineNode);
+ parentNode.addChild(outlineNode);
+ return false;
+ }
+
+ public boolean beginVisit(EnumDecl enumDecl) {
+ String name = enumDecl.getName().getText();
+ Image image = EmfaticOutlineBuilder.getEnumImage();
+ OutlineNode outlineNode = new OutlineNode(enumDecl, name, image);
+ a2o.put(enumDecl, outlineNode);
+ parentNode.addChild(outlineNode);
+ return false;
+ }
+
+ public boolean beginVisit(SubPackageDecl subPackageDecl) {
+ String name = GenerationPhase.getIDText(subPackageDecl.getName());
+ Image image = EmfaticOutlineBuilder.getPackageImage();
+ OutlineNode outlineNode = new OutlineNode(subPackageDecl, name, image);
+
+ a2o.put(subPackageDecl.getName(), outlineNode);
+ a2o.put(subPackageDecl.getPackage_KW(), outlineNode);
+ a2o.put(subPackageDecl.getLcurly(), outlineNode);
+
+ parentNode.addChild(outlineNode);
+ doPackageContents(outlineNode, subPackageDecl.getTopLevelDecls());
+ return false;
+ }
+
+ }).visit(topLevelDecls);
+ }
+
+ private static AdapterFactory getAdapterFactory() {
+ if (_adapterFactory == null)
+ _adapterFactory = new EcoreItemProviderAdapterFactory();
+ return _adapterFactory;
+ }
+
+ static Image getPackageImage() {
+ if (_packageImage == null) {
+ Object ePackage = EcoreFactory.eINSTANCE.createEPackage();
+ _packageImage = getImage(ePackage);
+ }
+ return _packageImage;
+ }
+
+ static Image getClassImage() {
+ if (_classImage == null) {
+ Object ePackage = EcoreFactory.eINSTANCE.createEClass();
+ _classImage = getImage(ePackage);
+ }
+ return _classImage;
+ }
+
+ static Image getEnumImage() {
+ if (_enumImage == null) {
+ Object ePackage = EcoreFactory.eINSTANCE.createEEnum();
+ _enumImage = getImage(ePackage);
+ }
+ return _enumImage;
+ }
+
+ static Image getDataTypeImage() {
+ if (_dataTypeImage == null) {
+ Object ePackage = EcoreFactory.eINSTANCE.createEDataType();
+ _dataTypeImage = getImage(ePackage);
+ }
+ return _dataTypeImage;
+ }
+
+ public static Image getOperationImage() {
+ if (_operationImage == null) {
+ Object eOperation = EcoreFactory.eINSTANCE.createEOperation();
+ _operationImage = getImage(eOperation);
+ }
+ return _operationImage;
+ }
+
+ public static Image getAnnotationImage() {
+ if (_annotationImage == null) {
+ Object eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
+ _annotationImage = getImage(eAnnotation);
+ }
+ return _annotationImage;
+ }
+
+ public static Image getAttributeImage() {
+ if (_attributeImage == null) {
+ Object eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
+ _attributeImage = getImage(eAttribute);
+ }
+ return _attributeImage;
+ }
+
+ public static Image getReferenceImage() {
+ if (_referenceImage == null) {
+ Object eReference = EcoreFactory.eINSTANCE.createEReference();
+ _referenceImage = getImage(eReference);
+ }
+ return _referenceImage;
+ }
+
+ static Image getTypeParamImage() {
+ if (_typeParamImage == null) {
+ Object etp = EcoreFactory.eINSTANCE.createETypeParameter();
+ _typeParamImage = getImage(etp);
+ }
+ return _typeParamImage;
+ }
+
+ static Image getParamImage() {
+ if (_paramImage == null) {
+ Object ep = EcoreFactory.eINSTANCE.createEParameter();
+ _paramImage = getImage(ep);
+ }
+ return _paramImage;
+ }
+
+ static Image getGenericExceptionImage() {
+ if (_genericExceptionImage == null) {
+ _genericExceptionImage = (Image) EcoreEditPlugin.INSTANCE.getImage("full/obj16/EGenericException");
+ }
+ return _genericExceptionImage;
+ }
+
+ static Image getGenericElementTypeImage() {
+ if (_genericElementTypeImage == null) {
+ _genericElementTypeImage = (Image) EcoreEditPlugin.INSTANCE.getImage("full/obj16/EGenericElementType");
+ }
+ return _genericElementTypeImage;
+ }
+
+ static Image getGenericSuperTypeImage() {
+ if (_genericSuperTypeImage == null) {
+ _genericSuperTypeImage = (Image) EcoreEditPlugin.INSTANCE.getImage("full/obj16/EGenericSuperType");
+ }
+ return _genericSuperTypeImage;
+ }
+
+ static Image getGenericWildcardImage() {
+ if (_genericWildcardImage == null) {
+ _genericWildcardImage = (Image) EcoreEditPlugin.INSTANCE.getImage("full/obj16/EGenericWildcard");
+ }
+ return _genericWildcardImage;
+ }
+
+ private static Image getImage(Object eObject) {
+ IItemLabelProvider itemLabelProvider = (IItemLabelProvider) getAdapterFactory().adapt(eObject,
+ org.eclipse.emf.edit.provider.IItemLabelProvider.class);
+ Object imageObject = itemLabelProvider.getImage(eObject);
+ Image image = ExtendedImageRegistry.getInstance().getImage(imageObject);
+ return image;
+ }
+
+ private static EcoreItemProviderAdapterFactory _adapterFactory;
+
+ private static Image _packageImage;
+
+ private static Image _classImage;
+
+ private static Image _enumImage;
+
+ private static Image _dataTypeImage;
+
+ private static Image _operationImage;
+
+ private static Image _annotationImage;
+
+ private static Image _attributeImage;
+
+ private static Image _referenceImage;
+
+ private static Image _typeParamImage;
+
+ private static Image _paramImage;
+
+ private static Image _genericExceptionImage;
+
+ private static Image _genericElementTypeImage;
+
+ private static Image _genericSuperTypeImage;
+
+ private static Image _genericWildcardImage;
+
+ /**
+ * This overlays the second image on the first.
+ */
+ public static Image overlayImage(Image first, Image second) {
+ List<Image> images = new ArrayList<Image>(2);
+ images.add(first);
+ images.add(second);
+ ComposedImage imageObject = new ComposedImage(images);
+ Image image = (Image) imageObject.getImages().get(0); // ExtendedImageRegistry.getInstance().getImage(imageObject);
+ return image;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/.classpath b/plugins/org.eclipse.emf.emfatic.ui/.classpath
new file mode 100644
index 0000000..065ac06
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.emfatic.ui/.cvsignore b/plugins/org.eclipse.emf.emfatic.ui/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/plugins/org.eclipse.emf.emfatic.ui/.project b/plugins/org.eclipse.emf.emfatic.ui/.project
new file mode 100644
index 0000000..37c5476
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.emfatic.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/EAnnotation.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/EAnnotation.gif
new file mode 100644
index 0000000..0df81a3
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/EAnnotation.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEAnnotations.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEAnnotations.gif
new file mode 100644
index 0000000..349ed09
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEAnnotations.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEAttributes.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEAttributes.gif
new file mode 100644
index 0000000..2db5ba5
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEAttributes.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEOperations.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEOperations.gif
new file mode 100644
index 0000000..b28fde3
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEOperations.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEReferences.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEReferences.gif
new file mode 100644
index 0000000..e58691e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideEReferences.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideETypeParameters.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideETypeParameters.gif
new file mode 100644
index 0000000..d65dfcd
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/HideETypeParameters.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/Thumbs.db b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/Thumbs.db
new file mode 100644
index 0000000..59c2ad2
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/Thumbs.db
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/class_hi.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/class_hi.gif
new file mode 100644
index 0000000..17f927e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/class_hi.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/emfatic.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/emfatic.gif
new file mode 100644
index 0000000..088b844
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/emfatic.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/error_co.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/error_co.gif
new file mode 100644
index 0000000..119dccc
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/error_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/label decorators at org.eclipse.jdt.ui icons full ovr16 b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/label decorators at org.eclipse.jdt.ui icons full ovr16
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/label decorators at org.eclipse.jdt.ui icons full ovr16
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/more icons at org.eclipse.emf.ecore.edit.txt b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/more icons at org.eclipse.emf.ecore.edit.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/more icons at org.eclipse.emf.ecore.edit.txt
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/sample.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/sample.gif
new file mode 100644
index 0000000..34fb3c9
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/sample.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/template.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/template.gif
new file mode 100644
index 0000000..65c2632
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/template.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/Thumbs.db b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/Thumbs.db
new file mode 100644
index 0000000..73d6ade
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/Thumbs.db
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/alphab_sort_co.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/alphab_sort_co.gif
new file mode 100644
index 0000000..6311cc0
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/alphab_sort_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/class_abs.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/class_abs.gif
new file mode 100644
index 0000000..7edb75a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/class_abs.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/class_abstract.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/class_abstract.gif
new file mode 100644
index 0000000..5c03ae2
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/class_abstract.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/class_obj.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/class_obj.gif
new file mode 100644
index 0000000..e4c2a83
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/class_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/definingtype_sort_co.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/definingtype_sort_co.gif
new file mode 100644
index 0000000..166eaba
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/definingtype_sort_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/inher_co.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/inher_co.gif
new file mode 100644
index 0000000..a326000
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/inher_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/int_abs.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/int_abs.gif
new file mode 100644
index 0000000..df4f73f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/int_abs.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/int_obj.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/int_obj.gif
new file mode 100644
index 0000000..2ebc46e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/int_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/sub_co.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/sub_co.gif
new file mode 100644
index 0000000..54871df
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/sub_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/super_co.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/super_co.gif
new file mode 100644
index 0000000..59ac116
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/typesView/super_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/warning_co.gif b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/warning_co.gif
new file mode 100644
index 0000000..ee2dac4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/ForJar/icons/warning_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.emfatic.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..499a2e1
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,28 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Plugin.name (Incubation)
+Bundle-SymbolicName: org.eclipse.emf.emfatic.ui;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.emf.emfatic.ui.EmfaticUIPlugin
+Bundle-Vendor: Eclipse.org
+Bundle-Localization: plugin
+Export-Package: org.eclipse.emf.emfatic.ui,
+ org.eclipse.emf.emfatic.ui.actions,
+ org.eclipse.emf.emfatic.ui.editor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.resources,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.jface.text,
+ org.eclipse.ui.console,
+ org.eclipse.ui.views,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.editors,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.emfatic.core,
+ org.eclipse.emf.ecore,
+ org.eclipse.jdt.ui,
+ org.eclipse.core.expressions,
+ org.eclipse.gymnast.runtime.core,
+ org.eclipse.gymnast.runtime.ui
+Eclipse-LazyStart: true
diff --git a/plugins/org.eclipse.emf.emfatic.ui/build.properties b/plugins/org.eclipse.emf.emfatic.ui/build.properties
new file mode 100644
index 0000000..ce2ae92
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/build.properties
@@ -0,0 +1,15 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ plugin.xml,\
+ icons/,\
+ emfatic-ui.jar,\
+ ForJar/,\
+ typesView/
+source.emfatic-ui.jar = src/,\
+ ForJar/
+
+
+output.emfatic-ui.jar = bin/,icons/
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/EAnnotation.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/EAnnotation.gif
new file mode 100644
index 0000000..0df81a3
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/EAnnotation.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/HideEAnnotations.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/HideEAnnotations.gif
new file mode 100644
index 0000000..349ed09
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/HideEAnnotations.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/HideEAttributes.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/HideEAttributes.gif
new file mode 100644
index 0000000..2db5ba5
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/HideEAttributes.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/HideEOperations.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/HideEOperations.gif
new file mode 100644
index 0000000..b28fde3
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/HideEOperations.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/HideEReferences.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/HideEReferences.gif
new file mode 100644
index 0000000..e58691e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/HideEReferences.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/HideETypeParameters.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/HideETypeParameters.gif
new file mode 100644
index 0000000..d65dfcd
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/HideETypeParameters.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/Thumbs.db b/plugins/org.eclipse.emf.emfatic.ui/icons/Thumbs.db
new file mode 100644
index 0000000..59c2ad2
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/Thumbs.db
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/class_hi.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/class_hi.gif
new file mode 100644
index 0000000..17f927e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/class_hi.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/emfatic.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/emfatic.gif
new file mode 100644
index 0000000..088b844
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/emfatic.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/error_co.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/error_co.gif
new file mode 100644
index 0000000..119dccc
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/error_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/label decorators at org.eclipse.jdt.ui icons full ovr16 b/plugins/org.eclipse.emf.emfatic.ui/icons/label decorators at org.eclipse.jdt.ui icons full ovr16
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/label decorators at org.eclipse.jdt.ui icons full ovr16
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/more icons at org.eclipse.emf.ecore.edit.txt b/plugins/org.eclipse.emf.emfatic.ui/icons/more icons at org.eclipse.emf.ecore.edit.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/more icons at org.eclipse.emf.ecore.edit.txt
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/sample.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/sample.gif
new file mode 100644
index 0000000..34fb3c9
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/sample.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/template.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/template.gif
new file mode 100644
index 0000000..65c2632
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/template.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/Thumbs.db b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/Thumbs.db
new file mode 100644
index 0000000..73d6ade
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/Thumbs.db
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/alphab_sort_co.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/alphab_sort_co.gif
new file mode 100644
index 0000000..6311cc0
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/alphab_sort_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/class_abs.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/class_abs.gif
new file mode 100644
index 0000000..7edb75a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/class_abs.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/class_abstract.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/class_abstract.gif
new file mode 100644
index 0000000..5c03ae2
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/class_abstract.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/class_obj.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/class_obj.gif
new file mode 100644
index 0000000..e4c2a83
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/class_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/definingtype_sort_co.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/definingtype_sort_co.gif
new file mode 100644
index 0000000..166eaba
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/definingtype_sort_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/inher_co.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/inher_co.gif
new file mode 100644
index 0000000..a326000
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/inher_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/int_abs.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/int_abs.gif
new file mode 100644
index 0000000..df4f73f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/int_abs.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/int_obj.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/int_obj.gif
new file mode 100644
index 0000000..2ebc46e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/int_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/sub_co.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/sub_co.gif
new file mode 100644
index 0000000..54871df
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/sub_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/super_co.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/super_co.gif
new file mode 100644
index 0000000..59ac116
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/typesView/super_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/icons/warning_co.gif b/plugins/org.eclipse.emf.emfatic.ui/icons/warning_co.gif
new file mode 100644
index 0000000..ee2dac4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/icons/warning_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/plugin.properties b/plugins/org.eclipse.emf.emfatic.ui/plugin.properties
new file mode 100644
index 0000000..52feb87
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/plugin.properties
@@ -0,0 +1,33 @@
+#/**
+# * <copyright>
+# *
+# * Copyright (c) 2004,2006 IBM Corporation and others.
+# * All rights reserved. This program and the accompanying materials
+# * are made available under the terms of the Eclipse Public License v1.0
+# * which accompanies this distribution, and is available at
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * IBM - Initial API and implementation
+# *
+# * </copyright>
+# *
+# * $Id: plugin.properties,v 1.1 2008/01/15 06:06:42 cdaly Exp $
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+# ==============================================================================
+# Do not change the properties between this line and the last line containing:
+# %%% END OF TRANSLATED PROPERTIES %%%
+# Instead, either redefine an existing property, or create a new property,
+# append it to the end of the file, and change the code to use the new name.
+# ==============================================================================
+
+# ==============================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# The above properties have been shipped for translation.
+# ==============================================================================
+
+Plugin.name = Emfatic UI
+Plugin.providerName = Eclipse.org
diff --git a/plugins/org.eclipse.emf.emfatic.ui/plugin.xml b/plugins/org.eclipse.emf.emfatic.ui/plugin.xml
new file mode 100644
index 0000000..4726186
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/plugin.xml
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ name="EmfaticEditor"
+ extensions="emf"
+ icon="icons/emfatic.gif"
+ class="org.eclipse.emf.emfatic.ui.editor.EmfaticEditor"
+ contributorClass="org.eclipse.emf.emfatic.ui.editor.EmfaticEditorActionContributor"
+ id="org.eclipse.emf.emfatic.ui.editor.EmfaticEditor">
+ </editor>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.emf"
+ id="org.eclipse.emf.emfatic.ui.actions.GenerateEcore">
+ <action
+ label="Generate Ecore Model"
+ icon="icons/emfatic.gif"
+ class="org.eclipse.emf.emfatic.ui.actions.GenerateEcore"
+ menubarPath="additions"
+ enablesFor="1"
+ id="GenerateEcore">
+ </action>
+ </objectContribution>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.ecore"
+ id="org.eclipse.emf.emfatic.ui.actions.GenerateEmfatic">
+ <action
+ label="Generate Emfatic Source"
+ icon="icons/emfatic.gif"
+ class="org.eclipse.emf.emfatic.ui.actions.GenerateEmfatic"
+ menubarPath="additions"
+ enablesFor="1"
+ id="GenerateEmfatic">
+ </action>
+ </objectContribution>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ class="org.eclipse.emf.emfatic.ui.wizards.EmfaticNewWizard"
+ icon="icons/emfatic.gif"
+ id="org.eclipse.emf.emfatic.ui.wizards.EmfaticNewWizard"
+ name="Emfatic file">
+ <selection
+ class="org.eclipse.core.resources.IResource">
+ </selection>
+ </wizard>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.emf.emfatic.ui.preferences.EmfaticPreferencePage"
+ id="org.eclipse.emf.emfatic.ui.preferences.EmfaticPreferencePage"
+ name="Emfatic">
+ </page>
+ <page
+ category="org.eclipse.emf.emfatic.ui.preferences.EmfaticPreferencePage"
+ class="org.eclipse.emf.emfatic.ui.preferences.EmfaticTemplatesPreferencePage"
+ id="org.eclipse.emf.emfatic.ui.preferences.EmfaticTemplatesPreferencePage"
+ name="Templates">
+ </page>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.emf.emfatic.ui.preferences.PreferenceInitializer">
+ </initializer>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.editors.templates">
+ <contextType
+ class="org.eclipse.emf.emfatic.ui.templates.EmfaticContextType"
+ id="org.eclipse.emf.emfatic.ui.templates.EmfaticContextType">
+ </contextType>
+
+ <template
+ contextTypeId="org.eclipse.emf.emfatic.ui.templates.EmfaticContextType"
+ icon="icons/template.gif"
+ description="Template for an OCL invariant"
+ name="inv"
+ id="org.eclipse.emf.emfatic.ui.templates.EmfaticOCLInv">
+ <pattern>
+@"http://www.eclipse.org/ocl/examples/OCL"(${invName}=" ${booleanExpression} ")
+ </pattern>
+ </template>
+
+ <template
+ contextTypeId="org.eclipse.emf.emfatic.ui.templates.EmfaticContextType"
+ icon="icons/template.gif"
+ description="Template for an OCL derive"
+ name="der"
+ id="org.eclipse.emf.emfatic.ui.templates.EmfaticOCLDer">
+ <pattern>
+@"http://www.eclipse.org/ocl/examples/OCL"(derive=" ${cursor} ")
+ </pattern>
+ </template>
+
+ <template
+ contextTypeId="org.eclipse.emf.emfatic.ui.templates.EmfaticContextType"
+ icon="icons/template.gif"
+ description="Template for an OCL body"
+ name="body"
+ id="org.eclipse.emf.emfatic.ui.templates.EmfaticOCLBody">
+ <pattern>
+@"http://www.eclipse.org/ocl/examples/OCL"(body=" ${cursor} ")
+ </pattern>
+ </template>
+
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ id="org.eclipse.emf.emfatic"
+ name="Emfatic">
+ </category>
+ <view
+ allowMultiple="false"
+ category="org.eclipse.emf.emfatic"
+ class="org.eclipse.emf.emfatic.ui.views.TypesView"
+ icon="icons/class_hi.gif"
+ id="org.eclipse.emf.emfatic.ui.views.TypesView"
+ name="EMF Type Hierarchy">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.ui.resourcePerspective">
+ <showInPart
+ id="org.eclipse.emf.emfatic.ui.views.TypesView">
+ </showInPart>
+ </perspectiveExtension>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/EmfaticUIPlugin.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/EmfaticUIPlugin.java
new file mode 100644
index 0000000..89867d5
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/EmfaticUIPlugin.java
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.emfatic.ui.redsquiggles.EmfaticRedSquiggler;
+import org.eclipse.emf.emfatic.ui.templates.EmfaticContextType;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
+import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ *
+ * @author miguel.garcia@tuhh.de
+ */
+public class EmfaticUIPlugin extends AbstractUIPlugin {
+
+ public EmfaticUIPlugin() {
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.eclipse.emf.emfatic.ui.EmfaticUIPluginResources");
+ } catch (MissingResourceException _ex) {
+ resourceBundle = null;
+ }
+
+ redSquiggler = new EmfaticRedSquiggler();
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(redSquiggler, IResourceChangeEvent.POST_CHANGE);
+ // TODO use IWorkspace.removeResourceChangeListener on plugin shutdown
+ }
+
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ }
+
+ public static EmfaticUIPlugin getDefault() {
+ return plugin;
+ }
+
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = getDefault().getResourceBundle();
+ try {
+ return bundle == null ? key : bundle.getString(key);
+ } catch (MissingResourceException _ex) {
+ return key;
+ }
+ }
+
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ /**
+ * Returns this plugin's template store.
+ *
+ * @return the template store of this plug-in instance
+ */
+ public TemplateStore getEmfaticTemplateStore() {
+ if (emfaticTemplateStore == null) {
+ emfaticTemplateStore = new ContributionTemplateStore(getEmfaticContextTypeRegistry(), getPreferenceStore(),
+ CUSTOM_TEMPLATES_EMFATIC_KEY);
+ try {
+ emfaticTemplateStore.load();
+ } catch (IOException e) {
+ // e.printStackTrace();
+ EmfaticUIPlugin.log("Loading Emfatic template store", e);
+ throw new RuntimeException(e);
+ }
+ }
+ return emfaticTemplateStore;
+ }
+
+ /**
+ * Returns this plugin's LaTeX context type registry.
+ *
+ * @return the context type registry for this plug-in instance
+ */
+ public ContextTypeRegistry getEmfaticContextTypeRegistry() {
+ if (emfaticTypeRegistry == null) {
+ // create an configure the contexts available in the template editor
+ emfaticTypeRegistry = new ContributionContextTypeRegistry();
+ emfaticTypeRegistry.addContextType(new EmfaticContextType());
+ }
+ return emfaticTypeRegistry;
+ }
+
+ /**
+ * Display a message in the Eclipse's Error Log. This is equivalent to
+ * calling <code>log(msg, t, IStatus.ERROR)</code>.
+ *
+ * @param msg
+ * error message to display in error log
+ * @param t
+ * exception
+ */
+ public static void log(String msg, Throwable t) {
+ log(msg, t, IStatus.ERROR);
+ }
+
+ /**
+ * Display a message in the Eclipse's Error Log. Used by e.g. the project
+ * creation wizard.
+ *
+ * @param msg
+ * error message
+ * @param t
+ * exception
+ * @param level
+ * one of the error levels defined in the <code>IStatus</code>
+ * -interface
+ */
+ public static void log(String msg, Throwable t, int level) {
+ IStatus stat = new Status(level, getPluginId(), level, msg, t);
+ getDefault().getLog().log(stat);
+ }
+
+ /**
+ * Returns the name of the plugin.
+ *
+ * Used by project creation wizard.
+ *
+ * @return unique id of this plugin
+ */
+ public static String getPluginId() {
+ return getDefault().getBundle().getSymbolicName();
+ }
+
+ /**
+ * Return an image from the plugin's icons-directory.
+ *
+ * @param name
+ * name of the icon
+ * @return the icon as an image object
+ */
+ public static Image getImage(String name) {
+ return getDefault().getCachedImage(name);
+ }
+
+ /**
+ * Cache the image if it is found.
+ *
+ * @param key
+ * name of the image
+ * @return image from the cache or from disk, null if image is not found in
+ * either
+ */
+ protected Image getCachedImage(String key) {
+ if (key == null) {
+ return null;
+ }
+
+ Image g = (Image) imageRegistry.get(key);
+ if (g != null) {
+ return g;
+ }
+
+ ImageDescriptor d = ImageDescriptor.createFromURL(getBundle().getEntry("icons/" + key + ".gif"));
+ if (d == null) {
+ return null;
+ }
+
+ // we want null instead of default missing image
+ if (d.equals(ImageDescriptor.getMissingImageDescriptor())) {
+ return null;
+ }
+
+ g = d.createImage();
+ imageRegistry.put(key, g);
+ return g;
+ }
+
+ /**
+ * Returns the image descriptor for the given image (from eclipse help)
+ *
+ * @param name
+ * Name of the iamge
+ * @return The corresponding image descriptor or
+ * <code>MissingImageDescriptor</code> if none is found
+ */
+ public static ImageDescriptor getImageDescriptor(String name) {
+ String iconPath = "icons/";
+ try {
+ URL installURL = getDefault().getBundle().getEntry("/");
+ URL url = new URL(installURL, iconPath + name + ".gif");
+ return ImageDescriptor.createFromURL(url);
+ } catch (MalformedURLException e) {
+ // should not happen
+ return ImageDescriptor.getMissingImageDescriptor();
+ }
+ }
+
+ private static EmfaticUIPlugin plugin;
+ private ResourceBundle resourceBundle;
+ private IResourceChangeListener redSquiggler;
+ private TemplateStore emfaticTemplateStore;
+ private ContributionContextTypeRegistry emfaticTypeRegistry = null;
+
+ // Key to store custom templates.
+ private static final String CUSTOM_TEMPLATES_EMFATIC_KEY = "EmfaticTemplates";
+
+ // cache for icons
+ private HashMap<String, Image> imageRegistry = new HashMap<String, Image>();
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/actions/GenerateEcore.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/actions/GenerateEcore.java
new file mode 100644
index 0000000..733e109
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/actions/GenerateEcore.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.actions;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.emfatic.core.generator.ecore.EcoreGenerator;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+
+/**
+ *
+ * @author cjdaly@us.ibm.com
+ */
+public class GenerateEcore implements IObjectActionDelegate {
+
+ private IFile _file;
+ private GenerateEcoreJob _job;
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ _file = null;
+
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection sel = (IStructuredSelection)selection;
+ Object selElem = sel.getFirstElement();
+ if (selElem instanceof IFile) {
+ _file = (IFile)selElem;
+ }
+ }
+ }
+
+ public void run(IAction action) {
+ if ((_file != null) && (_job == null)) {
+ _job = new GenerateEcoreJob();
+ _job.schedule();
+ }
+ }
+
+ private class GenerateEcoreJob extends Job {
+ private GenerateEcoreJob() {
+ super("Generating Ecore Model for " + _file.getName());
+ }
+
+ protected IStatus run(IProgressMonitor monitor) {
+
+ EcoreGenerator generator = new EcoreGenerator();
+ generator.generate(_file, monitor);
+
+ _job = null;
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/actions/GenerateEmfatic.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/actions/GenerateEmfatic.java
new file mode 100644
index 0000000..e365a45
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/actions/GenerateEmfatic.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.actions;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.emfatic.core.generator.emfatic.EmfaticGenerator;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class GenerateEmfatic implements IObjectActionDelegate {
+ private class GenerateEmfaticJob extends Job {
+
+ protected IStatus run(IProgressMonitor monitor) {
+
+ boolean ok = ecoreValidate(_file, monitor);
+ if (ok) {
+ EmfaticGenerator generator = new EmfaticGenerator();
+ generator.generate(_file, monitor);
+ }
+ _job = null;
+ return Status.OK_STATUS;
+ }
+
+ GenerateEmfaticJob() {
+ super("Generating Emfatic Source for " + _file.getName());
+ }
+ }
+
+ public GenerateEmfatic() {
+ }
+
+ public void setActivePart(IAction iaction, IWorkbenchPart iworkbenchpart) {
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ _file = null;
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection sel = (IStructuredSelection) selection;
+ Object selElem = sel.getFirstElement();
+ if (selElem instanceof IFile)
+ _file = (IFile) selElem;
+ }
+ }
+
+ public void run(IAction action) {
+ if (_file != null && _job == null) {
+ _job = new GenerateEmfaticJob();
+ _job.schedule();
+ }
+ }
+
+ private IFile _file;
+ private GenerateEmfaticJob _job;
+
+ public static boolean ecoreValidate(IFile ecoreFile, IProgressMonitor progressMonitor) {
+ String ecoreFilePath = ecoreFile.getFullPath().toString();
+ URI uri = URI.createPlatformResourceURI(ecoreFilePath);
+ ResourceSet resourceSet = new ResourceSetImpl();
+ Resource ecoreResource = resourceSet.getResource(uri, true);
+ if (ecoreFile != null) {
+ progressMonitor.beginTask("ecoreValidating ...", 1);
+ EObject rootPackage = ecoreResource.getContents().get(0);
+ Diagnostician diagnostician = new Diagnostician();
+ final Diagnostic diagnostic = diagnostician.validate(rootPackage);
+ progressMonitor.worked(1);
+ // display as markers
+ if (progressMonitor.isCanceled()) {
+ handleDiagnostic(ecoreFile, Diagnostic.CANCEL_INSTANCE);
+ } else {
+ handleDiagnostic(ecoreFile, diagnostic);
+ }
+ boolean res = diagnostic.getSeverity() < Diagnostic.ERROR;
+ return res;
+ }
+ return false;
+ }
+
+ private static void handleDiagnostic(IFile ecoreFile, Diagnostic diagnostic) {
+
+ int severity = diagnostic.getSeverity();
+ if (diagnostic.getSeverity() == Diagnostic.OK) {
+ // TODO no error
+ }
+
+ deleteMarkers(ecoreFile, false, IResource.DEPTH_ZERO);
+ for (Diagnostic childDiagnostic : diagnostic.getChildren()) {
+ try {
+ createMarkers(ecoreFile, childDiagnostic, null);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public static void createMarkers(IResource resource, Diagnostic diagnostic, Diagnostic parentDiagnostic)
+ throws CoreException {
+ if (resource != null && resource.exists()) {
+ IMarker marker = resource.createMarker(getMarkerID());
+ int severity = diagnostic.getSeverity();
+ if (severity < Diagnostic.WARNING) {
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO);
+ } else if (severity < Diagnostic.ERROR) {
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
+ } else {
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
+ }
+
+ String message = diagnostic.getMessage();
+ if (message != null) {
+ marker.setAttribute(IMarker.MESSAGE, message);
+ }
+
+ }
+ }
+
+ protected static String getMarkerID() {
+ return "org.eclipse.core.resources.problemmarker";
+ }
+
+ protected static void deleteMarkers(IResource resource, boolean includeSubtypes, int depth) {
+ if (resource != null && resource.exists()) {
+ try {
+ resource.deleteMarkers(getMarkerID(), includeSubtypes, depth);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/CascadedContentAssistProcessor.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/CascadedContentAssistProcessor.java
new file mode 100644
index 0000000..3f9ce5c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/CascadedContentAssistProcessor.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.contentassist;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+
+public class CascadedContentAssistProcessor implements IContentAssistProcessor {
+
+ private ProposalsComparator proposalsComparator = new ProposalsComparator();
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int offset) {
+ List<ICompletionProposal> res = new ArrayList<ICompletionProposal>();
+ for (IContentAssistProcessor cap : caps) {
+ ICompletionProposal[] oneCap = cap.computeCompletionProposals(
+ viewer, offset);
+ if (oneCap != null) {
+ for (ICompletionProposal cp : oneCap) {
+ if (!res.contains(cp)) {
+ res.add(cp);
+ }
+ }
+ }
+ }
+ ICompletionProposal[] res2 = new ICompletionProposal[res.size()];
+ res.toArray(res2);
+ // Arrays.sort(res2, proposalsComparator);
+ return res2;
+ }
+
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ return null;
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ List<Character> res = new ArrayList<Character>();
+ for (IContentAssistProcessor cap : caps) {
+ char[] capAct = cap.getCompletionProposalAutoActivationCharacters();
+ for (char c : capAct) {
+ if (!res.contains(c)) {
+ res.add(c);
+ }
+ }
+ }
+ char[] res2 = new char[res.size()];
+ int i = 0;
+ for (Character c : res) {
+ res2[i] = c;
+ i++;
+ }
+ return res2;
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ return null;
+ }
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ List<IContentAssistProcessor> caps = new ArrayList<IContentAssistProcessor>();
+
+ public void add(IContentAssistProcessor cap) {
+ caps.add(cap);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/EmfaticContentAssistProcessor.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/EmfaticContentAssistProcessor.java
new file mode 100644
index 0000000..da46832
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/EmfaticContentAssistProcessor.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+
+public class EmfaticContentAssistProcessor implements IContentAssistProcessor {
+
+ private EmfaticEditor _editor = null;
+ private ProposalsComparator proposalsComparator = new ProposalsComparator();
+
+ public EmfaticContentAssistProcessor(EmfaticEditor editor) {
+ _editor = editor;
+ }
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int offset) {
+
+ ASTNode nodeAtCursor = _editor.getNodeAtCursor();
+ if (nodeAtCursor == null) {
+ return null;
+ }
+ ASTNode node = _editor.getClosestEnclosingASTNodeAt(nodeAtCursor.getRangeStart(), EmfaticASTNode.class);
+ String word = node.getText();
+
+ List<ICompletionProposal> returnProposals = new ArrayList<ICompletionProposal>();
+
+ ICompletionProposal lonely = new CompletionProposal(
+ word, //replacementString
+ node.getRangeStart(), //replacementOffset the offset of the text to be replaced
+ node.getRangeLength(), //replacementLength the length of the text to be replaced
+ word.length(), //cursorPosition the position of the cursor following the insert relative to replacementOffset
+ null, //image to display
+ word, //displayString the string to be displayed for the proposal
+ null, //contentInformation the context information associated with this proposal
+ "" ); //additional proposal info
+ returnProposals.add(lonely);
+
+ ICompletionProposal[] proposals = new ICompletionProposal[returnProposals
+ .size()];
+ returnProposals.toArray(proposals);
+
+ Arrays.sort(proposals, proposalsComparator);
+ return proposals;
+ }
+
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ return null;
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ return new char[] { };
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ return null;
+ }
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/EmfaticKeywordContentAssistProcessor.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/EmfaticKeywordContentAssistProcessor.java
new file mode 100644
index 0000000..53dd02c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/EmfaticKeywordContentAssistProcessor.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.contentassist;
+
+import java.util.TreeSet;
+
+import org.eclipse.emf.emfatic.core.util.EmfaticKeywords;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ContextInformation;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+
+public class EmfaticKeywordContentAssistProcessor implements
+ IContentAssistProcessor {
+
+ private EmfaticEditor _editor = null;
+ private TreeSet<String> proposalList = new TreeSet<String>();
+ private IContextInformationValidator fValidator = new Validator();
+
+ public EmfaticKeywordContentAssistProcessor(EmfaticEditor editor) {
+ _editor = editor;
+ }
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int offset) {
+
+ try {
+ if (viewer.getDocument().getChar(offset - 1) == '@') {
+ return new ICompletionProposal[] {};
+ }
+ } catch (BadLocationException e) {
+ // do nothing
+ }
+
+ WordPartDetector wpd = new WordPartDetector(viewer, offset);
+ String start = wpd.wordPart;
+ proposalList = new TreeSet<String>();
+ for (String kw : EmfaticKeywords.GetKeywords()) {
+ if (kw.startsWith(start)) {
+ proposalList.add(kw);
+ }
+ }
+ ICompletionProposal[] res = turnProposalVectorIntoAdaptedArray(wpd);
+ return res;
+ }
+
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ return new char[] {};
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ return fValidator;
+ }
+
+ public String getErrorMessage() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /*
+ * Turns the vector into an Array of ICompletionProposal objects
+ */
+ protected ICompletionProposal[] turnProposalVectorIntoAdaptedArray(
+ WordPartDetector word) {
+ ICompletionProposal[] result = new ICompletionProposal[proposalList
+ .size()];
+
+ int index = 0;
+
+ for (String keyWord : proposalList) {
+
+ IContextInformation info = new ContextInformation(keyWord,
+ getContentInfoString(keyWord));
+ // Creates a new completion proposal.
+ result[index] = new CompletionProposal(keyWord, // replacementString
+ word.getOffset(), // replacementOffset the offset of the
+ // text to be replaced
+ word.getLength(), // replacementLength the length of the
+ // text to be replaced
+ keyWord.length(), // cursorPosition the position of the
+ // cursor following the insert relative
+ // to replacementOffset
+ null, // image to display
+ keyWord, // displayString the string to be displayed for
+ // the proposal
+ null, // contentInformation the context information
+ // associated with this proposal
+ getContentInfoString(keyWord));
+ index++;
+ }
+ proposalList.clear();
+ return result;
+ }
+
+ /**
+ * Method getContentInfoString.
+ *
+ * @param keyWord
+ */
+ private String getContentInfoString(String keyWord) {
+ return "";
+ }
+
+ /**
+ * Simple content assist tip closer. The tip is valid in a range of 5
+ * characters around its popup location.
+ */
+ protected static class Validator implements IContextInformationValidator,
+ IContextInformationPresenter {
+
+ protected int fInstallOffset;
+
+ /*
+ * @see IContextInformationValidator#isContextInformationValid(int)
+ */
+ public boolean isContextInformationValid(int offset) {
+ return Math.abs(fInstallOffset - offset) < 5;
+ }
+
+ /*
+ * @see IContextInformationValidator#install(IContextInformation,
+ * ITextViewer, int)
+ */
+ public void install(IContextInformation info, ITextViewer viewer,
+ int offset) {
+ fInstallOffset = offset;
+ }
+
+ /*
+ * @see org.eclipse.jface.text.contentassist.IContextInformationPresenter#updatePresentation(int,
+ * TextPresentation)
+ */
+ public boolean updatePresentation(int documentPosition,
+ TextPresentation presentation) {
+ return false;
+ }
+ };
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/ProposalsComparator.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/ProposalsComparator.java
new file mode 100644
index 0000000..139a966
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/ProposalsComparator.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.contentassist;
+
+import java.util.Comparator;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+
+public class ProposalsComparator implements Comparator<ICompletionProposal> {
+
+ /**
+ * Compares two ICompletionProposals according to their display Strings
+ *
+ * @return same as String.compareToIgnoreCase()
+ */
+ public int compare(ICompletionProposal p1, ICompletionProposal p2) {
+ return p1.getDisplayString().compareToIgnoreCase(p2.getDisplayString());
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/WordPartDetector.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/WordPartDetector.java
new file mode 100644
index 0000000..71c1042
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/contentassist/WordPartDetector.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.contentassist;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.ITextViewer;
+
+public class WordPartDetector {
+ String wordPart = "";
+ int docOffset;
+
+ /**
+ * Method WordPartDetector.
+ *
+ * @param viewer
+ * is a text viewer
+ * @param documentOffset
+ * into the SQL document
+ */
+ public WordPartDetector(ITextViewer viewer, int documentOffset) {
+ docOffset = documentOffset - 1;
+ try {
+ // find the word that must be finished
+ while (docOffset >= viewer.getTopIndexStartOffset()
+ && Character.isLetterOrDigit(viewer.getDocument().getChar(
+ docOffset))) {
+ docOffset--;
+ }
+ // we've been one step too far : increase the offset
+ docOffset++;
+ wordPart = viewer.getDocument().get(docOffset,
+ documentOffset - docOffset);
+ } catch (BadLocationException e) {
+ // do nothing
+ }
+ }
+
+ /**
+ * Method getString.
+ *
+ * @return String
+ */
+ public String getString() {
+ return wordPart;
+ }
+
+ public int getLength() {
+ return wordPart.length();
+ }
+
+ public int getOffset() {
+ return docOffset;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticAutoEditStrategy.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticAutoEditStrategy.java
new file mode 100644
index 0000000..6017866
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticAutoEditStrategy.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import org.eclipse.emf.emfatic.ui.EmfaticUIPlugin;
+import org.eclipse.emf.emfatic.ui.preferences.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
+import org.eclipse.jface.text.DocumentCommand;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+
+public class EmfaticAutoEditStrategy implements IAutoEditStrategy {
+
+ EmfaticEditor _editor = null;
+ private IPreferenceStore preferenceStore;
+
+ public EmfaticAutoEditStrategy(EmfaticEditor editor) {
+ _editor = editor;
+ preferenceStore = EmfaticUIPlugin.getDefault().getPreferenceStore();
+ }
+
+ public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
+ if (c.text == null) {
+ return;
+ }
+ if (c.text.endsWith("{")) {
+ smartBrace(d, c);
+ } else if (c.text.endsWith("\"")) {
+ insert(c, "", "\"");
+ } else if (c.text.endsWith("[")) {
+ c.text = c.text + "*]";
+ }
+ }
+
+ /**
+ * @see DefaultIndentLineAutoEditStrategy
+ */
+ private void smartBrace(IDocument d, DocumentCommand c) {
+ if (!preferenceStore.getBoolean(PreferenceConstants.P_BOOLEAN)) {
+ return;
+ }
+ if (c.offset == -1 || d.getLength() == 0) {
+ return;
+ }
+ String computedIndent = computeIndent(d, c);
+ String beforeCaret = "\r\n" + computedIndent + " ";
+ String afterCaret = "\r\n" + computedIndent + "}";
+ insert(c, beforeCaret, afterCaret);
+ }
+
+ private void insert (DocumentCommand c, String beforeCaret, String afterCaret) {
+ StringBuffer buf = new StringBuffer(c.text);
+ buf.append(beforeCaret);
+ c.caretOffset = c.offset + beforeCaret.toCharArray().length + 1;
+ c.shiftsCaret = false;
+ buf.append(afterCaret);
+ c.length = 0;
+ c.text = buf.toString();
+ }
+
+ private String computeIndent(IDocument d, DocumentCommand c) {
+ String res = "";
+ try {
+ int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
+ IRegion info = d.getLineInformationOfOffset(p);
+ int start = info.getOffset();
+
+ // find white spaces
+ int end = findEndOfWhiteSpace(d, start, c.offset);
+
+ if (end > start) {
+ res = d.get(start, end - start);
+ }
+ } catch (BadLocationException excp) {
+ // stop work
+ }
+ return res;
+ }
+
+ /**
+ * Returns the first offset greater than <code>offset</code> and smaller
+ * than <code>end</code> whose character is not a space or tab character.
+ * If no such offset is found, <code>end</code> is returned.
+ *
+ * @param document
+ * the document to search in
+ * @param offset
+ * the offset at which searching start
+ * @param end
+ * the offset at which searching stops
+ * @return the offset in the specified range whose character is not a space
+ * or tab
+ * @exception BadLocationException
+ * if position is an invalid range in the given document
+ */
+ protected int findEndOfWhiteSpace(IDocument document, int offset, int end) throws BadLocationException {
+ while (offset < end) {
+ char c = document.getChar(offset);
+ if (c != ' ' && c != '\t') {
+ return offset;
+ }
+ offset++;
+ }
+ return end;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticCodeScanner.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticCodeScanner.java
new file mode 100644
index 0000000..9ee8096
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticCodeScanner.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import org.eclipse.emf.emfatic.core.util.EmfaticBasicTypes;
+import org.eclipse.emf.emfatic.core.util.EmfaticKeywords;
+import org.eclipse.gymnast.runtime.ui.editor.LDTCodeScanner;
+import org.eclipse.gymnast.runtime.ui.util.LDTColorProvider;
+import org.eclipse.jface.text.rules.MultiLineRule;
+
+public class EmfaticCodeScanner extends LDTCodeScanner
+{
+
+ public EmfaticCodeScanner()
+ {
+ }
+
+ public void initKeywords()
+ {
+ addKeywords(EmfaticKeywords.GetNormalKeywords(), LDTColorProvider.BLUE);
+ addKeywords(EmfaticKeywords.GetSpecialKeywords(), LDTColorProvider.DARK_BLUE, null, 1);
+ addKeywords(EmfaticBasicTypes.GetBasicTypeNames(), LDTColorProvider.DARK_GREEN);
+ }
+
+ public void initLiterals()
+ {
+ org.eclipse.jface.text.rules.IToken literalToken = getLiteralToken();
+ addRule(new MultiLineRule("\"", "\"", literalToken, '\\'));
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditor.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditor.java
new file mode 100644
index 0000000..1b9241c
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditor.java
@@ -0,0 +1,512 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import java.lang.ref.WeakReference;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.emfatic.core.generics.util.OneToManyMap;
+import org.eclipse.emf.emfatic.core.generics.util.OneToOneMap;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.BoundExceptWildcard;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Reference;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeWithMulti;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Wildcard;
+import org.eclipse.emf.emfatic.ui.hyperlinks.EmfaticHyperlinkDetector;
+import org.eclipse.emf.emfatic.ui.outline.EmfaticContentOutlinePage;
+import org.eclipse.emf.emfatic.ui.partition.EmfaticDocumentProvider;
+import org.eclipse.emf.emfatic.ui.redsquiggles.EmfaticCSTChangeListener;
+import org.eclipse.emf.emfatic.ui.views.TypesView;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+import org.eclipse.gymnast.runtime.ui.editor.LDTEditor;
+import org.eclipse.gymnast.runtime.ui.editor.LDTSourceViewerConfiguration;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
+import org.eclipse.jface.text.source.projection.ProjectionSupport;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.IShowInSource;
+import org.eclipse.ui.part.IShowInTargetList;
+import org.eclipse.ui.part.ShowInContext;
+import org.eclipse.ui.texteditor.ContentAssistAction;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+
+public class EmfaticEditor extends LDTEditor implements IShowInTargetList,
+ IShowInSource {
+
+ private EmfaticEditorSelectionListener selectionListener = new EmfaticEditorSelectionListener(
+ this);
+ private EmfaticContentOutlinePage _emfaticContentOutlinePage;
+ private EmfaticKeyListener _keyListener = null;
+ private OutlineNode[] lastShownOutlineNodes = new OutlineNode[0];
+ private IViewReference _typesViewReference = null;
+
+ public EmfaticEditor() {
+ addParseTreeChangedListener(new EmfaticCSTChangeListener(this));
+ setDocumentProvider(new EmfaticDocumentProvider());
+ }
+
+ protected LDTSourceViewerConfiguration createSourceViewerConfiguration() {
+ return new EmfaticSourceViewerConfiguration(this);
+ }
+
+ @Override
+ protected EmfaticOutlineConfiguration createOutlineConfiguration() {
+ return new EmfaticOutlineConfiguration(this);
+ }
+
+ private ProjectionSupport projectionSupport;
+ private ProjectionAnnotationModel annotationModel;
+ private Annotation[] oldAnnotations;
+
+ /**
+ * folding support, as explained in
+ * http://www.eclipse.org/articles/Article-Folding-in-Eclipse-Text-Editors/folding.html
+ */
+ public void updateFoldingStructure(List<Position> positions) {
+ initFoldingSupport();
+ Annotation[] annotations = new Annotation[positions.size()];
+ // the new (annotation, position) pairs
+ HashMap<ProjectionAnnotation, Position> newAnnotations = new HashMap<ProjectionAnnotation, Position>();
+ for (int i = 0; i < positions.size(); i++) {
+ ProjectionAnnotation annotation = new ProjectionAnnotation();
+ newAnnotations.put(annotation, positions.get(i));
+ annotations[i] = annotation;
+ }
+ annotationModel.modifyAnnotations(oldAnnotations, newAnnotations, null);
+ oldAnnotations = annotations;
+ }
+
+ /**
+ * folding support, as explained in
+ * http://www.eclipse.org/articles/Article-Folding-in-Eclipse-Text-Editors/folding.html
+ *
+ */
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+ initFoldingSupport();
+ selectionListener.install(getSelectionProvider());
+ _keyListener = new EmfaticKeyListener(this);
+ getSourceViewer().getTextWidget().addKeyListener(_keyListener);
+ }
+
+ private void initFoldingSupport() {
+ if (annotationModel == null) {
+ ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
+ projectionSupport = new ProjectionSupport(viewer,
+ getAnnotationAccess(), getSharedColors());
+ // see AntEditor for hovers displaying HTML
+ /*
+ * A summary is an annotation that gets created out of all
+ * annotations with a type that has been registered through this
+ * method and that are inside the folded region.
+ *
+ */
+ projectionSupport
+ .addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
+ projectionSupport
+ .addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
+ projectionSupport.install();
+ // turn projection mode on
+ viewer.doOperation(ProjectionViewer.TOGGLE);
+ annotationModel = viewer.getProjectionAnnotationModel();
+ }
+ }
+
+ /**
+ * folding support, as explained in
+ * http://www.eclipse.org/articles/Article-Folding-in-Eclipse-Text-Editors/folding.html
+ *
+ *
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite,
+ * org.eclipse.jface.text.source.IVerticalRuler, int)
+ */
+ protected ISourceViewer createSourceViewer(Composite parent,
+ IVerticalRuler ruler, int styles) {
+ fAnnotationAccess = getAnnotationAccess();
+ fOverviewRuler = createOverviewRuler(getSharedColors());
+ ISourceViewer viewer = new ProjectionViewer(parent, ruler,
+ getOverviewRuler(), isOverviewRulerVisible(), styles);
+ // ensure decoration support has been created and configured.
+ getSourceViewerDecorationSupport(viewer);
+ // viewer.addTextListener(textListener);
+ return viewer;
+ }
+
+ /*
+ * LDT has already support for this (as well as for ITextListener). I
+ * realized after adding it here
+ */
+ public EmfaticASTNode getClosestEnclosingASTNodeAt(int offset, Class filter) {
+ return getClosestEnclosingASTNodeAt(offset, 0, filter);
+ }
+
+ public EmfaticASTNode getClosestEnclosingASTNodeAt(int offset, int length,
+ Class filter) {
+ EmfaticASTNode node = getClosestEnclosingASTNodeAtWithin(
+ getParseRoot(), offset, length, filter);
+ return node;
+ }
+
+ private EmfaticASTNode getClosestEnclosingASTNodeAtWithin(ASTNode within,
+ int offset, int length, Class filter) {
+ if (within == null) {
+ return null;
+ }
+ ASTNode node = within.getNodeAt(offset, 0);
+ // search within the for any ASTNode
+ for (int i = offset + 1; (node == null) && (i < offset + length); i++) {
+ node = getParseRoot().getNodeAt(i, 0);
+ }
+ if (node != null) {
+ /*
+ * An outer node fulfilling the filter condition may have been found
+ * which hides a more specific node also fulfilling the filter
+ */
+ if (node.getChildren().length > 0) {
+ for (ASTNode child : node.getChildren()) {
+ ASTNode innerNode = getClosestEnclosingASTNodeAtWithin(
+ child, offset, length, filter);
+ if (innerNode != null) {
+ node = innerNode;
+ break;
+ }
+ }
+ }
+ /*
+ * search upwards till finding a node of type filter, or reaching
+ * the root
+ */
+ while (!filter.isInstance(node) && (node.getParent() != null)) {
+ node = node.getParent();
+ }
+ }
+ if (filter.isInstance(node)) {
+ return (EmfaticASTNode) node;
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public void dispose() {
+ if (selectionListener != null) {
+ selectionListener.uninstall(getSelectionProvider());
+ selectionListener = null;
+ }
+ super.dispose();
+ }
+
+ public OneToOneMap<ASTNode, EObject> getCstDecl2EcoreAST() {
+ CompUnit compUnit = (CompUnit) getParseRoot();
+ if (compUnit != null) {
+ return compUnit.getCstDecl2EcoreAST();
+ }
+ return null;
+ }
+
+ public OneToManyMap<EObject, ASTNode> getEcoreDecl2CstUse() {
+ CompUnit compUnit = (CompUnit) getParseRoot();
+ if (compUnit != null) {
+ return compUnit.getEcoreDecl2CstUse();
+ }
+ return null;
+ }
+
+ public IDocument getDocument() {
+ IDocument doc = null;
+ if (getDocumentProvider() == null) {
+ return doc;
+ }
+ doc = getDocumentProvider().getDocument(getEditorInput());
+ return doc;
+ }
+
+ public void openTarget(EmfaticASTNode linkTarget) {
+ setSelection(linkTarget, true);
+ }
+
+ public void setSelection(EmfaticASTNode reference, boolean moveCursor) {
+ if (reference == null) {
+ if (moveCursor) {
+ resetHighlightRange();
+ markInNavigationHistory();
+ }
+ return;
+ }
+
+ if (moveCursor) {
+ markInNavigationHistory();
+ }
+
+ ISourceViewer sourceViewer = getSourceViewer();
+ if (sourceViewer == null) {
+ return;
+ }
+ StyledText textWidget = sourceViewer.getTextWidget();
+ if (textWidget == null) {
+ return;
+ }
+
+ try {
+ int offset = reference.getRangeStart();
+ if (offset < 0) {
+ return;
+ }
+ int length = reference.getRangeLength();
+ textWidget.setRedraw(false);
+ if (length > 0) {
+ setHighlightRange(offset, length, moveCursor);
+ }
+ if (!moveCursor) {
+ return;
+ }
+ if (offset > -1 && length > 0) {
+ sourceViewer.revealRange(offset, length);
+ // Selected region begins one index after offset
+ sourceViewer.setSelectedRange(offset, length);
+ markInNavigationHistory();
+ }
+ } catch (IllegalArgumentException x) {
+ x.printStackTrace();
+ } finally {
+ textWidget.setRedraw(true);
+ }
+ }
+
+ public void setContentOutlinePage(
+ EmfaticContentOutlinePage emfaticContentOutlinePage) {
+ _emfaticContentOutlinePage = emfaticContentOutlinePage;
+
+ }
+
+ protected EmfaticContentOutlinePage getContentOutlinePage() {
+ return _emfaticContentOutlinePage;
+ }
+
+ public EObject getEcoreDeclAtCursor() {
+ ISelection selection = getSelectionProvider().getSelection();
+ if (selection instanceof ITextSelection) {
+ ITextSelection ts = (ITextSelection) selection;
+ int offset = ts.getOffset();
+ int length = ts.getLength();
+ ReferedEcoreDecl red = getReferedEcoreDecl(offset, length);
+ if (red == null || red.ecoreDecl == null) {
+ return null;
+ }
+ EObject ecoreDecl = red.ecoreDecl;
+ return ecoreDecl;
+ }
+ return null;
+ }
+
+ public EObject gotoDeclaration() {
+ EObject ecoreDecl = getEcoreDeclAtCursor();
+ if (ecoreDecl == null) {
+ return null;
+ }
+ EmfaticASTNode landingPlace = EmfaticHyperlinkDetector.getLandingPlace(
+ ecoreDecl, this);
+ setSelection(landingPlace, true);
+ return ecoreDecl;
+ }
+
+ public ReferedEcoreDecl getReferedEcoreDecl(int offset, int length) {
+ /*
+ * first chance: Wildcard
+ */
+ EmfaticASTNode node = getClosestEnclosingASTNodeAt(offset, length,
+ Wildcard.class);
+ if (node != null) {
+ // it can still be an unbounded wildcard
+ node = ((Wildcard) node).getBoundExceptWildcard();
+ }
+ if (node == null) {
+ // second chance: BoundExceptWildcard
+ node = getClosestEnclosingASTNodeAt(offset, length,
+ BoundExceptWildcard.class);
+ if (node == null) {
+ // thir chance: TypeWithMult
+ node = getClosestEnclosingASTNodeAt(offset, length,
+ TypeWithMulti.class);
+ if (node == null) {
+ // fourth chance: Reference (for an opposite reference)
+ node = getClosestEnclosingASTNodeAt(offset, length,
+ Reference.class);
+ if (node == null) {
+ return null;
+ }
+ node = ((Reference) node).getOppositeName();
+ } else {
+ // leave a BoundExceptWildcard in node
+ node = ((TypeWithMulti) node).getName();
+ }
+ }
+ }
+ // actually the QualifiedID was placed in the bigMap
+ if (node instanceof BoundExceptWildcard) {
+ node = ((BoundExceptWildcard) node)
+ .getRawTNameOrTVarOrParamzedTName();
+ }
+ EObject ecoreDecl = getEcoreDecl2CstUse().getInv(node);
+ ReferedEcoreDecl res = new ReferedEcoreDecl();
+ res.ecoreDecl = ecoreDecl;
+ res.node = node;
+ return res;
+ }
+
+ public class ReferedEcoreDecl {
+ public EObject ecoreDecl;
+ public EmfaticASTNode node;
+ }
+
+ protected void createActions() {
+ super.createActions();
+ ResourceBundle bundle = EmfaticEditorMessages.getResourceBundle();
+
+ IAction action = new ContentAssistAction(bundle,
+ "ContentAssistProposal.", this); //$NON-NLS-1$
+ action
+ .setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
+ setAction("ContentAssistProposal", action); //$NON-NLS-1$
+ markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$
+ // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
+ // helpContextId);
+
+ }
+
+ @Override
+ public OutlineNode[] getOutlineElements() {
+ OutlineNode[] candidateOutlineNodes = super.getOutlineElements();
+ if (candidateOutlineNodes != null && candidateOutlineNodes.length > 0) {
+ lastShownOutlineNodes = candidateOutlineNodes;
+ }
+ return lastShownOutlineNodes;
+ }
+
+ /**
+ * see p. 467 and p. 499 of JDGE 2nd Ed
+ */
+ public String[] getShowInTargetIds() {
+ EObject ecoreDecl = getEcoreDeclAtCursor();
+ String[] res = null;
+ if (ecoreDecl == null) {
+ ecoreDecl = getEcoreDeclAtCursor2();
+ if (ecoreDecl == null) {
+ res = new String[] {};
+ } else {
+ res = new String[] {TypesView.ID };
+ }
+
+ } else {
+ res = new String[] { TypesView.ID };
+ }
+ return res;
+ }
+
+ private EObject getEcoreDeclAtCursor2() {
+ ISelection selection = getSelectionProvider().getSelection();
+ if (selection instanceof ITextSelection) {
+ ITextSelection ts = (ITextSelection) selection;
+ int offset = ts.getOffset();
+ int length = ts.getLength();
+ ASTNode node = getClosestEnclosingASTNodeAt(offset, ClassDecl.class);
+ if (node == null) {
+ return null;
+ }
+ EObject ecoreDecl = getCstDecl2EcoreAST().get(node);
+ return ecoreDecl;
+ }
+ return null;
+
+ }
+
+ /**
+ * see p. 467 and p. 499 of JDGE 2nd Ed
+ */
+ public ShowInContext getShowInContext() {
+ FileEditorInput fei = (FileEditorInput) getEditorInput();
+ ISelection selection = getSelectionProvider().getSelection();
+ IFile f = fei.getFile();
+ ShowInContext res = new ShowInContext(f, selection);
+ return res;
+ }
+
+ public void showInTypeHierarchy(EClass openedDecl) {
+ if (!(openedDecl instanceof EClass)) {
+ return;
+ }
+ TypesView tv = getTypesView();
+ if (tv == null) {
+ return;
+ }
+ WeakReference<EClass> wrC = new WeakReference<EClass>(
+ (EClass) openedDecl);
+ tv.setInput(wrC, true);
+ }
+
+ public TypesView getTypesView() {
+ // 1) try if there's a cached reference
+ if (_typesViewReference != null) {
+ TypesView tv = (TypesView) _typesViewReference.getView(false);
+ if (tv != null) {
+ return tv;
+ }
+ }
+ // 2) look for the view opened by the user
+ IWorkbenchPage wp = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ IViewReference _typesViewReference = wp.findViewReference(TypesView.ID);
+ if (_typesViewReference != null) {
+ TypesView tv = (TypesView) _typesViewReference.getView(true);
+ if (tv != null) {
+ return tv;
+ }
+ }
+ // 3) open it programatically
+ try {
+ IViewPart tv = wp.showView(TypesView.ID);
+ return (TypesView) tv;
+ } catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorActionContributor.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorActionContributor.java
new file mode 100644
index 0000000..cd262c1
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorActionContributor.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.emf.emfatic.ui.editor.actions.OpenDeclarationAction;
+import org.eclipse.gymnast.runtime.ui.editor.LDTEditorActionContributor;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+
+public class EmfaticEditorActionContributor extends LDTEditorActionContributor {
+
+ // private RetargetTextEditorAction fContentAssistProposal;
+ private OpenDeclarationAction fOpenDeclarationAction;
+
+ public EmfaticEditorActionContributor() {
+ super();
+ ResourceBundle bundle = EmfaticEditorMessages.getResourceBundle();
+
+ /*
+ * fContentAssistProposal = new RetargetTextEditorAction(bundle,
+ * "ContentAssistProposal."); //$NON-NLS-1$
+ */
+ String commandId = ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS;
+ // fContentAssistProposal.setActionDefinitionId(commandId);
+
+ }
+
+ public void contributeToMenu(IMenuManager menu) {
+ super.contributeToMenu(menu);
+
+ /*
+ * if (fContentAssistProposal != null) { IMenuManager editMenu = menu
+ * .findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
+ * editMenu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS,
+ * fContentAssistProposal); }
+ */
+
+ if (fOpenDeclarationAction != null) {
+ IMenuManager navigateMenu = menu
+ .findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
+ if (navigateMenu != null) {
+ navigateMenu.appendToGroup(IWorkbenchActionConstants.OPEN_EXT,
+ fOpenDeclarationAction);
+ navigateMenu.setVisible(true);
+ }
+ }
+
+ }
+
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+
+ ITextEditor editor = null;
+ if (part instanceof ITextEditor) {
+ editor = (ITextEditor) part;
+ }
+
+ /*
+ * fContentAssistProposal.setAction(getAction(editor,
+ * "ContentAssistProposal")); //$NON-NLS-1$
+ */
+
+ if (editor instanceof EmfaticEditor) {
+ EmfaticEditor _editor = (EmfaticEditor) part;
+
+ if (fOpenDeclarationAction == null) {
+ fOpenDeclarationAction = new OpenDeclarationAction(_editor);
+ contributeToMenu(getActionBars().getMenuManager());
+ }
+ if (fOpenDeclarationAction != null) {
+ fOpenDeclarationAction.setEditor(_editor);
+ }
+
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorMessages.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorMessages.java
new file mode 100644
index 0000000..b1019cb
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorMessages.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class EmfaticEditorMessages {
+
+ private static final String BUNDLE_NAME = "org.eclipse.emf.emfatic.ui.editor.EmfaticEditorMessages"; //$NON-NLS-1$
+
+ private static final ResourceBundle fgResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private EmfaticEditorMessages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ protected static ResourceBundle getResourceBundle() {
+ return fgResourceBundle;
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorMessages.properties b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorMessages.properties
new file mode 100644
index 0000000..b2ca0a8
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorMessages.properties
@@ -0,0 +1,11 @@
+
+ContentAssistProposal.label=Content &Assist@Ctrl+Space
+ContentAssistProposal.tooltip=Content Assist
+ContentAssistProposal.image=
+ContentAssistProposal.description=Content Assist
+
+ContentFormat.label=&Format
+ContentFormat.tooltip=Format build file source
+ContentFormat.image=
+ContentFormat.description=Format build file source
+
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorSelectionListener.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorSelectionListener.java
new file mode 100644
index 0000000..1c1d4dc
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticEditorSelectionListener.java
@@ -0,0 +1,255 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.BoundExceptWildcard;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TopLevelDecl;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ISynchronizable;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.text.source.IAnnotationModelExtension;
+import org.eclipse.jface.viewers.IPostSelectionProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+
+public class EmfaticEditorSelectionListener implements ISelectionChangedListener {
+
+ private EmfaticEditor _editor = null;
+
+ public EmfaticEditorSelectionListener(EmfaticEditor editor) {
+ _editor = editor;
+ }
+
+ /**
+ * places as in the Java editor a highlight range on the left for the chosen
+ * class, datatype, enum, or mapentry
+ */
+ public void highlightRangeForTopLevelDecl(ITextSelection selection) {
+ _editor.resetHighlightRange();
+ ITextSelection ts = (ITextSelection) selection;
+ /*
+ * highlight the border of the top-level declaration at the cursor, if
+ * any
+ */
+ int offset = ts.getOffset();
+ int length = ts.getLength();
+ ASTNode declAtCursor = _editor.getClosestEnclosingASTNodeAt(offset, length, TopLevelDecl.class);
+ if ((declAtCursor != null) && declAtCursor instanceof TopLevelDecl) {
+ _editor.setHighlightRange(declAtCursor.getRangeStart(), declAtCursor.getRangeLength(), false);
+ }
+ }
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof ITextSelection) {
+ ITextSelection textSelection = (ITextSelection) selection;
+ highlightRangeForTopLevelDecl(textSelection);
+ markOccurrences(textSelection);
+ selectInOutline(textSelection);
+ }
+ }
+
+ private void selectInOutline(ITextSelection ts) {
+ int offset = ts.getOffset();
+ int length = ts.getLength();
+ EmfaticASTNode n = _editor.getClosestEnclosingASTNodeAt(offset, length, Object.class);
+ CompUnit compUnit = (CompUnit) _editor.getParseRoot();
+ if (compUnit == null) {
+ return;
+ }
+ Map<ASTNode, OutlineNode> a2o = compUnit.getCst2Outline();
+ OutlineNode toHighlight = findOutlineNodeFor(n, a2o);
+ if (toHighlight == null) {
+ return;
+ }
+ ISelection currentOutlineSelection = _editor.getContentOutlinePage().getSelection();
+ OutlineNode selected = null;
+ if (currentOutlineSelection instanceof TreeSelection) {
+ selected = (OutlineNode) ((TreeSelection) currentOutlineSelection).getFirstElement();
+ }
+ boolean skipSelect = (selected == toHighlight);
+ if (!skipSelect) {
+ _editor.getContentOutlinePage().selectFromEditor(toHighlight);
+ }
+ }
+
+ private OutlineNode findOutlineNodeFor(ASTNode n, Map<ASTNode, OutlineNode> a2o) {
+ if (a2o == null) {
+ return null;
+ }
+ OutlineNode res = a2o.get(n);
+ if (res != null) {
+ return res;
+ }
+ if (n != null && n.getParent() != null) {
+ res = findOutlineNodeFor(n.getParent(), a2o);
+ return res;
+ }
+ return null;
+ }
+
+ private void markOccurrences(ITextSelection ts) {
+ removeOccurrenceAnnotations();
+ int offset = ts.getOffset();
+ int length = ts.getLength();
+ BoundExceptWildcard cstUse = (BoundExceptWildcard) _editor.getClosestEnclosingASTNodeAt(offset, length,
+ BoundExceptWildcard.class);
+ if (cstUse == null) {
+ return;
+ }
+ EObject ecoreDecl = _editor.getEcoreDecl2CstUse().getInv(cstUse.getRawTNameOrTVarOrParamzedTName());
+ if (ecoreDecl == null) {
+ return;
+ }
+ Set<ASTNode> occuNodes = _editor.getEcoreDecl2CstUse().get(ecoreDecl);
+ Map<Annotation, Position> annotationMap = new HashMap<Annotation, Position>();
+ for (ASTNode n : occuNodes) {
+ String message = "";
+ Position pos = new Position(n.getRangeStart(), n.getRangeLength());
+ try {
+ message = _editor.getDocument().get(pos.offset, pos.length);
+ } catch (BadLocationException ex) {
+ // Skip this match
+ continue;
+ }
+ Annotation ann = new Annotation("org.eclipse.jdt.ui.occurrences", false, message);
+ annotationMap.put(ann, pos);
+ }
+ IDocumentProvider documentProvider = _editor.getDocumentProvider();
+ IDocument document = _editor.getDocument();
+ IAnnotationModel annotationModel = documentProvider.getAnnotationModel(_editor.getEditorInput());
+ if (annotationModel == null)
+ return;
+ Object lock = getLockObject(document);
+ if (lock == null) {
+ updateAnnotations(annotationModel, annotationMap);
+ } else {
+ synchronized (lock) {
+ updateAnnotations(annotationModel, annotationMap);
+ }
+ }
+ }
+
+ private void updateAnnotations(IAnnotationModel annotationModel, Map annotationMap) {
+ if (annotationModel instanceof IAnnotationModelExtension) {
+ ((IAnnotationModelExtension) annotationModel).replaceAnnotations(fOccurrenceAnnotations, annotationMap);
+ } else {
+ removeOccurrenceAnnotations();
+ Iterator iter = annotationMap.entrySet().iterator();
+ while (iter.hasNext()) {
+ Map.Entry mapEntry = (Map.Entry) iter.next();
+ annotationModel.addAnnotation((Annotation) mapEntry.getKey(), (Position) mapEntry.getValue());
+ }
+ }
+ fOccurrenceAnnotations = (Annotation[]) annotationMap.keySet().toArray(
+ new Annotation[annotationMap.keySet().size()]);
+ }
+
+ private void removeOccurrenceAnnotations() {
+ IDocumentProvider documentProvider = _editor.getDocumentProvider();
+ if (documentProvider == null) {
+ return;
+ }
+ IAnnotationModel annotationModel = documentProvider.getAnnotationModel(_editor.getEditorInput());
+ if (annotationModel == null || fOccurrenceAnnotations == null) {
+ return;
+ }
+ IDocument document = documentProvider.getDocument(_editor.getEditorInput());
+ Object lock = getLockObject(document);
+ if (lock == null) {
+ updateAnnotationModelForRemoves(annotationModel);
+ } else {
+ synchronized (lock) {
+ updateAnnotationModelForRemoves(annotationModel);
+ }
+ }
+ }
+
+ private void updateAnnotationModelForRemoves(IAnnotationModel annotationModel) {
+ if (annotationModel instanceof IAnnotationModelExtension) {
+ ((IAnnotationModelExtension) annotationModel).replaceAnnotations(fOccurrenceAnnotations, null);
+ } else {
+ for (int i = 0, length = fOccurrenceAnnotations.length; i < length; i++) {
+ annotationModel.removeAnnotation(fOccurrenceAnnotations[i]);
+ }
+ }
+ fOccurrenceAnnotations = null;
+ }
+
+ private Annotation[] fOccurrenceAnnotations = null;
+
+ /**
+ * Installs this selection changed listener with the given selection
+ * provider. If the selection provider is a post selection provider, post
+ * selection changed events are the preferred choice, otherwise normal
+ * selection changed events are requested.
+ *
+ * @param selectionProvider
+ */
+ public void install(ISelectionProvider selectionProvider) {
+ if (selectionProvider == null) {
+ return;
+ }
+ if (selectionProvider instanceof IPostSelectionProvider) {
+ IPostSelectionProvider provider = (IPostSelectionProvider) selectionProvider;
+ provider.addPostSelectionChangedListener(this);
+ } else {
+ selectionProvider.addSelectionChangedListener(this);
+ }
+ }
+
+ /**
+ * Removes this selection changed listener from the given selection
+ * provider.
+ *
+ * @param selectionProvider
+ */
+ public void uninstall(ISelectionProvider selectionProvider) {
+ if (selectionProvider == null) {
+ return;
+ }
+ if (selectionProvider instanceof IPostSelectionProvider) {
+ IPostSelectionProvider provider = (IPostSelectionProvider) selectionProvider;
+ provider.removePostSelectionChangedListener(this);
+ } else {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ }
+
+ private Object getLockObject(IDocument doc) {
+ Object lock = null;
+ if (doc instanceof ISynchronizable) {
+ lock = ((ISynchronizable) doc).getLockObject();
+ }
+ return lock;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticKeyListener.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticKeyListener.java
new file mode 100644
index 0000000..dd77522
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticKeyListener.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+
+public class EmfaticKeyListener implements KeyListener {
+
+ private EmfaticEditor _editor = null;
+
+ public EmfaticKeyListener(EmfaticEditor emfaticEditor) {
+ _editor = emfaticEditor;
+ }
+
+ public void keyPressed(KeyEvent e) {
+ }
+
+ public void keyReleased(KeyEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticOutlineConfiguration.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticOutlineConfiguration.java
new file mode 100644
index 0000000..248bead
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticOutlineConfiguration.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import org.eclipse.emf.emfatic.core.util.EmfaticOutlineBuilder;
+import org.eclipse.emf.emfatic.ui.outline.EmfaticContentOutlinePage;
+import org.eclipse.gymnast.runtime.core.outline.IOutlineBuilder;
+import org.eclipse.gymnast.runtime.ui.outline.LDTContentOutlinePage;
+import org.eclipse.gymnast.runtime.ui.outline.LDTOutlineConfiguration;
+
+public class EmfaticOutlineConfiguration extends LDTOutlineConfiguration {
+
+ private EmfaticEditor _editor;
+
+ public EmfaticOutlineConfiguration(EmfaticEditor editor) {
+ super(editor);
+ _editor = editor;
+ }
+
+ public IOutlineBuilder getOutlineBuilder() {
+ return new EmfaticOutlineBuilder();
+ }
+
+ public LDTContentOutlinePage createContentOutlinePage() {
+ return new EmfaticContentOutlinePage(_editor);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticSourceViewerConfiguration.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticSourceViewerConfiguration.java
new file mode 100644
index 0000000..235cc8d
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticSourceViewerConfiguration.java
@@ -0,0 +1,251 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.emfatic.core.lang.gen.parser.EmfaticParserDriver;
+import org.eclipse.emf.emfatic.ui.contentassist.CascadedContentAssistProcessor;
+import org.eclipse.emf.emfatic.ui.contentassist.EmfaticContentAssistProcessor;
+import org.eclipse.emf.emfatic.ui.contentassist.EmfaticKeywordContentAssistProcessor;
+import org.eclipse.emf.emfatic.ui.hyperlinks.EmfaticHyperlinkDetector;
+import org.eclipse.emf.emfatic.ui.partition.EmfaticPartitionScanner;
+import org.eclipse.emf.emfatic.ui.templates.EmfaticContextType;
+import org.eclipse.emf.emfatic.ui.templates.EmfaticTemplateCompletionProcessor;
+import org.eclipse.gymnast.runtime.core.parser.IParser;
+import org.eclipse.gymnast.runtime.ui.editor.LDTCodeScanner;
+import org.eclipse.gymnast.runtime.ui.editor.LDTSourceViewerConfiguration;
+import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
+import org.eclipse.jface.text.IAutoEditStrategy;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.presentation.PresentationReconciler;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.source.DefaultAnnotationHover;
+import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.ISourceViewer;
+
+
+public class EmfaticSourceViewerConfiguration extends
+ LDTSourceViewerConfiguration {
+
+ EmfaticCodeScanner _emfaticCodeScanner = null;
+ EmfaticEditor _editor = null;
+
+ public EmfaticSourceViewerConfiguration(EmfaticEditor editor) {
+ super(editor);
+ _editor = editor;
+ _textHover = new EmfaticTextHover(editor);
+ }
+
+ public LDTCodeScanner createCodeScanner() {
+ if (_emfaticCodeScanner == null) {
+ _emfaticCodeScanner = new EmfaticCodeScanner();
+ }
+ return _emfaticCodeScanner;
+ }
+
+ public IParser getParser() {
+ return new EmfaticParserDriver();
+ }
+
+ public ITextHover getTextHover(ISourceViewer sourceViewer,
+ String contentType) {
+ return _textHover;
+ }
+
+ public ITextHover getTextHover(ISourceViewer sourceViewer,
+ String contentType, int stateMask) {
+ return _textHover;
+ }
+
+ private final EmfaticTextHover _textHover;
+
+ public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+ return EmfaticPartitionScanner.contentTypes();
+ }
+
+ @Override
+ public IPresentationReconciler getPresentationReconciler(ISourceViewer arg0) {
+ PresentationReconciler reconciler = new PresentationReconciler();
+ DefaultDamagerRepairer dr = new DefaultDamagerRepairer(
+ createCodeScanner());
+
+ /*
+ * make syntax coloring work for all document partitions except the
+ * comment ones
+ */
+
+ // i.e., IDocument.DEFAULT_CONTENT_TYPE
+ reconciler.setDamager(dr, "__dftl_partition_content_type");
+ reconciler.setRepairer(dr, "__dftl_partition_content_type");
+
+ setDR(reconciler, dr, EmfaticPartitionScanner.packagePart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.importPart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.annotationPart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.subPackagePart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.attrPart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.refPart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.valrPart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.opPart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.datatypePart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.enumPart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.mapentryPart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.classHeadingPart);
+ setDR(reconciler, dr, EmfaticPartitionScanner.ifaceHeadingPart);
+
+ return reconciler;
+ }
+
+ private void setDR(PresentationReconciler reconciler,
+ DefaultDamagerRepairer dr, String docPart) {
+ reconciler.setDamager(dr, docPart);
+ reconciler.setRepairer(dr, docPart);
+
+ }
+
+ @Override
+ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
+ if (_annotationHover == null) {
+ // TODO use HTMLAnnotationHover instead
+ // TODO use ProjectionAnnotationHover instead, so that summarizing annotations are shown
+ _annotationHover = new DefaultAnnotationHover();
+ }
+ return _annotationHover;
+ }
+
+ DefaultAnnotationHover _annotationHover = null;
+
+ /*
+ * hyperlinks
+ *
+ * http://orangevolt.com/wordpress/archives/2005/01/05/howto-enable-hyperlinking-in-text-editor/
+ *
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
+ IHyperlinkDetector[] inheritedDetectors = super
+ .getHyperlinkDetectors(sourceViewer);
+
+ if (_editor == null) {
+ return inheritedDetectors;
+ }
+
+ int inheritedDetectorsLength = inheritedDetectors != null ? inheritedDetectors.length
+ : 0;
+ IHyperlinkDetector[] detectors = new IHyperlinkDetector[inheritedDetectorsLength + 1];
+ detectors[0] = new EmfaticHyperlinkDetector(_editor);
+ for (int i = 0; i < inheritedDetectorsLength; i++) {
+ detectors[i + 1] = inheritedDetectors[i];
+ }
+
+ return detectors;
+ }
+
+ @Override
+ public IAutoEditStrategy[] getAutoEditStrategies(
+ ISourceViewer sourceViewer, String contentType) {
+ List<IAutoEditStrategy> s = new ArrayList<IAutoEditStrategy>();
+ IAutoEditStrategy[] vonOben = super.getAutoEditStrategies(sourceViewer,
+ contentType);
+ for (IAutoEditStrategy autoEditStrategy : vonOben) {
+ s.add(autoEditStrategy);
+ }
+ s.add(new DefaultIndentLineAutoEditStrategy());
+ s.add(new EmfaticAutoEditStrategy(_editor));
+ // TODO add partition type-specific auto edit strategies
+ IAutoEditStrategy[] res = s.toArray(new IAutoEditStrategy[0]);
+ return res;
+ }
+
+ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+ ContentAssistant ca = new ContentAssistant();
+ ca.enableAutoActivation(true);
+ ca.setAutoActivationDelay(500);
+ ca.setProposalPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW);
+ ca
+ .setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW);
+ ca
+ .setInformationControlCreator(getInformationControlCreator(sourceViewer));
+
+ CascadedContentAssistProcessor masterCap = new CascadedContentAssistProcessor();
+
+ IContentAssistProcessor cap = new EmfaticTemplateCompletionProcessor(
+ EmfaticContextType.EMFATIC_CONTEXT_TYPE);
+ masterCap.add(cap);
+ registerForAllEmfaticContentTypes(ca, masterCap);
+
+ cap = new EmfaticContentAssistProcessor(_editor);
+ masterCap.add(cap);
+
+ cap = new EmfaticKeywordContentAssistProcessor(_editor);
+ masterCap.add(cap);
+
+ return ca;
+ }
+
+ private void registerForAllEmfaticContentTypes(ContentAssistant ca,
+ IContentAssistProcessor cap) {
+ ca.setContentAssistProcessor(cap, IDocument.DEFAULT_CONTENT_TYPE);
+
+ ca.setContentAssistProcessor(cap, EmfaticPartitionScanner.packagePart);
+ ca.setContentAssistProcessor(cap, EmfaticPartitionScanner.importPart);
+ ca.setContentAssistProcessor(cap,
+ EmfaticPartitionScanner.annotationPart);
+ ca.setContentAssistProcessor(cap,
+ EmfaticPartitionScanner.subPackagePart);
+ ca.setContentAssistProcessor(cap, EmfaticPartitionScanner.attrPart);
+ ca.setContentAssistProcessor(cap, EmfaticPartitionScanner.refPart);
+ ca.setContentAssistProcessor(cap, EmfaticPartitionScanner.valrPart);
+ ca.setContentAssistProcessor(cap, EmfaticPartitionScanner.opPart);
+ ca.setContentAssistProcessor(cap, EmfaticPartitionScanner.datatypePart);
+ ca.setContentAssistProcessor(cap, EmfaticPartitionScanner.enumPart);
+ ca.setContentAssistProcessor(cap, EmfaticPartitionScanner.mapentryPart);
+ ca.setContentAssistProcessor(cap,
+ EmfaticPartitionScanner.classHeadingPart);
+ ca.setContentAssistProcessor(cap,
+ EmfaticPartitionScanner.ifaceHeadingPart);
+ ca.setContentAssistProcessor(cap,
+ EmfaticPartitionScanner.multiLineComment);
+ ca.setContentAssistProcessor(cap,
+ EmfaticPartitionScanner.singleLineComment);
+
+ }
+
+ @Override
+ public ITextDoubleClickStrategy getDoubleClickStrategy(
+ ISourceViewer sourceViewer, String contentType) {
+ // TODO Auto-generated method stub
+ return super.getDoubleClickStrategy(sourceViewer, contentType);
+ }
+
+ @Override
+ public IAnnotationHover getOverviewRulerAnnotationHover(
+ ISourceViewer sourceViewer) {
+ // TODO Auto-generated method stub
+ return super.getOverviewRulerAnnotationHover(sourceViewer);
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticTextHover.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticTextHover.java
new file mode 100644
index 0000000..f416869
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/EmfaticTextHover.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+
+package org.eclipse.emf.emfatic.ui.editor;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.emfatic.core.generator.ecore.TokenText;
+import org.eclipse.emf.emfatic.core.generator.emfatic.Writer;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.AbstractModifier;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassKind;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.OptNegatedModifier;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ReferenceKind;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TransientModifier;
+import org.eclipse.emf.emfatic.core.util.EmfaticKeywords;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor.ReferedEcoreDecl;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+
+public class EmfaticTextHover implements ITextHover {
+
+ EmfaticTextHover(EmfaticEditor editor) {
+ _editor = editor;
+ _hoverClasses = (new Class[] { OptNegatedModifier.class,
+ AbstractModifier.class,
+ ClassKind.class,
+ TransientModifier.class,
+ ReferenceKind.class });
+ }
+
+ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
+ if (hoverRegion != null) {
+ ASTNode rootNode = _editor.getParseRoot();
+ if (rootNode != null) {
+ /*
+ * hovers for modifiers ASTNode hoverNode =
+ * rootNode.getNodeAt(hoverRegion.getOffset(),
+ * hoverRegion.getLength(), _hoverClasses, true); if (hoverNode !=
+ * null) { return getHoverInfo(hoverNode); }
+ */
+ CompUnit compUnit = (CompUnit) rootNode;
+ String msg = tryTypeHover(compUnit, hoverRegion.getOffset());
+ if (msg != null)
+ return msg;
+ }
+ }
+ return null;
+ }
+
+ private String tryTypeHover(CompUnit compUnit, int offset) {
+ ReferedEcoreDecl red = _editor.getReferedEcoreDecl(offset, 0);
+ if (red == null || red.node == null || red.ecoreDecl == null) {
+ return null;
+ }
+ EObject ecoreDecl = red.ecoreDecl;
+ String msg = Writer.stringify(ecoreDecl);
+ return msg;
+ }
+
+ public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+ return new Region(offset, 0);
+ }
+
+ private String getHoverInfo(ASTNode hoverNode) {
+ if (hoverNode instanceof OptNegatedModifier) {
+ OptNegatedModifier node = (OptNegatedModifier) hoverNode;
+ String modifierText = node.getModifier().getText();
+ String hoverText = EmfaticKeywords.GetHoverText(modifierText);
+ return composeHoverText(hoverText, node.getBang() != null, hoverNode);
+ }
+ if (hoverNode instanceof AbstractModifier) {
+ AbstractModifier node = (AbstractModifier) hoverNode;
+ String hoverText = EmfaticKeywords.GetHoverText(node.getAbstract_KW().getText());
+ return composeHoverText(hoverText, false, hoverNode);
+ }
+ if (hoverNode instanceof ClassKind) {
+ String hoverText = EmfaticKeywords.GetHoverText(hoverNode.getText());
+ return composeHoverText(hoverText, false, hoverNode);
+ }
+ if (hoverNode instanceof TransientModifier) {
+ String hoverText = "EDataType.isSerializable() == <F>";
+ return composeHoverText(hoverText, false, hoverNode);
+ }
+ if (hoverNode instanceof ReferenceKind) {
+ String hoverText = EmfaticKeywords.GetHoverText(hoverNode.getText());
+ return composeHoverText(hoverText, false, hoverNode);
+ } else {
+ return null;
+ }
+ }
+
+ private String composeHoverText(String hoverText, boolean isNegated, ASTNode hoverNode) {
+ if (hoverText == null)
+ return null;
+ String composedText = null;
+ if (hoverText.indexOf("<T>") != -1) {
+ if (!isNegated)
+ composedText = hoverText.replaceFirst("<T>", "true");
+ else
+ composedText = hoverText.replaceFirst("<T>", "false");
+ } else if (hoverText.indexOf("<F>") != -1)
+ if (!isNegated)
+ composedText = hoverText.replaceFirst("<F>", "false");
+ else
+ composedText = hoverText.replaceFirst("<F>", "true");
+ if (composedText != null) {
+ String tokenText = TokenText.Get((EmfaticASTNode) hoverNode);
+ return "'" + tokenText + "' means " + composedText;
+ } else {
+ return null;
+ }
+ }
+
+ private final EmfaticEditor _editor;
+ private final Class _hoverClasses[];
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/actions/EmfaticEditorActionMessages.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/actions/EmfaticEditorActionMessages.java
new file mode 100644
index 0000000..19e1f19
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/actions/EmfaticEditorActionMessages.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.editor.actions;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class EmfaticEditorActionMessages {
+
+ private static final String BUNDLE_NAME = "org.eclipse.emf.emfatic.ui.editor.actions.EmfaticEditorActionMessages"; //$NON-NLS-1$
+
+ private static final ResourceBundle fgResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private EmfaticEditorActionMessages() {
+ }
+
+ public static ResourceBundle getResourceBundle() {
+ return fgResourceBundle;
+ }
+ public static String getString(String key) {
+ try {
+ return fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/actions/EmfaticEditorActionMessages.properties b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/actions/EmfaticEditorActionMessages.properties
new file mode 100644
index 0000000..31501e5
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/actions/EmfaticEditorActionMessages.properties
@@ -0,0 +1,42 @@
+###############################################################################
+# Copyright (c) 2000, 2006 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# John-Mason P. Shackelford - bug 40255
+###############################################################################
+
+OpenDeclarationAction.0=&Open Declaration
+OpenDeclarationAction.1=Open an editor on the referenced element
+OpenExternalDocAction.0=Open External Ant Documentation
+OpenExternalDocAction.1=Open E&xternal Documentation
+OpenExternalDocAction.2=Opens an external browser on the referenced Ant element
+
+TogglePresentation.label=Show Source of Selected Element Only
+TogglePresentation.tooltip=Show Source of Selected Element Only
+
+ToggleMarkOccurrencesAction.label= Toggle Ant Mark Occurrences
+ToggleMarkOccurrencesAction.tooltip= Toggle Ant Mark Occurrences
+
+ToggleAutoReconcileAction.label= Toggle Auto Reconcile
+ToggleAutoReconcileAction.tooltip= Toggle Auto reconcile
+
+Projection.Toggle.label= &Enable Folding
+Projection.Toggle.tooltip= Toggles Folding
+Projection.Toggle.description= Toggles folding for the current editor
+
+Projection.ExpandAll.label= Expand &All
+Projection.ExpandAll.tooltip= Expands All Folded Regions
+Projection.ExpandAll.description= Expands any folded regions in the current editor
+
+RunToLineAdapter.0=Empty editor
+RunToLineAdapter.1=Missing document
+RunToLineAdapter.2=No file could be found
+RunToLineAdapter.3=Unable to locate debug target
+RenameInFileAction.0=Re&name In File
+RenameInFileAction.1=Renames all references within the same buildfile
+RenameInFileAction.2=Renames all references
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/actions/OpenDeclarationAction.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/actions/OpenDeclarationAction.java
new file mode 100644
index 0000000..69bdf20
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/editor/actions/OpenDeclarationAction.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.editor.actions;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor;
+import org.eclipse.jdt.ui.actions.IJavaEditorActionDefinitionIds;
+import org.eclipse.jdt.ui.actions.OpenAction;
+import org.eclipse.jface.commands.ActionHandler;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.ui.handlers.IHandlerService;
+
+public class OpenDeclarationAction extends OpenAction {
+
+ private EmfaticEditor _editor;
+
+ public OpenDeclarationAction(EmfaticEditor editor) {
+ super(editor.getSite());
+ _editor = editor;
+ setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR);
+ IHandlerService handlerServer = (IHandlerService) editor.getSite()
+ .getService(IHandlerService.class);
+ handlerServer.activateHandler(
+ IJavaEditorActionDefinitionIds.OPEN_EDITOR, new ActionHandler(
+ this));
+
+ setText(EmfaticEditorActionMessages
+ .getString("OpenDeclarationAction.0")); //$NON-NLS-1$
+ setDescription(EmfaticEditorActionMessages
+ .getString("OpenDeclarationAction.1")); //$NON-NLS-1$
+ setToolTipText(EmfaticEditorActionMessages
+ .getString("OpenDeclarationAction.1")); //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run() {
+ if (_editor == null) {
+ return;
+ }
+
+ EObject openedDecl = _editor.gotoDeclaration();
+
+ if (openedDecl instanceof EClass) {
+
+ _editor.showInTypeHierarchy((EClass) openedDecl);
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.ui.actions.SelectionDispatchAction#selectionChanged(org.eclipse.jface.text.ITextSelection)
+ */
+ public void selectionChanged(ITextSelection selection) {
+ setEnabled(_editor != null);
+ }
+
+ public void setEditor(EmfaticEditor editor) {
+ _editor = editor;
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/hyperlinks/EmfaticHyperlink.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/hyperlinks/EmfaticHyperlink.java
new file mode 100644
index 0000000..51d0e93
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/hyperlinks/EmfaticHyperlink.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.hyperlinks;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+
+public class EmfaticHyperlink implements IHyperlink {
+
+ private IRegion fRegion= null;
+ private EmfaticASTNode fLinkTarget= null;
+ private EmfaticEditor fEditor= null;
+
+ public EmfaticHyperlink(EmfaticEditor editor, IRegion region, EmfaticASTNode linkTarget) {
+
+ fRegion= region;
+ fLinkTarget= linkTarget;
+ fEditor= editor;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
+ */
+ public IRegion getHyperlinkRegion() {
+ return fRegion;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+ */
+ public String getTypeLabel() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+ */
+ public String getHyperlinkText() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
+ */
+ public void open() {
+ fEditor.openTarget(fLinkTarget);
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/hyperlinks/EmfaticHyperlinkDetector.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/hyperlinks/EmfaticHyperlinkDetector.java
new file mode 100644
index 0000000..ae1611e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/hyperlinks/EmfaticHyperlinkDetector.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.hyperlinks;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Attribute;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.DataTypeDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EnumDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Operation;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Reference;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeParam;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor.ReferedEcoreDecl;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+
+public class EmfaticHyperlinkDetector implements IHyperlinkDetector {
+
+ private EmfaticEditor _editor;
+
+ public EmfaticHyperlinkDetector(EmfaticEditor editor) {
+ _editor = editor;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer,
+ * org.eclipse.jface.text.IRegion, boolean)
+ */
+ public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
+ if (region == null) {
+ return null;
+ }
+ ReferedEcoreDecl red = _editor.getReferedEcoreDecl(region.getOffset(), region.getLength());
+ if (red == null || red.node == null || red.ecoreDecl == null) {
+ return null;
+ }
+ EObject ecoreDecl = red.ecoreDecl;
+ EmfaticASTNode node = red.node;
+ EmfaticASTNode landingPlace = getLandingPlace(ecoreDecl, _editor);
+ if (landingPlace == null) {
+ return null;
+ }
+ IRegion underlineRegion = new org.eclipse.jface.text.Region(node.getRangeStart(), node.getRangeLength());
+ return new IHyperlink[] { new EmfaticHyperlink(_editor, underlineRegion, landingPlace) };
+ }
+
+ public static EmfaticASTNode getLandingPlace(EObject ecoreDecl, EmfaticEditor editor) {
+ ASTNode cstDecl = editor.getCstDecl2EcoreAST().getInv(ecoreDecl);
+ if (cstDecl == null || !(cstDecl instanceof EmfaticASTNode)) {
+ return null;
+ }
+ EmfaticASTNode landingPlace = (EmfaticASTNode) cstDecl;
+ if (cstDecl instanceof ClassDecl) {
+ landingPlace = ((ClassDecl) cstDecl).getName();
+ }
+ if (cstDecl instanceof DataTypeDecl) {
+ landingPlace = ((DataTypeDecl) cstDecl).getName();
+ }
+ if (cstDecl instanceof EnumDecl) {
+ landingPlace = ((EnumDecl) cstDecl).getName();
+ }
+ if (cstDecl instanceof TypeParam) {
+ landingPlace = ((TypeParam) cstDecl).getTypeVarName();
+ }
+ if (cstDecl instanceof Reference) {
+ landingPlace = ((Reference) cstDecl).getName();
+ }
+ if (cstDecl instanceof Attribute) {
+ landingPlace = ((Attribute) cstDecl).getName();
+ }
+ if (cstDecl instanceof Operation) {
+ landingPlace = ((Operation) cstDecl).getName();
+ }
+ return landingPlace;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AnnFilterAction.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AnnFilterAction.java
new file mode 100644
index 0000000..1d30641
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AnnFilterAction.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class AnnFilterAction extends Action {
+ private AnnotationFilter _filter;
+ private TreeViewer _treeViewer;
+
+ public AnnFilterAction(String string, int asCheckBox, AnnotationFilter annFilter, TreeViewer treeViewer) {
+ super(string, asCheckBox);
+ _filter = annFilter;
+ _treeViewer = treeViewer;
+ }
+
+ public void run() {
+ if (isChecked()) {
+ setText("Show Annotations");
+ setToolTipText("Show Annotations");
+ if (_filter == null) {
+ _filter = new AnnotationFilter();
+ }
+ _treeViewer.addFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ } else {
+ setText("Hide Annotations");
+ setToolTipText("Hide Annotations");
+ _treeViewer.removeFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AnnotationFilter.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AnnotationFilter.java
new file mode 100644
index 0000000..f070cad
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AnnotationFilter.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Annotation;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.KeyEqualsValue;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+public class AnnotationFilter extends ViewerFilter {
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof OutlineNode) {
+ OutlineNode on = (OutlineNode) element;
+ ASTNode an = on.getASTNode();
+ if (isAnnOrKeyValue(an)) {
+ return false;
+ }
+ }
+ if (parentElement instanceof OutlineNode) {
+ OutlineNode pn = (OutlineNode) parentElement;
+ ASTNode ap = pn.getASTNode();
+ if (isAnnOrKeyValue(ap)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private boolean isAnnOrKeyValue(ASTNode n) {
+ boolean res = (n instanceof Annotation || n instanceof KeyEqualsValue) ;
+ return res;
+ }
+
+
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AttrFilter.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AttrFilter.java
new file mode 100644
index 0000000..0399b6d
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AttrFilter.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Attribute;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+
+public class AttrFilter extends ViewerFilter {
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof OutlineNode) {
+ OutlineNode on = (OutlineNode) element;
+ ASTNode an = on.getASTNode();
+ if (an instanceof Attribute) {
+ return false;
+ }
+ // actually the node in the outline is the name, i.e.
+ // Attribute#getName()
+ if (an.getParent() != null && an.getParent() instanceof Attribute) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AttrFilterAction.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AttrFilterAction.java
new file mode 100644
index 0000000..323a08a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/AttrFilterAction.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class AttrFilterAction extends Action {
+ private AttrFilter _filter;
+ private TreeViewer _treeViewer;
+
+ public AttrFilterAction(String string, int asCheckBox, AttrFilter filter, TreeViewer treeViewer) {
+ super(string, asCheckBox);
+ _filter = filter;
+ _treeViewer = treeViewer;
+ }
+
+ public void run() {
+ if (isChecked()) {
+ setText("Show Attributes");
+ setToolTipText("Show Attributes");
+ if (_filter == null) {
+ _filter = new AttrFilter();
+ }
+ _treeViewer.addFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ } else {
+ setText("Hide Attributes");
+ setToolTipText("Hide Attributes");
+ _treeViewer.removeFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/EmfaticContentOutlinePage.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/EmfaticContentOutlinePage.java
new file mode 100644
index 0000000..c8360d3
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/EmfaticContentOutlinePage.java
@@ -0,0 +1,325 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassDecl;
+import org.eclipse.emf.emfatic.ui.EmfaticUIPlugin;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+import org.eclipse.gymnast.runtime.ui.outline.LDTContentOutlinePage;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.IPageSite;
+
+public class EmfaticContentOutlinePage extends LDTContentOutlinePage {
+
+ private EmfaticEditor _editor = null;
+
+ private Action annFilterAction;
+ private AnnotationFilter annFilter;
+
+ private Action attrFilterAction;
+ private AttrFilter attrFilter;
+
+ private Action refFilterAction;
+ private RefFilter refFilter;
+
+ private Action opFilterAction;
+ private OpFilter opFilter;
+
+ private Action typeParamFilterAction;
+ private TypeParamFilter typeParamFilter;
+
+ private Action fOpenInTypeHierarchy;
+
+ private Menu fMenu;
+
+ public EmfaticContentOutlinePage(EmfaticEditor _editor) {
+ super(_editor);
+ this._editor = _editor;
+ _editor.setContentOutlinePage(this);
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ makeFilterActions();
+ IActionBars bars = getSite().getActionBars();
+ IToolBarManager manager = bars.getToolBarManager();
+ manager.add(annFilterAction);
+ manager.add(attrFilterAction);
+ manager.add(refFilterAction);
+ manager.add(opFilterAction);
+ manager.add(typeParamFilterAction);
+ // allows external contributions
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ manager.add(new Separator());
+ // TODO decorator
+ // getTreeViewer().setLabelProvider(createOutlineLabelProvideDecorated());
+
+ populateContextMenu();
+ }
+
+ private void populateContextMenu() {
+ fOpenInTypeHierarchy = new Action() {
+ public void run() {
+ OutlineNode element = getSelectedNode();
+ if (element != null) {
+ if (element.getASTNode() != null) {
+ if (element.getASTNode() instanceof ClassDecl) {
+ ClassDecl cd = (ClassDecl) element.getASTNode();
+ EObject eO = _editor.getCstDecl2EcoreAST().get(cd);
+ if (eO != null && (eO instanceof EClass)) {
+ _editor.showInTypeHierarchy((EClass) eO);
+ }
+ }
+ }
+ }
+
+ }
+ };
+ fOpenInTypeHierarchy.setText("fOpenInTypeHierarchy");
+ fOpenInTypeHierarchy.setToolTipText("fOpenInTypeHierarchy");
+ fOpenInTypeHierarchy.setImageDescriptor(PlatformUI.getWorkbench()
+ .getSharedImages().getImageDescriptor(
+ ISharedImages.IMG_OBJS_INFO_TSK));
+
+ // see AntEditor and p. 470 on JDGE 2nd Ed.
+ TreeViewer viewer = getTreeViewer();
+ MenuManager manager = new MenuManager("#PopUp"); //$NON-NLS-1$
+ manager.setRemoveAllWhenShown(true);
+ manager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ contextMenuAboutToShow(menuManager);
+ }
+ });
+ fMenu = manager.createContextMenu(viewer.getTree());
+ viewer.getTree().setMenu(fMenu);
+
+ IPageSite site = getSite();
+ site.registerContextMenu(
+ "org.eclipse.emf.emfatic.ui.outline", manager, viewer); //$NON-NLS-1$
+ }
+
+ public ILabelProvider createOutlineLabelProvideDecorated() {
+ // ILabelProvider ldtOLP = (ILabelProvider)
+ // getTreeViewer().getLabelProvider();
+ // ILabelDecorator decorator = new EmfaticLabelDecorator();
+ // DecoratingLabelProvider decoratedOLP = new
+ // DecoratingLabelProvider(ldtOLP, decorator);
+ // return decoratedOLP;
+ return null;
+ }
+
+ void makeFilterActions() {
+
+ annFilterAction = new AnnFilterAction("Show Annotations",
+ IAction.AS_CHECK_BOX, annFilter, getTreeViewer());
+ annFilterAction.setText("Hide Annotations");
+ annFilterAction.setToolTipText("Hide Annotations");
+ // Image annImg = EmfaticOutlineBuilder.getAnnotationImage();
+ ImageDescriptor id = getImageDescriptorFromIconsFolder("HideEAnnotations.gif");
+ annFilterAction.setImageDescriptor(id);
+
+ attrFilterAction = new AttrFilterAction("Show Attributes",
+ IAction.AS_CHECK_BOX, attrFilter, getTreeViewer());
+ attrFilterAction.setText("Hide Attributes");
+ attrFilterAction.setToolTipText("Hide Attributes");
+ id = getImageDescriptorFromIconsFolder("HideEAttributes.gif");
+ attrFilterAction.setImageDescriptor(id);
+
+ refFilterAction = new RefFilterAction("Show References",
+ IAction.AS_CHECK_BOX, refFilter, getTreeViewer());
+ refFilterAction.setText("Hide References");
+ refFilterAction.setToolTipText("Hide References");
+ id = getImageDescriptorFromIconsFolder("HideEReferences.gif");
+ refFilterAction.setImageDescriptor(id);
+
+ opFilterAction = new OpFilterAction("Show Operations",
+ IAction.AS_CHECK_BOX, opFilter, getTreeViewer());
+ opFilterAction.setText("Hide Operations");
+ opFilterAction.setToolTipText("Hide Operations");
+ id = getImageDescriptorFromIconsFolder("HideEOperations.gif");
+ opFilterAction.setImageDescriptor(id);
+
+ typeParamFilterAction = new TypeParamFilterAction("Show Type Params",
+ IAction.AS_CHECK_BOX, typeParamFilter, getTreeViewer());
+ typeParamFilterAction.setText("Hide Type Params");
+ typeParamFilterAction.setToolTipText("Hide Type Params");
+ id = getImageDescriptorFromIconsFolder("HideETypeParameters.gif");
+ typeParamFilterAction.setImageDescriptor(id);
+ }
+
+ /**
+ * @param name
+ * the name of the icon file
+ * @return an Image
+ */
+ static public Image getImageFromIconsFolder(String name) {
+ String iconPath = "icons/";
+ try {
+ URL installURL = EmfaticUIPlugin.getDefault().getBundle().getEntry(
+ "/");
+ URL url = new URL(installURL, iconPath + name);
+ ImageDescriptor imageDescriptor = ImageDescriptor
+ .createFromURL(url);
+ Image image = imageDescriptor.createImage();
+ return image;
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+
+ /**
+ * @param name
+ * the name of the icon file
+ * @return an Image
+ */
+ static public ImageDescriptor getImageDescriptorFromIconsFolder(String name) {
+ String iconPath = "icons/";
+ try {
+ URL installURL = EmfaticUIPlugin.getDefault().getBundle().getEntry(
+ "/");
+ URL url = new URL(installURL, iconPath + name);
+ ImageDescriptor imageDescriptor = ImageDescriptor
+ .createFromURL(url);
+ return imageDescriptor;
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+
+ public boolean showingAnnotations() {
+ return !annFilterAction.isChecked();
+ }
+
+ public boolean showingAttributes() {
+ return !attrFilterAction.isChecked();
+ }
+
+ public boolean showingOperations() {
+ return !opFilterAction.isChecked();
+ }
+
+ public boolean showingReferences() {
+ return !refFilterAction.isChecked();
+ }
+
+ public boolean showingTypeParams() {
+ return !typeParamFilterAction.isChecked();
+ }
+
+ public void selectFromEditor(OutlineNode toHighlight) {
+ if (toHighlight != null) {
+ ASTNode astNode = toHighlight.getASTNode();
+ OutlineNode outlineRoot = null;
+ TreeItem root = getTreeViewer().getTree().getTopItem();
+ Object rootData = root.getData();
+ if (rootData instanceof OutlineNode) {
+ outlineRoot = (OutlineNode) rootData;
+ while (outlineRoot.getParent() != null) {
+ outlineRoot = outlineRoot.getParent();
+ }
+ }
+ toHighlight = findOutlineNodeForASTNode(outlineRoot, astNode);
+ TreeViewer viewer = getTreeViewer();
+ viewer.removeSelectionChangedListener(this);
+ viewer.setSelection(new StructuredSelection(toHighlight), true);
+ // TODO this should be a preference:
+ viewer.reveal(toHighlight);
+ viewer.addSelectionChangedListener(this);
+ }
+ }
+
+ private OutlineNode findOutlineNodeForASTNode(OutlineNode nodeInTree,
+ ASTNode astNode) {
+ if (nodeInTree == null) {
+ return null;
+ }
+ ASTNode treeASTNode = nodeInTree.getASTNode();
+ if (treeASTNode == astNode) {
+ return nodeInTree;
+ }
+ if (nodeInTree.getChildren() != null) {
+ for (OutlineNode outlineChild : nodeInTree.getChildren()) {
+ OutlineNode candidate = findOutlineNodeForASTNode(outlineChild,
+ astNode);
+ if (candidate != null) {
+ return candidate;
+ }
+ }
+ }
+ return null;
+ }
+
+ private void contextMenuAboutToShow(IMenuManager menuManager) {
+ if (selectionIsEClass()) {
+ menuManager.add(fOpenInTypeHierarchy);
+ }
+ menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private boolean selectionIsEClass() {
+ OutlineNode o = getSelectedNode();
+ if (o.getASTNode() != null) {
+ if (o.getASTNode() instanceof ClassDecl) {
+ ClassDecl cd = (ClassDecl) o.getASTNode();
+ EObject eO = _editor.getCstDecl2EcoreAST().get(cd);
+ if (eO != null && (eO instanceof EClass)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private OutlineNode getSelectedNode() {
+ ISelection iselection = getSelection();
+ if (iselection instanceof IStructuredSelection) {
+ IStructuredSelection selection = (IStructuredSelection) iselection;
+ if (selection.size() == 1) {
+ Object selected = selection.getFirstElement();
+ if (selected instanceof OutlineNode) {
+ return (OutlineNode) selected;
+ }
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/OpFilter.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/OpFilter.java
new file mode 100644
index 0000000..f34899b
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/OpFilter.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Operation;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+public class OpFilter extends ViewerFilter {
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof OutlineNode) {
+ OutlineNode on = (OutlineNode) element;
+ ASTNode an = on.getASTNode();
+ if (an instanceof Operation) {
+ return false;
+ }
+ // actually the node in the outline is the name, i.e.
+ // Attribute#getName()
+ if (an.getParent() != null && an.getParent() instanceof Operation) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/OpFilterAction.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/OpFilterAction.java
new file mode 100644
index 0000000..188b826
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/OpFilterAction.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class OpFilterAction extends Action {
+ private OpFilter _filter;
+ private TreeViewer _treeViewer;
+
+ public OpFilterAction(String string, int asCheckBox, OpFilter filter, TreeViewer treeViewer) {
+ super(string, asCheckBox);
+ _filter = filter;
+ _treeViewer = treeViewer;
+ }
+
+ public void run() {
+ if (isChecked()) {
+ setText("Show Operations");
+ setToolTipText("Show Operations");
+ if (_filter == null) {
+ _filter = new OpFilter();
+ }
+ _treeViewer.addFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ } else {
+ setText("Hide Operations");
+ setToolTipText("Hide Operations");
+ _treeViewer.removeFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/RefFilter.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/RefFilter.java
new file mode 100644
index 0000000..6c7fa3b
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/RefFilter.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.Reference;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+public class RefFilter extends ViewerFilter {
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof OutlineNode) {
+ OutlineNode on = (OutlineNode) element;
+ ASTNode an = on.getASTNode();
+ if (an instanceof Reference) {
+ return false;
+ }
+ // actually the node in the outline is the name, i.e.
+ // Attribute#getName()
+ if (an.getParent() != null && an.getParent() instanceof Reference) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/RefFilterAction.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/RefFilterAction.java
new file mode 100644
index 0000000..a1446d3
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/RefFilterAction.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class RefFilterAction extends Action {
+ private RefFilter _filter;
+ private TreeViewer _treeViewer;
+
+ public RefFilterAction(String string, int asCheckBox, RefFilter filter, TreeViewer treeViewer) {
+ super(string, asCheckBox);
+ _filter = filter;
+ _treeViewer = treeViewer;
+ }
+
+ public void run() {
+ if (isChecked()) {
+ setText("Show References");
+ setToolTipText("Show References");
+ if (_filter == null) {
+ _filter = new RefFilter();
+ }
+ _treeViewer.addFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ } else {
+ setText("Hide References");
+ setToolTipText("Hide References");
+ _treeViewer.removeFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/TypeParamFilter.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/TypeParamFilter.java
new file mode 100644
index 0000000..1be6939
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/TypeParamFilter.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TypeParam;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.core.outline.OutlineNode;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+public class TypeParamFilter extends ViewerFilter {
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof OutlineNode) {
+ OutlineNode on = (OutlineNode) element;
+ ASTNode an = on.getASTNode();
+ if (an instanceof TypeParam) {
+ return false;
+ }
+ if (an.getParent() != null && an.getParent() instanceof TypeParam) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/TypeParamFilterAction.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/TypeParamFilterAction.java
new file mode 100644
index 0000000..cf2c89a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/outline/TypeParamFilterAction.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.outline;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class TypeParamFilterAction extends Action {
+ private TypeParamFilter _filter;
+ private TreeViewer _treeViewer;
+
+ public TypeParamFilterAction(String string, int asCheckBox, TypeParamFilter filter, TreeViewer treeViewer) {
+ super(string, asCheckBox);
+ _filter = filter;
+ _treeViewer = treeViewer;
+ }
+
+ public void run() {
+ if (isChecked()) {
+ setText("Show Type Params");
+ setToolTipText("Show Type Params");
+ if (_filter == null) {
+ _filter = new TypeParamFilter();
+ }
+ _treeViewer.addFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ } else {
+ setText("Hide Type Params");
+ setToolTipText("Hide Type Params");
+ _treeViewer.removeFilter(_filter);
+ // TODO avoid flicker
+ _treeViewer.expandAll();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/DebugPartitioner.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/DebugPartitioner.java
new file mode 100644
index 0000000..2cb8a4d
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/DebugPartitioner.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.partition;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.rules.FastPartitioner;
+import org.eclipse.jface.text.rules.IPartitionTokenScanner;
+
+/**
+ * Simple extension of DefaultPartitioner with printPartitions() method to assist with printing out partition
+ * information
+ *
+ */
+public class DebugPartitioner extends FastPartitioner
+{
+
+ public DebugPartitioner(IPartitionTokenScanner scanner, String[] legalContentTypes)
+ {
+ super(scanner, legalContentTypes);
+ }
+
+ @Override
+ public ITypedRegion[] computePartitioning(int offset, int length, boolean includeZeroLengthPartitions)
+ {
+ return super.computePartitioning(offset, length, includeZeroLengthPartitions);
+ }
+
+ @Override
+ public void connect(IDocument document, boolean delayInitialization)
+ {
+ super.connect(document, delayInitialization);
+ printPartitions(document);
+ }
+
+ public void printPartitions(IDocument document)
+ {
+ StringBuffer buffer = new StringBuffer();
+
+ ITypedRegion[] partitions = computePartitioning(0, document.getLength());
+ for (int i = 0; i < partitions.length; i++)
+ {
+ try
+ {
+ String text = document.get(partitions[i].getOffset(), partitions[i].getLength());
+ String[] lines = text.split("\n");
+ String newText = "";
+ for (String line : lines) {
+ if (!line.trim().equals("")) {
+ newText += line + "\n";
+ }
+ }
+ if (!newText.trim().equals("")) {
+ buffer.append("Partition type: " + partitions[i].getType() + ", offset: " + partitions[i].getOffset()
+ + ", length: " + partitions[i].getLength() + "\n");
+ buffer.append(newText);
+ buffer.append("---------------------------\n");
+ }
+ }
+ catch (BadLocationException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ System.out.print(buffer);
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/EmfaticDocumentProvider.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/EmfaticDocumentProvider.java
new file mode 100644
index 0000000..abd3ea7
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/EmfaticDocumentProvider.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.partition;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.ui.editors.text.FileDocumentProvider;
+
+public class EmfaticDocumentProvider extends FileDocumentProvider {
+
+ protected IDocument createDocument(Object element) throws CoreException {
+ IDocument document = super.createDocument(element);
+ if (document != null) {
+ IDocumentPartitioner partitioner = new DebugPartitioner(new EmfaticPartitionScanner(),
+ EmfaticPartitionScanner.contentTypes());
+ partitioner.connect(document);
+ document.setDocumentPartitioner(partitioner);
+ }
+ return document;
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/EmfaticPartitionScanner.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/EmfaticPartitionScanner.java
new file mode 100644
index 0000000..779b152
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/EmfaticPartitionScanner.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.partition;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+
+public class EmfaticPartitionScanner extends RuleBasedPartitionScanner {
+ public final static String packagePart = "packagePart";
+ public final static String importPart = "importPart";
+ public final static String annotationPart = "annotationPart";
+ public final static String subPackagePart = "subPackagePart";
+ public final static String attrPart = "attrPart";
+ public final static String refPart = "refPart";
+ public final static String valrPart = "valPart";
+ public final static String opPart = "opPart";
+ public final static String datatypePart = "datatypePart";
+ public final static String enumPart = "enumPart";
+ public final static String mapentryPart = "mapentryPart";
+ public final static String classHeadingPart = "classHeadingPart";
+ public final static String ifaceHeadingPart = "ifaceHeadingPart";
+ public final static String multiLineComment = "multiLineComment";
+ public final static String singleLineComment = "singleLineComment";
+
+ public static String[] contentTypes() {
+ return new String[] { IDocument.DEFAULT_CONTENT_TYPE, packagePart, importPart, annotationPart, subPackagePart,
+ attrPart, refPart, valrPart, opPart, datatypePart, enumPart, mapentryPart, classHeadingPart,
+ ifaceHeadingPart, multiLineComment, singleLineComment };
+ }
+
+ public EmfaticPartitionScanner() {
+
+ IToken packagePartToken = new Token(packagePart); // 1
+ IToken importPartToken = new Token(importPart); // 2
+ IToken annotationPartToken = new Token(annotationPart); // 3
+ IToken subPackagePartToken = new Token(subPackagePart); // 4
+ IToken attrPartToken = new Token(attrPart); // 5
+ IToken refPartToken = new Token(refPart); // 6
+ IToken valrPartToken = new Token(valrPart); // 7
+ IToken opPartToken = new Token(opPart); // 8
+ IToken datatypePartToken = new Token(datatypePart); // 9
+ IToken enumPartToken = new Token(enumPart); // 10
+ IToken mapentryPartToken = new Token(mapentryPart); // 11
+ IToken classHeadingPartToken = new Token(classHeadingPart); // 12
+ IToken ifaceHeadingPartToken = new Token(ifaceHeadingPart); // 13
+ IToken multiLineCommentToken = new Token(multiLineComment); // 14
+ IToken singleLineCommentToken = new Token(singleLineComment); // 15
+
+ IPredicateRule[] rules = new IPredicateRule[16];
+
+ rules[0] = new NonMatchingRule();
+ rules[1] = new SingleLineRule("package", ";", packagePartToken);
+ rules[2] = new SingleLineRule("import", ";", importPartToken);
+ rules[3] = new MultiLineRule("@", ")", annotationPartToken);
+ rules[4] = new SingleLineRule("package", "{", subPackagePartToken);
+ rules[5] = new MultiLineRule("attr", ";", attrPartToken);
+ rules[6] = new MultiLineRule("ref", ";", refPartToken);
+ rules[7] = new MultiLineRule("val", ";", valrPartToken);
+ rules[8] = new MultiLineRule("op", ";", opPartToken);
+ rules[9] = new MultiLineRule("datatype", ";", datatypePartToken);
+ rules[10] = new MultiLineRule("enum", "}", enumPartToken);
+ rules[11] = new MultiLineRule("mapentry", ";", mapentryPartToken);
+ rules[12] = new MultiLineRule("class", "{", classHeadingPartToken);
+ rules[13] = new MultiLineRule("interface", "{", ifaceHeadingPartToken);
+ rules[14] = new MultiLineRule("/*", "*/", multiLineCommentToken);
+ rules[15] = new EndOfLineRule("//", singleLineCommentToken);
+
+ setPredicateRules(rules);
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/HTMLAnnotationHover.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/HTMLAnnotationHover.java
new file mode 100644
index 0000000..5760636
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/HTMLAnnotationHover.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.partition;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.text.source.DefaultAnnotationHover;
+
+/**
+ * Determines all markers for the given line and collects, concatenates, and
+ * formats returns their messages in HTML.
+ *
+ * @since 3.2
+ */
+public class HTMLAnnotationHover extends DefaultAnnotationHover {
+
+ /*
+ * Formats a message as HTML text.
+ */
+ protected String formatSingleMessage(String message) {
+ StringBuffer buffer = new StringBuffer();
+ HTMLPrinter.addPageProlog(buffer);
+ HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(message));
+ HTMLPrinter.addPageEpilog(buffer);
+ return buffer.toString();
+ }
+
+ /*
+ * Formats several message as HTML text.
+ */
+ protected String formatMultipleMessages(List messages) {
+ StringBuffer buffer = new StringBuffer();
+ HTMLPrinter.addPageProlog(buffer);
+ HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent("Multiple markers at this line"));
+
+ HTMLPrinter.startBulletList(buffer);
+ Iterator e = messages.iterator();
+ while (e.hasNext())
+ HTMLPrinter.addBullet(buffer, HTMLPrinter.convertToHTMLContent((String) e.next()));
+ HTMLPrinter.endBulletList(buffer);
+
+ HTMLPrinter.addPageEpilog(buffer);
+ return buffer.toString();
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/HTMLPrinter.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/HTMLPrinter.java
new file mode 100644
index 0000000..f2ac1e6
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/HTMLPrinter.java
@@ -0,0 +1,306 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.partition;
+
+
+import java.io.IOException;
+import java.io.Reader;
+import java.net.URL;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * Provides a set of convenience methods for creating HTML pages.
+ * <p>
+ * Moved into this package from <code>org.eclipse.jface.internal.text.revisions</code>.</p>
+ */
+public class HTMLPrinter {
+
+ private static RGB BG_COLOR_RGB= null;
+
+ static {
+ final Display display= Display.getDefault();
+ if (display != null && !display.isDisposed()) {
+ try {
+ display.asyncExec(new Runnable() {
+ /*
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ BG_COLOR_RGB= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
+ }
+ });
+ } catch (SWTError err) {
+ // see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=45294
+ if (err.code != SWT.ERROR_DEVICE_DISPOSED)
+ throw err;
+ }
+ }
+ }
+
+ private HTMLPrinter() {
+ }
+
+ private static String replace(String text, char c, String s) {
+
+ int previous= 0;
+ int current= text.indexOf(c, previous);
+
+ if (current == -1)
+ return text;
+
+ StringBuffer buffer= new StringBuffer();
+ while (current > -1) {
+ buffer.append(text.substring(previous, current));
+ buffer.append(s);
+ previous= current + 1;
+ current= text.indexOf(c, previous);
+ }
+ buffer.append(text.substring(previous));
+
+ return buffer.toString();
+ }
+
+ public static String convertToHTMLContent(String content) {
+ content= replace(content, '&', "&"); //$NON-NLS-1$
+ content= replace(content, '"', """); //$NON-NLS-1$
+ content= replace(content, '<', "<"); //$NON-NLS-1$
+ return replace(content, '>', ">"); //$NON-NLS-1$
+ }
+
+ public static String read(Reader rd) {
+
+ StringBuffer buffer= new StringBuffer();
+ char[] readBuffer= new char[2048];
+
+ try {
+ int n= rd.read(readBuffer);
+ while (n > 0) {
+ buffer.append(readBuffer, 0, n);
+ n= rd.read(readBuffer);
+ }
+ return buffer.toString();
+ } catch (IOException x) {
+ }
+
+ return null;
+ }
+
+ public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB, URL styleSheetURL) {
+
+ if (bgRGB == null)
+ insertPageProlog(buffer, position, styleSheetURL);
+ else {
+ StringBuffer pageProlog= new StringBuffer(300);
+
+ pageProlog.append("<html>"); //$NON-NLS-1$
+
+ appendStyleSheetURL(pageProlog, styleSheetURL);
+
+ pageProlog.append("<body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
+ appendColor(pageProlog, bgRGB);
+ pageProlog.append("\">"); //$NON-NLS-1$
+
+ buffer.insert(position, pageProlog.toString());
+ }
+ }
+ public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB, String styleSheet) {
+
+ if (bgRGB == null)
+ insertPageProlog(buffer, position, styleSheet);
+ else {
+ StringBuffer pageProlog= new StringBuffer(300);
+
+ pageProlog.append("<html>"); //$NON-NLS-1$
+
+ appendStyleSheetURL(pageProlog, styleSheet);
+
+ pageProlog.append("<body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
+ appendColor(pageProlog, bgRGB);
+ pageProlog.append("\">"); //$NON-NLS-1$
+
+ buffer.insert(position, pageProlog.toString());
+ }
+ }
+
+ public static void insertStyles(StringBuffer buffer, String[] styles) {
+ if (styles == null || styles.length == 0)
+ return;
+
+ StringBuffer styleBuf= new StringBuffer(10 * styles.length);
+ for (int i= 0; styles != null && i < styles.length; i++) {
+ styleBuf.append(" style=\""); //$NON-NLS-1$
+ styleBuf.append(styles[i]);
+ styleBuf.append('"');
+ }
+
+ // Find insertion index
+ // a) within existing body tag with trailing space
+ int index= buffer.indexOf("<body "); //$NON-NLS-1$
+ if (index != -1) {
+ buffer.insert(index+5, styleBuf);
+ return;
+ }
+
+ // b) within existing body tag without attributes
+ index= buffer.indexOf("<body>"); //$NON-NLS-1$
+ if (index != -1) {
+ buffer.insert(index+5, ' ');
+ buffer.insert(index+6, styleBuf);
+ return;
+ }
+ }
+
+ public static void insertPageProlog(StringBuffer buffer, int position, RGB bgRGB) {
+ if (bgRGB == null)
+ insertPageProlog(buffer, position);
+ else {
+ StringBuffer pageProlog= new StringBuffer(60);
+ pageProlog.append("<html><body text=\"#000000\" bgcolor=\""); //$NON-NLS-1$
+ appendColor(pageProlog, bgRGB);
+ pageProlog.append("\">"); //$NON-NLS-1$
+ buffer.insert(position, pageProlog.toString());
+ }
+ }
+
+ private static void appendStyleSheetURL(StringBuffer buffer, String styleSheet) {
+ if (styleSheet == null)
+ return;
+
+ buffer.append("<head><style CHARSET=\"ISO-8859-1\" TYPE=\"text/css\">"); //$NON-NLS-1$
+ buffer.append(styleSheet);
+ buffer.append("</style></head>"); //$NON-NLS-1$
+ }
+
+ private static void appendStyleSheetURL(StringBuffer buffer, URL styleSheetURL) {
+ if (styleSheetURL == null)
+ return;
+
+ buffer.append("<head>"); //$NON-NLS-1$
+
+ buffer.append("<LINK REL=\"stylesheet\" HREF= \""); //$NON-NLS-1$
+ buffer.append(styleSheetURL);
+ buffer.append("\" CHARSET=\"ISO-8859-1\" TYPE=\"text/css\">"); //$NON-NLS-1$
+
+ buffer.append("</head>"); //$NON-NLS-1$
+ }
+
+ private static void appendColor(StringBuffer buffer, RGB rgb) {
+ buffer.append('#');
+ buffer.append(Integer.toHexString(rgb.red));
+ buffer.append(Integer.toHexString(rgb.green));
+ buffer.append(Integer.toHexString(rgb.blue));
+ }
+
+ public static void insertPageProlog(StringBuffer buffer, int position) {
+ insertPageProlog(buffer, position, getBgColor());
+ }
+
+ public static void insertPageProlog(StringBuffer buffer, int position, URL styleSheetURL) {
+ insertPageProlog(buffer, position, getBgColor(), styleSheetURL);
+ }
+
+ public static void insertPageProlog(StringBuffer buffer, int position, String styleSheet) {
+ insertPageProlog(buffer, position, getBgColor(), styleSheet);
+ }
+
+ private static RGB getBgColor() {
+ if (BG_COLOR_RGB != null)
+ return BG_COLOR_RGB;
+ return new RGB(255,255, 225); // RGB value of info bg color on WindowsXP
+
+ }
+
+ public static void addPageProlog(StringBuffer buffer) {
+ insertPageProlog(buffer, buffer.length());
+ }
+
+ public static void addPageEpilog(StringBuffer buffer) {
+ buffer.append("</font></body></html>"); //$NON-NLS-1$
+ }
+
+ public static void startBulletList(StringBuffer buffer) {
+ buffer.append("<ul>"); //$NON-NLS-1$
+ }
+
+ public static void endBulletList(StringBuffer buffer) {
+ buffer.append("</ul>"); //$NON-NLS-1$
+ }
+
+ public static void addBullet(StringBuffer buffer, String bullet) {
+ if (bullet != null) {
+ buffer.append("<li>"); //$NON-NLS-1$
+ buffer.append(bullet);
+ buffer.append("</li>"); //$NON-NLS-1$
+ }
+ }
+
+ public static void addSmallHeader(StringBuffer buffer, String header) {
+ if (header != null) {
+ buffer.append("<h5>"); //$NON-NLS-1$
+ buffer.append(header);
+ buffer.append("</h5>"); //$NON-NLS-1$
+ }
+ }
+
+ public static void addParagraph(StringBuffer buffer, String paragraph) {
+ if (paragraph != null) {
+ buffer.append("<p>"); //$NON-NLS-1$
+ buffer.append(paragraph);
+ }
+ }
+
+ public static void addParagraph(StringBuffer buffer, Reader paragraphReader) {
+ if (paragraphReader != null)
+ addParagraph(buffer, read(paragraphReader));
+ }
+
+ /**
+ * Replaces the following style attributes of the font definition of the <code>html</code>
+ * element:
+ * <ul>
+ * <li>font-size</li>
+ * <li>font-weight</li>
+ * <li>font-style</li>
+ * <li>font-family</li>
+ * </ul>
+ * The font's name is used as font family, a <code>sans-serif</code> default font family is
+ * appended for the case that the given font name is not available.
+ * <p>
+ * If the listed font attributes are not contained in the passed style list, nothing happens.
+ * </p>
+ *
+ * @param styles CSS style definitions
+ * @param fontData the font information to use
+ * @return the modified style definitions
+ * @since 3.3
+ */
+ public static String convertTopLevelFont(String styles, FontData fontData) {
+ boolean bold= (fontData.getStyle() & SWT.BOLD) != 0;
+ boolean italic= (fontData.getStyle() & SWT.ITALIC) != 0;
+
+ // See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=155993
+ String size= Integer.toString(fontData.getHeight()) + ("carbon".equals(SWT.getPlatform()) ? "px" : "pt"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ String family= "'" + fontData.getName() + "',sans-serif"; //$NON-NLS-1$ //$NON-NLS-2$
+ styles= styles.replaceFirst("(html\\s*\\{.*(?:\\s|;)font-size:\\s*)\\d+pt(\\;?.*\\})", "$1" + size + "$2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ styles= styles.replaceFirst("(html\\s*\\{.*(?:\\s|;)font-weight:\\s*)\\w+(\\;?.*\\})", "$1" + (bold ? "bold" : "normal") + "$2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ styles= styles.replaceFirst("(html\\s*\\{.*(?:\\s|;)font-style:\\s*)\\w+(\\;?.*\\})", "$1" + (italic ? "italic" : "normal") + "$2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ styles= styles.replaceFirst("(html\\s*\\{.*(?:\\s|;)font-family:\\s*).+?(;.*\\})", "$1" + family + "$2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return styles;
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/NonMatchingRule.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/NonMatchingRule.java
new file mode 100644
index 0000000..75029a1
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/partition/NonMatchingRule.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.partition;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+
+public class NonMatchingRule implements IPredicateRule
+{
+
+ public NonMatchingRule()
+ {
+ super();
+ }
+
+ public IToken getSuccessToken()
+ {
+ return Token.UNDEFINED;
+ }
+
+ public IToken evaluate(ICharacterScanner scanner, boolean resume)
+ {
+ return Token.UNDEFINED;
+ }
+
+ public IToken evaluate(ICharacterScanner scanner)
+ {
+ return Token.UNDEFINED;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/EmfaticPreferencePage.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/EmfaticPreferencePage.java
new file mode 100644
index 0000000..df3559b
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/EmfaticPreferencePage.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.preferences;
+
+import org.eclipse.emf.emfatic.ui.EmfaticUIPlugin;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.DirectoryFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * This class represents a preference page that
+ * is contributed to the Preferences dialog. By
+ * subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows
+ * us to create a page that is small and knows how to
+ * save, restore and apply itself.
+ * <p>
+ * This page is used to modify preferences only. They
+ * are stored in the preference store that belongs to
+ * the main plug-in class. That way, preferences can
+ * be accessed directly via the preference store.
+ */
+
+public class EmfaticPreferencePage
+ extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ public EmfaticPreferencePage() {
+ super(GRID);
+ setPreferenceStore(EmfaticUIPlugin.getDefault().getPreferenceStore());
+ setDescription("A demonstration of a preference page implementation");
+ }
+
+ /**
+ * Creates the field editors. Field editors are abstractions of
+ * the common GUI blocks needed to manipulate various types
+ * of preferences. Each field editor knows how to save and
+ * restore itself.
+ */
+ public void createFieldEditors() {
+ addField(new DirectoryFieldEditor(PreferenceConstants.P_PATH,
+ "&Directory preference:", getFieldEditorParent()));
+ addField(
+ new BooleanFieldEditor(
+ PreferenceConstants.P_BOOLEAN,
+ "&SmartBrace (add closing brace automatically)",
+ getFieldEditorParent()));
+
+ addField(new RadioGroupFieldEditor(
+ PreferenceConstants.P_CHOICE,
+ "An example of a multiple-choice preference",
+ 1,
+ new String[][] { { "&Choice 1", "choice1" }, {
+ "C&hoice 2", "choice2" }
+ }, getFieldEditorParent()));
+ addField(
+ new StringFieldEditor(PreferenceConstants.P_STRING, "A &text preference:", getFieldEditorParent()));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/EmfaticTemplatesPreferencePage.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/EmfaticTemplatesPreferencePage.java
new file mode 100644
index 0000000..60f122f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/EmfaticTemplatesPreferencePage.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.preferences;
+
+import org.eclipse.emf.emfatic.ui.EmfaticUIPlugin;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
+
+public class EmfaticTemplatesPreferencePage extends TemplatePreferencePage implements IWorkbenchPreferencePage {
+
+ /**
+ * Constructor
+ */
+ public EmfaticTemplatesPreferencePage() {
+ setPreferenceStore(EmfaticUIPlugin.getDefault().getPreferenceStore());
+ setTemplateStore(EmfaticUIPlugin.getDefault().getEmfaticTemplateStore());
+ setContextTypeRegistry(EmfaticUIPlugin.getDefault().getEmfaticContextTypeRegistry());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.texteditor.templates.TemplatePreferencePage#isShowFormatterSetting()
+ */
+ protected boolean isShowFormatterSetting() {
+ return true;
+ }
+
+ /**
+ * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+ */
+ public boolean performOk() {
+ boolean ok = super.performOk();
+
+ if (ok)
+ EmfaticUIPlugin.getDefault().savePluginPreferences();
+
+ return ok;
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/PreferenceConstants.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/PreferenceConstants.java
new file mode 100644
index 0000000..a84f66a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/PreferenceConstants.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.preferences;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class PreferenceConstants {
+
+ public static final String P_PATH = "pathPreference";
+
+ public static final String P_BOOLEAN = "booleanPreference";
+
+ public static final String P_CHOICE = "choicePreference";
+
+ public static final String P_STRING = "stringPreference";
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/PreferenceInitializer.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000..c75a5a3
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/preferences/PreferenceInitializer.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.emf.emfatic.ui.EmfaticUIPlugin;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * Class used to initialize default preference values.
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = EmfaticUIPlugin.getDefault()
+ .getPreferenceStore();
+ store.setDefault(PreferenceConstants.P_BOOLEAN, true);
+ store.setDefault(PreferenceConstants.P_CHOICE, "choice2");
+ store.setDefault(PreferenceConstants.P_STRING,
+ "Default value");
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/redsquiggles/EmfaticCSTChangeListener.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/redsquiggles/EmfaticCSTChangeListener.java
new file mode 100644
index 0000000..5ca440f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/redsquiggles/EmfaticCSTChangeListener.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.redsquiggles;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.CompUnit;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNodeVisitor;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.MapEntryDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.TopLevelDecl;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.gymnast.runtime.ui.views.parsetree.IParseTreeChangedListener;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+
+public class EmfaticCSTChangeListener implements IParseTreeChangedListener {
+
+ EmfaticEditor _editor;
+ public static QualifiedName qnCST = new QualifiedName("de.tuhh.sts.emfatic", "cst");
+ public static QualifiedName qnAST = new QualifiedName("de.tuhh.sts.emfatic", "ast");
+
+ public EmfaticCSTChangeListener(EmfaticEditor editor) {
+ _editor = editor;
+ }
+
+ /**
+ * responsible for folding
+ */
+ public void parseTreeChanged(ASTNode[] arg0) {
+ /*
+ * TODO arg0 is always null because LDTEditor#setParseRoot gives just
+ * that instead of its _parseRoot
+ */
+
+ /*
+ * see the resource listener EmfaticRedSquiggler for an alternative way
+ * of listening
+ */
+
+ IFile emfFile = _editor.getFile();
+ CompUnit compUnit = (CompUnit) _editor.getParseRoot();
+ try {
+ if (emfFile != null) {
+ emfFile.setSessionProperty(qnCST, compUnit);
+ emfFile.setSessionProperty(qnAST, null);
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ if (compUnit != null) {
+ // the ast was set in EmfaticParserDriver#parse()
+ EPackage rootPackage = compUnit.getAST();
+ try {
+ emfFile.setSessionProperty(qnAST, rootPackage);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ updateFolding();
+
+ return;
+ }
+
+ private List<Position> fPositions = new ArrayList<Position>();
+
+ private void updateFolding() {
+ fPositions = new ArrayList<Position>();
+ CompUnit compUnit = (CompUnit) _editor.getParseRoot();
+
+ if (compUnit == null) {
+ return;
+ }
+
+ new EmfaticASTNodeVisitor() {
+ public boolean beginVisit(TopLevelDecl tld) {
+ if (!(tld instanceof MapEntryDecl)) {
+ int offset = tld.getRangeStart();
+ int length = tld.getRangeLength();
+ if (spansSeveralLines(offset, length)) {
+ fPositions.add(new Position(offset, length));
+ }
+ }
+ return true;
+ }
+ /*
+ * comments (including multiline ones) are eaten up by the lexer,
+ * there are no productions in the grammar for comments, and thus
+ * cannot be folded. Once that changes, this is the place to add a
+ * visitor handler which creates a Position to indicate that region
+ * can be folded.
+ */
+ }.visit(compUnit.getTopLevelDecls());
+
+ _editor.updateFoldingStructure(fPositions);
+
+ }
+
+ private boolean spansSeveralLines(final int offset, final int length) {
+ IDocumentProvider dp = _editor.getDocumentProvider();
+ IDocument doc = dp.getDocument(_editor.getEditorInput());
+ if (doc != null) {
+ try {
+ String[] lines = doc.get(offset, length).split("\n");
+ boolean res = lines.length > 2;
+ return res;
+ } catch (BadLocationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/redsquiggles/EmfaticRedSquiggler.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/redsquiggles/EmfaticRedSquiggler.java
new file mode 100644
index 0000000..133bdd4
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/redsquiggles/EmfaticRedSquiggler.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.redsquiggles;
+
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.runtime.CoreException;
+
+
+public class EmfaticRedSquiggler implements IResourceChangeListener {
+
+ /*
+ * Besides Ch. "Workspace Resource Programming" in JDGE, details can be
+ * found in
+ *
+ * http://www.eclipse.org/articles/Article-Resource-deltas/resource-deltas.html
+ *
+ *
+ */
+
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ IResourceDeltaVisitor visitor = new EmfaticRedSquigglerDeltaVisitor();
+ try {
+ delta.accept(visitor);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/redsquiggles/EmfaticRedSquigglerDeltaVisitor.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/redsquiggles/EmfaticRedSquigglerDeltaVisitor.java
new file mode 100644
index 0000000..e8f76bb
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/redsquiggles/EmfaticRedSquigglerDeltaVisitor.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.redsquiggles;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+
+public class EmfaticRedSquigglerDeltaVisitor implements IResourceDeltaVisitor {
+ public boolean visit(IResourceDelta delta) {
+ // only interested in changed resources (not added or removed)
+ if (delta.getKind() != IResourceDelta.CHANGED)
+ return true;
+ // not interested in marker changes
+ // if ((delta.getFlags() & IResourceDelta.MARKERS) == 0)
+ // return true;
+ // interested in content changes
+ if ((delta.getFlags() & IResourceDelta.CONTENT) == 0)
+ return true;
+ IResource resource = delta.getResource();
+ // only interested in files with the "txt" extension
+ if (resource.getType() == IResource.FILE && "emf".equalsIgnoreCase(resource.getFileExtension())) {
+ IFile emfFile = (IFile) resource;
+ _job = new RedSquigglerJob(emfFile);
+ _job.schedule();
+ }
+ return true;
+ }
+
+ private class RedSquigglerJob extends Job {
+
+ protected IStatus run(IProgressMonitor monitor) {
+ /*
+ * actually all red squiggles are placed in
+ * EmfaticParserDriver#parse(), thus here only sthg beyond that
+ * should go
+ */
+ _job = null;
+ return Status.OK_STATUS;
+ }
+
+ RedSquigglerJob(IFile emfFile) {
+ super("Computing red squiggles (EmfaticRedSquiggler) for " + emfFile.getName());
+ this.emfFile = emfFile;
+ }
+
+ private IFile emfFile;
+
+ }
+
+ private RedSquigglerJob _job;
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/templates/EmfaticContextType.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/templates/EmfaticContextType.java
new file mode 100644
index 0000000..92cb51d
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/templates/EmfaticContextType.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.templates;
+
+import org.eclipse.jface.text.templates.GlobalTemplateVariables;
+import org.eclipse.jface.text.templates.TemplateContextType;
+
+/**
+ *
+ * @author miguel.garcia@tuhh.de
+ */
+public class EmfaticContextType
+extends TemplateContextType {
+ public static final String EMFATIC_CONTEXT_TYPE = "org.eclipse.emf.emfatic.ui.templates.EmfaticContextType";
+
+ /**
+ * Constructor
+ */
+ public EmfaticContextType() {
+ super(EMFATIC_CONTEXT_TYPE);
+ addGlobalResolvers();
+ }
+
+ /*
+ * All default solvers provided by eclipse are enabled
+ */
+ private void addGlobalResolvers() {
+ addResolver(new GlobalTemplateVariables.Cursor());
+ addResolver(new GlobalTemplateVariables.WordSelection());
+ addResolver(new GlobalTemplateVariables.LineSelection());
+ addResolver(new GlobalTemplateVariables.Dollar());
+ addResolver(new GlobalTemplateVariables.Date());
+ addResolver(new GlobalTemplateVariables.Year());
+ addResolver(new GlobalTemplateVariables.Time());
+ addResolver(new GlobalTemplateVariables.User());
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/templates/EmfaticTemplateCompletionProcessor.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/templates/EmfaticTemplateCompletionProcessor.java
new file mode 100644
index 0000000..3d2da87
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/templates/EmfaticTemplateCompletionProcessor.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.templates;
+
+import java.util.ArrayList;
+import java.util.Collections;
+
+import org.eclipse.emf.emfatic.ui.EmfaticUIPlugin;
+import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ *
+ * @author miguel.garcia@tuhh.de
+ */
+public class EmfaticTemplateCompletionProcessor extends
+ TemplateCompletionProcessor {
+
+ TemplateContextType context;
+
+ /**
+ *
+ */
+ public EmfaticTemplateCompletionProcessor(String contextName) {
+ super();
+ this.context = EmfaticUIPlugin.getDefault()
+ .getEmfaticContextTypeRegistry().getContextType(contextName);
+ }
+
+ /**
+ * Returns the templates valid for the context type specified by
+ * <code>contextTypeId</code>. This implementation always returns the
+ * shared TemplateStore.
+ *
+ * @param contextTypeId
+ * the context type id
+ * @return the templates valid for this context type id
+ */
+ protected Template[] getTemplates(String contextTypeId) {
+ return EmfaticUIPlugin.getDefault().getEmfaticTemplateStore()
+ .getTemplates();
+ }
+
+ /**
+ * Returns the context type that can handle template insertion at the given
+ * region in the viewer's document.
+ *
+ * @param viewer
+ * the text viewer
+ * @param region
+ * the region into the document displayed by viewer
+ * @return the context type that can handle template expansion for the given
+ * location, or <code>null</code> if none exists
+ */
+ protected TemplateContextType getContextType(ITextViewer viewer,
+ IRegion region) {
+ // return EmfaticUIPlugin.getDefault().getTexContextTypeRegistry()
+ // .getContextType(EmfaticContextType.EMFATIC_CONTEXT_TYPE);
+ return context;
+ }
+
+ /**
+ * Returns an image for the given template. This implementation always
+ * returns the same icon (called "template").
+ *
+ * @param template
+ * template
+ * @return image for the given template
+ */
+ protected Image getImage(Template template) {
+ return EmfaticUIPlugin.getImage("template");
+ }
+
+ /**
+ * Adds all available templates to the given list, available meaning here
+ * that the templates match the found prefix.
+ *
+ * @param viewer
+ * The viewer associated with this editor
+ * @param documentOffset
+ * The offset in the document where the completions hould take
+ * place
+ * @param prefix
+ * The prefix of the completion string
+ * @return An <code>ArrayList</code> containing the
+ * <code>ICompletionProposals</code>
+ */
+ public ArrayList<ICompletionProposal> addTemplateProposals(
+ ITextViewer viewer, int documentOffset, String prefix) {
+
+ ArrayList<ICompletionProposal> propList = new ArrayList<ICompletionProposal>();
+
+ ICompletionProposal[] templateProposals = computeCompletionProposals(
+ viewer, documentOffset);
+
+ for (int j = 0; j < templateProposals.length; j++) {
+ ICompletionProposal proposal = templateProposals[j];
+ if (proposal.getDisplayString().startsWith(prefix)) {
+ propList.add(templateProposals[j]);
+ }
+ }
+ Collections.sort(propList, new CompletionProposalComparator());
+
+ return propList;
+ }
+
+ @Override
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ return new char[] { '@' };
+ }
+
+ @Override
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int offset) {
+ boolean activated = false;
+ try {
+ if (viewer.getDocument().getChar(offset - 1) == '@') {
+ activated = true;
+ ICompletionProposal[] res = super.computeCompletionProposals(
+ viewer, offset);
+ return res;
+ }
+ } catch (BadLocationException e) {
+ }
+ return new ICompletionProposal[] {};
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/MethodsViewContentProvider.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/MethodsViewContentProvider.java
new file mode 100644
index 0000000..6442aee
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/MethodsViewContentProvider.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.views;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+public class MethodsViewContentProvider implements IStructuredContentProvider {
+
+ private TypesView _typesView = null;
+
+ public MethodsViewContentProvider(TypesView tv) {
+ _typesView = tv;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ EClass eC = (EClass) inputElement;
+ List<EObject> members = new ArrayList<EObject>();
+ if (_typesView.isShowingInheritedMembers()) {
+ members.addAll(eC.getEAllAttributes());
+ members.addAll(eC.getEAllReferences());
+ members.addAll(eC.getEAllOperations());
+ } else {
+ members.addAll(eC.getEAttributes());
+ members.addAll(eC.getEReferences());
+ members.addAll(eC.getEOperations());
+ }
+ EObject[] res = new EObject[members.size()];
+ members.toArray(res);
+ return res;
+ }
+
+ public void dispose() {
+ // TODO Auto-generated method stub
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // we're not listening for property changes
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/MethodsViewLabelProvider.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/MethodsViewLabelProvider.java
new file mode 100644
index 0000000..b0399c0
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/MethodsViewLabelProvider.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.views;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.emfatic.core.generator.emfatic.Writer;
+import org.eclipse.emf.emfatic.core.util.EmfaticOutlineBuilder;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+public class MethodsViewLabelProvider implements ITableLabelProvider {
+
+ private TypesView _typesView;
+
+ public MethodsViewLabelProvider(TypesView tv) {
+ _typesView = tv;
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ if (columnIndex != 0) {
+ return null;
+ }
+ if (element instanceof EOperation) {
+ return EmfaticOutlineBuilder.getOperationImage();
+ }
+ if (element instanceof EAttribute) {
+ return EmfaticOutlineBuilder.getAttributeImage();
+ }
+ if (element instanceof EReference) {
+ return EmfaticOutlineBuilder.getReferenceImage();
+ }
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if (columnIndex == 0) {
+ boolean prependClassName = _typesView.isSortingByDefiningType();
+ String res = labelFor(element, prependClassName);
+ return res;
+ }
+ return null;
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void dispose() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static String labelFor(Object element, boolean prependClassName) {
+ if (!(element instanceof EObject)) {
+ return "";
+ }
+ EObject eO = (EObject) element;
+ String res = null;
+ if (eO instanceof EAttribute) {
+ res = Writer.attributeEssentials((EAttribute) eO);
+ } else if (eO instanceof EReference) {
+ res = Writer.referenceEssentials((EReference) eO);
+ } else {
+ res = Writer.operationEssentials((EOperation) eO);
+ }
+
+ if (prependClassName) {
+ EClass declaringClass = null;
+ if (eO instanceof EOperation) {
+ declaringClass = ((EOperation) eO).getEContainingClass();
+ }
+ if (eO instanceof EStructuralFeature) {
+ declaringClass = ((EStructuralFeature) eO)
+ .getEContainingClass();
+ }
+ if (declaringClass != null) {
+ res = "( " + declaringClass.getName() + " ) - " + res;
+ }
+ }
+ return res;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypeHierarchyMessages.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypeHierarchyMessages.java
new file mode 100644
index 0000000..57d7a1d
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypeHierarchyMessages.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.emfatic.ui.views;
+
+import org.eclipse.osgi.util.NLS;
+
+public final class TypeHierarchyMessages extends NLS {
+
+ private static final String BUNDLE_NAME= "org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyMessages";//$NON-NLS-1$
+
+ private TypeHierarchyMessages() {
+ // Do not instantiate
+ }
+
+ public static String EnableMemberFilterAction_label;
+ public static String EnableMemberFilterAction_tooltip;
+ public static String EnableMemberFilterAction_description;
+ public static String HistoryDropDownAction_clearhistory_label;
+ public static String ToggleOrientationAction_horizontal_label;
+ public static String ToggleOrientationAction_horizontal_tooltip;
+ public static String ToggleOrientationAction_horizontal_description;
+ public static String ToggleOrientationAction_vertical_label;
+ public static String ToggleOrientationAction_vertical_tooltip;
+ public static String ToggleOrientationAction_vertical_description;
+ public static String ToggleOrientationAction_automatic_label;
+ public static String ToggleOrientationAction_automatic_tooltip;
+ public static String ToggleOrientationAction_automatic_description;
+ public static String ToggleOrientationAction_single_label;
+ public static String ToggleOrientationAction_single_tooltip;
+ public static String ToggleOrientationAction_single_description;
+ public static String FocusOnSelectionAction_label;
+ public static String FocusOnSelectionAction_tooltip;
+ public static String FocusOnSelectionAction_description;
+ public static String FocusOnTypeAction_label;
+ public static String FocusOnTypeAction_tooltip;
+ public static String FocusOnTypeAction_description;
+ public static String FocusOnTypeAction_dialog_title;
+ public static String FocusOnTypeAction_dialog_message;
+ public static String HistoryDropDownAction_tooltip;
+ public static String HistoryAction_description;
+ public static String HistoryAction_tooltip;
+ public static String HistoryListDialog_title;
+ public static String HistoryListDialog_label;
+ public static String HistoryListDialog_remove_button;
+ public static String HistoryListAction_label;
+ public static String ShowInheritedMembersAction_label;
+ public static String ShowInheritedMembersAction_tooltip;
+ public static String ShowInheritedMembersAction_description;
+ public static String ShowQualifiedTypeNamesAction_label;
+ public static String ShowQualifiedTypeNamesAction_tooltip;
+ public static String ShowQualifiedTypeNamesAction_description;
+ public static String SortByDefiningTypeAction_label;
+ public static String SortByDefiningTypeAction_tooltip;
+ public static String SortByDefiningTypeAction_description;
+ public static String SubTypeHierarchyViewer_title;
+ public static String SubTypeHierarchyViewer_filtered_title;
+ public static String SuperTypeHierarchyViewer_title;
+ public static String SuperTypeHierarchyViewer_filtered_title;
+ public static String TraditionalHierarchyViewer_title;
+ public static String TraditionalHierarchyViewer_filtered_title;
+ public static String TypeHierarchyViewPart_error_title;
+ public static String TypeHierarchyViewPart_error_message;
+ public static String TypeHierarchyViewPart_empty;
+ public static String TypeHierarchyViewPart_nodecl;
+ public static String TypeHierarchyViewPart_exception_title;
+ public static String TypeHierarchyViewPart_exception_message;
+ public static String TypeHierarchyViewPart_title;
+ public static String TypeHierarchyViewPart_tooltip;
+ public static String TypeHierarchyViewPart_ws_title;
+ public static String TypeHierarchyViewPart_ws_tooltip;
+ public static String TypeHierarchyViewPart_restoreinput;
+ public static String TypeHierarchyViewPart_layout_submenu;
+ public static String ToggleViewAction_subtypes_label;
+ public static String ToggleViewAction_subtypes_tooltip;
+ public static String ToggleViewAction_subtypes_description;
+ public static String ToggleViewAction_supertypes_label;
+ public static String ToggleViewAction_supertypes_tooltip;
+ public static String ToggleViewAction_supertypes_description;
+ public static String ToggleViewAction_vajhierarchy_label;
+ public static String ToggleViewAction_vajhierarchy_tooltip;
+ public static String ToggleViewAction_vajhierarchy_description;
+ public static String HierarchyInformationControl_methodhierarchy_label;
+ public static String HierarchyInformationControl_hierarchy_label;
+ public static String HierarchyInformationControl_toggle_traditionalhierarchy_label;
+ public static String HierarchyInformationControl_toggle_superhierarchy_label;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, TypeHierarchyMessages.class);
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypeHierarchyMessages.properties b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypeHierarchyMessages.properties
new file mode 100644
index 0000000..cdf4406
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypeHierarchyMessages.properties
@@ -0,0 +1,108 @@
+###############################################################################
+# Copyright (c) 2000, 2006 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+EnableMemberFilterAction_label=Members in Hierarchy
+EnableMemberFilterAction_tooltip=Lock View and Show Members in Hierarchy
+EnableMemberFilterAction_description=Lock view and show members in hierarchy
+
+ToggleOrientationAction_horizontal_label=&Horizontal View Orientation
+ToggleOrientationAction_horizontal_tooltip=Horizontal View Orientation
+ToggleOrientationAction_horizontal_description=Horizontal View Orientation
+
+ToggleOrientationAction_vertical_label=&Vertical View Orientation
+ToggleOrientationAction_vertical_tooltip=Vertical View Orientation
+ToggleOrientationAction_vertical_description=Vertical View Orientation
+
+ToggleOrientationAction_automatic_label=&Automatic View Orientation
+ToggleOrientationAction_automatic_tooltip=Automatic View Orientation
+ToggleOrientationAction_automatic_description=Automatic View Orientation
+
+
+ToggleOrientationAction_single_label=Hierarchy View &Only
+ToggleOrientationAction_single_tooltip=Hierarchy View Only
+ToggleOrientationAction_single_description=Hierarchy View Only
+
+FocusOnSelectionAction_label=Fo&cus On ''{0}''
+FocusOnSelectionAction_tooltip=Focus the Type Hierarchy on the Selected Element
+FocusOnSelectionAction_description=Focus the Type Hierarchy on the selected element
+
+FocusOnTypeAction_label=Foc&us On...
+FocusOnTypeAction_tooltip=Focus the Type Hierarchy on a New Type
+FocusOnTypeAction_description=Focus the Type Hierarchy on a new type
+FocusOnTypeAction_dialog_title=Focus On Type
+FocusOnTypeAction_dialog_message=&Select the type to be shown in the Type Hierarchy view:
+
+HistoryDropDownAction_tooltip=Previous Type Hierarchies
+HistoryDropDownAction_clearhistory_label=Clear History
+
+HistoryAction_description=Open ''{0}'' in Hierarchy
+HistoryAction_tooltip=Open ''{0}'' in Hierarchy
+
+HistoryListDialog_title=Type Hierarchy History
+HistoryListDialog_label=&Select the element to open in the type hierarchy:
+HistoryListDialog_remove_button=&Remove
+
+HistoryListAction_label=History...
+
+ShowInheritedMembersAction_label=All Inherited Members
+ShowInheritedMembersAction_tooltip=Show All Inherited Members
+ShowInheritedMembersAction_description=Show all inherited members
+
+ShowQualifiedTypeNamesAction_label=Show &Qualified Type Names
+ShowQualifiedTypeNamesAction_tooltip=Show Qualified Type Names
+ShowQualifiedTypeNamesAction_description=Show qualified type names
+
+SortByDefiningTypeAction_label=Sort by the Defining Type
+SortByDefiningTypeAction_tooltip=Sort Methods by the Defining Type
+SortByDefiningTypeAction_description=Sort methods by the defining type
+
+SubTypeHierarchyViewer_title=Hierarchy
+SubTypeHierarchyViewer_filtered_title=Hierarchy
+
+SuperTypeHierarchyViewer_title=Hierarchy
+SuperTypeHierarchyViewer_filtered_title=Hierarchy
+
+TraditionalHierarchyViewer_title=Hierarchy
+TraditionalHierarchyViewer_filtered_title=Hierarchy
+
+TypeHierarchyViewPart_error_title=Open Type Hierarchy
+
+TypeHierarchyViewPart_error_message=The selected element only exists in the editor. To perform this operation you have to save the editor first.
+TypeHierarchyViewPart_empty=To display the type hierarchy, select a type (for example in the outline view or in the editor), and select the \'Open Type Hierarchy\' menu option. Alternatively, you can drag and drop an element (e.g. project, package, type) onto this view.
+TypeHierarchyViewPart_nodecl=All types of the current hierarchy ''{0}'' have been filtered by either the selected working set or the chosen locked method.
+TypeHierarchyViewPart_exception_title=Type Hierarchy
+TypeHierarchyViewPart_exception_message=Creating hierarchy failed. See log for details.
+
+TypeHierarchyViewPart_title={1}
+TypeHierarchyViewPart_tooltip={0} of ''{1}''
+TypeHierarchyViewPart_ws_title={1}, working set: {2}
+TypeHierarchyViewPart_ws_tooltip={0} of {1} - working set: {2}
+
+TypeHierarchyViewPart_restoreinput=Restoring type hierarchy of ''{0}''...
+
+TypeHierarchyViewPart_layout_submenu=&Layout
+
+ToggleViewAction_subtypes_label=Su&btype Hierarchy
+ToggleViewAction_subtypes_tooltip=Show the Subtype Hierarchy
+ToggleViewAction_subtypes_description=Show the subtype hierarchy
+
+ToggleViewAction_supertypes_label=Su&pertype Hierarchy
+ToggleViewAction_supertypes_tooltip=Show the Supertype Hierarchy
+ToggleViewAction_supertypes_description=Show the supertype hierarchy
+
+ToggleViewAction_vajhierarchy_label=&Type Hierarchy
+ToggleViewAction_vajhierarchy_tooltip=Show the Type Hierarchy
+ToggleViewAction_vajhierarchy_description=Show the type hierarchy
+
+HierarchyInformationControl_methodhierarchy_label=Types implementing or defining ''{0}.{1}''
+HierarchyInformationControl_hierarchy_label=Type hierarchy of ''{0}'':
+HierarchyInformationControl_toggle_traditionalhierarchy_label=Press ''{0}'' to see the subtype hierarchy
+HierarchyInformationControl_toggle_superhierarchy_label=Press ''{0}'' to see the supertype hierarchy
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesView.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesView.java
new file mode 100644
index 0000000..d38a2da
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesView.java
@@ -0,0 +1,505 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.views;
+
+import java.lang.ref.WeakReference;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.ClassDecl;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.ui.EmfaticUIPlugin;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor.ReferedEcoreDecl;
+import org.eclipse.emf.emfatic.ui.hyperlinks.EmfaticHyperlinkDetector;
+import org.eclipse.gymnast.runtime.core.ast.ASTNode;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.ViewForm;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.IShowInTarget;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.ShowInContext;
+import org.eclipse.ui.part.ViewPart;
+
+public class TypesView extends ViewPart implements IShowInTarget {
+
+ public static final String ID = "org.eclipse.emf.emfatic.ui.views.TypesView";
+
+ public TypesView() {
+ super();
+ }
+
+ private TreeViewer typesViewer;
+ private TreeViewer memberViewer;
+ // private DrillDownAdapter drillDownAdapter;
+ private Action actionSupertypeH;
+ private Action actionSubtypeH;
+ private TypesViewDoubleClick doubleClickAction;
+ private String _currentClassifier = "";
+ private PageBook fPagebook;
+ private Label fNoHierarchyShownLabel;
+ private SashForm fTypeMethodsSplitter;
+ private ViewForm fTypeViewerViewForm;
+ private PageBook fViewerbook;
+ private ViewForm fMethodViewerViewForm;
+ private TableViewer fMethodsViewer;
+ private CLabel fMethodViewerPaneLabel;
+ private IAction fShowInheritedMembersAction;
+ private IAction fSortByDefiningTypeAction;
+
+ /**
+ * This is a callback that will allow us to create the viewer and initialize
+ * it.
+ */
+ public void createPartControl(Composite parent) {
+
+ /*
+ * A pagebook is a composite control where only a single control is
+ * visible at a time. It is similar to a notebook, but without tabs.
+ */
+ fPagebook = new PageBook(parent, SWT.NONE);
+
+ // page 1 of page book (no hierarchy label)
+
+ fNoHierarchyShownLabel = new Label(fPagebook, SWT.TOP + SWT.LEFT
+ + SWT.WRAP);
+ fNoHierarchyShownLabel
+ .setText(TypeHierarchyMessages.TypeHierarchyViewPart_empty);
+
+ // page 2 of page book (viewers)
+
+ fTypeMethodsSplitter = new SashForm(fPagebook, SWT.VERTICAL);
+ fTypeMethodsSplitter.setVisible(false);
+
+ fTypeViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
+
+ Control typeViewerControl = createTypeViewerControl(fTypeViewerViewForm);
+ fTypeViewerViewForm.setContent(typeViewerControl);
+
+ fMethodViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
+ fTypeMethodsSplitter.setWeights(new int[] { 35, 65 });
+
+ Control methodViewerPart = createMethodViewerControl(fMethodViewerViewForm);
+ fMethodViewerViewForm.setContent(methodViewerPart);
+
+ fMethodViewerPaneLabel = new CLabel(fMethodViewerViewForm, SWT.NONE);
+ fMethodViewerViewForm.setTopLeft(fMethodViewerPaneLabel);
+
+ fTypeMethodsSplitter.pack();
+
+ makeTypeViewerActions();
+ hookTypeViewerClickActions();
+ contributeToActionBars();
+
+ fillTheMethodViewerToolbar();
+
+ }
+
+ private void fillTheMethodViewerToolbar() {
+ ToolBar methodViewerToolBar = new ToolBar(fMethodViewerViewForm,
+ SWT.FLAT | SWT.WRAP);
+ fMethodViewerViewForm.setTopCenter(methodViewerToolBar);
+
+ fShowInheritedMembersAction = new Action("Show inherited members",
+ IAction.AS_CHECK_BOX) {
+ public void run() {
+ fMethodsViewer.refresh();
+ }
+ };
+ fShowInheritedMembersAction.setToolTipText("Show inherited members");
+ fShowInheritedMembersAction.setImageDescriptor(EmfaticUIPlugin
+ .getImageDescriptor("typesView/inher_co"));
+ fShowInheritedMembersAction.setChecked(false);
+
+ fSortByDefiningTypeAction = new Action("Sort by defining type",
+ IAction.AS_CHECK_BOX) {
+ public void run() {
+ if (!isChecked()) {
+ fMethodsViewer.setSorter(null);
+ } else {
+ fMethodsViewer.setSorter(new ViewerSorter() {
+
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+
+ int subtyping = compareSubtyping(e1, e2);
+ if (subtyping != 0) {
+ return subtyping;
+ }
+ String s1 = MethodsViewLabelProvider.labelFor(e1,
+ true);
+ String s2 = MethodsViewLabelProvider.labelFor(e2,
+ true);
+ return s1.compareTo(s2);
+ }
+
+ private int compareSubtyping(Object e1, Object e2) {
+ int res = 0;
+ EClass declClass1 = declaringClass(e1);
+ EClass declClass2 = declaringClass(e2);
+ if (declClass1 != null && declClass2 != null) {
+ if (declClass1.getEAllSuperTypes().contains(
+ declClass2)) {
+ return -1;
+ }
+ if (declClass2.getEAllSuperTypes().contains(
+ declClass1)) {
+ return 1;
+ }
+ }
+ return res;
+ }
+
+ private EClass declaringClass(Object e) {
+ EClass eC = null;
+ if (e instanceof EStructuralFeature) {
+ EStructuralFeature sf = (EStructuralFeature) e;
+ eC = sf.getEContainingClass();
+ }
+ if (e instanceof EOperation) {
+ EOperation eOp = (EOperation) e;
+ eC = eOp.getEContainingClass();
+ }
+ return eC;
+ }
+ });
+ }
+ fMethodsViewer.refresh();
+ }
+ };
+ fSortByDefiningTypeAction.setToolTipText("Sort by defining type");
+ fSortByDefiningTypeAction.setImageDescriptor(EmfaticUIPlugin
+ .getImageDescriptor("typesView/definingtype_sort_co"));
+ fSortByDefiningTypeAction.setChecked(false);
+
+ // fill the method viewer tool bar
+ ToolBarManager lowertbmanager = new ToolBarManager(methodViewerToolBar);
+ lowertbmanager.add(new Separator());
+ lowertbmanager.add(fShowInheritedMembersAction);
+ lowertbmanager.add(fSortByDefiningTypeAction);
+ lowertbmanager.add(new Separator());
+
+ lowertbmanager.update(true);
+
+ }
+
+ private void initActionMember(IAction a, final String msg) {
+ a.setText(msg);
+ a.setToolTipText(msg);
+ a.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
+ .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
+ }
+
+ private Control createMethodViewerControl(ViewForm parent) {
+
+ /*
+ * how to use a table viewer:
+ * http://www-128.ibm.com/developerworks/library/os-ecgui2/
+ *
+ */
+ fMethodsViewer = new TableViewer(parent, SWT.BORDER
+ | SWT.FULL_SELECTION | SWT.MULTI);
+ fMethodsViewer.setContentProvider(new MethodsViewContentProvider(this));
+ fMethodsViewer.setLabelProvider(new MethodsViewLabelProvider(this));
+
+ TableColumn column = new TableColumn(fMethodsViewer.getTable(),
+ SWT.LEFT);
+ column.setText("Name");
+ column.setWidth(400);
+
+ fMethodsViewer.getTable().setHeaderVisible(true);
+
+ Control control = fMethodsViewer.getTable();
+
+ // on double click navigate in the editor to declaration
+ fMethodsViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ if (!(event.getSelection() instanceof IStructuredSelection)) {
+ return;
+ }
+ IStructuredSelection ssel = (IStructuredSelection) event
+ .getSelection();
+ if (!(ssel.getFirstElement() instanceof EObject)) {
+ return;
+ }
+ EObject eO = (EObject) ssel.getFirstElement();
+ // TODO find the right one!
+ EmfaticEditor editor = getActiveEmfaticEditor();
+ if (editor != null) {
+ EmfaticASTNode landingPlace = EmfaticHyperlinkDetector
+ .getLandingPlace(eO, editor);
+ if (landingPlace != null) {
+ editor.setSelection(landingPlace, true);
+ editor.setFocus();
+ }
+ }
+ }
+ });
+
+ return control;
+ }
+
+ private Control createTypeViewerControl(Composite parent) {
+ fViewerbook = new PageBook(parent, SWT.NULL);
+
+ // KeyListener keyListener= createKeyListener();
+
+ // Create the viewers
+ typesViewer = new TreeViewer(fViewerbook, SWT.MULTI | SWT.H_SCROLL
+ | SWT.V_SCROLL);
+
+ typesViewer.setSorter(new ViewerSorter() {
+
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+
+ if (e1 instanceof EClass && e2 instanceof EClass) {
+ EClass eC1 = (EClass) e1;
+ EClass eC2 = (EClass) e2;
+ return eC1.getName().compareToIgnoreCase(eC2.getName());
+ }
+ return super.compare(viewer, e1, e2);
+ }
+ });
+
+ typesViewer.setContentProvider(new TypesViewContentProvider(this));
+ typesViewer.setLabelProvider(new TypesViewLabelProvider());
+
+ return fViewerbook;
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(actionSupertypeH);
+ manager.add(actionSubtypeH);
+ manager.add(new Separator());
+ }
+
+ private void makeTypeViewerActions() {
+ actionSupertypeH = new Action("Show the supertype hierarchy",
+ IAction.AS_CHECK_BOX) {
+
+ public void run() {
+ actionSubtypeH.setChecked(!actionSupertypeH.isChecked());
+ fMethodsViewer.setInput(null);
+ typesViewer.refresh();
+ }
+ };
+ actionSupertypeH.setToolTipText("Show the supertype hierarchy");
+ actionSupertypeH.setImageDescriptor(EmfaticUIPlugin
+ .getImageDescriptor("typesView/super_co"));
+ actionSupertypeH.setChecked(false);
+
+ actionSubtypeH = new Action("Show the subtype hierarchy",
+ IAction.AS_CHECK_BOX) {
+ public void run() {
+ actionSupertypeH.setChecked(!actionSubtypeH.isChecked());
+ fMethodsViewer.setInput(null);
+ typesViewer.refresh();
+ }
+ };
+ actionSubtypeH.setText("Show the subtype hierarchy");
+ actionSubtypeH.setToolTipText("Show the subtype hierarchy");
+ actionSubtypeH.setImageDescriptor(EmfaticUIPlugin
+ .getImageDescriptor("typesView/sub_co"));
+ actionSubtypeH.setChecked(true);
+
+ doubleClickAction = new TypesViewDoubleClick(this, typesViewer);
+ }
+
+ private void hookTypeViewerClickActions() {
+
+ // on double click navigate in the editor to EClass declaration
+ typesViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ doubleClickAction.run();
+ }
+ });
+
+ // on single click update the members view
+ typesViewer
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection ssel = (IStructuredSelection) event
+ .getSelection();
+ if (!(ssel.getFirstElement() instanceof EClass)) {
+ fMethodsViewer.setInput(null);
+ return;
+ }
+ EClass eC = (EClass) ssel.getFirstElement();
+ fMethodsViewer.setInput(eC);
+ }
+ });
+ }
+
+ private void showMessage(String message) {
+ MessageDialog.openInformation(typesViewer.getControl().getShell(),
+ "Types View", message);
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ fPagebook.setFocus();
+ }
+
+ public void setInput(WeakReference<EClass> wrC, boolean navigateInEditor) {
+ EClass eC = wrC.get();
+ _currentClassifier = getQualifiedName(eC);
+ typesViewer.setInput(wrC);
+ fPagebook.showPage(fTypeMethodsSplitter);
+ fViewerbook.showPage(typesViewer.getControl());
+ typesViewer.getTree().setFocus();
+ }
+
+ private String getQualifiedName(EClassifier eC) {
+ String res = eC.getName();
+ EPackage eP = eC.getEPackage();
+ do {
+ res = eP.getName() + "." + res;
+ eP = eP.getESuperPackage();
+ } while (eP != null);
+ return res;
+ }
+
+ /**
+ * see p. 467 and p. 499 of JDGE 2nd Ed
+ */
+ public boolean show(ShowInContext context) {
+ if (context == null) {
+ return false;
+ }
+ if (!(context.getSelection() instanceof ITextSelection)) {
+ return false;
+ }
+ if (!(context.getInput() instanceof IFile)) {
+ return false;
+ }
+ EmfaticEditor editor = getActiveEmfaticEditor();
+ if (editor == null) {
+ return false;
+ }
+ ITextSelection ts = (ITextSelection) context.getSelection();
+ int offset = ts.getOffset();
+ int length = ts.getLength();
+ ReferedEcoreDecl red = editor.getReferedEcoreDecl(offset, length);
+
+ EObject ecoreDecl = null;
+
+ if (red == null || red.ecoreDecl == null) {
+ // perhaps the cursor is at a declaration and not at a usage
+ ASTNode n = editor.getClosestEnclosingASTNodeAt(offset,
+ ClassDecl.class);
+ ecoreDecl = editor.getCstDecl2EcoreAST().get(n);
+ if (ecoreDecl == null) {
+ return false;
+ }
+ } else {
+ ecoreDecl = red.ecoreDecl;
+ }
+
+ if (!(ecoreDecl instanceof EClass)) {
+ return false;
+ }
+ EClass eC = (EClass) ecoreDecl;
+ WeakReference<EClass> wrC = new WeakReference<EClass>(eC);
+ setInput(wrC, false);
+ return true;
+ }
+
+ EmfaticEditor getEditor(IFile f) {
+ IWorkbenchPage[] wps = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getPages();
+ for (IWorkbenchPage wp : wps) {
+ IEditorPart[] edsInPage = wp.getEditors();
+ for (IEditorPart ep : edsInPage) {
+ if (ep instanceof EmfaticEditor) {
+ EmfaticEditor ee = (EmfaticEditor) ep;
+ if (!(ee.getEditorInput() instanceof FileEditorInput)) {
+ return null;
+ }
+ FileEditorInput fei = (FileEditorInput) ee.getEditorInput();
+ if (fei.getFile() == f) {
+ return ee;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ EmfaticEditor getActiveEmfaticEditor() {
+ IEditorPart ep = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().getActiveEditor();
+ if (ep instanceof EmfaticEditor) {
+ EmfaticEditor ee = (EmfaticEditor) ep;
+ return ee;
+ }
+ return null;
+ }
+
+ public Object getTypesViewerInput() {
+ Object i = typesViewer.getInput();
+ return i;
+ }
+
+ public boolean isShowinSuperTypeHierarchy() {
+ return actionSupertypeH.isChecked();
+ }
+
+ public boolean isShowingInheritedMembers() {
+ return fShowInheritedMembersAction.isChecked();
+ }
+
+ public boolean isSortingByDefiningType() {
+ return fSortByDefiningTypeAction.isChecked();
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesViewContentProvider.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesViewContentProvider.java
new file mode 100644
index 0000000..f27efba
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesViewContentProvider.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.views;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+class TypesViewContentProvider implements ITreeContentProvider {
+
+ TypesView _typesView = null;
+ EClass lastShown = null;
+
+ public TypesViewContentProvider(TypesView tv) {
+ _typesView = tv;
+ }
+
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ // we're not listening for property changes
+ }
+
+ public void dispose() {
+ }
+
+ public Object[] getElements(Object parent) {
+ if (parent instanceof WeakReference) {
+ WeakReference wrC = (WeakReference) parent;
+ EClass eC = (EClass) wrC.get();
+ return new EClass[] { eC };
+ }
+ if (parent instanceof EClass) {
+ EClass eC = (EClass) parent;
+ return getChildren(eC);
+ }
+ return new Object[] {};
+ }
+
+ public Object getParent(Object child) {
+ EClass eC = (EClass) child;
+ if (_typesView.isShowinSuperTypeHierarchy()) {
+ if (subClassesOf(eC).length > 0) {
+ EClass fstSubtype = subClassesOf(eC)[0];
+ return fstSubtype;
+ } else {
+ return null;
+ }
+ } else {
+ if (eC.getESuperTypes().size() > 0) {
+ EClass firstParent = eC.getESuperTypes().get(0);
+ return firstParent;
+ } else {
+ return null;
+ }
+ }
+ }
+
+ public Object[] getChildren(Object parent) {
+ EClass eC = (EClass) parent;
+ EClass[] res;
+ if (_typesView.isShowinSuperTypeHierarchy()) {
+ res = superTypesOf(eC);
+ } else {
+ res = subClassesOf(eC);
+ }
+ return res;
+ }
+
+ private EClass[] superTypesOf(EClass eC) {
+ EClass[] res = new EClass[eC.getESuperTypes().size()];
+ eC.getESuperTypes().toArray(res);
+ return res;
+ }
+
+ private EClass[] subClassesOf(EClass eC) {
+ Collection<EObject> subClasses = findOpposites(eC,
+ EcorePackage.eINSTANCE.getEClass_ESuperTypes());
+ EClass[] res = new EClass[subClasses.size()];
+ int i = 0;
+ for (EObject sc : subClasses) {
+ if (sc instanceof EClass) {
+ res[i] = (EClass) sc;
+ i++;
+ }
+ }
+ return res;
+ }
+
+ public boolean hasChildren(Object parent) {
+ EClass eC = (EClass) parent;
+ boolean res;
+ if (_typesView.isShowinSuperTypeHierarchy()) {
+ res = superTypesOf(eC).length != 0;
+ } else {
+ res = subClassesOf(eC).length != 0;
+ }
+ return res;
+ }
+
+ public static Collection<EObject> findOpposites(final EObject object,
+ final EReference outgoingEReference) {
+ // see Sec. 13.5.3 Using Cross Referencers on EMF book (1st Ed.)
+ Collection<EStructuralFeature.Setting> settings = new EcoreUtil.UsageCrossReferencer(
+ object.eResource().getResourceSet()) {
+
+ protected boolean crossReference(EObject eObject,
+ EReference eReference, EObject crossReferencedObject) {
+ return object == crossReferencedObject
+ && eReference == outgoingEReference;
+ }
+
+ public Collection<EStructuralFeature.Setting> findUsage(
+ EObject eObject) {
+ return super.findUsage(eObject);
+ }
+
+ }.findUsage(object);
+
+ List<EObject> references = new ArrayList<EObject>();
+
+ for (EStructuralFeature.Setting setting : settings) {
+ if (setting.getEStructuralFeature() == outgoingEReference) {
+ references.add(setting.getEObject());
+ }
+ }
+ return references;
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesViewDoubleClick.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesViewDoubleClick.java
new file mode 100644
index 0000000..c09d370
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesViewDoubleClick.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.views;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.emfatic.core.lang.gen.ast.EmfaticASTNode;
+import org.eclipse.emf.emfatic.ui.editor.EmfaticEditor;
+import org.eclipse.emf.emfatic.ui.hyperlinks.EmfaticHyperlinkDetector;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class TypesViewDoubleClick extends Action {
+
+ private TypesView _tv;
+ private TreeViewer _typesViewer;
+
+ public TypesViewDoubleClick(TypesView tv, TreeViewer typesViewer) {
+ _tv = tv;
+ _typesViewer = typesViewer;
+ }
+
+ public void run() {
+ /*
+ * TODO keep a reference to the document where the clicked type is being
+ * edited
+ */
+ ISelection selection = _typesViewer.getSelection();
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
+ if (obj instanceof EClass) {
+ // TODO find the right one!
+ EmfaticEditor editor = _tv.getActiveEmfaticEditor();
+ if (editor != null) {
+ EmfaticASTNode landingPlace = EmfaticHyperlinkDetector
+ .getLandingPlace((EClass) obj, editor);
+ if (landingPlace != null) {
+ editor.setSelection(landingPlace, true);
+ editor.setFocus();
+ }
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesViewLabelProvider.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesViewLabelProvider.java
new file mode 100644
index 0000000..8ebc7ed
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/views/TypesViewLabelProvider.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.views;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.emfatic.core.generics.util.GenericsUtil;
+import org.eclipse.emf.emfatic.ui.EmfaticUIPlugin;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+
+class TypesViewLabelProvider extends LabelProvider {
+
+ public String getText(Object obj) {
+ EClass eC = (EClass) obj;
+ String res = GenericsUtil.getText(GenericsUtil.getEGenericType(eC));
+ return res;
+ }
+
+ public Image getImage(Object obj) {
+ String imgName = "";
+ if (obj instanceof EClass) {
+ EClass eC = (EClass) obj;
+ imgName += eC.isInterface() ? "int_" : "class_";
+ imgName += eC.isAbstract() ? "abs" : "obj";
+ }
+ if (!imgName.equals("")) {
+ return EmfaticUIPlugin.getImage("typesView/" + imgName);
+ }
+ String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
+ imageKey = ISharedImages.IMG_OBJ_FOLDER;
+ return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
+ }
+}
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/wizards/EmfaticNewFileCreationPage.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/wizards/EmfaticNewFileCreationPage.java
new file mode 100644
index 0000000..2876a64
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/wizards/EmfaticNewFileCreationPage.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.wizards;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+/**
+ * The "New" wizard page allows setting the container for the new file as well
+ * as the file name. The page will only accept file name without the extension
+ * OR with the extension that matches the expected one (emf).
+ */
+
+public class EmfaticNewFileCreationPage extends WizardPage {
+ private Text containerText;
+
+ private Text fileText;
+
+ private ISelection selection;
+
+ /**
+ * Constructor for SampleNewWizardPage.
+ *
+ * @param pageName
+ */
+ public EmfaticNewFileCreationPage(ISelection selection) {
+ super("wizardPage");
+ setTitle("Emfatic File");
+ setDescription("This wizard creates a new file with *.emf extension that can be opened by the Emfatic editor.");
+ this.selection = selection;
+ }
+
+ /**
+ * @see IDialogPage#createControl(Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 3;
+ layout.verticalSpacing = 9;
+ Label label = new Label(container, SWT.NULL);
+ label.setText("&Container:");
+
+ containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ containerText.setLayoutData(gd);
+ containerText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+
+ Button button = new Button(container, SWT.PUSH);
+ button.setText("Browse...");
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+ label = new Label(container, SWT.NULL);
+ label.setText("&File name:");
+
+ fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ fileText.setLayoutData(gd);
+ fileText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+ initialize();
+ dialogChanged();
+ setControl(container);
+ }
+
+ /**
+ * Tests if the current workbench selection is a suitable container to use.
+ */
+
+ private void initialize() {
+ if (selection != null && selection.isEmpty() == false
+ && selection instanceof IStructuredSelection) {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ if (ssel.size() > 1)
+ return;
+ Object obj = ssel.getFirstElement();
+ if (obj instanceof IResource) {
+ IContainer container;
+ if (obj instanceof IContainer)
+ container = (IContainer) obj;
+ else
+ container = ((IResource) obj).getParent();
+ containerText.setText(container.getFullPath().toString());
+ }
+ }
+ fileText.setText("new_file.emf");
+ }
+
+ /**
+ * Uses the standard container selection dialog to choose the new value for
+ * the container field.
+ */
+
+ private void handleBrowse() {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(
+ getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
+ "Select new file container");
+ if (dialog.open() == ContainerSelectionDialog.OK) {
+ Object[] result = dialog.getResult();
+ if (result.length == 1) {
+ containerText.setText(((Path) result[0]).toString());
+ }
+ }
+ }
+
+ /**
+ * Ensures that both text fields are set.
+ */
+
+ private void dialogChanged() {
+ IResource container = ResourcesPlugin.getWorkspace().getRoot()
+ .findMember(new Path(getContainerName()));
+ String fileName = getFileName();
+
+ if (getContainerName().length() == 0) {
+ updateStatus("File container must be specified");
+ return;
+ }
+ if (container == null
+ || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
+ updateStatus("File container must exist");
+ return;
+ }
+ if (!container.isAccessible()) {
+ updateStatus("Project must be writable");
+ return;
+ }
+ if (fileName.length() == 0) {
+ updateStatus("File name must be specified");
+ return;
+ }
+ if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
+ updateStatus("File name must be valid");
+ return;
+ }
+ int dotLoc = fileName.lastIndexOf('.');
+ if (dotLoc != -1) {
+ String ext = fileName.substring(dotLoc + 1);
+ if (ext.equalsIgnoreCase("emf") == false) {
+ updateStatus("File extension must be \"emf\"");
+ return;
+ }
+ }
+ updateStatus(null);
+ }
+
+ private void updateStatus(String message) {
+ setErrorMessage(message);
+ setPageComplete(message == null);
+ }
+
+ public String getContainerName() {
+ return containerText.getText();
+ }
+
+ public String getFileName() {
+ return fileText.getText();
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/wizards/EmfaticNewWizard.java b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/wizards/EmfaticNewWizard.java
new file mode 100644
index 0000000..54ff69b
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/src/org/eclipse/emf/emfatic/ui/wizards/EmfaticNewWizard.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Garcia (Tech Univ Hamburg-Harburg) - customization for EMF Generics
+ *******************************************************************************/
+
+package org.eclipse.emf.emfatic.ui.wizards;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+
+/**
+ * This is a sample new wizard. Its role is to create a new file
+ * resource in the provided container. If the container resource
+ * (a folder or a project) is selected in the workspace
+ * when the wizard is opened, it will accept it as the target
+ * container. The wizard creates one file with the extension
+ * "emf". If a sample editor (also available
+ * as a template) is registered for the same extension, it will
+ * be able to open it.
+ */
+
+public class EmfaticNewWizard extends Wizard implements INewWizard {
+ private EmfaticNewFileCreationPage page;
+ private ISelection selection;
+
+ /**
+ * Constructor for EmfaticNewWizard.
+ */
+ public EmfaticNewWizard() {
+ super();
+ setNeedsProgressMonitor(true);
+ }
+
+ /**
+ * Adding the page to the wizard.
+ */
+
+ public void addPages() {
+ page = new EmfaticNewFileCreationPage(selection);
+ addPage(page);
+ }
+
+ /**
+ * This method is called when 'Finish' button is pressed in
+ * the wizard. We will create an operation and run it
+ * using wizard as execution context.
+ */
+ public boolean performFinish() {
+ final String containerName = page.getContainerName();
+ final String fileName = page.getFileName();
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ try {
+ doFinish(containerName, fileName, monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ try {
+ getContainer().run(true, false, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ Throwable realException = e.getTargetException();
+ MessageDialog.openError(getShell(), "Error", realException.getMessage());
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * The worker method. It will find the container, create the
+ * file if missing or just replace its contents, and open
+ * the editor on the newly created file.
+ */
+
+ private void doFinish(
+ String containerName,
+ String fileName,
+ IProgressMonitor monitor)
+ throws CoreException {
+ // create a sample file
+ monitor.beginTask("Creating " + fileName, 2);
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource resource = root.findMember(new Path(containerName));
+ if (!resource.exists() || !(resource instanceof IContainer)) {
+ throwCoreException("Container \"" + containerName + "\" does not exist.");
+ }
+ IContainer container = (IContainer) resource;
+ final IFile file = container.getFile(new Path(fileName));
+ try {
+ InputStream stream = openContentStream();
+ if (file.exists()) {
+ file.setContents(stream, true, true, monitor);
+ } else {
+ file.create(stream, true, monitor);
+ }
+ stream.close();
+ } catch (IOException e) {
+ }
+ monitor.worked(1);
+ monitor.setTaskName("Opening file for editing...");
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchPage page =
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ IDE.openEditor(page, file, true);
+ } catch (PartInitException e) {
+ }
+ }
+ });
+ monitor.worked(1);
+ }
+
+ /**
+ * We will initialize file contents with a sample text.
+ */
+
+ private InputStream openContentStream() {
+ String contents =
+ "@namespace(\r\n\turi=\"http://a.b.c/x/y/Z\",\r\n\tprefix=\"p\")\r\npackage top;\r\n\r\n";
+ return new ByteArrayInputStream(contents.getBytes());
+ }
+
+ private void throwCoreException(String message) throws CoreException {
+ IStatus status =
+ new Status(IStatus.ERROR, "org.eclipse.emf.emfatic.ui", IStatus.OK, message, null);
+ throw new CoreException(status);
+ }
+
+ /**
+ * We will accept the selection in the workbench to see if
+ * we can initialize from it.
+ * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/Thumbs.db b/plugins/org.eclipse.emf.emfatic.ui/typesView/Thumbs.db
new file mode 100644
index 0000000..73d6ade
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/Thumbs.db
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/alphab_sort_co.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/alphab_sort_co.gif
new file mode 100644
index 0000000..6311cc0
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/alphab_sort_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/class_abs.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/class_abs.gif
new file mode 100644
index 0000000..7edb75a
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/class_abs.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/class_abstract.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/class_abstract.gif
new file mode 100644
index 0000000..5c03ae2
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/class_abstract.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/class_obj.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/class_obj.gif
new file mode 100644
index 0000000..e4c2a83
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/class_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/definingtype_sort_co.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/definingtype_sort_co.gif
new file mode 100644
index 0000000..166eaba
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/definingtype_sort_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/inher_co.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/inher_co.gif
new file mode 100644
index 0000000..a326000
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/inher_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/int_abs.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/int_abs.gif
new file mode 100644
index 0000000..df4f73f
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/int_abs.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/int_obj.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/int_obj.gif
new file mode 100644
index 0000000..2ebc46e
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/int_obj.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/sub_co.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/sub_co.gif
new file mode 100644
index 0000000..54871df
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/sub_co.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.emfatic.ui/typesView/super_co.gif b/plugins/org.eclipse.emf.emfatic.ui/typesView/super_co.gif
new file mode 100644
index 0000000..59ac116
--- /dev/null
+++ b/plugins/org.eclipse.emf.emfatic.ui/typesView/super_co.gif
Binary files differ