diff --git a/plugins/.classpath b/plugins/.classpath new file mode 100644 index 000000000..eca7bdba8 --- /dev/null +++ b/plugins/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/plugins/de.cognicrypt.codegenerator.tests/.settings/org.eclipse.core.resources.prefs b/plugins/de.cognicrypt.codegenerator.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cognicrypt.codegenerator.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cognicrypt.order.editor/.antlr-generator-3.2.0-patch.jar b/plugins/de.cognicrypt.order.editor/.antlr-generator-3.2.0-patch.jar new file mode 100644 index 000000000..90516fd7a Binary files /dev/null and b/plugins/de.cognicrypt.order.editor/.antlr-generator-3.2.0-patch.jar differ diff --git a/plugins/de.cognicrypt.order.editor/.classpath b/plugins/de.cognicrypt.order.editor/.classpath new file mode 100644 index 000000000..80311bc44 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/.classpath @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/.launch/Generate Statemachine (statemachine) Language Infrastructure.launch b/plugins/de.cognicrypt.order.editor/.launch/Generate Statemachine (statemachine) Language Infrastructure.launch new file mode 100644 index 000000000..d12199f1a --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/.launch/Generate Statemachine (statemachine) Language Infrastructure.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/.launch/Launch Runtime Eclipse.launch b/plugins/de.cognicrypt.order.editor/.launch/Launch Runtime Eclipse.launch new file mode 100644 index 000000000..399ecb15a --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/.launch/Launch Runtime Eclipse.launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/.project b/plugins/de.cognicrypt.order.editor/.project new file mode 100644 index 000000000..cf7cb4159 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/.project @@ -0,0 +1,34 @@ + + + de.cognicrypt.order.editor + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.xtext.ui.shared.xtextNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/plugins/de.cognicrypt.order.editor/.settings/org.eclipse.core.resources.prefs b/plugins/de.cognicrypt.order.editor/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..68a030452 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=windows-1252 diff --git a/plugins/de.cognicrypt.order.editor/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cognicrypt.order.editor/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..9f6ece88b --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/plugins/de.cognicrypt.order.editor/META-INF/MANIFEST.MF b/plugins/de.cognicrypt.order.editor/META-INF/MANIFEST.MF new file mode 100644 index 000000000..e23f85715 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/META-INF/MANIFEST.MF @@ -0,0 +1,53 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Order Editor +Bundle-Activator: de.cognicrypt.order.editor.Activator +Bundle-Vendor: Technical University Darmstadt, Paderborn University +Bundle-Version: 1.0.0.qualifier +Bundle-SymbolicName: de.cognicrypt.order.editor; singleton:=true +Bundle-ActivationPolicy: lazy +Require-Bundle: org.eclipse.xtext, + org.eclipse.xtext.xbase, + org.eclipse.equinox.common;bundle-version="3.5.0", + org.eclipse.emf.ecore, + org.eclipse.xtext.common.types, + org.eclipse.xtext.xbase.lib;bundle-version="2.14.0", + org.objectweb.asm;bundle-version="[7.2.0,7.3.0)";resolution:=optional, + org.eclipse.xtext.util, + org.eclipse.emf.common, + org.antlr.runtime;bundle-version="[3.2.0,3.2.1)", + org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf.mwe2.launch;bundle-version="2.11.2", + org.eclipse.emf.mwe2.runtime;bundle-version="2.11.2", + org.eclipse.xtext.generator, + org.eclipse.xtext.common.types.ui, + org.apache.log4j, + org.apache.commons.logging, + de.cognicrypt.codegenerator;bundle-version="1.0.0", + de.cognicrypt.core, + org.eclipse.ui.workbench, + com.google.gson, + com.google.guava, + org.junit, + de.darmstadt.tu.crossing.CrySL +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ClassPath: lib/claferchocoig.jar, + lib/dom4j-2.0.0.jar, + . +Export-Package: de.cognicrypt.order.editor.services, + de.cognicrypt.order.editor.parser.antlr, + de.cognicrypt.order.editor, + de.cognicrypt.order.editor.statemachine, + de.cognicrypt.order.editor.statemachine.impl, + de.cognicrypt.order.editor.scoping, + de.cognicrypt.order.editor.serializer, + de.cognicrypt.order.editor.statemachine.util, + de.cognicrypt.order.editor.parser.antlr.internal, + de.cognicrypt.order.editor.validation, + de.cognicrypt.order.editor.generator, + . +Import-Package: org.apache.log4j, + org.eclipse.core.resources, + org.eclipse.jdt.core.dom +Automatic-Module-Name: de.cognicrypt.order.editor diff --git a/plugins/de.cognicrypt.order.editor/README.md b/plugins/de.cognicrypt.order.editor/README.md new file mode 100644 index 000000000..014b10905 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/README.md @@ -0,0 +1,31 @@ +# CrySL Visual Order Editor + +The Order Editor displays the usage pattern of the class as defined in the Order expression of its CrySL rule as a state machine. + +More detailed documentation on the use of this feature can be found in the document +"CogniCrypt\plugins\de.cognicrypt.order.editor\doc\CrySL Visual Order Editor – User Manual.pdf". + + +## Set up + +* Clone the project, open Eclipse. +* Clone the [**Crypto-API-Rules**](https://github.com/CROSSINGTUD/Crypto-API-Rules) repository to a folder named "git" in your home directory. + This is required since the class StaxWriter which writes the configuration file needs to access this different repository and therefore accesses the paths relative to home directory by e.g. "\\git\\Crypto-API-Rules\\JavaCryptographicArchitecture\\src". +* Install Sirius (http://www.eclipse.org/sirius) from the Eclipse Marketplace. + +## Create a diagram + +* Launch a new runtime from your Eclipse. Click on the black plugin icon "S" in the upper left corner, next to the other buttons for TaskIntegrator and CogniCrypt, + then click on the button "Generate Statemachine Models", which is currently a simple button but should later be replaced by a single crysl rule selection. The + button triggers the generation of the statemachine model resources into the output folder, i.e., "de.cognicrypt.order.editor\output". +* Within the runtime environment, select the Sirius perspective. This opens a model explorer in the left corner. +* Open the Sirius project contained in the plugin relative sirius + folder, i.e. "CogniCrypt\plugins\de.cognicrypt.order.editor\sirius". + The project folder "~\CogniCrypt\plugins\de.cognicrypt.order.editor\sirius\my.project.design" + is the Viewpoint Specification Project containing the .odesign file (definition of the modeling workbench), the other project folder + "~\CogniCrypt\plugins\de.cognicrypt.order.editor\sirius\my.project.order.diagram.modeling" is the Modeling project containing the graphical representations created with Sirius. +* To open a diagram, select the file representations.aird from the modeling project. + In the left corner of the new window, named "Models", click on Add > Browse File System + to select a statemachine model from the plugin-relative output folder. The model will + appear in the Models window. Now double click "orderDiagram" below "orderViewpoint" in the Representations window on the right. This opens a new window "Create a new representation" which allows to select a semantic element for a new representation. Here, you can select the model you just added, click on its "Statemachine" model identifier and click on Finish. You can optionally type a custom name for the diagram. The representation is opened now and you can play around with the Sirius model editor features to enhace the representation. +* For more information on Sirius, have a look at their [**tutorial**](https://wiki.eclipse.org/Sirius/Tutorials/StarterTutorial). \ No newline at end of file diff --git a/plugins/de.cognicrypt.order.editor/build.properties b/plugins/de.cognicrypt.order.editor/build.properties new file mode 100644 index 000000000..33156c43b --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/build.properties @@ -0,0 +1,7 @@ +source.. = src/,\ + src-gen/,\ + xtend-gen/ +bin.includes = model/generated/,\ + .,\ + META-INF/,\ + plugin.xml diff --git "a/plugins/de.cognicrypt.order.editor/doc/CrySL Visual Order Editor \342\200\223 User Manual.pdf" "b/plugins/de.cognicrypt.order.editor/doc/CrySL Visual Order Editor \342\200\223 User Manual.pdf" new file mode 100644 index 000000000..78d6c538c Binary files /dev/null and "b/plugins/de.cognicrypt.order.editor/doc/CrySL Visual Order Editor \342\200\223 User Manual.pdf" differ diff --git a/plugins/de.cognicrypt.order.editor/icons/icon_order_editor.png b/plugins/de.cognicrypt.order.editor/icons/icon_order_editor.png new file mode 100644 index 000000000..829b6bec0 Binary files /dev/null and b/plugins/de.cognicrypt.order.editor/icons/icon_order_editor.png differ diff --git a/plugins/de.cognicrypt.order.editor/model/generated/Statemachine.ecore b/plugins/de.cognicrypt.order.editor/model/generated/Statemachine.ecore new file mode 100644 index 000000000..19c1d1c6f --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/model/generated/Statemachine.ecore @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/model/generated/Statemachine.genmodel b/plugins/de.cognicrypt.order.editor/model/generated/Statemachine.genmodel new file mode 100644 index 000000000..e636d1cb5 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/model/generated/Statemachine.genmodel @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/plugin.xml b/plugins/de.cognicrypt.order.editor/plugin.xml new file mode 100644 index 000000000..c3df727a4 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/plugin.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/plugin.xml_gen b/plugins/de.cognicrypt.order.editor/plugin.xml_gen new file mode 100644 index 000000000..2a656bbbf --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/plugin.xml_gen @@ -0,0 +1,10 @@ + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/pom.xml b/plugins/de.cognicrypt.order.editor/pom.xml new file mode 100644 index 000000000..3f77001da --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/pom.xml @@ -0,0 +1,108 @@ + + + 4.0.0 + de.cognicrypt.order.editor + eclipse-plugin + + de.cognicrypt + de.cognicrypt.parent + 1.0.0-SNAPSHOT + ../../pom.xml + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.eclipse.tycho + + tycho-packaging-plugin + + + [0.26.0,) + + + build-qualifier + validate-id + validate-version + + + + + + + + + org.eclipse.tycho + + tycho-compiler-plugin + + + [0.26.0,) + + + compile + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + [0.26.0,) + + + test-compile + + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + [0.26.0,) + + + test + + + + + + + + + + + + + + de.cognicrypt + diff --git a/plugins/de.cognicrypt.order.editor/sirius/.project b/plugins/de.cognicrypt.order.editor/sirius/.project new file mode 100644 index 000000000..3d2c5b909 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/.project @@ -0,0 +1,11 @@ + + + de.cognicrypt.order.editor.sirius + + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/.classpath b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/.classpath new file mode 100644 index 000000000..39810b7d6 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/.project b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/.project new file mode 100644 index 000000000..c25c11398 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/.project @@ -0,0 +1,24 @@ + + + order.statemachine.design + + + + + org.eclipse.jdt.core.javabuilder + + + + org.eclipse.pde.ManifestBuilder + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/META-INF/MANIFEST.MF b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/META-INF/MANIFEST.MF new file mode 100644 index 000000000..84619df66 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: order.statemachine.design;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: order.statemachine.design.Activator +Bundle-Localization: plugin +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.sirius, + org.eclipse.sirius.common.acceleo.aql, + de.cognicrypt.order.editor;bundle-version="1.0.0" +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-Vendor: %providerName +Automatic-Module-Name: order.statemachine.design diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/build.properties b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/build.properties new file mode 100644 index 000000000..1ab7df2cb --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + description/,\ + plugin.properties,\ + plugin.xml diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/description/statemachine.odesign b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/description/statemachine.odesign new file mode 100644 index 000000000..e40649353 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/description/statemachine.odesign @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/plugin.properties b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/plugin.properties new file mode 100644 index 000000000..8d2f3aceb --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/plugin.properties @@ -0,0 +1,3 @@ +pluginName = order.statemachine.design +providerName = Eclipse Modeling Project +viewpointName = MyViewpoint diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/plugin.xml b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/plugin.xml new file mode 100644 index 000000000..8ec8ec9ab --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/plugin.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/src/order/statemachine/design/Activator.java b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/src/order/statemachine/design/Activator.java new file mode 100644 index 000000000..2a90f9e98 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/src/order/statemachine/design/Activator.java @@ -0,0 +1,66 @@ +package order.statemachine.design; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.sirius.business.api.componentization.ViewpointRegistry; +import org.eclipse.sirius.viewpoint.description.Viewpoint; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + // The plug-in ID + public static final String PLUGIN_ID = "order.statemachine.design"; + + // The shared instance + private static Activator plugin; + + private static Set viewpoints; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + viewpoints = new HashSet(); + viewpoints.addAll(ViewpointRegistry.getInstance().registerFromPlugin(PLUGIN_ID + "/description/statemachine.odesign")); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + if (viewpoints != null) { + for (final Viewpoint viewpoint: viewpoints) { + ViewpointRegistry.getInstance().disposeFromPlugin(viewpoint); + } + viewpoints.clear(); + viewpoints = null; + } + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/src/order/statemachine/design/Services.java b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/src/order/statemachine/design/Services.java new file mode 100644 index 000000000..5b6fe93a6 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.design/src/order/statemachine/design/Services.java @@ -0,0 +1,31 @@ +package order.statemachine.design; + +import org.eclipse.emf.ecore.EObject; +import de.cognicrypt.order.editor.statemachine.State; + +/** + * The services class used by VSM. + */ +public class Services { + + /** + * See http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.sirius.doc%2Fdoc%2Findex.html&cp=24 for documentation on how to write service methods. + */ + public EObject myService(EObject self, String arg) { + // TODO Auto-generated code + return self; + } + + public int changeBorderFinalNode(EObject self) { + + if(self instanceof State) { + State s = (State) self; + boolean finalNode = s.isIsFinal(); + if(finalNode) { + return 5; + } + } + + return 1; + } +} diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.modeling/.project b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.modeling/.project new file mode 100644 index 000000000..fbf9279fc --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.modeling/.project @@ -0,0 +1,12 @@ + + + order.statemachine.modeling + + + + + + + org.eclipse.sirius.nature.modelingproject + + diff --git a/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.modeling/representations.aird b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.modeling/representations.aird new file mode 100644 index 000000000..0057d96e0 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/sirius/order.statemachine.modeling/representations.aird @@ -0,0 +1,8 @@ + + + file:/C:/Users/T440s/git/CogniCrypt/plugins/de.cognicrypt.order.editor/model/generated/Statemachine.ecore + file:/C:/Users/T440s/git/CogniCrypt/plugins/de.cognicrypt.order.editor/output/AlgorithmParameters.statemachine + + + + diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/AbstractStatemachineRuntimeModule.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/AbstractStatemachineRuntimeModule.java new file mode 100644 index 000000000..afb215573 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/AbstractStatemachineRuntimeModule.java @@ -0,0 +1,201 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor; + +import com.google.inject.Binder; +import com.google.inject.Provider; +import com.google.inject.name.Names; +import de.cognicrypt.order.editor.generator.StatemachineGenerator; +import de.cognicrypt.order.editor.parser.antlr.StatemachineAntlrTokenFileProvider; +import de.cognicrypt.order.editor.parser.antlr.StatemachineParser; +import de.cognicrypt.order.editor.parser.antlr.internal.InternalStatemachineLexer; +import de.cognicrypt.order.editor.scoping.StatemachineScopeProvider; +import de.cognicrypt.order.editor.serializer.StatemachineSemanticSequencer; +import de.cognicrypt.order.editor.serializer.StatemachineSyntacticSequencer; +import de.cognicrypt.order.editor.services.StatemachineGrammarAccess; +import de.cognicrypt.order.editor.validation.StatemachineConfigurableIssueCodesProvider; +import de.cognicrypt.order.editor.validation.StatemachineValidator; +import java.util.Properties; +import org.eclipse.xtext.Constants; +import org.eclipse.xtext.IGrammarAccess; +import org.eclipse.xtext.common.types.DefaultCommonTypesRuntimeModule; +import org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider; +import org.eclipse.xtext.generator.IGenerator2; +import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider; +import org.eclipse.xtext.naming.IQualifiedNameProvider; +import org.eclipse.xtext.parser.IParser; +import org.eclipse.xtext.parser.ITokenToStringConverter; +import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider; +import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter; +import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; +import org.eclipse.xtext.parser.antlr.ITokenDefProvider; +import org.eclipse.xtext.parser.antlr.Lexer; +import org.eclipse.xtext.parser.antlr.LexerBindings; +import org.eclipse.xtext.parser.antlr.LexerProvider; +import org.eclipse.xtext.resource.IContainer; +import org.eclipse.xtext.resource.IResourceDescriptions; +import org.eclipse.xtext.resource.containers.IAllContainersState; +import org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider; +import org.eclipse.xtext.resource.containers.StateBasedContainerManager; +import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider; +import org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions; +import org.eclipse.xtext.scoping.IGlobalScopeProvider; +import org.eclipse.xtext.scoping.IScopeProvider; +import org.eclipse.xtext.scoping.IgnoreCaseLinking; +import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider; +import org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider; +import org.eclipse.xtext.serializer.ISerializer; +import org.eclipse.xtext.serializer.impl.Serializer; +import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer; +import org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer; +import org.eclipse.xtext.service.SingletonBinding; +import org.eclipse.xtext.validation.ConfigurableIssueCodesProvider; + +/** + * Manual modifications go to {@link StatemachineRuntimeModule}. + */ +@SuppressWarnings("all") +public abstract class AbstractStatemachineRuntimeModule extends DefaultCommonTypesRuntimeModule { + + protected Properties properties = null; + + @Override + public void configure(Binder binder) { + properties = tryBindProperties(binder, "de/cognicrypt/order/editor/Statemachine.properties"); + super.configure(binder); + } + + public void configureLanguageName(Binder binder) { + binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("de.cognicrypt.order.editor.Statemachine"); + } + + public void configureFileExtensions(Binder binder) { + if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null) + binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("statemachine"); + } + + // contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2 + public ClassLoader bindClassLoaderToInstance() { + return getClass().getClassLoader(); + } + + // contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2 + public Class bindIGrammarAccess() { + return StatemachineGrammarAccess.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 + public Class bindISemanticSequencer() { + return StatemachineSemanticSequencer.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 + public Class bindISyntacticSequencer() { + return StatemachineSyntacticSequencer.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2 + public Class bindISerializer() { + return Serializer.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindIParser() { + return StatemachineParser.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindITokenToStringConverter() { + return AntlrTokenToStringConverter.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindIAntlrTokenFileProvider() { + return StatemachineAntlrTokenFileProvider.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindLexer() { + return InternalStatemachineLexer.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Class bindITokenDefProvider() { + return AntlrTokenDefProvider.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public Provider provideInternalStatemachineLexer() { + return LexerProvider.create(InternalStatemachineLexer.class); + } + + // contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2 + public void configureRuntimeLexer(Binder binder) { + binder.bind(Lexer.class) + .annotatedWith(Names.named(LexerBindings.RUNTIME)) + .to(InternalStatemachineLexer.class); + } + + // contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2 + @SingletonBinding(eager=true) + public Class bindStatemachineValidator() { + return StatemachineValidator.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2 + public Class bindConfigurableIssueCodesProvider() { + return StatemachineConfigurableIssueCodesProvider.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2 + public Class bindIScopeProvider() { + return StatemachineScopeProvider.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2 + public void configureIScopeProviderDelegate(Binder binder) { + binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(ImportedNamespaceAwareLocalScopeProvider.class); + } + + // contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2 + public void configureIgnoreCaseLinking(Binder binder) { + binder.bindConstant().annotatedWith(IgnoreCaseLinking.class).to(false); + } + + // contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2 + public Class bindIQualifiedNameProvider() { + return DefaultDeclarativeQualifiedNameProvider.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public Class bindIContainer$Manager() { + return StateBasedContainerManager.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public Class bindIAllContainersState$Provider() { + return ResourceSetBasedAllContainersStateProvider.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public void configureIResourceDescriptions(Binder binder) { + binder.bind(IResourceDescriptions.class).to(ResourceSetBasedResourceDescriptions.class); + } + + // contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2 + public void configureIResourceDescriptionsPersisted(Binder binder) { + binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(ResourceSetBasedResourceDescriptions.class); + } + + // contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2 + public Class bindIGenerator2() { + return StatemachineGenerator.class; + } + + // contributed by org.eclipse.xtext.xtext.generator.types.TypesGeneratorFragment2 + public Class bindIGlobalScopeProvider() { + return TypesAwareDefaultGlobalScopeProvider.class; + } + +} diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/Statemachine.xtextbin b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/Statemachine.xtextbin new file mode 100644 index 000000000..542cff278 Binary files /dev/null and b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/Statemachine.xtextbin differ diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/StatemachineStandaloneSetupGenerated.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/StatemachineStandaloneSetupGenerated.java new file mode 100644 index 000000000..1fa1a38d2 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/StatemachineStandaloneSetupGenerated.java @@ -0,0 +1,42 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor; + +import com.google.inject.Guice; +import com.google.inject.Injector; +import de.cognicrypt.order.editor.statemachine.StatemachinePackage; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.xtext.ISetup; +import org.eclipse.xtext.resource.IResourceFactory; +import org.eclipse.xtext.resource.IResourceServiceProvider; +import org.eclipse.xtext.xbase.XtypeStandaloneSetup; + +@SuppressWarnings("all") +public class StatemachineStandaloneSetupGenerated implements ISetup { + + @Override + public Injector createInjectorAndDoEMFRegistration() { + XtypeStandaloneSetup.doSetup(); + + Injector injector = createInjector(); + register(injector); + return injector; + } + + public Injector createInjector() { + return Guice.createInjector(new StatemachineRuntimeModule()); + } + + public void register(Injector injector) { + if (!EPackage.Registry.INSTANCE.containsKey("http://www.cognicrypt.de/order/editor/Statemachine")) { + EPackage.Registry.INSTANCE.put("http://www.cognicrypt.de/order/editor/Statemachine", StatemachinePackage.eINSTANCE); + } + IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); + IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); + + Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("statemachine", resourceFactory); + IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("statemachine", serviceProvider); + } +} diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/StatemachineAntlrTokenFileProvider.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/StatemachineAntlrTokenFileProvider.java new file mode 100644 index 000000000..b49983efc --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/StatemachineAntlrTokenFileProvider.java @@ -0,0 +1,16 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.parser.antlr; + +import java.io.InputStream; +import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; + +public class StatemachineAntlrTokenFileProvider implements IAntlrTokenFileProvider { + + @Override + public InputStream getAntlrTokenFile() { + ClassLoader classLoader = getClass().getClassLoader(); + return classLoader.getResourceAsStream("de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachine.tokens"); + } +} diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/StatemachineParser.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/StatemachineParser.java new file mode 100644 index 000000000..e010f9972 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/StatemachineParser.java @@ -0,0 +1,40 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.parser.antlr; + +import com.google.inject.Inject; +import de.cognicrypt.order.editor.parser.antlr.internal.InternalStatemachineParser; +import de.cognicrypt.order.editor.services.StatemachineGrammarAccess; +import org.eclipse.xtext.parser.antlr.AbstractAntlrParser; +import org.eclipse.xtext.parser.antlr.XtextTokenStream; + +public class StatemachineParser extends AbstractAntlrParser { + + @Inject + private StatemachineGrammarAccess grammarAccess; + + @Override + protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { + tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); + } + + + @Override + protected InternalStatemachineParser createParser(XtextTokenStream stream) { + return new InternalStatemachineParser(stream, getGrammarAccess()); + } + + @Override + protected String getDefaultRuleName() { + return "Statemachine"; + } + + public StatemachineGrammarAccess getGrammarAccess() { + return this.grammarAccess; + } + + public void setGrammarAccess(StatemachineGrammarAccess grammarAccess) { + this.grammarAccess = grammarAccess; + } +} diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachine.g b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachine.g new file mode 100644 index 000000000..63982272e --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachine.g @@ -0,0 +1,1342 @@ +/* + * generated by Xtext 2.25.0 + */ +grammar InternalStatemachine; + +options { + superClass=AbstractInternalAntlrParser; +} + +@lexer::header { +package de.cognicrypt.order.editor.parser.antlr.internal; + +// Hack: Use our own Lexer superclass by means of import. +// Currently there is no other way to specify the superclass for the lexer. +import org.eclipse.xtext.parser.antlr.Lexer; +} + +@parser::header { +package de.cognicrypt.order.editor.parser.antlr.internal; + +import org.eclipse.xtext.*; +import org.eclipse.xtext.parser.*; +import org.eclipse.xtext.parser.impl.*; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser; +import org.eclipse.xtext.parser.antlr.XtextTokenStream; +import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; +import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken; +import de.cognicrypt.order.editor.services.StatemachineGrammarAccess; + +} + +@parser::members { + + private StatemachineGrammarAccess grammarAccess; + + public InternalStatemachineParser(TokenStream input, StatemachineGrammarAccess grammarAccess) { + this(input); + this.grammarAccess = grammarAccess; + registerRules(grammarAccess.getGrammar()); + } + + @Override + protected String getFirstRuleName() { + return "Statemachine"; + } + + @Override + protected StatemachineGrammarAccess getGrammarAccess() { + return grammarAccess; + } + +} + +@rulecatch { + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } +} + +// Entry rule entryRuleStatemachine +entryRuleStatemachine returns [EObject current=null]: + { newCompositeNode(grammarAccess.getStatemachineRule()); } + iv_ruleStatemachine=ruleStatemachine + { $current=$iv_ruleStatemachine.current; } + EOF; + +// Rule Statemachine +ruleStatemachine returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + { + $current = forceCreateModelElement( + grammarAccess.getStatemachineAccess().getStatemachineAction_0(), + $current); + } + ) + ( + ( + { + newCompositeNode(grammarAccess.getStatemachineAccess().getStatesStateParserRuleCall_1_0()); + } + lv_states_1_0=ruleState + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getStatemachineRule()); + } + add( + $current, + "states", + lv_states_1_0, + "de.cognicrypt.order.editor.Statemachine.State"); + afterParserOrEnumRuleCall(); + } + ) + )* + ( + ( + { + newCompositeNode(grammarAccess.getStatemachineAccess().getTransitionsTransitionParserRuleCall_2_0()); + } + lv_transitions_2_0=ruleTransition + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getStatemachineRule()); + } + add( + $current, + "transitions", + lv_transitions_2_0, + "de.cognicrypt.order.editor.Statemachine.Transition"); + afterParserOrEnumRuleCall(); + } + ) + )* + ) +; + +// Entry rule entryRuleState +entryRuleState returns [EObject current=null]: + { newCompositeNode(grammarAccess.getStateRule()); } + iv_ruleState=ruleState + { $current=$iv_ruleState.current; } + EOF; + +// Rule State +ruleState returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='state' + { + newLeafNode(otherlv_0, grammarAccess.getStateAccess().getStateKeyword_0()); + } + ( + ( + lv_name_1_0=RULE_ID + { + newLeafNode(lv_name_1_0, grammarAccess.getStateAccess().getNameIDTerminalRuleCall_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getStateRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_1_0, + "org.eclipse.xtext.xbase.Xtype.ID"); + } + ) + ) + ( + ( + ( + lv_isFinal_2_0='true' + { + newLeafNode(lv_isFinal_2_0, grammarAccess.getStateAccess().getIsFinalTrueKeyword_2_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getStateRule()); + } + setWithLastConsumed($current, "isFinal", lv_isFinal_2_0 != null, "true"); + } + ) + ) + | + otherlv_3='false' + { + newLeafNode(otherlv_3, grammarAccess.getStateAccess().getFalseKeyword_2_1()); + } + ) + ( + ( + { + newCompositeNode(grammarAccess.getStateAccess().getTransitionsTransitionParserRuleCall_3_0()); + } + lv_transitions_4_0=ruleTransition + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getStateRule()); + } + add( + $current, + "transitions", + lv_transitions_4_0, + "de.cognicrypt.order.editor.Statemachine.Transition"); + afterParserOrEnumRuleCall(); + } + ) + )* + otherlv_5='end' + { + newLeafNode(otherlv_5, grammarAccess.getStateAccess().getEndKeyword_4()); + } + ) +; + +// Entry rule entryRuleTransition +entryRuleTransition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getTransitionRule()); } + iv_ruleTransition=ruleTransition + { $current=$iv_ruleTransition.current; } + EOF; + +// Rule Transition +ruleTransition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='transition' + { + newLeafNode(otherlv_0, grammarAccess.getTransitionAccess().getTransitionKeyword_0()); + } + ( + ( + lv_name_1_0=RULE_ID + { + newLeafNode(lv_name_1_0, grammarAccess.getTransitionAccess().getNameIDTerminalRuleCall_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getTransitionRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_1_0, + "org.eclipse.xtext.xbase.Xtype.ID"); + } + ) + ) + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getTransitionRule()); + } + } + otherlv_2=RULE_ID + { + newLeafNode(otherlv_2, grammarAccess.getTransitionAccess().getFromStateStateCrossReference_2_0()); + } + ) + ) + otherlv_3=',' + { + newLeafNode(otherlv_3, grammarAccess.getTransitionAccess().getCommaKeyword_3()); + } + ( + ( + { + newCompositeNode(grammarAccess.getTransitionAccess().getEventEventParserRuleCall_4_0()); + } + lv_event_4_0=ruleEvent + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getTransitionRule()); + } + set( + $current, + "event", + lv_event_4_0, + "de.cognicrypt.order.editor.Statemachine.Event"); + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_5=',' + { + newLeafNode(otherlv_5, grammarAccess.getTransitionAccess().getCommaKeyword_5()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getTransitionRule()); + } + } + otherlv_6=RULE_ID + { + newLeafNode(otherlv_6, grammarAccess.getTransitionAccess().getEndStateStateCrossReference_6_0()); + } + ) + ) + otherlv_7='end' + { + newLeafNode(otherlv_7, grammarAccess.getTransitionAccess().getEndKeyword_7()); + } + ) +; + +// Entry rule entryRuleEvent +entryRuleEvent returns [EObject current=null]: + { newCompositeNode(grammarAccess.getEventRule()); } + iv_ruleEvent=ruleEvent + { $current=$iv_ruleEvent.current; } + EOF; + +// Rule Event +ruleEvent returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + lv_name_0_0=RULE_ID + { + newLeafNode(lv_name_0_0, grammarAccess.getEventAccess().getNameIDTerminalRuleCall_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getEventRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_0_0, + "org.eclipse.xtext.xbase.Xtype.ID"); + } + ) + ) +; + +// Entry rule entryRuleJvmTypeReference +entryRuleJvmTypeReference returns [EObject current=null]: + { newCompositeNode(grammarAccess.getJvmTypeReferenceRule()); } + iv_ruleJvmTypeReference=ruleJvmTypeReference + { $current=$iv_ruleJvmTypeReference.current; } + EOF; + +// Rule JvmTypeReference +ruleJvmTypeReference returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + { + newCompositeNode(grammarAccess.getJvmTypeReferenceAccess().getJvmParameterizedTypeReferenceParserRuleCall_0_0()); + } + this_JvmParameterizedTypeReference_0=ruleJvmParameterizedTypeReference + { + $current = $this_JvmParameterizedTypeReference_0.current; + afterParserOrEnumRuleCall(); + } + ( + (( + ( + ) + ruleArrayBrackets + ) + )=> + ( + ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getJvmTypeReferenceAccess().getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0(), + $current); + } + ) + { + newCompositeNode(grammarAccess.getJvmTypeReferenceAccess().getArrayBracketsParserRuleCall_0_1_0_1()); + } + ruleArrayBrackets + { + afterParserOrEnumRuleCall(); + } + ) + )* + ) + | + { + newCompositeNode(grammarAccess.getJvmTypeReferenceAccess().getXFunctionTypeRefParserRuleCall_1()); + } + this_XFunctionTypeRef_3=ruleXFunctionTypeRef + { + $current = $this_XFunctionTypeRef_3.current; + afterParserOrEnumRuleCall(); + } + ) +; + +// Entry rule entryRuleArrayBrackets +entryRuleArrayBrackets returns [String current=null]: + { newCompositeNode(grammarAccess.getArrayBracketsRule()); } + iv_ruleArrayBrackets=ruleArrayBrackets + { $current=$iv_ruleArrayBrackets.current.getText(); } + EOF; + +// Rule ArrayBrackets +ruleArrayBrackets returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + kw='[' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getArrayBracketsAccess().getLeftSquareBracketKeyword_0()); + } + kw=']' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getArrayBracketsAccess().getRightSquareBracketKeyword_1()); + } + ) +; + +// Entry rule entryRuleXFunctionTypeRef +entryRuleXFunctionTypeRef returns [EObject current=null]: + { newCompositeNode(grammarAccess.getXFunctionTypeRefRule()); } + iv_ruleXFunctionTypeRef=ruleXFunctionTypeRef + { $current=$iv_ruleXFunctionTypeRef.current; } + EOF; + +// Rule XFunctionTypeRef +ruleXFunctionTypeRef returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + otherlv_0='(' + { + newLeafNode(otherlv_0, grammarAccess.getXFunctionTypeRefAccess().getLeftParenthesisKeyword_0_0()); + } + ( + ( + ( + { + newCompositeNode(grammarAccess.getXFunctionTypeRefAccess().getParamTypesJvmTypeReferenceParserRuleCall_0_1_0_0()); + } + lv_paramTypes_1_0=ruleJvmTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getXFunctionTypeRefRule()); + } + add( + $current, + "paramTypes", + lv_paramTypes_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + otherlv_2=',' + { + newLeafNode(otherlv_2, grammarAccess.getXFunctionTypeRefAccess().getCommaKeyword_0_1_1_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getXFunctionTypeRefAccess().getParamTypesJvmTypeReferenceParserRuleCall_0_1_1_1_0()); + } + lv_paramTypes_3_0=ruleJvmTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getXFunctionTypeRefRule()); + } + add( + $current, + "paramTypes", + lv_paramTypes_3_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + )* + )? + otherlv_4=')' + { + newLeafNode(otherlv_4, grammarAccess.getXFunctionTypeRefAccess().getRightParenthesisKeyword_0_2()); + } + )? + otherlv_5='=>' + { + newLeafNode(otherlv_5, grammarAccess.getXFunctionTypeRefAccess().getEqualsSignGreaterThanSignKeyword_1()); + } + ( + ( + { + newCompositeNode(grammarAccess.getXFunctionTypeRefAccess().getReturnTypeJvmTypeReferenceParserRuleCall_2_0()); + } + lv_returnType_6_0=ruleJvmTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getXFunctionTypeRefRule()); + } + set( + $current, + "returnType", + lv_returnType_6_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) +; + +// Entry rule entryRuleJvmParameterizedTypeReference +entryRuleJvmParameterizedTypeReference returns [EObject current=null]: + { newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceRule()); } + iv_ruleJvmParameterizedTypeReference=ruleJvmParameterizedTypeReference + { $current=$iv_ruleJvmParameterizedTypeReference.current; } + EOF; + +// Rule JvmParameterizedTypeReference +ruleJvmParameterizedTypeReference returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + } + { + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getTypeJvmTypeCrossReference_0_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + ('<')=> + otherlv_1='<' + { + newLeafNode(otherlv_1, grammarAccess.getJvmParameterizedTypeReferenceAccess().getLessThanSignKeyword_1_0()); + } + ) + ( + ( + { + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_1_0()); + } + lv_arguments_2_0=ruleJvmArgumentTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + add( + $current, + "arguments", + lv_arguments_2_0, + "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + otherlv_3=',' + { + newLeafNode(otherlv_3, grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_2_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_2_1_0()); + } + lv_arguments_4_0=ruleJvmArgumentTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + add( + $current, + "arguments", + lv_arguments_4_0, + "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + )* + otherlv_5='>' + { + newLeafNode(otherlv_5, grammarAccess.getJvmParameterizedTypeReferenceAccess().getGreaterThanSignKeyword_1_3()); + } + ( + ( + (( + ( + ) + '.' + ) + )=> + ( + ( + { + $current = forceCreateModelElementAndSet( + grammarAccess.getJvmParameterizedTypeReferenceAccess().getJvmInnerTypeReferenceOuterAction_1_4_0_0_0(), + $current); + } + ) + otherlv_7='.' + { + newLeafNode(otherlv_7, grammarAccess.getJvmParameterizedTypeReferenceAccess().getFullStopKeyword_1_4_0_0_1()); + } + ) + ) + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + } + { + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getTypeJvmTypeCrossReference_1_4_1_0()); + } + ruleValidID + { + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + ('<')=> + otherlv_9='<' + { + newLeafNode(otherlv_9, grammarAccess.getJvmParameterizedTypeReferenceAccess().getLessThanSignKeyword_1_4_2_0()); + } + ) + ( + ( + { + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_1_0()); + } + lv_arguments_10_0=ruleJvmArgumentTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + add( + $current, + "arguments", + lv_arguments_10_0, + "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + otherlv_11=',' + { + newLeafNode(otherlv_11, grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_4_2_2_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_2_1_0()); + } + lv_arguments_12_0=ruleJvmArgumentTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + add( + $current, + "arguments", + lv_arguments_12_0, + "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + )* + otherlv_13='>' + { + newLeafNode(otherlv_13, grammarAccess.getJvmParameterizedTypeReferenceAccess().getGreaterThanSignKeyword_1_4_2_3()); + } + )? + )* + )? + ) +; + +// Entry rule entryRuleJvmArgumentTypeReference +entryRuleJvmArgumentTypeReference returns [EObject current=null]: + { newCompositeNode(grammarAccess.getJvmArgumentTypeReferenceRule()); } + iv_ruleJvmArgumentTypeReference=ruleJvmArgumentTypeReference + { $current=$iv_ruleJvmArgumentTypeReference.current; } + EOF; + +// Rule JvmArgumentTypeReference +ruleJvmArgumentTypeReference returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + { + newCompositeNode(grammarAccess.getJvmArgumentTypeReferenceAccess().getJvmTypeReferenceParserRuleCall_0()); + } + this_JvmTypeReference_0=ruleJvmTypeReference + { + $current = $this_JvmTypeReference_0.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getJvmArgumentTypeReferenceAccess().getJvmWildcardTypeReferenceParserRuleCall_1()); + } + this_JvmWildcardTypeReference_1=ruleJvmWildcardTypeReference + { + $current = $this_JvmWildcardTypeReference_1.current; + afterParserOrEnumRuleCall(); + } + ) +; + +// Entry rule entryRuleJvmWildcardTypeReference +entryRuleJvmWildcardTypeReference returns [EObject current=null]: + { newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceRule()); } + iv_ruleJvmWildcardTypeReference=ruleJvmWildcardTypeReference + { $current=$iv_ruleJvmWildcardTypeReference.current; } + EOF; + +// Rule JvmWildcardTypeReference +ruleJvmWildcardTypeReference returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + { + $current = forceCreateModelElement( + grammarAccess.getJvmWildcardTypeReferenceAccess().getJvmWildcardTypeReferenceAction_0(), + $current); + } + ) + otherlv_1='?' + { + newLeafNode(otherlv_1, grammarAccess.getJvmWildcardTypeReferenceAccess().getQuestionMarkKeyword_1()); + } + ( + ( + ( + ( + { + newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0_0()); + } + lv_constraints_2_0=ruleJvmUpperBound + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmWildcardTypeReferenceRule()); + } + add( + $current, + "constraints", + lv_constraints_2_0, + "org.eclipse.xtext.xbase.Xtype.JvmUpperBound"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundAndedParserRuleCall_2_0_1_0()); + } + lv_constraints_3_0=ruleJvmUpperBoundAnded + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmWildcardTypeReferenceRule()); + } + add( + $current, + "constraints", + lv_constraints_3_0, + "org.eclipse.xtext.xbase.Xtype.JvmUpperBoundAnded"); + afterParserOrEnumRuleCall(); + } + ) + )* + ) + | + ( + ( + ( + { + newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmLowerBoundParserRuleCall_2_1_0_0()); + } + lv_constraints_4_0=ruleJvmLowerBound + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmWildcardTypeReferenceRule()); + } + add( + $current, + "constraints", + lv_constraints_4_0, + "org.eclipse.xtext.xbase.Xtype.JvmLowerBound"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + { + newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmLowerBoundAndedParserRuleCall_2_1_1_0()); + } + lv_constraints_5_0=ruleJvmLowerBoundAnded + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmWildcardTypeReferenceRule()); + } + add( + $current, + "constraints", + lv_constraints_5_0, + "org.eclipse.xtext.xbase.Xtype.JvmLowerBoundAnded"); + afterParserOrEnumRuleCall(); + } + ) + )* + ) + )? + ) +; + +// Entry rule entryRuleJvmUpperBound +entryRuleJvmUpperBound returns [EObject current=null]: + { newCompositeNode(grammarAccess.getJvmUpperBoundRule()); } + iv_ruleJvmUpperBound=ruleJvmUpperBound + { $current=$iv_ruleJvmUpperBound.current; } + EOF; + +// Rule JvmUpperBound +ruleJvmUpperBound returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='extends' + { + newLeafNode(otherlv_0, grammarAccess.getJvmUpperBoundAccess().getExtendsKeyword_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0()); + } + lv_typeReference_1_0=ruleJvmTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmUpperBoundRule()); + } + set( + $current, + "typeReference", + lv_typeReference_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) +; + +// Entry rule entryRuleJvmUpperBoundAnded +entryRuleJvmUpperBoundAnded returns [EObject current=null]: + { newCompositeNode(grammarAccess.getJvmUpperBoundAndedRule()); } + iv_ruleJvmUpperBoundAnded=ruleJvmUpperBoundAnded + { $current=$iv_ruleJvmUpperBoundAnded.current; } + EOF; + +// Rule JvmUpperBoundAnded +ruleJvmUpperBoundAnded returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='&' + { + newLeafNode(otherlv_0, grammarAccess.getJvmUpperBoundAndedAccess().getAmpersandKeyword_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getJvmUpperBoundAndedAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0()); + } + lv_typeReference_1_0=ruleJvmTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmUpperBoundAndedRule()); + } + set( + $current, + "typeReference", + lv_typeReference_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) +; + +// Entry rule entryRuleJvmLowerBound +entryRuleJvmLowerBound returns [EObject current=null]: + { newCompositeNode(grammarAccess.getJvmLowerBoundRule()); } + iv_ruleJvmLowerBound=ruleJvmLowerBound + { $current=$iv_ruleJvmLowerBound.current; } + EOF; + +// Rule JvmLowerBound +ruleJvmLowerBound returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='super' + { + newLeafNode(otherlv_0, grammarAccess.getJvmLowerBoundAccess().getSuperKeyword_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getJvmLowerBoundAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0()); + } + lv_typeReference_1_0=ruleJvmTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmLowerBoundRule()); + } + set( + $current, + "typeReference", + lv_typeReference_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) +; + +// Entry rule entryRuleJvmLowerBoundAnded +entryRuleJvmLowerBoundAnded returns [EObject current=null]: + { newCompositeNode(grammarAccess.getJvmLowerBoundAndedRule()); } + iv_ruleJvmLowerBoundAnded=ruleJvmLowerBoundAnded + { $current=$iv_ruleJvmLowerBoundAnded.current; } + EOF; + +// Rule JvmLowerBoundAnded +ruleJvmLowerBoundAnded returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='&' + { + newLeafNode(otherlv_0, grammarAccess.getJvmLowerBoundAndedAccess().getAmpersandKeyword_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getJvmLowerBoundAndedAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0()); + } + lv_typeReference_1_0=ruleJvmTypeReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getJvmLowerBoundAndedRule()); + } + set( + $current, + "typeReference", + lv_typeReference_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) +; + +// Entry rule entryRuleQualifiedName +entryRuleQualifiedName returns [String current=null]: + { newCompositeNode(grammarAccess.getQualifiedNameRule()); } + iv_ruleQualifiedName=ruleQualifiedName + { $current=$iv_ruleQualifiedName.current.getText(); } + EOF; + +// Rule QualifiedName +ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + { + newCompositeNode(grammarAccess.getQualifiedNameAccess().getValidIDParserRuleCall_0()); + } + this_ValidID_0=ruleValidID + { + $current.merge(this_ValidID_0); + } + { + afterParserOrEnumRuleCall(); + } + ( + kw='.' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getFullStopKeyword_1_0()); + } + { + newCompositeNode(grammarAccess.getQualifiedNameAccess().getValidIDParserRuleCall_1_1()); + } + this_ValidID_2=ruleValidID + { + $current.merge(this_ValidID_2); + } + { + afterParserOrEnumRuleCall(); + } + )* + ) +; + +// Entry rule entryRuleQualifiedNameWithWildcard +entryRuleQualifiedNameWithWildcard returns [String current=null]: + { newCompositeNode(grammarAccess.getQualifiedNameWithWildcardRule()); } + iv_ruleQualifiedNameWithWildcard=ruleQualifiedNameWithWildcard + { $current=$iv_ruleQualifiedNameWithWildcard.current.getText(); } + EOF; + +// Rule QualifiedNameWithWildcard +ruleQualifiedNameWithWildcard returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + { + newCompositeNode(grammarAccess.getQualifiedNameWithWildcardAccess().getQualifiedNameParserRuleCall_0()); + } + this_QualifiedName_0=ruleQualifiedName + { + $current.merge(this_QualifiedName_0); + } + { + afterParserOrEnumRuleCall(); + } + kw='.' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameWithWildcardAccess().getFullStopKeyword_1()); + } + kw='*' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameWithWildcardAccess().getAsteriskKeyword_2()); + } + ) +; + +// Entry rule entryRuleValidID +entryRuleValidID returns [String current=null]: + { newCompositeNode(grammarAccess.getValidIDRule()); } + iv_ruleValidID=ruleValidID + { $current=$iv_ruleValidID.current.getText(); } + EOF; + +// Rule ValidID +ruleValidID returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + this_ID_0=RULE_ID + { + $current.merge(this_ID_0); + } + { + newLeafNode(this_ID_0, grammarAccess.getValidIDAccess().getIDTerminalRuleCall()); + } +; + +// Entry rule entryRuleXImportDeclaration +entryRuleXImportDeclaration returns [EObject current=null]: + { newCompositeNode(grammarAccess.getXImportDeclarationRule()); } + iv_ruleXImportDeclaration=ruleXImportDeclaration + { $current=$iv_ruleXImportDeclaration.current; } + EOF; + +// Rule XImportDeclaration +ruleXImportDeclaration returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='import' + { + newLeafNode(otherlv_0, grammarAccess.getXImportDeclarationAccess().getImportKeyword_0()); + } + ( + ( + ( + ( + lv_static_1_0='static' + { + newLeafNode(lv_static_1_0, grammarAccess.getXImportDeclarationAccess().getStaticStaticKeyword_1_0_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + setWithLastConsumed($current, "static", lv_static_1_0 != null, "static"); + } + ) + ) + ( + ( + lv_extension_2_0='extension' + { + newLeafNode(lv_extension_2_0, grammarAccess.getXImportDeclarationAccess().getExtensionExtensionKeyword_1_0_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + setWithLastConsumed($current, "extension", lv_extension_2_0 != null, "extension"); + } + ) + )? + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + } + { + newCompositeNode(grammarAccess.getXImportDeclarationAccess().getImportedTypeJvmDeclaredTypeCrossReference_1_0_2_0()); + } + ruleQualifiedNameInStaticImport + { + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + ( + lv_wildcard_4_0='*' + { + newLeafNode(lv_wildcard_4_0, grammarAccess.getXImportDeclarationAccess().getWildcardAsteriskKeyword_1_0_3_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + setWithLastConsumed($current, "wildcard", lv_wildcard_4_0 != null, "*"); + } + ) + ) + | + ( + ( + { + newCompositeNode(grammarAccess.getXImportDeclarationAccess().getMemberNameValidIDParserRuleCall_1_0_3_1_0()); + } + lv_memberName_5_0=ruleValidID + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getXImportDeclarationRule()); + } + set( + $current, + "memberName", + lv_memberName_5_0, + "org.eclipse.xtext.xbase.Xtype.ValidID"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) + ) + | + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + } + { + newCompositeNode(grammarAccess.getXImportDeclarationAccess().getImportedTypeJvmDeclaredTypeCrossReference_1_1_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + | + ( + ( + { + newCompositeNode(grammarAccess.getXImportDeclarationAccess().getImportedNamespaceQualifiedNameWithWildcardParserRuleCall_1_2_0()); + } + lv_importedNamespace_7_0=ruleQualifiedNameWithWildcard + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getXImportDeclarationRule()); + } + set( + $current, + "importedNamespace", + lv_importedNamespace_7_0, + "org.eclipse.xtext.xbase.Xtype.QualifiedNameWithWildcard"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) + ( + otherlv_8=';' + { + newLeafNode(otherlv_8, grammarAccess.getXImportDeclarationAccess().getSemicolonKeyword_2()); + } + )? + ) +; + +// Entry rule entryRuleQualifiedNameInStaticImport +entryRuleQualifiedNameInStaticImport returns [String current=null]: + { newCompositeNode(grammarAccess.getQualifiedNameInStaticImportRule()); } + iv_ruleQualifiedNameInStaticImport=ruleQualifiedNameInStaticImport + { $current=$iv_ruleQualifiedNameInStaticImport.current.getText(); } + EOF; + +// Rule QualifiedNameInStaticImport +ruleQualifiedNameInStaticImport returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + { + newCompositeNode(grammarAccess.getQualifiedNameInStaticImportAccess().getValidIDParserRuleCall_0()); + } + this_ValidID_0=ruleValidID + { + $current.merge(this_ValidID_0); + } + { + afterParserOrEnumRuleCall(); + } + kw='.' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameInStaticImportAccess().getFullStopKeyword_1()); + } + )+ +; + +RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'$'|'_') ('a'..'z'|'A'..'Z'|'$'|'_'|'0'..'9')*; + +RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'?|'\'' ('\\' .|~(('\\'|'\'')))* '\''?); + +RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; + +RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; + +RULE_WS : (' '|'\t'|'\r'|'\n')+; + +RULE_ANY_OTHER : .; diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachine.tokens b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachine.tokens new file mode 100644 index 000000000..20f8e0989 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachine.tokens @@ -0,0 +1,52 @@ +'&'=26 +'('=18 +')'=19 +'*'=28 +','=15 +'.'=23 +';'=32 +'<'=21 +'=>'=20 +'>'=22 +'?'=24 +'['=16 +']'=17 +'end'=13 +'extends'=25 +'extension'=31 +'false'=12 +'import'=29 +'state'=10 +'static'=30 +'super'=27 +'transition'=14 +'true'=11 +RULE_ANY_OTHER=9 +RULE_ID=4 +RULE_ML_COMMENT=6 +RULE_SL_COMMENT=7 +RULE_STRING=5 +RULE_WS=8 +T__10=10 +T__11=11 +T__12=12 +T__13=13 +T__14=14 +T__15=15 +T__16=16 +T__17=17 +T__18=18 +T__19=19 +T__20=20 +T__21=21 +T__22=22 +T__23=23 +T__24=24 +T__25=25 +T__26=26 +T__27=27 +T__28=28 +T__29=29 +T__30=30 +T__31=31 +T__32=32 diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachineLexer.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachineLexer.java new file mode 100644 index 000000000..356da44e2 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachineLexer.java @@ -0,0 +1,1440 @@ +package de.cognicrypt.order.editor.parser.antlr.internal; + +// Hack: Use our own Lexer superclass by means of import. +// Currently there is no other way to specify the superclass for the lexer. +import org.eclipse.xtext.parser.antlr.Lexer; + + +import org.antlr.runtime.*; +import java.util.Stack; +import java.util.List; +import java.util.ArrayList; + +@SuppressWarnings("all") +public class InternalStatemachineLexer extends Lexer { + public static final int RULE_STRING=5; + public static final int RULE_SL_COMMENT=7; + public static final int T__19=19; + public static final int T__15=15; + public static final int T__16=16; + public static final int T__17=17; + public static final int T__18=18; + public static final int T__11=11; + public static final int T__12=12; + public static final int T__13=13; + public static final int T__14=14; + public static final int EOF=-1; + public static final int T__30=30; + public static final int T__31=31; + public static final int T__10=10; + public static final int T__32=32; + public static final int RULE_ID=4; + public static final int RULE_WS=8; + public static final int RULE_ANY_OTHER=9; + public static final int T__26=26; + public static final int T__27=27; + public static final int T__28=28; + public static final int T__29=29; + public static final int T__22=22; + public static final int RULE_ML_COMMENT=6; + public static final int T__23=23; + public static final int T__24=24; + public static final int T__25=25; + public static final int T__20=20; + public static final int T__21=21; + + // delegates + // delegators + + public InternalStatemachineLexer() {;} + public InternalStatemachineLexer(CharStream input) { + this(input, new RecognizerSharedState()); + } + public InternalStatemachineLexer(CharStream input, RecognizerSharedState state) { + super(input,state); + + } + public String getGrammarFileName() { return "InternalStatemachine.g"; } + + // $ANTLR start "T__10" + public final void mT__10() throws RecognitionException { + try { + int _type = T__10; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:11:7: ( 'state' ) + // InternalStatemachine.g:11:9: 'state' + { + match("state"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__10" + + // $ANTLR start "T__11" + public final void mT__11() throws RecognitionException { + try { + int _type = T__11; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:12:7: ( 'true' ) + // InternalStatemachine.g:12:9: 'true' + { + match("true"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__11" + + // $ANTLR start "T__12" + public final void mT__12() throws RecognitionException { + try { + int _type = T__12; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:13:7: ( 'false' ) + // InternalStatemachine.g:13:9: 'false' + { + match("false"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__12" + + // $ANTLR start "T__13" + public final void mT__13() throws RecognitionException { + try { + int _type = T__13; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:14:7: ( 'end' ) + // InternalStatemachine.g:14:9: 'end' + { + match("end"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__13" + + // $ANTLR start "T__14" + public final void mT__14() throws RecognitionException { + try { + int _type = T__14; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:15:7: ( 'transition' ) + // InternalStatemachine.g:15:9: 'transition' + { + match("transition"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__14" + + // $ANTLR start "T__15" + public final void mT__15() throws RecognitionException { + try { + int _type = T__15; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:16:7: ( ',' ) + // InternalStatemachine.g:16:9: ',' + { + match(','); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__15" + + // $ANTLR start "T__16" + public final void mT__16() throws RecognitionException { + try { + int _type = T__16; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:17:7: ( '[' ) + // InternalStatemachine.g:17:9: '[' + { + match('['); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__16" + + // $ANTLR start "T__17" + public final void mT__17() throws RecognitionException { + try { + int _type = T__17; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:18:7: ( ']' ) + // InternalStatemachine.g:18:9: ']' + { + match(']'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__17" + + // $ANTLR start "T__18" + public final void mT__18() throws RecognitionException { + try { + int _type = T__18; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:19:7: ( '(' ) + // InternalStatemachine.g:19:9: '(' + { + match('('); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__18" + + // $ANTLR start "T__19" + public final void mT__19() throws RecognitionException { + try { + int _type = T__19; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:20:7: ( ')' ) + // InternalStatemachine.g:20:9: ')' + { + match(')'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__19" + + // $ANTLR start "T__20" + public final void mT__20() throws RecognitionException { + try { + int _type = T__20; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:21:7: ( '=>' ) + // InternalStatemachine.g:21:9: '=>' + { + match("=>"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__20" + + // $ANTLR start "T__21" + public final void mT__21() throws RecognitionException { + try { + int _type = T__21; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:22:7: ( '<' ) + // InternalStatemachine.g:22:9: '<' + { + match('<'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__21" + + // $ANTLR start "T__22" + public final void mT__22() throws RecognitionException { + try { + int _type = T__22; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:23:7: ( '>' ) + // InternalStatemachine.g:23:9: '>' + { + match('>'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__22" + + // $ANTLR start "T__23" + public final void mT__23() throws RecognitionException { + try { + int _type = T__23; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:24:7: ( '.' ) + // InternalStatemachine.g:24:9: '.' + { + match('.'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__23" + + // $ANTLR start "T__24" + public final void mT__24() throws RecognitionException { + try { + int _type = T__24; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:25:7: ( '?' ) + // InternalStatemachine.g:25:9: '?' + { + match('?'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__24" + + // $ANTLR start "T__25" + public final void mT__25() throws RecognitionException { + try { + int _type = T__25; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:26:7: ( 'extends' ) + // InternalStatemachine.g:26:9: 'extends' + { + match("extends"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__25" + + // $ANTLR start "T__26" + public final void mT__26() throws RecognitionException { + try { + int _type = T__26; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:27:7: ( '&' ) + // InternalStatemachine.g:27:9: '&' + { + match('&'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__26" + + // $ANTLR start "T__27" + public final void mT__27() throws RecognitionException { + try { + int _type = T__27; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:28:7: ( 'super' ) + // InternalStatemachine.g:28:9: 'super' + { + match("super"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__27" + + // $ANTLR start "T__28" + public final void mT__28() throws RecognitionException { + try { + int _type = T__28; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:29:7: ( '*' ) + // InternalStatemachine.g:29:9: '*' + { + match('*'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__28" + + // $ANTLR start "T__29" + public final void mT__29() throws RecognitionException { + try { + int _type = T__29; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:30:7: ( 'import' ) + // InternalStatemachine.g:30:9: 'import' + { + match("import"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__29" + + // $ANTLR start "T__30" + public final void mT__30() throws RecognitionException { + try { + int _type = T__30; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:31:7: ( 'static' ) + // InternalStatemachine.g:31:9: 'static' + { + match("static"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__30" + + // $ANTLR start "T__31" + public final void mT__31() throws RecognitionException { + try { + int _type = T__31; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:32:7: ( 'extension' ) + // InternalStatemachine.g:32:9: 'extension' + { + match("extension"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__31" + + // $ANTLR start "T__32" + public final void mT__32() throws RecognitionException { + try { + int _type = T__32; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:33:7: ( ';' ) + // InternalStatemachine.g:33:9: ';' + { + match(';'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__32" + + // $ANTLR start "RULE_ID" + public final void mRULE_ID() throws RecognitionException { + try { + int _type = RULE_ID; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:1332:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '$' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '$' | '_' | '0' .. '9' )* ) + // InternalStatemachine.g:1332:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '$' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '$' | '_' | '0' .. '9' )* + { + // InternalStatemachine.g:1332:11: ( '^' )? + int alt1=2; + int LA1_0 = input.LA(1); + + if ( (LA1_0=='^') ) { + alt1=1; + } + switch (alt1) { + case 1 : + // InternalStatemachine.g:1332:11: '^' + { + match('^'); + + } + break; + + } + + if ( input.LA(1)=='$'||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { + input.consume(); + + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse;} + + // InternalStatemachine.g:1332:44: ( 'a' .. 'z' | 'A' .. 'Z' | '$' | '_' | '0' .. '9' )* + loop2: + do { + int alt2=2; + int LA2_0 = input.LA(1); + + if ( (LA2_0=='$'||(LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) { + alt2=1; + } + + + switch (alt2) { + case 1 : + // InternalStatemachine.g: + { + if ( input.LA(1)=='$'||(input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { + input.consume(); + + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse;} + + + } + break; + + default : + break loop2; + } + } while (true); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "RULE_ID" + + // $ANTLR start "RULE_STRING" + public final void mRULE_STRING() throws RecognitionException { + try { + int _type = RULE_STRING; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:1334:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* ( '\"' )? | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* ( '\\'' )? ) ) + // InternalStatemachine.g:1334:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* ( '\"' )? | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* ( '\\'' )? ) + { + // InternalStatemachine.g:1334:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* ( '\"' )? | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* ( '\\'' )? ) + int alt7=2; + int LA7_0 = input.LA(1); + + if ( (LA7_0=='\"') ) { + alt7=1; + } + else if ( (LA7_0=='\'') ) { + alt7=2; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 7, 0, input); + + throw nvae; + } + switch (alt7) { + case 1 : + // InternalStatemachine.g:1334:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* ( '\"' )? + { + match('\"'); + // InternalStatemachine.g:1334:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* + loop3: + do { + int alt3=3; + int LA3_0 = input.LA(1); + + if ( (LA3_0=='\\') ) { + alt3=1; + } + else if ( ((LA3_0>='\u0000' && LA3_0<='!')||(LA3_0>='#' && LA3_0<='[')||(LA3_0>=']' && LA3_0<='\uFFFF')) ) { + alt3=2; + } + + + switch (alt3) { + case 1 : + // InternalStatemachine.g:1334:21: '\\\\' . + { + match('\\'); + matchAny(); + + } + break; + case 2 : + // InternalStatemachine.g:1334:28: ~ ( ( '\\\\' | '\"' ) ) + { + if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { + input.consume(); + + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse;} + + + } + break; + + default : + break loop3; + } + } while (true); + + // InternalStatemachine.g:1334:44: ( '\"' )? + int alt4=2; + int LA4_0 = input.LA(1); + + if ( (LA4_0=='\"') ) { + alt4=1; + } + switch (alt4) { + case 1 : + // InternalStatemachine.g:1334:44: '\"' + { + match('\"'); + + } + break; + + } + + + } + break; + case 2 : + // InternalStatemachine.g:1334:49: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* ( '\\'' )? + { + match('\''); + // InternalStatemachine.g:1334:54: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* + loop5: + do { + int alt5=3; + int LA5_0 = input.LA(1); + + if ( (LA5_0=='\\') ) { + alt5=1; + } + else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) { + alt5=2; + } + + + switch (alt5) { + case 1 : + // InternalStatemachine.g:1334:55: '\\\\' . + { + match('\\'); + matchAny(); + + } + break; + case 2 : + // InternalStatemachine.g:1334:62: ~ ( ( '\\\\' | '\\'' ) ) + { + if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { + input.consume(); + + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse;} + + + } + break; + + default : + break loop5; + } + } while (true); + + // InternalStatemachine.g:1334:79: ( '\\'' )? + int alt6=2; + int LA6_0 = input.LA(1); + + if ( (LA6_0=='\'') ) { + alt6=1; + } + switch (alt6) { + case 1 : + // InternalStatemachine.g:1334:79: '\\'' + { + match('\''); + + } + break; + + } + + + } + break; + + } + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "RULE_STRING" + + // $ANTLR start "RULE_ML_COMMENT" + public final void mRULE_ML_COMMENT() throws RecognitionException { + try { + int _type = RULE_ML_COMMENT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:1336:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) + // InternalStatemachine.g:1336:19: '/*' ( options {greedy=false; } : . )* '*/' + { + match("/*"); + + // InternalStatemachine.g:1336:24: ( options {greedy=false; } : . )* + loop8: + do { + int alt8=2; + int LA8_0 = input.LA(1); + + if ( (LA8_0=='*') ) { + int LA8_1 = input.LA(2); + + if ( (LA8_1=='/') ) { + alt8=2; + } + else if ( ((LA8_1>='\u0000' && LA8_1<='.')||(LA8_1>='0' && LA8_1<='\uFFFF')) ) { + alt8=1; + } + + + } + else if ( ((LA8_0>='\u0000' && LA8_0<=')')||(LA8_0>='+' && LA8_0<='\uFFFF')) ) { + alt8=1; + } + + + switch (alt8) { + case 1 : + // InternalStatemachine.g:1336:52: . + { + matchAny(); + + } + break; + + default : + break loop8; + } + } while (true); + + match("*/"); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "RULE_ML_COMMENT" + + // $ANTLR start "RULE_SL_COMMENT" + public final void mRULE_SL_COMMENT() throws RecognitionException { + try { + int _type = RULE_SL_COMMENT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:1338:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) + // InternalStatemachine.g:1338:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? + { + match("//"); + + // InternalStatemachine.g:1338:24: (~ ( ( '\\n' | '\\r' ) ) )* + loop9: + do { + int alt9=2; + int LA9_0 = input.LA(1); + + if ( ((LA9_0>='\u0000' && LA9_0<='\t')||(LA9_0>='\u000B' && LA9_0<='\f')||(LA9_0>='\u000E' && LA9_0<='\uFFFF')) ) { + alt9=1; + } + + + switch (alt9) { + case 1 : + // InternalStatemachine.g:1338:24: ~ ( ( '\\n' | '\\r' ) ) + { + if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { + input.consume(); + + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse;} + + + } + break; + + default : + break loop9; + } + } while (true); + + // InternalStatemachine.g:1338:40: ( ( '\\r' )? '\\n' )? + int alt11=2; + int LA11_0 = input.LA(1); + + if ( (LA11_0=='\n'||LA11_0=='\r') ) { + alt11=1; + } + switch (alt11) { + case 1 : + // InternalStatemachine.g:1338:41: ( '\\r' )? '\\n' + { + // InternalStatemachine.g:1338:41: ( '\\r' )? + int alt10=2; + int LA10_0 = input.LA(1); + + if ( (LA10_0=='\r') ) { + alt10=1; + } + switch (alt10) { + case 1 : + // InternalStatemachine.g:1338:41: '\\r' + { + match('\r'); + + } + break; + + } + + match('\n'); + + } + break; + + } + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "RULE_SL_COMMENT" + + // $ANTLR start "RULE_WS" + public final void mRULE_WS() throws RecognitionException { + try { + int _type = RULE_WS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:1340:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) + // InternalStatemachine.g:1340:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + { + // InternalStatemachine.g:1340:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + int cnt12=0; + loop12: + do { + int alt12=2; + int LA12_0 = input.LA(1); + + if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) { + alt12=1; + } + + + switch (alt12) { + case 1 : + // InternalStatemachine.g: + { + if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) { + input.consume(); + + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse;} + + + } + break; + + default : + if ( cnt12 >= 1 ) break loop12; + EarlyExitException eee = + new EarlyExitException(12, input); + throw eee; + } + cnt12++; + } while (true); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "RULE_WS" + + // $ANTLR start "RULE_ANY_OTHER" + public final void mRULE_ANY_OTHER() throws RecognitionException { + try { + int _type = RULE_ANY_OTHER; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalStatemachine.g:1342:16: ( . ) + // InternalStatemachine.g:1342:18: . + { + matchAny(); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "RULE_ANY_OTHER" + + public void mTokens() throws RecognitionException { + // InternalStatemachine.g:1:8: ( T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | RULE_ID | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) + int alt13=29; + alt13 = dfa13.predict(input); + switch (alt13) { + case 1 : + // InternalStatemachine.g:1:10: T__10 + { + mT__10(); + + } + break; + case 2 : + // InternalStatemachine.g:1:16: T__11 + { + mT__11(); + + } + break; + case 3 : + // InternalStatemachine.g:1:22: T__12 + { + mT__12(); + + } + break; + case 4 : + // InternalStatemachine.g:1:28: T__13 + { + mT__13(); + + } + break; + case 5 : + // InternalStatemachine.g:1:34: T__14 + { + mT__14(); + + } + break; + case 6 : + // InternalStatemachine.g:1:40: T__15 + { + mT__15(); + + } + break; + case 7 : + // InternalStatemachine.g:1:46: T__16 + { + mT__16(); + + } + break; + case 8 : + // InternalStatemachine.g:1:52: T__17 + { + mT__17(); + + } + break; + case 9 : + // InternalStatemachine.g:1:58: T__18 + { + mT__18(); + + } + break; + case 10 : + // InternalStatemachine.g:1:64: T__19 + { + mT__19(); + + } + break; + case 11 : + // InternalStatemachine.g:1:70: T__20 + { + mT__20(); + + } + break; + case 12 : + // InternalStatemachine.g:1:76: T__21 + { + mT__21(); + + } + break; + case 13 : + // InternalStatemachine.g:1:82: T__22 + { + mT__22(); + + } + break; + case 14 : + // InternalStatemachine.g:1:88: T__23 + { + mT__23(); + + } + break; + case 15 : + // InternalStatemachine.g:1:94: T__24 + { + mT__24(); + + } + break; + case 16 : + // InternalStatemachine.g:1:100: T__25 + { + mT__25(); + + } + break; + case 17 : + // InternalStatemachine.g:1:106: T__26 + { + mT__26(); + + } + break; + case 18 : + // InternalStatemachine.g:1:112: T__27 + { + mT__27(); + + } + break; + case 19 : + // InternalStatemachine.g:1:118: T__28 + { + mT__28(); + + } + break; + case 20 : + // InternalStatemachine.g:1:124: T__29 + { + mT__29(); + + } + break; + case 21 : + // InternalStatemachine.g:1:130: T__30 + { + mT__30(); + + } + break; + case 22 : + // InternalStatemachine.g:1:136: T__31 + { + mT__31(); + + } + break; + case 23 : + // InternalStatemachine.g:1:142: T__32 + { + mT__32(); + + } + break; + case 24 : + // InternalStatemachine.g:1:148: RULE_ID + { + mRULE_ID(); + + } + break; + case 25 : + // InternalStatemachine.g:1:156: RULE_STRING + { + mRULE_STRING(); + + } + break; + case 26 : + // InternalStatemachine.g:1:168: RULE_ML_COMMENT + { + mRULE_ML_COMMENT(); + + } + break; + case 27 : + // InternalStatemachine.g:1:184: RULE_SL_COMMENT + { + mRULE_SL_COMMENT(); + + } + break; + case 28 : + // InternalStatemachine.g:1:200: RULE_WS + { + mRULE_WS(); + + } + break; + case 29 : + // InternalStatemachine.g:1:208: RULE_ANY_OTHER + { + mRULE_ANY_OTHER(); + + } + break; + + } + + } + + + protected DFA13 dfa13 = new DFA13(this); + static final String DFA13_eotS = + "\1\uffff\4\34\5\uffff\1\31\6\uffff\1\34\1\uffff\1\31\3\uffff\1\31\2\uffff\2\34\1\uffff\4\34\14\uffff\1\34\5\uffff\5\34\1\100\4\34\1\106\2\34\1\uffff\2\34\1\113\1\34\1\115\1\uffff\1\34\1\117\2\34\1\uffff\1\123\1\uffff\1\34\1\uffff\2\34\1\127\1\uffff\1\34\1\131\1\34\1\uffff\1\34\1\uffff\2\34\1\136\1\137\2\uffff"; + static final String DFA13_eofS = + "\140\uffff"; + static final String DFA13_minS = + "\1\0\1\164\1\162\1\141\1\156\5\uffff\1\76\6\uffff\1\155\1\uffff\1\44\3\uffff\1\52\2\uffff\1\141\1\160\1\uffff\1\141\1\154\1\144\1\164\14\uffff\1\160\5\uffff\1\164\2\145\1\156\1\163\1\44\1\145\1\157\1\145\1\162\1\44\1\163\1\145\1\uffff\1\156\1\162\1\44\1\143\1\44\1\uffff\1\151\1\44\1\144\1\164\1\uffff\1\44\1\uffff\1\164\1\uffff\1\163\1\151\1\44\1\uffff\1\151\1\44\1\157\1\uffff\1\157\1\uffff\2\156\2\44\2\uffff"; + static final String DFA13_maxS = + "\1\uffff\1\165\1\162\1\141\1\170\5\uffff\1\76\6\uffff\1\155\1\uffff\1\172\3\uffff\1\57\2\uffff\1\141\1\160\1\uffff\1\165\1\154\1\144\1\164\14\uffff\1\160\5\uffff\1\164\2\145\1\156\1\163\1\172\1\145\1\157\1\151\1\162\1\172\1\163\1\145\1\uffff\1\156\1\162\1\172\1\143\1\172\1\uffff\1\151\1\172\1\163\1\164\1\uffff\1\172\1\uffff\1\164\1\uffff\1\163\1\151\1\172\1\uffff\1\151\1\172\1\157\1\uffff\1\157\1\uffff\2\156\2\172\2\uffff"; + static final String DFA13_acceptS = + "\5\uffff\1\6\1\7\1\10\1\11\1\12\1\uffff\1\14\1\15\1\16\1\17\1\21\1\23\1\uffff\1\27\1\uffff\1\30\2\31\1\uffff\1\34\1\35\2\uffff\1\30\4\uffff\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1\15\1\16\1\17\1\21\1\23\1\uffff\1\27\1\31\1\32\1\33\1\34\15\uffff\1\4\5\uffff\1\2\4\uffff\1\1\1\uffff\1\22\1\uffff\1\3\3\uffff\1\25\3\uffff\1\24\1\uffff\1\20\4\uffff\1\26\1\5"; + static final String DFA13_specialS = + "\1\0\137\uffff}>"; + static final String[] DFA13_transitionS = { + "\11\31\2\30\2\31\1\30\22\31\1\30\1\31\1\25\1\31\1\24\1\31\1\17\1\26\1\10\1\11\1\20\1\31\1\5\1\31\1\15\1\27\13\31\1\22\1\13\1\12\1\14\1\16\1\31\32\24\1\6\1\31\1\7\1\23\1\24\1\31\4\24\1\4\1\3\2\24\1\21\11\24\1\1\1\2\6\24\uff85\31", + "\1\32\1\33", + "\1\35", + "\1\36", + "\1\37\11\uffff\1\40", + "", + "", + "", + "", + "", + "\1\46", + "", + "", + "", + "", + "", + "", + "\1\55", + "", + "\1\34\34\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "", + "", + "", + "\1\60\4\uffff\1\61", + "", + "", + "\1\63", + "\1\64", + "", + "\1\66\23\uffff\1\65", + "\1\67", + "\1\70", + "\1\71", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\1\72", + "", + "", + "", + "", + "", + "\1\73", + "\1\74", + "\1\75", + "\1\76", + "\1\77", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "\1\101", + "\1\102", + "\1\103\3\uffff\1\104", + "\1\105", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "\1\107", + "\1\110", + "", + "\1\111", + "\1\112", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "\1\114", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "", + "\1\116", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "\1\120\16\uffff\1\121", + "\1\122", + "", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "", + "\1\124", + "", + "\1\125", + "\1\126", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "", + "\1\130", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "\1\132", + "", + "\1\133", + "", + "\1\134", + "\1\135", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "\1\34\13\uffff\12\34\7\uffff\32\34\4\uffff\1\34\1\uffff\32\34", + "", + "" + }; + + static final short[] DFA13_eot = DFA.unpackEncodedString(DFA13_eotS); + static final short[] DFA13_eof = DFA.unpackEncodedString(DFA13_eofS); + static final char[] DFA13_min = DFA.unpackEncodedStringToUnsignedChars(DFA13_minS); + static final char[] DFA13_max = DFA.unpackEncodedStringToUnsignedChars(DFA13_maxS); + static final short[] DFA13_accept = DFA.unpackEncodedString(DFA13_acceptS); + static final short[] DFA13_special = DFA.unpackEncodedString(DFA13_specialS); + static final short[][] DFA13_transition; + + static { + int numStates = DFA13_transitionS.length; + DFA13_transition = new short[numStates][]; + for (int i=0; i') ) {s = 12;} + + else if ( (LA13_0=='.') ) {s = 13;} + + else if ( (LA13_0=='?') ) {s = 14;} + + else if ( (LA13_0=='&') ) {s = 15;} + + else if ( (LA13_0=='*') ) {s = 16;} + + else if ( (LA13_0=='i') ) {s = 17;} + + else if ( (LA13_0==';') ) {s = 18;} + + else if ( (LA13_0=='^') ) {s = 19;} + + else if ( (LA13_0=='$'||(LA13_0>='A' && LA13_0<='Z')||LA13_0=='_'||(LA13_0>='a' && LA13_0<='d')||(LA13_0>='g' && LA13_0<='h')||(LA13_0>='j' && LA13_0<='r')||(LA13_0>='u' && LA13_0<='z')) ) {s = 20;} + + else if ( (LA13_0=='\"') ) {s = 21;} + + else if ( (LA13_0=='\'') ) {s = 22;} + + else if ( (LA13_0=='/') ) {s = 23;} + + else if ( ((LA13_0>='\t' && LA13_0<='\n')||LA13_0=='\r'||LA13_0==' ') ) {s = 24;} + + else if ( ((LA13_0>='\u0000' && LA13_0<='\b')||(LA13_0>='\u000B' && LA13_0<='\f')||(LA13_0>='\u000E' && LA13_0<='\u001F')||LA13_0=='!'||LA13_0=='#'||LA13_0=='%'||LA13_0=='+'||LA13_0=='-'||(LA13_0>='0' && LA13_0<=':')||LA13_0=='@'||LA13_0=='\\'||LA13_0=='`'||(LA13_0>='{' && LA13_0<='\uFFFF')) ) {s = 25;} + + if ( s>=0 ) return s; + break; + } + NoViableAltException nvae = + new NoViableAltException(getDescription(), 13, _s, input); + error(nvae); + throw nvae; + } + } + + +} \ No newline at end of file diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachineParser.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachineParser.java new file mode 100644 index 000000000..1037498de --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/parser/antlr/internal/InternalStatemachineParser.java @@ -0,0 +1,4025 @@ +package de.cognicrypt.order.editor.parser.antlr.internal; + +import org.eclipse.xtext.*; +import org.eclipse.xtext.parser.*; +import org.eclipse.xtext.parser.impl.*; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser; +import org.eclipse.xtext.parser.antlr.XtextTokenStream; +import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; +import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken; +import de.cognicrypt.order.editor.services.StatemachineGrammarAccess; + + + +import org.antlr.runtime.*; +import java.util.Stack; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +@SuppressWarnings("all") +public class InternalStatemachineParser extends AbstractInternalAntlrParser { + public static final String[] tokenNames = new String[] { + "", "", "", "", "RULE_ID", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'state'", "'true'", "'false'", "'end'", "'transition'", "','", "'['", "']'", "'('", "')'", "'=>'", "'<'", "'>'", "'.'", "'?'", "'extends'", "'&'", "'super'", "'*'", "'import'", "'static'", "'extension'", "';'" + }; + public static final int RULE_STRING=5; + public static final int RULE_SL_COMMENT=7; + public static final int T__19=19; + public static final int T__15=15; + public static final int T__16=16; + public static final int T__17=17; + public static final int T__18=18; + public static final int T__11=11; + public static final int T__12=12; + public static final int T__13=13; + public static final int T__14=14; + public static final int EOF=-1; + public static final int T__30=30; + public static final int T__31=31; + public static final int T__10=10; + public static final int T__32=32; + public static final int RULE_ID=4; + public static final int RULE_WS=8; + public static final int RULE_ANY_OTHER=9; + public static final int T__26=26; + public static final int T__27=27; + public static final int T__28=28; + public static final int T__29=29; + public static final int T__22=22; + public static final int RULE_ML_COMMENT=6; + public static final int T__23=23; + public static final int T__24=24; + public static final int T__25=25; + public static final int T__20=20; + public static final int T__21=21; + + // delegates + // delegators + + + public InternalStatemachineParser(TokenStream input) { + this(input, new RecognizerSharedState()); + } + public InternalStatemachineParser(TokenStream input, RecognizerSharedState state) { + super(input, state); + + } + + + public String[] getTokenNames() { return InternalStatemachineParser.tokenNames; } + public String getGrammarFileName() { return "InternalStatemachine.g"; } + + + + private StatemachineGrammarAccess grammarAccess; + + public InternalStatemachineParser(TokenStream input, StatemachineGrammarAccess grammarAccess) { + this(input); + this.grammarAccess = grammarAccess; + registerRules(grammarAccess.getGrammar()); + } + + @Override + protected String getFirstRuleName() { + return "Statemachine"; + } + + @Override + protected StatemachineGrammarAccess getGrammarAccess() { + return grammarAccess; + } + + + + + // $ANTLR start "entryRuleStatemachine" + // InternalStatemachine.g:64:1: entryRuleStatemachine returns [EObject current=null] : iv_ruleStatemachine= ruleStatemachine EOF ; + public final EObject entryRuleStatemachine() throws RecognitionException { + EObject current = null; + + EObject iv_ruleStatemachine = null; + + + try { + // InternalStatemachine.g:64:53: (iv_ruleStatemachine= ruleStatemachine EOF ) + // InternalStatemachine.g:65:2: iv_ruleStatemachine= ruleStatemachine EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getStatemachineRule()); + } + pushFollow(FOLLOW_1); + iv_ruleStatemachine=ruleStatemachine(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleStatemachine; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleStatemachine" + + + // $ANTLR start "ruleStatemachine" + // InternalStatemachine.g:71:1: ruleStatemachine returns [EObject current=null] : ( () ( (lv_states_1_0= ruleState ) )* ( (lv_transitions_2_0= ruleTransition ) )* ) ; + public final EObject ruleStatemachine() throws RecognitionException { + EObject current = null; + + EObject lv_states_1_0 = null; + + EObject lv_transitions_2_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:77:2: ( ( () ( (lv_states_1_0= ruleState ) )* ( (lv_transitions_2_0= ruleTransition ) )* ) ) + // InternalStatemachine.g:78:2: ( () ( (lv_states_1_0= ruleState ) )* ( (lv_transitions_2_0= ruleTransition ) )* ) + { + // InternalStatemachine.g:78:2: ( () ( (lv_states_1_0= ruleState ) )* ( (lv_transitions_2_0= ruleTransition ) )* ) + // InternalStatemachine.g:79:3: () ( (lv_states_1_0= ruleState ) )* ( (lv_transitions_2_0= ruleTransition ) )* + { + // InternalStatemachine.g:79:3: () + // InternalStatemachine.g:80:4: + { + if ( state.backtracking==0 ) { + + current = forceCreateModelElement( + grammarAccess.getStatemachineAccess().getStatemachineAction_0(), + current); + + } + + } + + // InternalStatemachine.g:86:3: ( (lv_states_1_0= ruleState ) )* + loop1: + do { + int alt1=2; + int LA1_0 = input.LA(1); + + if ( (LA1_0==10) ) { + alt1=1; + } + + + switch (alt1) { + case 1 : + // InternalStatemachine.g:87:4: (lv_states_1_0= ruleState ) + { + // InternalStatemachine.g:87:4: (lv_states_1_0= ruleState ) + // InternalStatemachine.g:88:5: lv_states_1_0= ruleState + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getStatemachineAccess().getStatesStateParserRuleCall_1_0()); + + } + pushFollow(FOLLOW_3); + lv_states_1_0=ruleState(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getStatemachineRule()); + } + add( + current, + "states", + lv_states_1_0, + "de.cognicrypt.order.editor.Statemachine.State"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + break; + + default : + break loop1; + } + } while (true); + + // InternalStatemachine.g:105:3: ( (lv_transitions_2_0= ruleTransition ) )* + loop2: + do { + int alt2=2; + int LA2_0 = input.LA(1); + + if ( (LA2_0==14) ) { + alt2=1; + } + + + switch (alt2) { + case 1 : + // InternalStatemachine.g:106:4: (lv_transitions_2_0= ruleTransition ) + { + // InternalStatemachine.g:106:4: (lv_transitions_2_0= ruleTransition ) + // InternalStatemachine.g:107:5: lv_transitions_2_0= ruleTransition + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getStatemachineAccess().getTransitionsTransitionParserRuleCall_2_0()); + + } + pushFollow(FOLLOW_4); + lv_transitions_2_0=ruleTransition(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getStatemachineRule()); + } + add( + current, + "transitions", + lv_transitions_2_0, + "de.cognicrypt.order.editor.Statemachine.Transition"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + break; + + default : + break loop2; + } + } while (true); + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleStatemachine" + + + // $ANTLR start "entryRuleState" + // InternalStatemachine.g:128:1: entryRuleState returns [EObject current=null] : iv_ruleState= ruleState EOF ; + public final EObject entryRuleState() throws RecognitionException { + EObject current = null; + + EObject iv_ruleState = null; + + + try { + // InternalStatemachine.g:128:46: (iv_ruleState= ruleState EOF ) + // InternalStatemachine.g:129:2: iv_ruleState= ruleState EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getStateRule()); + } + pushFollow(FOLLOW_1); + iv_ruleState=ruleState(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleState; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleState" + + + // $ANTLR start "ruleState" + // InternalStatemachine.g:135:1: ruleState returns [EObject current=null] : (otherlv_0= 'state' ( (lv_name_1_0= RULE_ID ) ) ( ( (lv_isFinal_2_0= 'true' ) ) | otherlv_3= 'false' ) ( (lv_transitions_4_0= ruleTransition ) )* otherlv_5= 'end' ) ; + public final EObject ruleState() throws RecognitionException { + EObject current = null; + + Token otherlv_0=null; + Token lv_name_1_0=null; + Token lv_isFinal_2_0=null; + Token otherlv_3=null; + Token otherlv_5=null; + EObject lv_transitions_4_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:141:2: ( (otherlv_0= 'state' ( (lv_name_1_0= RULE_ID ) ) ( ( (lv_isFinal_2_0= 'true' ) ) | otherlv_3= 'false' ) ( (lv_transitions_4_0= ruleTransition ) )* otherlv_5= 'end' ) ) + // InternalStatemachine.g:142:2: (otherlv_0= 'state' ( (lv_name_1_0= RULE_ID ) ) ( ( (lv_isFinal_2_0= 'true' ) ) | otherlv_3= 'false' ) ( (lv_transitions_4_0= ruleTransition ) )* otherlv_5= 'end' ) + { + // InternalStatemachine.g:142:2: (otherlv_0= 'state' ( (lv_name_1_0= RULE_ID ) ) ( ( (lv_isFinal_2_0= 'true' ) ) | otherlv_3= 'false' ) ( (lv_transitions_4_0= ruleTransition ) )* otherlv_5= 'end' ) + // InternalStatemachine.g:143:3: otherlv_0= 'state' ( (lv_name_1_0= RULE_ID ) ) ( ( (lv_isFinal_2_0= 'true' ) ) | otherlv_3= 'false' ) ( (lv_transitions_4_0= ruleTransition ) )* otherlv_5= 'end' + { + otherlv_0=(Token)match(input,10,FOLLOW_5); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_0, grammarAccess.getStateAccess().getStateKeyword_0()); + + } + // InternalStatemachine.g:147:3: ( (lv_name_1_0= RULE_ID ) ) + // InternalStatemachine.g:148:4: (lv_name_1_0= RULE_ID ) + { + // InternalStatemachine.g:148:4: (lv_name_1_0= RULE_ID ) + // InternalStatemachine.g:149:5: lv_name_1_0= RULE_ID + { + lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_6); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(lv_name_1_0, grammarAccess.getStateAccess().getNameIDTerminalRuleCall_1_0()); + + } + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getStateRule()); + } + setWithLastConsumed( + current, + "name", + lv_name_1_0, + "org.eclipse.xtext.xbase.Xtype.ID"); + + } + + } + + + } + + // InternalStatemachine.g:165:3: ( ( (lv_isFinal_2_0= 'true' ) ) | otherlv_3= 'false' ) + int alt3=2; + int LA3_0 = input.LA(1); + + if ( (LA3_0==11) ) { + alt3=1; + } + else if ( (LA3_0==12) ) { + alt3=2; + } + else { + if (state.backtracking>0) {state.failed=true; return current;} + NoViableAltException nvae = + new NoViableAltException("", 3, 0, input); + + throw nvae; + } + switch (alt3) { + case 1 : + // InternalStatemachine.g:166:4: ( (lv_isFinal_2_0= 'true' ) ) + { + // InternalStatemachine.g:166:4: ( (lv_isFinal_2_0= 'true' ) ) + // InternalStatemachine.g:167:5: (lv_isFinal_2_0= 'true' ) + { + // InternalStatemachine.g:167:5: (lv_isFinal_2_0= 'true' ) + // InternalStatemachine.g:168:6: lv_isFinal_2_0= 'true' + { + lv_isFinal_2_0=(Token)match(input,11,FOLLOW_7); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(lv_isFinal_2_0, grammarAccess.getStateAccess().getIsFinalTrueKeyword_2_0_0()); + + } + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getStateRule()); + } + setWithLastConsumed(current, "isFinal", lv_isFinal_2_0 != null, "true"); + + } + + } + + + } + + + } + break; + case 2 : + // InternalStatemachine.g:181:4: otherlv_3= 'false' + { + otherlv_3=(Token)match(input,12,FOLLOW_7); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_3, grammarAccess.getStateAccess().getFalseKeyword_2_1()); + + } + + } + break; + + } + + // InternalStatemachine.g:186:3: ( (lv_transitions_4_0= ruleTransition ) )* + loop4: + do { + int alt4=2; + int LA4_0 = input.LA(1); + + if ( (LA4_0==14) ) { + alt4=1; + } + + + switch (alt4) { + case 1 : + // InternalStatemachine.g:187:4: (lv_transitions_4_0= ruleTransition ) + { + // InternalStatemachine.g:187:4: (lv_transitions_4_0= ruleTransition ) + // InternalStatemachine.g:188:5: lv_transitions_4_0= ruleTransition + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getStateAccess().getTransitionsTransitionParserRuleCall_3_0()); + + } + pushFollow(FOLLOW_7); + lv_transitions_4_0=ruleTransition(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getStateRule()); + } + add( + current, + "transitions", + lv_transitions_4_0, + "de.cognicrypt.order.editor.Statemachine.Transition"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + break; + + default : + break loop4; + } + } while (true); + + otherlv_5=(Token)match(input,13,FOLLOW_2); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_5, grammarAccess.getStateAccess().getEndKeyword_4()); + + } + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleState" + + + // $ANTLR start "entryRuleTransition" + // InternalStatemachine.g:213:1: entryRuleTransition returns [EObject current=null] : iv_ruleTransition= ruleTransition EOF ; + public final EObject entryRuleTransition() throws RecognitionException { + EObject current = null; + + EObject iv_ruleTransition = null; + + + try { + // InternalStatemachine.g:213:51: (iv_ruleTransition= ruleTransition EOF ) + // InternalStatemachine.g:214:2: iv_ruleTransition= ruleTransition EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getTransitionRule()); + } + pushFollow(FOLLOW_1); + iv_ruleTransition=ruleTransition(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleTransition; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleTransition" + + + // $ANTLR start "ruleTransition" + // InternalStatemachine.g:220:1: ruleTransition returns [EObject current=null] : (otherlv_0= 'transition' ( (lv_name_1_0= RULE_ID ) ) ( (otherlv_2= RULE_ID ) ) otherlv_3= ',' ( (lv_event_4_0= ruleEvent ) ) otherlv_5= ',' ( (otherlv_6= RULE_ID ) ) otherlv_7= 'end' ) ; + public final EObject ruleTransition() throws RecognitionException { + EObject current = null; + + Token otherlv_0=null; + Token lv_name_1_0=null; + Token otherlv_2=null; + Token otherlv_3=null; + Token otherlv_5=null; + Token otherlv_6=null; + Token otherlv_7=null; + EObject lv_event_4_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:226:2: ( (otherlv_0= 'transition' ( (lv_name_1_0= RULE_ID ) ) ( (otherlv_2= RULE_ID ) ) otherlv_3= ',' ( (lv_event_4_0= ruleEvent ) ) otherlv_5= ',' ( (otherlv_6= RULE_ID ) ) otherlv_7= 'end' ) ) + // InternalStatemachine.g:227:2: (otherlv_0= 'transition' ( (lv_name_1_0= RULE_ID ) ) ( (otherlv_2= RULE_ID ) ) otherlv_3= ',' ( (lv_event_4_0= ruleEvent ) ) otherlv_5= ',' ( (otherlv_6= RULE_ID ) ) otherlv_7= 'end' ) + { + // InternalStatemachine.g:227:2: (otherlv_0= 'transition' ( (lv_name_1_0= RULE_ID ) ) ( (otherlv_2= RULE_ID ) ) otherlv_3= ',' ( (lv_event_4_0= ruleEvent ) ) otherlv_5= ',' ( (otherlv_6= RULE_ID ) ) otherlv_7= 'end' ) + // InternalStatemachine.g:228:3: otherlv_0= 'transition' ( (lv_name_1_0= RULE_ID ) ) ( (otherlv_2= RULE_ID ) ) otherlv_3= ',' ( (lv_event_4_0= ruleEvent ) ) otherlv_5= ',' ( (otherlv_6= RULE_ID ) ) otherlv_7= 'end' + { + otherlv_0=(Token)match(input,14,FOLLOW_5); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_0, grammarAccess.getTransitionAccess().getTransitionKeyword_0()); + + } + // InternalStatemachine.g:232:3: ( (lv_name_1_0= RULE_ID ) ) + // InternalStatemachine.g:233:4: (lv_name_1_0= RULE_ID ) + { + // InternalStatemachine.g:233:4: (lv_name_1_0= RULE_ID ) + // InternalStatemachine.g:234:5: lv_name_1_0= RULE_ID + { + lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_5); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(lv_name_1_0, grammarAccess.getTransitionAccess().getNameIDTerminalRuleCall_1_0()); + + } + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getTransitionRule()); + } + setWithLastConsumed( + current, + "name", + lv_name_1_0, + "org.eclipse.xtext.xbase.Xtype.ID"); + + } + + } + + + } + + // InternalStatemachine.g:250:3: ( (otherlv_2= RULE_ID ) ) + // InternalStatemachine.g:251:4: (otherlv_2= RULE_ID ) + { + // InternalStatemachine.g:251:4: (otherlv_2= RULE_ID ) + // InternalStatemachine.g:252:5: otherlv_2= RULE_ID + { + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getTransitionRule()); + } + + } + otherlv_2=(Token)match(input,RULE_ID,FOLLOW_8); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_2, grammarAccess.getTransitionAccess().getFromStateStateCrossReference_2_0()); + + } + + } + + + } + + otherlv_3=(Token)match(input,15,FOLLOW_5); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_3, grammarAccess.getTransitionAccess().getCommaKeyword_3()); + + } + // InternalStatemachine.g:267:3: ( (lv_event_4_0= ruleEvent ) ) + // InternalStatemachine.g:268:4: (lv_event_4_0= ruleEvent ) + { + // InternalStatemachine.g:268:4: (lv_event_4_0= ruleEvent ) + // InternalStatemachine.g:269:5: lv_event_4_0= ruleEvent + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getTransitionAccess().getEventEventParserRuleCall_4_0()); + + } + pushFollow(FOLLOW_8); + lv_event_4_0=ruleEvent(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getTransitionRule()); + } + set( + current, + "event", + lv_event_4_0, + "de.cognicrypt.order.editor.Statemachine.Event"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + otherlv_5=(Token)match(input,15,FOLLOW_5); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_5, grammarAccess.getTransitionAccess().getCommaKeyword_5()); + + } + // InternalStatemachine.g:290:3: ( (otherlv_6= RULE_ID ) ) + // InternalStatemachine.g:291:4: (otherlv_6= RULE_ID ) + { + // InternalStatemachine.g:291:4: (otherlv_6= RULE_ID ) + // InternalStatemachine.g:292:5: otherlv_6= RULE_ID + { + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getTransitionRule()); + } + + } + otherlv_6=(Token)match(input,RULE_ID,FOLLOW_9); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_6, grammarAccess.getTransitionAccess().getEndStateStateCrossReference_6_0()); + + } + + } + + + } + + otherlv_7=(Token)match(input,13,FOLLOW_2); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_7, grammarAccess.getTransitionAccess().getEndKeyword_7()); + + } + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleTransition" + + + // $ANTLR start "entryRuleEvent" + // InternalStatemachine.g:311:1: entryRuleEvent returns [EObject current=null] : iv_ruleEvent= ruleEvent EOF ; + public final EObject entryRuleEvent() throws RecognitionException { + EObject current = null; + + EObject iv_ruleEvent = null; + + + try { + // InternalStatemachine.g:311:46: (iv_ruleEvent= ruleEvent EOF ) + // InternalStatemachine.g:312:2: iv_ruleEvent= ruleEvent EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getEventRule()); + } + pushFollow(FOLLOW_1); + iv_ruleEvent=ruleEvent(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleEvent; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleEvent" + + + // $ANTLR start "ruleEvent" + // InternalStatemachine.g:318:1: ruleEvent returns [EObject current=null] : ( (lv_name_0_0= RULE_ID ) ) ; + public final EObject ruleEvent() throws RecognitionException { + EObject current = null; + + Token lv_name_0_0=null; + + + enterRule(); + + try { + // InternalStatemachine.g:324:2: ( ( (lv_name_0_0= RULE_ID ) ) ) + // InternalStatemachine.g:325:2: ( (lv_name_0_0= RULE_ID ) ) + { + // InternalStatemachine.g:325:2: ( (lv_name_0_0= RULE_ID ) ) + // InternalStatemachine.g:326:3: (lv_name_0_0= RULE_ID ) + { + // InternalStatemachine.g:326:3: (lv_name_0_0= RULE_ID ) + // InternalStatemachine.g:327:4: lv_name_0_0= RULE_ID + { + lv_name_0_0=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(lv_name_0_0, grammarAccess.getEventAccess().getNameIDTerminalRuleCall_0()); + + } + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getEventRule()); + } + setWithLastConsumed( + current, + "name", + lv_name_0_0, + "org.eclipse.xtext.xbase.Xtype.ID"); + + } + + } + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleEvent" + + + // $ANTLR start "entryRuleJvmTypeReference" + // InternalStatemachine.g:346:1: entryRuleJvmTypeReference returns [EObject current=null] : iv_ruleJvmTypeReference= ruleJvmTypeReference EOF ; + public final EObject entryRuleJvmTypeReference() throws RecognitionException { + EObject current = null; + + EObject iv_ruleJvmTypeReference = null; + + + try { + // InternalStatemachine.g:346:57: (iv_ruleJvmTypeReference= ruleJvmTypeReference EOF ) + // InternalStatemachine.g:347:2: iv_ruleJvmTypeReference= ruleJvmTypeReference EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getJvmTypeReferenceRule()); + } + pushFollow(FOLLOW_1); + iv_ruleJvmTypeReference=ruleJvmTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleJvmTypeReference; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleJvmTypeReference" + + + // $ANTLR start "ruleJvmTypeReference" + // InternalStatemachine.g:353:1: ruleJvmTypeReference returns [EObject current=null] : ( (this_JvmParameterizedTypeReference_0= ruleJvmParameterizedTypeReference ( ( ( () ruleArrayBrackets ) )=> ( () ruleArrayBrackets ) )* ) | this_XFunctionTypeRef_3= ruleXFunctionTypeRef ) ; + public final EObject ruleJvmTypeReference() throws RecognitionException { + EObject current = null; + + EObject this_JvmParameterizedTypeReference_0 = null; + + EObject this_XFunctionTypeRef_3 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:359:2: ( ( (this_JvmParameterizedTypeReference_0= ruleJvmParameterizedTypeReference ( ( ( () ruleArrayBrackets ) )=> ( () ruleArrayBrackets ) )* ) | this_XFunctionTypeRef_3= ruleXFunctionTypeRef ) ) + // InternalStatemachine.g:360:2: ( (this_JvmParameterizedTypeReference_0= ruleJvmParameterizedTypeReference ( ( ( () ruleArrayBrackets ) )=> ( () ruleArrayBrackets ) )* ) | this_XFunctionTypeRef_3= ruleXFunctionTypeRef ) + { + // InternalStatemachine.g:360:2: ( (this_JvmParameterizedTypeReference_0= ruleJvmParameterizedTypeReference ( ( ( () ruleArrayBrackets ) )=> ( () ruleArrayBrackets ) )* ) | this_XFunctionTypeRef_3= ruleXFunctionTypeRef ) + int alt6=2; + int LA6_0 = input.LA(1); + + if ( (LA6_0==RULE_ID) ) { + alt6=1; + } + else if ( (LA6_0==18||LA6_0==20) ) { + alt6=2; + } + else { + if (state.backtracking>0) {state.failed=true; return current;} + NoViableAltException nvae = + new NoViableAltException("", 6, 0, input); + + throw nvae; + } + switch (alt6) { + case 1 : + // InternalStatemachine.g:361:3: (this_JvmParameterizedTypeReference_0= ruleJvmParameterizedTypeReference ( ( ( () ruleArrayBrackets ) )=> ( () ruleArrayBrackets ) )* ) + { + // InternalStatemachine.g:361:3: (this_JvmParameterizedTypeReference_0= ruleJvmParameterizedTypeReference ( ( ( () ruleArrayBrackets ) )=> ( () ruleArrayBrackets ) )* ) + // InternalStatemachine.g:362:4: this_JvmParameterizedTypeReference_0= ruleJvmParameterizedTypeReference ( ( ( () ruleArrayBrackets ) )=> ( () ruleArrayBrackets ) )* + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmTypeReferenceAccess().getJvmParameterizedTypeReferenceParserRuleCall_0_0()); + + } + pushFollow(FOLLOW_10); + this_JvmParameterizedTypeReference_0=ruleJvmParameterizedTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + current = this_JvmParameterizedTypeReference_0; + afterParserOrEnumRuleCall(); + + } + // InternalStatemachine.g:370:4: ( ( ( () ruleArrayBrackets ) )=> ( () ruleArrayBrackets ) )* + loop5: + do { + int alt5=2; + int LA5_0 = input.LA(1); + + if ( (LA5_0==16) && (synpred1_InternalStatemachine())) { + alt5=1; + } + + + switch (alt5) { + case 1 : + // InternalStatemachine.g:371:5: ( ( () ruleArrayBrackets ) )=> ( () ruleArrayBrackets ) + { + // InternalStatemachine.g:377:5: ( () ruleArrayBrackets ) + // InternalStatemachine.g:378:6: () ruleArrayBrackets + { + // InternalStatemachine.g:378:6: () + // InternalStatemachine.g:379:7: + { + if ( state.backtracking==0 ) { + + current = forceCreateModelElementAndSet( + grammarAccess.getJvmTypeReferenceAccess().getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0(), + current); + + } + + } + + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmTypeReferenceAccess().getArrayBracketsParserRuleCall_0_1_0_1()); + + } + pushFollow(FOLLOW_10); + ruleArrayBrackets(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + afterParserOrEnumRuleCall(); + + } + + } + + + } + break; + + default : + break loop5; + } + } while (true); + + + } + + + } + break; + case 2 : + // InternalStatemachine.g:396:3: this_XFunctionTypeRef_3= ruleXFunctionTypeRef + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmTypeReferenceAccess().getXFunctionTypeRefParserRuleCall_1()); + + } + pushFollow(FOLLOW_2); + this_XFunctionTypeRef_3=ruleXFunctionTypeRef(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + current = this_XFunctionTypeRef_3; + afterParserOrEnumRuleCall(); + + } + + } + break; + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleJvmTypeReference" + + + // $ANTLR start "entryRuleArrayBrackets" + // InternalStatemachine.g:408:1: entryRuleArrayBrackets returns [String current=null] : iv_ruleArrayBrackets= ruleArrayBrackets EOF ; + public final String entryRuleArrayBrackets() throws RecognitionException { + String current = null; + + AntlrDatatypeRuleToken iv_ruleArrayBrackets = null; + + + try { + // InternalStatemachine.g:408:53: (iv_ruleArrayBrackets= ruleArrayBrackets EOF ) + // InternalStatemachine.g:409:2: iv_ruleArrayBrackets= ruleArrayBrackets EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getArrayBracketsRule()); + } + pushFollow(FOLLOW_1); + iv_ruleArrayBrackets=ruleArrayBrackets(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleArrayBrackets.getText(); + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleArrayBrackets" + + + // $ANTLR start "ruleArrayBrackets" + // InternalStatemachine.g:415:1: ruleArrayBrackets returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= '[' kw= ']' ) ; + public final AntlrDatatypeRuleToken ruleArrayBrackets() throws RecognitionException { + AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); + + Token kw=null; + + + enterRule(); + + try { + // InternalStatemachine.g:421:2: ( (kw= '[' kw= ']' ) ) + // InternalStatemachine.g:422:2: (kw= '[' kw= ']' ) + { + // InternalStatemachine.g:422:2: (kw= '[' kw= ']' ) + // InternalStatemachine.g:423:3: kw= '[' kw= ']' + { + kw=(Token)match(input,16,FOLLOW_11); if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(kw); + newLeafNode(kw, grammarAccess.getArrayBracketsAccess().getLeftSquareBracketKeyword_0()); + + } + kw=(Token)match(input,17,FOLLOW_2); if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(kw); + newLeafNode(kw, grammarAccess.getArrayBracketsAccess().getRightSquareBracketKeyword_1()); + + } + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleArrayBrackets" + + + // $ANTLR start "entryRuleXFunctionTypeRef" + // InternalStatemachine.g:437:1: entryRuleXFunctionTypeRef returns [EObject current=null] : iv_ruleXFunctionTypeRef= ruleXFunctionTypeRef EOF ; + public final EObject entryRuleXFunctionTypeRef() throws RecognitionException { + EObject current = null; + + EObject iv_ruleXFunctionTypeRef = null; + + + try { + // InternalStatemachine.g:437:57: (iv_ruleXFunctionTypeRef= ruleXFunctionTypeRef EOF ) + // InternalStatemachine.g:438:2: iv_ruleXFunctionTypeRef= ruleXFunctionTypeRef EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getXFunctionTypeRefRule()); + } + pushFollow(FOLLOW_1); + iv_ruleXFunctionTypeRef=ruleXFunctionTypeRef(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleXFunctionTypeRef; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleXFunctionTypeRef" + + + // $ANTLR start "ruleXFunctionTypeRef" + // InternalStatemachine.g:444:1: ruleXFunctionTypeRef returns [EObject current=null] : ( (otherlv_0= '(' ( ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* )? otherlv_4= ')' )? otherlv_5= '=>' ( (lv_returnType_6_0= ruleJvmTypeReference ) ) ) ; + public final EObject ruleXFunctionTypeRef() throws RecognitionException { + EObject current = null; + + Token otherlv_0=null; + Token otherlv_2=null; + Token otherlv_4=null; + Token otherlv_5=null; + EObject lv_paramTypes_1_0 = null; + + EObject lv_paramTypes_3_0 = null; + + EObject lv_returnType_6_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:450:2: ( ( (otherlv_0= '(' ( ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* )? otherlv_4= ')' )? otherlv_5= '=>' ( (lv_returnType_6_0= ruleJvmTypeReference ) ) ) ) + // InternalStatemachine.g:451:2: ( (otherlv_0= '(' ( ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* )? otherlv_4= ')' )? otherlv_5= '=>' ( (lv_returnType_6_0= ruleJvmTypeReference ) ) ) + { + // InternalStatemachine.g:451:2: ( (otherlv_0= '(' ( ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* )? otherlv_4= ')' )? otherlv_5= '=>' ( (lv_returnType_6_0= ruleJvmTypeReference ) ) ) + // InternalStatemachine.g:452:3: (otherlv_0= '(' ( ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* )? otherlv_4= ')' )? otherlv_5= '=>' ( (lv_returnType_6_0= ruleJvmTypeReference ) ) + { + // InternalStatemachine.g:452:3: (otherlv_0= '(' ( ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* )? otherlv_4= ')' )? + int alt9=2; + int LA9_0 = input.LA(1); + + if ( (LA9_0==18) ) { + alt9=1; + } + switch (alt9) { + case 1 : + // InternalStatemachine.g:453:4: otherlv_0= '(' ( ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* )? otherlv_4= ')' + { + otherlv_0=(Token)match(input,18,FOLLOW_12); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_0, grammarAccess.getXFunctionTypeRefAccess().getLeftParenthesisKeyword_0_0()); + + } + // InternalStatemachine.g:457:4: ( ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* )? + int alt8=2; + int LA8_0 = input.LA(1); + + if ( (LA8_0==RULE_ID||LA8_0==18||LA8_0==20) ) { + alt8=1; + } + switch (alt8) { + case 1 : + // InternalStatemachine.g:458:5: ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* + { + // InternalStatemachine.g:458:5: ( (lv_paramTypes_1_0= ruleJvmTypeReference ) ) + // InternalStatemachine.g:459:6: (lv_paramTypes_1_0= ruleJvmTypeReference ) + { + // InternalStatemachine.g:459:6: (lv_paramTypes_1_0= ruleJvmTypeReference ) + // InternalStatemachine.g:460:7: lv_paramTypes_1_0= ruleJvmTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getXFunctionTypeRefAccess().getParamTypesJvmTypeReferenceParserRuleCall_0_1_0_0()); + + } + pushFollow(FOLLOW_13); + lv_paramTypes_1_0=ruleJvmTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getXFunctionTypeRefRule()); + } + add( + current, + "paramTypes", + lv_paramTypes_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + // InternalStatemachine.g:477:5: (otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) )* + loop7: + do { + int alt7=2; + int LA7_0 = input.LA(1); + + if ( (LA7_0==15) ) { + alt7=1; + } + + + switch (alt7) { + case 1 : + // InternalStatemachine.g:478:6: otherlv_2= ',' ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) + { + otherlv_2=(Token)match(input,15,FOLLOW_14); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_2, grammarAccess.getXFunctionTypeRefAccess().getCommaKeyword_0_1_1_0()); + + } + // InternalStatemachine.g:482:6: ( (lv_paramTypes_3_0= ruleJvmTypeReference ) ) + // InternalStatemachine.g:483:7: (lv_paramTypes_3_0= ruleJvmTypeReference ) + { + // InternalStatemachine.g:483:7: (lv_paramTypes_3_0= ruleJvmTypeReference ) + // InternalStatemachine.g:484:8: lv_paramTypes_3_0= ruleJvmTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getXFunctionTypeRefAccess().getParamTypesJvmTypeReferenceParserRuleCall_0_1_1_1_0()); + + } + pushFollow(FOLLOW_13); + lv_paramTypes_3_0=ruleJvmTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getXFunctionTypeRefRule()); + } + add( + current, + "paramTypes", + lv_paramTypes_3_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + break; + + default : + break loop7; + } + } while (true); + + + } + break; + + } + + otherlv_4=(Token)match(input,19,FOLLOW_15); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_4, grammarAccess.getXFunctionTypeRefAccess().getRightParenthesisKeyword_0_2()); + + } + + } + break; + + } + + otherlv_5=(Token)match(input,20,FOLLOW_14); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_5, grammarAccess.getXFunctionTypeRefAccess().getEqualsSignGreaterThanSignKeyword_1()); + + } + // InternalStatemachine.g:512:3: ( (lv_returnType_6_0= ruleJvmTypeReference ) ) + // InternalStatemachine.g:513:4: (lv_returnType_6_0= ruleJvmTypeReference ) + { + // InternalStatemachine.g:513:4: (lv_returnType_6_0= ruleJvmTypeReference ) + // InternalStatemachine.g:514:5: lv_returnType_6_0= ruleJvmTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getXFunctionTypeRefAccess().getReturnTypeJvmTypeReferenceParserRuleCall_2_0()); + + } + pushFollow(FOLLOW_2); + lv_returnType_6_0=ruleJvmTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getXFunctionTypeRefRule()); + } + set( + current, + "returnType", + lv_returnType_6_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleXFunctionTypeRef" + + + // $ANTLR start "entryRuleJvmParameterizedTypeReference" + // InternalStatemachine.g:535:1: entryRuleJvmParameterizedTypeReference returns [EObject current=null] : iv_ruleJvmParameterizedTypeReference= ruleJvmParameterizedTypeReference EOF ; + public final EObject entryRuleJvmParameterizedTypeReference() throws RecognitionException { + EObject current = null; + + EObject iv_ruleJvmParameterizedTypeReference = null; + + + try { + // InternalStatemachine.g:535:70: (iv_ruleJvmParameterizedTypeReference= ruleJvmParameterizedTypeReference EOF ) + // InternalStatemachine.g:536:2: iv_ruleJvmParameterizedTypeReference= ruleJvmParameterizedTypeReference EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + pushFollow(FOLLOW_1); + iv_ruleJvmParameterizedTypeReference=ruleJvmParameterizedTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleJvmParameterizedTypeReference; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleJvmParameterizedTypeReference" + + + // $ANTLR start "ruleJvmParameterizedTypeReference" + // InternalStatemachine.g:542:1: ruleJvmParameterizedTypeReference returns [EObject current=null] : ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? ) ; + public final EObject ruleJvmParameterizedTypeReference() throws RecognitionException { + EObject current = null; + + Token otherlv_1=null; + Token otherlv_3=null; + Token otherlv_5=null; + Token otherlv_7=null; + Token otherlv_9=null; + Token otherlv_11=null; + Token otherlv_13=null; + EObject lv_arguments_2_0 = null; + + EObject lv_arguments_4_0 = null; + + EObject lv_arguments_10_0 = null; + + EObject lv_arguments_12_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:548:2: ( ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? ) ) + // InternalStatemachine.g:549:2: ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? ) + { + // InternalStatemachine.g:549:2: ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? ) + // InternalStatemachine.g:550:3: ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? + { + // InternalStatemachine.g:550:3: ( ( ruleQualifiedName ) ) + // InternalStatemachine.g:551:4: ( ruleQualifiedName ) + { + // InternalStatemachine.g:551:4: ( ruleQualifiedName ) + // InternalStatemachine.g:552:5: ruleQualifiedName + { + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + + } + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getTypeJvmTypeCrossReference_0_0()); + + } + pushFollow(FOLLOW_16); + ruleQualifiedName(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + afterParserOrEnumRuleCall(); + + } + + } + + + } + + // InternalStatemachine.g:566:3: ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? + int alt14=2; + int LA14_0 = input.LA(1); + + if ( (LA14_0==21) && (synpred2_InternalStatemachine())) { + alt14=1; + } + switch (alt14) { + case 1 : + // InternalStatemachine.g:567:4: ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* + { + // InternalStatemachine.g:567:4: ( ( '<' )=>otherlv_1= '<' ) + // InternalStatemachine.g:568:5: ( '<' )=>otherlv_1= '<' + { + otherlv_1=(Token)match(input,21,FOLLOW_17); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_1, grammarAccess.getJvmParameterizedTypeReferenceAccess().getLessThanSignKeyword_1_0()); + + } + + } + + // InternalStatemachine.g:574:4: ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) + // InternalStatemachine.g:575:5: (lv_arguments_2_0= ruleJvmArgumentTypeReference ) + { + // InternalStatemachine.g:575:5: (lv_arguments_2_0= ruleJvmArgumentTypeReference ) + // InternalStatemachine.g:576:6: lv_arguments_2_0= ruleJvmArgumentTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_1_0()); + + } + pushFollow(FOLLOW_18); + lv_arguments_2_0=ruleJvmArgumentTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + add( + current, + "arguments", + lv_arguments_2_0, + "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + // InternalStatemachine.g:593:4: (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* + loop10: + do { + int alt10=2; + int LA10_0 = input.LA(1); + + if ( (LA10_0==15) ) { + alt10=1; + } + + + switch (alt10) { + case 1 : + // InternalStatemachine.g:594:5: otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) + { + otherlv_3=(Token)match(input,15,FOLLOW_17); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_3, grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_2_0()); + + } + // InternalStatemachine.g:598:5: ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) + // InternalStatemachine.g:599:6: (lv_arguments_4_0= ruleJvmArgumentTypeReference ) + { + // InternalStatemachine.g:599:6: (lv_arguments_4_0= ruleJvmArgumentTypeReference ) + // InternalStatemachine.g:600:7: lv_arguments_4_0= ruleJvmArgumentTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_2_1_0()); + + } + pushFollow(FOLLOW_18); + lv_arguments_4_0=ruleJvmArgumentTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + add( + current, + "arguments", + lv_arguments_4_0, + "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + break; + + default : + break loop10; + } + } while (true); + + otherlv_5=(Token)match(input,22,FOLLOW_19); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_5, grammarAccess.getJvmParameterizedTypeReferenceAccess().getGreaterThanSignKeyword_1_3()); + + } + // InternalStatemachine.g:622:4: ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* + loop13: + do { + int alt13=2; + int LA13_0 = input.LA(1); + + if ( (LA13_0==23) && (synpred3_InternalStatemachine())) { + alt13=1; + } + + + switch (alt13) { + case 1 : + // InternalStatemachine.g:623:5: ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? + { + // InternalStatemachine.g:623:5: ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) + // InternalStatemachine.g:624:6: ( ( () '.' ) )=> ( () otherlv_7= '.' ) + { + // InternalStatemachine.g:630:6: ( () otherlv_7= '.' ) + // InternalStatemachine.g:631:7: () otherlv_7= '.' + { + // InternalStatemachine.g:631:7: () + // InternalStatemachine.g:632:8: + { + if ( state.backtracking==0 ) { + + current = forceCreateModelElementAndSet( + grammarAccess.getJvmParameterizedTypeReferenceAccess().getJvmInnerTypeReferenceOuterAction_1_4_0_0_0(), + current); + + } + + } + + otherlv_7=(Token)match(input,23,FOLLOW_5); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_7, grammarAccess.getJvmParameterizedTypeReferenceAccess().getFullStopKeyword_1_4_0_0_1()); + + } + + } + + + } + + // InternalStatemachine.g:644:5: ( ( ruleValidID ) ) + // InternalStatemachine.g:645:6: ( ruleValidID ) + { + // InternalStatemachine.g:645:6: ( ruleValidID ) + // InternalStatemachine.g:646:7: ruleValidID + { + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + + } + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getTypeJvmTypeCrossReference_1_4_1_0()); + + } + pushFollow(FOLLOW_20); + ruleValidID(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + afterParserOrEnumRuleCall(); + + } + + } + + + } + + // InternalStatemachine.g:660:5: ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? + int alt12=2; + int LA12_0 = input.LA(1); + + if ( (LA12_0==21) && (synpred4_InternalStatemachine())) { + alt12=1; + } + switch (alt12) { + case 1 : + // InternalStatemachine.g:661:6: ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' + { + // InternalStatemachine.g:661:6: ( ( '<' )=>otherlv_9= '<' ) + // InternalStatemachine.g:662:7: ( '<' )=>otherlv_9= '<' + { + otherlv_9=(Token)match(input,21,FOLLOW_17); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_9, grammarAccess.getJvmParameterizedTypeReferenceAccess().getLessThanSignKeyword_1_4_2_0()); + + } + + } + + // InternalStatemachine.g:668:6: ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) + // InternalStatemachine.g:669:7: (lv_arguments_10_0= ruleJvmArgumentTypeReference ) + { + // InternalStatemachine.g:669:7: (lv_arguments_10_0= ruleJvmArgumentTypeReference ) + // InternalStatemachine.g:670:8: lv_arguments_10_0= ruleJvmArgumentTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_1_0()); + + } + pushFollow(FOLLOW_18); + lv_arguments_10_0=ruleJvmArgumentTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + add( + current, + "arguments", + lv_arguments_10_0, + "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + // InternalStatemachine.g:687:6: (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* + loop11: + do { + int alt11=2; + int LA11_0 = input.LA(1); + + if ( (LA11_0==15) ) { + alt11=1; + } + + + switch (alt11) { + case 1 : + // InternalStatemachine.g:688:7: otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) + { + otherlv_11=(Token)match(input,15,FOLLOW_17); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_11, grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_4_2_2_0()); + + } + // InternalStatemachine.g:692:7: ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) + // InternalStatemachine.g:693:8: (lv_arguments_12_0= ruleJvmArgumentTypeReference ) + { + // InternalStatemachine.g:693:8: (lv_arguments_12_0= ruleJvmArgumentTypeReference ) + // InternalStatemachine.g:694:9: lv_arguments_12_0= ruleJvmArgumentTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_2_1_0()); + + } + pushFollow(FOLLOW_18); + lv_arguments_12_0=ruleJvmArgumentTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); + } + add( + current, + "arguments", + lv_arguments_12_0, + "org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + break; + + default : + break loop11; + } + } while (true); + + otherlv_13=(Token)match(input,22,FOLLOW_19); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_13, grammarAccess.getJvmParameterizedTypeReferenceAccess().getGreaterThanSignKeyword_1_4_2_3()); + + } + + } + break; + + } + + + } + break; + + default : + break loop13; + } + } while (true); + + + } + break; + + } + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleJvmParameterizedTypeReference" + + + // $ANTLR start "entryRuleJvmArgumentTypeReference" + // InternalStatemachine.g:723:1: entryRuleJvmArgumentTypeReference returns [EObject current=null] : iv_ruleJvmArgumentTypeReference= ruleJvmArgumentTypeReference EOF ; + public final EObject entryRuleJvmArgumentTypeReference() throws RecognitionException { + EObject current = null; + + EObject iv_ruleJvmArgumentTypeReference = null; + + + try { + // InternalStatemachine.g:723:65: (iv_ruleJvmArgumentTypeReference= ruleJvmArgumentTypeReference EOF ) + // InternalStatemachine.g:724:2: iv_ruleJvmArgumentTypeReference= ruleJvmArgumentTypeReference EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getJvmArgumentTypeReferenceRule()); + } + pushFollow(FOLLOW_1); + iv_ruleJvmArgumentTypeReference=ruleJvmArgumentTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleJvmArgumentTypeReference; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleJvmArgumentTypeReference" + + + // $ANTLR start "ruleJvmArgumentTypeReference" + // InternalStatemachine.g:730:1: ruleJvmArgumentTypeReference returns [EObject current=null] : (this_JvmTypeReference_0= ruleJvmTypeReference | this_JvmWildcardTypeReference_1= ruleJvmWildcardTypeReference ) ; + public final EObject ruleJvmArgumentTypeReference() throws RecognitionException { + EObject current = null; + + EObject this_JvmTypeReference_0 = null; + + EObject this_JvmWildcardTypeReference_1 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:736:2: ( (this_JvmTypeReference_0= ruleJvmTypeReference | this_JvmWildcardTypeReference_1= ruleJvmWildcardTypeReference ) ) + // InternalStatemachine.g:737:2: (this_JvmTypeReference_0= ruleJvmTypeReference | this_JvmWildcardTypeReference_1= ruleJvmWildcardTypeReference ) + { + // InternalStatemachine.g:737:2: (this_JvmTypeReference_0= ruleJvmTypeReference | this_JvmWildcardTypeReference_1= ruleJvmWildcardTypeReference ) + int alt15=2; + int LA15_0 = input.LA(1); + + if ( (LA15_0==RULE_ID||LA15_0==18||LA15_0==20) ) { + alt15=1; + } + else if ( (LA15_0==24) ) { + alt15=2; + } + else { + if (state.backtracking>0) {state.failed=true; return current;} + NoViableAltException nvae = + new NoViableAltException("", 15, 0, input); + + throw nvae; + } + switch (alt15) { + case 1 : + // InternalStatemachine.g:738:3: this_JvmTypeReference_0= ruleJvmTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmArgumentTypeReferenceAccess().getJvmTypeReferenceParserRuleCall_0()); + + } + pushFollow(FOLLOW_2); + this_JvmTypeReference_0=ruleJvmTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + current = this_JvmTypeReference_0; + afterParserOrEnumRuleCall(); + + } + + } + break; + case 2 : + // InternalStatemachine.g:747:3: this_JvmWildcardTypeReference_1= ruleJvmWildcardTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmArgumentTypeReferenceAccess().getJvmWildcardTypeReferenceParserRuleCall_1()); + + } + pushFollow(FOLLOW_2); + this_JvmWildcardTypeReference_1=ruleJvmWildcardTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + current = this_JvmWildcardTypeReference_1; + afterParserOrEnumRuleCall(); + + } + + } + break; + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleJvmArgumentTypeReference" + + + // $ANTLR start "entryRuleJvmWildcardTypeReference" + // InternalStatemachine.g:759:1: entryRuleJvmWildcardTypeReference returns [EObject current=null] : iv_ruleJvmWildcardTypeReference= ruleJvmWildcardTypeReference EOF ; + public final EObject entryRuleJvmWildcardTypeReference() throws RecognitionException { + EObject current = null; + + EObject iv_ruleJvmWildcardTypeReference = null; + + + try { + // InternalStatemachine.g:759:65: (iv_ruleJvmWildcardTypeReference= ruleJvmWildcardTypeReference EOF ) + // InternalStatemachine.g:760:2: iv_ruleJvmWildcardTypeReference= ruleJvmWildcardTypeReference EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceRule()); + } + pushFollow(FOLLOW_1); + iv_ruleJvmWildcardTypeReference=ruleJvmWildcardTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleJvmWildcardTypeReference; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleJvmWildcardTypeReference" + + + // $ANTLR start "ruleJvmWildcardTypeReference" + // InternalStatemachine.g:766:1: ruleJvmWildcardTypeReference returns [EObject current=null] : ( () otherlv_1= '?' ( ( ( (lv_constraints_2_0= ruleJvmUpperBound ) ) ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* ) | ( ( (lv_constraints_4_0= ruleJvmLowerBound ) ) ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* ) )? ) ; + public final EObject ruleJvmWildcardTypeReference() throws RecognitionException { + EObject current = null; + + Token otherlv_1=null; + EObject lv_constraints_2_0 = null; + + EObject lv_constraints_3_0 = null; + + EObject lv_constraints_4_0 = null; + + EObject lv_constraints_5_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:772:2: ( ( () otherlv_1= '?' ( ( ( (lv_constraints_2_0= ruleJvmUpperBound ) ) ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* ) | ( ( (lv_constraints_4_0= ruleJvmLowerBound ) ) ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* ) )? ) ) + // InternalStatemachine.g:773:2: ( () otherlv_1= '?' ( ( ( (lv_constraints_2_0= ruleJvmUpperBound ) ) ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* ) | ( ( (lv_constraints_4_0= ruleJvmLowerBound ) ) ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* ) )? ) + { + // InternalStatemachine.g:773:2: ( () otherlv_1= '?' ( ( ( (lv_constraints_2_0= ruleJvmUpperBound ) ) ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* ) | ( ( (lv_constraints_4_0= ruleJvmLowerBound ) ) ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* ) )? ) + // InternalStatemachine.g:774:3: () otherlv_1= '?' ( ( ( (lv_constraints_2_0= ruleJvmUpperBound ) ) ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* ) | ( ( (lv_constraints_4_0= ruleJvmLowerBound ) ) ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* ) )? + { + // InternalStatemachine.g:774:3: () + // InternalStatemachine.g:775:4: + { + if ( state.backtracking==0 ) { + + current = forceCreateModelElement( + grammarAccess.getJvmWildcardTypeReferenceAccess().getJvmWildcardTypeReferenceAction_0(), + current); + + } + + } + + otherlv_1=(Token)match(input,24,FOLLOW_21); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_1, grammarAccess.getJvmWildcardTypeReferenceAccess().getQuestionMarkKeyword_1()); + + } + // InternalStatemachine.g:785:3: ( ( ( (lv_constraints_2_0= ruleJvmUpperBound ) ) ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* ) | ( ( (lv_constraints_4_0= ruleJvmLowerBound ) ) ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* ) )? + int alt18=3; + int LA18_0 = input.LA(1); + + if ( (LA18_0==25) ) { + alt18=1; + } + else if ( (LA18_0==27) ) { + alt18=2; + } + switch (alt18) { + case 1 : + // InternalStatemachine.g:786:4: ( ( (lv_constraints_2_0= ruleJvmUpperBound ) ) ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* ) + { + // InternalStatemachine.g:786:4: ( ( (lv_constraints_2_0= ruleJvmUpperBound ) ) ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* ) + // InternalStatemachine.g:787:5: ( (lv_constraints_2_0= ruleJvmUpperBound ) ) ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* + { + // InternalStatemachine.g:787:5: ( (lv_constraints_2_0= ruleJvmUpperBound ) ) + // InternalStatemachine.g:788:6: (lv_constraints_2_0= ruleJvmUpperBound ) + { + // InternalStatemachine.g:788:6: (lv_constraints_2_0= ruleJvmUpperBound ) + // InternalStatemachine.g:789:7: lv_constraints_2_0= ruleJvmUpperBound + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundParserRuleCall_2_0_0_0()); + + } + pushFollow(FOLLOW_22); + lv_constraints_2_0=ruleJvmUpperBound(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmWildcardTypeReferenceRule()); + } + add( + current, + "constraints", + lv_constraints_2_0, + "org.eclipse.xtext.xbase.Xtype.JvmUpperBound"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + // InternalStatemachine.g:806:5: ( (lv_constraints_3_0= ruleJvmUpperBoundAnded ) )* + loop16: + do { + int alt16=2; + int LA16_0 = input.LA(1); + + if ( (LA16_0==26) ) { + alt16=1; + } + + + switch (alt16) { + case 1 : + // InternalStatemachine.g:807:6: (lv_constraints_3_0= ruleJvmUpperBoundAnded ) + { + // InternalStatemachine.g:807:6: (lv_constraints_3_0= ruleJvmUpperBoundAnded ) + // InternalStatemachine.g:808:7: lv_constraints_3_0= ruleJvmUpperBoundAnded + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmUpperBoundAndedParserRuleCall_2_0_1_0()); + + } + pushFollow(FOLLOW_22); + lv_constraints_3_0=ruleJvmUpperBoundAnded(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmWildcardTypeReferenceRule()); + } + add( + current, + "constraints", + lv_constraints_3_0, + "org.eclipse.xtext.xbase.Xtype.JvmUpperBoundAnded"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + break; + + default : + break loop16; + } + } while (true); + + + } + + + } + break; + case 2 : + // InternalStatemachine.g:827:4: ( ( (lv_constraints_4_0= ruleJvmLowerBound ) ) ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* ) + { + // InternalStatemachine.g:827:4: ( ( (lv_constraints_4_0= ruleJvmLowerBound ) ) ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* ) + // InternalStatemachine.g:828:5: ( (lv_constraints_4_0= ruleJvmLowerBound ) ) ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* + { + // InternalStatemachine.g:828:5: ( (lv_constraints_4_0= ruleJvmLowerBound ) ) + // InternalStatemachine.g:829:6: (lv_constraints_4_0= ruleJvmLowerBound ) + { + // InternalStatemachine.g:829:6: (lv_constraints_4_0= ruleJvmLowerBound ) + // InternalStatemachine.g:830:7: lv_constraints_4_0= ruleJvmLowerBound + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmLowerBoundParserRuleCall_2_1_0_0()); + + } + pushFollow(FOLLOW_22); + lv_constraints_4_0=ruleJvmLowerBound(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmWildcardTypeReferenceRule()); + } + add( + current, + "constraints", + lv_constraints_4_0, + "org.eclipse.xtext.xbase.Xtype.JvmLowerBound"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + // InternalStatemachine.g:847:5: ( (lv_constraints_5_0= ruleJvmLowerBoundAnded ) )* + loop17: + do { + int alt17=2; + int LA17_0 = input.LA(1); + + if ( (LA17_0==26) ) { + alt17=1; + } + + + switch (alt17) { + case 1 : + // InternalStatemachine.g:848:6: (lv_constraints_5_0= ruleJvmLowerBoundAnded ) + { + // InternalStatemachine.g:848:6: (lv_constraints_5_0= ruleJvmLowerBoundAnded ) + // InternalStatemachine.g:849:7: lv_constraints_5_0= ruleJvmLowerBoundAnded + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmWildcardTypeReferenceAccess().getConstraintsJvmLowerBoundAndedParserRuleCall_2_1_1_0()); + + } + pushFollow(FOLLOW_22); + lv_constraints_5_0=ruleJvmLowerBoundAnded(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmWildcardTypeReferenceRule()); + } + add( + current, + "constraints", + lv_constraints_5_0, + "org.eclipse.xtext.xbase.Xtype.JvmLowerBoundAnded"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + break; + + default : + break loop17; + } + } while (true); + + + } + + + } + break; + + } + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleJvmWildcardTypeReference" + + + // $ANTLR start "entryRuleJvmUpperBound" + // InternalStatemachine.g:872:1: entryRuleJvmUpperBound returns [EObject current=null] : iv_ruleJvmUpperBound= ruleJvmUpperBound EOF ; + public final EObject entryRuleJvmUpperBound() throws RecognitionException { + EObject current = null; + + EObject iv_ruleJvmUpperBound = null; + + + try { + // InternalStatemachine.g:872:54: (iv_ruleJvmUpperBound= ruleJvmUpperBound EOF ) + // InternalStatemachine.g:873:2: iv_ruleJvmUpperBound= ruleJvmUpperBound EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getJvmUpperBoundRule()); + } + pushFollow(FOLLOW_1); + iv_ruleJvmUpperBound=ruleJvmUpperBound(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleJvmUpperBound; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleJvmUpperBound" + + + // $ANTLR start "ruleJvmUpperBound" + // InternalStatemachine.g:879:1: ruleJvmUpperBound returns [EObject current=null] : (otherlv_0= 'extends' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) ; + public final EObject ruleJvmUpperBound() throws RecognitionException { + EObject current = null; + + Token otherlv_0=null; + EObject lv_typeReference_1_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:885:2: ( (otherlv_0= 'extends' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) ) + // InternalStatemachine.g:886:2: (otherlv_0= 'extends' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) + { + // InternalStatemachine.g:886:2: (otherlv_0= 'extends' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) + // InternalStatemachine.g:887:3: otherlv_0= 'extends' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) + { + otherlv_0=(Token)match(input,25,FOLLOW_14); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_0, grammarAccess.getJvmUpperBoundAccess().getExtendsKeyword_0()); + + } + // InternalStatemachine.g:891:3: ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) + // InternalStatemachine.g:892:4: (lv_typeReference_1_0= ruleJvmTypeReference ) + { + // InternalStatemachine.g:892:4: (lv_typeReference_1_0= ruleJvmTypeReference ) + // InternalStatemachine.g:893:5: lv_typeReference_1_0= ruleJvmTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmUpperBoundAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0()); + + } + pushFollow(FOLLOW_2); + lv_typeReference_1_0=ruleJvmTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmUpperBoundRule()); + } + set( + current, + "typeReference", + lv_typeReference_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleJvmUpperBound" + + + // $ANTLR start "entryRuleJvmUpperBoundAnded" + // InternalStatemachine.g:914:1: entryRuleJvmUpperBoundAnded returns [EObject current=null] : iv_ruleJvmUpperBoundAnded= ruleJvmUpperBoundAnded EOF ; + public final EObject entryRuleJvmUpperBoundAnded() throws RecognitionException { + EObject current = null; + + EObject iv_ruleJvmUpperBoundAnded = null; + + + try { + // InternalStatemachine.g:914:59: (iv_ruleJvmUpperBoundAnded= ruleJvmUpperBoundAnded EOF ) + // InternalStatemachine.g:915:2: iv_ruleJvmUpperBoundAnded= ruleJvmUpperBoundAnded EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getJvmUpperBoundAndedRule()); + } + pushFollow(FOLLOW_1); + iv_ruleJvmUpperBoundAnded=ruleJvmUpperBoundAnded(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleJvmUpperBoundAnded; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleJvmUpperBoundAnded" + + + // $ANTLR start "ruleJvmUpperBoundAnded" + // InternalStatemachine.g:921:1: ruleJvmUpperBoundAnded returns [EObject current=null] : (otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) ; + public final EObject ruleJvmUpperBoundAnded() throws RecognitionException { + EObject current = null; + + Token otherlv_0=null; + EObject lv_typeReference_1_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:927:2: ( (otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) ) + // InternalStatemachine.g:928:2: (otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) + { + // InternalStatemachine.g:928:2: (otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) + // InternalStatemachine.g:929:3: otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) + { + otherlv_0=(Token)match(input,26,FOLLOW_14); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_0, grammarAccess.getJvmUpperBoundAndedAccess().getAmpersandKeyword_0()); + + } + // InternalStatemachine.g:933:3: ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) + // InternalStatemachine.g:934:4: (lv_typeReference_1_0= ruleJvmTypeReference ) + { + // InternalStatemachine.g:934:4: (lv_typeReference_1_0= ruleJvmTypeReference ) + // InternalStatemachine.g:935:5: lv_typeReference_1_0= ruleJvmTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmUpperBoundAndedAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0()); + + } + pushFollow(FOLLOW_2); + lv_typeReference_1_0=ruleJvmTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmUpperBoundAndedRule()); + } + set( + current, + "typeReference", + lv_typeReference_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleJvmUpperBoundAnded" + + + // $ANTLR start "entryRuleJvmLowerBound" + // InternalStatemachine.g:956:1: entryRuleJvmLowerBound returns [EObject current=null] : iv_ruleJvmLowerBound= ruleJvmLowerBound EOF ; + public final EObject entryRuleJvmLowerBound() throws RecognitionException { + EObject current = null; + + EObject iv_ruleJvmLowerBound = null; + + + try { + // InternalStatemachine.g:956:54: (iv_ruleJvmLowerBound= ruleJvmLowerBound EOF ) + // InternalStatemachine.g:957:2: iv_ruleJvmLowerBound= ruleJvmLowerBound EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getJvmLowerBoundRule()); + } + pushFollow(FOLLOW_1); + iv_ruleJvmLowerBound=ruleJvmLowerBound(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleJvmLowerBound; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleJvmLowerBound" + + + // $ANTLR start "ruleJvmLowerBound" + // InternalStatemachine.g:963:1: ruleJvmLowerBound returns [EObject current=null] : (otherlv_0= 'super' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) ; + public final EObject ruleJvmLowerBound() throws RecognitionException { + EObject current = null; + + Token otherlv_0=null; + EObject lv_typeReference_1_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:969:2: ( (otherlv_0= 'super' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) ) + // InternalStatemachine.g:970:2: (otherlv_0= 'super' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) + { + // InternalStatemachine.g:970:2: (otherlv_0= 'super' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) + // InternalStatemachine.g:971:3: otherlv_0= 'super' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) + { + otherlv_0=(Token)match(input,27,FOLLOW_14); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_0, grammarAccess.getJvmLowerBoundAccess().getSuperKeyword_0()); + + } + // InternalStatemachine.g:975:3: ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) + // InternalStatemachine.g:976:4: (lv_typeReference_1_0= ruleJvmTypeReference ) + { + // InternalStatemachine.g:976:4: (lv_typeReference_1_0= ruleJvmTypeReference ) + // InternalStatemachine.g:977:5: lv_typeReference_1_0= ruleJvmTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmLowerBoundAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0()); + + } + pushFollow(FOLLOW_2); + lv_typeReference_1_0=ruleJvmTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmLowerBoundRule()); + } + set( + current, + "typeReference", + lv_typeReference_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleJvmLowerBound" + + + // $ANTLR start "entryRuleJvmLowerBoundAnded" + // InternalStatemachine.g:998:1: entryRuleJvmLowerBoundAnded returns [EObject current=null] : iv_ruleJvmLowerBoundAnded= ruleJvmLowerBoundAnded EOF ; + public final EObject entryRuleJvmLowerBoundAnded() throws RecognitionException { + EObject current = null; + + EObject iv_ruleJvmLowerBoundAnded = null; + + + try { + // InternalStatemachine.g:998:59: (iv_ruleJvmLowerBoundAnded= ruleJvmLowerBoundAnded EOF ) + // InternalStatemachine.g:999:2: iv_ruleJvmLowerBoundAnded= ruleJvmLowerBoundAnded EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getJvmLowerBoundAndedRule()); + } + pushFollow(FOLLOW_1); + iv_ruleJvmLowerBoundAnded=ruleJvmLowerBoundAnded(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleJvmLowerBoundAnded; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleJvmLowerBoundAnded" + + + // $ANTLR start "ruleJvmLowerBoundAnded" + // InternalStatemachine.g:1005:1: ruleJvmLowerBoundAnded returns [EObject current=null] : (otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) ; + public final EObject ruleJvmLowerBoundAnded() throws RecognitionException { + EObject current = null; + + Token otherlv_0=null; + EObject lv_typeReference_1_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:1011:2: ( (otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) ) + // InternalStatemachine.g:1012:2: (otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) + { + // InternalStatemachine.g:1012:2: (otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) ) + // InternalStatemachine.g:1013:3: otherlv_0= '&' ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) + { + otherlv_0=(Token)match(input,26,FOLLOW_14); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_0, grammarAccess.getJvmLowerBoundAndedAccess().getAmpersandKeyword_0()); + + } + // InternalStatemachine.g:1017:3: ( (lv_typeReference_1_0= ruleJvmTypeReference ) ) + // InternalStatemachine.g:1018:4: (lv_typeReference_1_0= ruleJvmTypeReference ) + { + // InternalStatemachine.g:1018:4: (lv_typeReference_1_0= ruleJvmTypeReference ) + // InternalStatemachine.g:1019:5: lv_typeReference_1_0= ruleJvmTypeReference + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getJvmLowerBoundAndedAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0()); + + } + pushFollow(FOLLOW_2); + lv_typeReference_1_0=ruleJvmTypeReference(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getJvmLowerBoundAndedRule()); + } + set( + current, + "typeReference", + lv_typeReference_1_0, + "org.eclipse.xtext.xbase.Xtype.JvmTypeReference"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleJvmLowerBoundAnded" + + + // $ANTLR start "entryRuleQualifiedName" + // InternalStatemachine.g:1040:1: entryRuleQualifiedName returns [String current=null] : iv_ruleQualifiedName= ruleQualifiedName EOF ; + public final String entryRuleQualifiedName() throws RecognitionException { + String current = null; + + AntlrDatatypeRuleToken iv_ruleQualifiedName = null; + + + try { + // InternalStatemachine.g:1040:53: (iv_ruleQualifiedName= ruleQualifiedName EOF ) + // InternalStatemachine.g:1041:2: iv_ruleQualifiedName= ruleQualifiedName EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getQualifiedNameRule()); + } + pushFollow(FOLLOW_1); + iv_ruleQualifiedName=ruleQualifiedName(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleQualifiedName.getText(); + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleQualifiedName" + + + // $ANTLR start "ruleQualifiedName" + // InternalStatemachine.g:1047:1: ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ValidID_0= ruleValidID (kw= '.' this_ValidID_2= ruleValidID )* ) ; + public final AntlrDatatypeRuleToken ruleQualifiedName() throws RecognitionException { + AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); + + Token kw=null; + AntlrDatatypeRuleToken this_ValidID_0 = null; + + AntlrDatatypeRuleToken this_ValidID_2 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:1053:2: ( (this_ValidID_0= ruleValidID (kw= '.' this_ValidID_2= ruleValidID )* ) ) + // InternalStatemachine.g:1054:2: (this_ValidID_0= ruleValidID (kw= '.' this_ValidID_2= ruleValidID )* ) + { + // InternalStatemachine.g:1054:2: (this_ValidID_0= ruleValidID (kw= '.' this_ValidID_2= ruleValidID )* ) + // InternalStatemachine.g:1055:3: this_ValidID_0= ruleValidID (kw= '.' this_ValidID_2= ruleValidID )* + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getQualifiedNameAccess().getValidIDParserRuleCall_0()); + + } + pushFollow(FOLLOW_19); + this_ValidID_0=ruleValidID(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(this_ValidID_0); + + } + if ( state.backtracking==0 ) { + + afterParserOrEnumRuleCall(); + + } + // InternalStatemachine.g:1065:3: (kw= '.' this_ValidID_2= ruleValidID )* + loop19: + do { + int alt19=2; + int LA19_0 = input.LA(1); + + if ( (LA19_0==23) ) { + int LA19_2 = input.LA(2); + + if ( (LA19_2==RULE_ID) ) { + alt19=1; + } + + + } + + + switch (alt19) { + case 1 : + // InternalStatemachine.g:1066:4: kw= '.' this_ValidID_2= ruleValidID + { + kw=(Token)match(input,23,FOLLOW_5); if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getFullStopKeyword_1_0()); + + } + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getQualifiedNameAccess().getValidIDParserRuleCall_1_1()); + + } + pushFollow(FOLLOW_19); + this_ValidID_2=ruleValidID(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(this_ValidID_2); + + } + if ( state.backtracking==0 ) { + + afterParserOrEnumRuleCall(); + + } + + } + break; + + default : + break loop19; + } + } while (true); + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleQualifiedName" + + + // $ANTLR start "entryRuleQualifiedNameWithWildcard" + // InternalStatemachine.g:1086:1: entryRuleQualifiedNameWithWildcard returns [String current=null] : iv_ruleQualifiedNameWithWildcard= ruleQualifiedNameWithWildcard EOF ; + public final String entryRuleQualifiedNameWithWildcard() throws RecognitionException { + String current = null; + + AntlrDatatypeRuleToken iv_ruleQualifiedNameWithWildcard = null; + + + try { + // InternalStatemachine.g:1086:65: (iv_ruleQualifiedNameWithWildcard= ruleQualifiedNameWithWildcard EOF ) + // InternalStatemachine.g:1087:2: iv_ruleQualifiedNameWithWildcard= ruleQualifiedNameWithWildcard EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getQualifiedNameWithWildcardRule()); + } + pushFollow(FOLLOW_1); + iv_ruleQualifiedNameWithWildcard=ruleQualifiedNameWithWildcard(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleQualifiedNameWithWildcard.getText(); + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleQualifiedNameWithWildcard" + + + // $ANTLR start "ruleQualifiedNameWithWildcard" + // InternalStatemachine.g:1093:1: ruleQualifiedNameWithWildcard returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_QualifiedName_0= ruleQualifiedName kw= '.' kw= '*' ) ; + public final AntlrDatatypeRuleToken ruleQualifiedNameWithWildcard() throws RecognitionException { + AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); + + Token kw=null; + AntlrDatatypeRuleToken this_QualifiedName_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:1099:2: ( (this_QualifiedName_0= ruleQualifiedName kw= '.' kw= '*' ) ) + // InternalStatemachine.g:1100:2: (this_QualifiedName_0= ruleQualifiedName kw= '.' kw= '*' ) + { + // InternalStatemachine.g:1100:2: (this_QualifiedName_0= ruleQualifiedName kw= '.' kw= '*' ) + // InternalStatemachine.g:1101:3: this_QualifiedName_0= ruleQualifiedName kw= '.' kw= '*' + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getQualifiedNameWithWildcardAccess().getQualifiedNameParserRuleCall_0()); + + } + pushFollow(FOLLOW_23); + this_QualifiedName_0=ruleQualifiedName(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(this_QualifiedName_0); + + } + if ( state.backtracking==0 ) { + + afterParserOrEnumRuleCall(); + + } + kw=(Token)match(input,23,FOLLOW_24); if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameWithWildcardAccess().getFullStopKeyword_1()); + + } + kw=(Token)match(input,28,FOLLOW_2); if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameWithWildcardAccess().getAsteriskKeyword_2()); + + } + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleQualifiedNameWithWildcard" + + + // $ANTLR start "entryRuleValidID" + // InternalStatemachine.g:1125:1: entryRuleValidID returns [String current=null] : iv_ruleValidID= ruleValidID EOF ; + public final String entryRuleValidID() throws RecognitionException { + String current = null; + + AntlrDatatypeRuleToken iv_ruleValidID = null; + + + try { + // InternalStatemachine.g:1125:47: (iv_ruleValidID= ruleValidID EOF ) + // InternalStatemachine.g:1126:2: iv_ruleValidID= ruleValidID EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getValidIDRule()); + } + pushFollow(FOLLOW_1); + iv_ruleValidID=ruleValidID(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleValidID.getText(); + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleValidID" + + + // $ANTLR start "ruleValidID" + // InternalStatemachine.g:1132:1: ruleValidID returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : this_ID_0= RULE_ID ; + public final AntlrDatatypeRuleToken ruleValidID() throws RecognitionException { + AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); + + Token this_ID_0=null; + + + enterRule(); + + try { + // InternalStatemachine.g:1138:2: (this_ID_0= RULE_ID ) + // InternalStatemachine.g:1139:2: this_ID_0= RULE_ID + { + this_ID_0=(Token)match(input,RULE_ID,FOLLOW_2); if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(this_ID_0); + + } + if ( state.backtracking==0 ) { + + newLeafNode(this_ID_0, grammarAccess.getValidIDAccess().getIDTerminalRuleCall()); + + } + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleValidID" + + + // $ANTLR start "entryRuleXImportDeclaration" + // InternalStatemachine.g:1149:1: entryRuleXImportDeclaration returns [EObject current=null] : iv_ruleXImportDeclaration= ruleXImportDeclaration EOF ; + public final EObject entryRuleXImportDeclaration() throws RecognitionException { + EObject current = null; + + EObject iv_ruleXImportDeclaration = null; + + + try { + // InternalStatemachine.g:1149:59: (iv_ruleXImportDeclaration= ruleXImportDeclaration EOF ) + // InternalStatemachine.g:1150:2: iv_ruleXImportDeclaration= ruleXImportDeclaration EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getXImportDeclarationRule()); + } + pushFollow(FOLLOW_1); + iv_ruleXImportDeclaration=ruleXImportDeclaration(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleXImportDeclaration; + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleXImportDeclaration" + + + // $ANTLR start "ruleXImportDeclaration" + // InternalStatemachine.g:1156:1: ruleXImportDeclaration returns [EObject current=null] : (otherlv_0= 'import' ( ( ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) ) | ( ( ruleQualifiedName ) ) | ( (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) ) ) (otherlv_8= ';' )? ) ; + public final EObject ruleXImportDeclaration() throws RecognitionException { + EObject current = null; + + Token otherlv_0=null; + Token lv_static_1_0=null; + Token lv_extension_2_0=null; + Token lv_wildcard_4_0=null; + Token otherlv_8=null; + AntlrDatatypeRuleToken lv_memberName_5_0 = null; + + AntlrDatatypeRuleToken lv_importedNamespace_7_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:1162:2: ( (otherlv_0= 'import' ( ( ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) ) | ( ( ruleQualifiedName ) ) | ( (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) ) ) (otherlv_8= ';' )? ) ) + // InternalStatemachine.g:1163:2: (otherlv_0= 'import' ( ( ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) ) | ( ( ruleQualifiedName ) ) | ( (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) ) ) (otherlv_8= ';' )? ) + { + // InternalStatemachine.g:1163:2: (otherlv_0= 'import' ( ( ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) ) | ( ( ruleQualifiedName ) ) | ( (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) ) ) (otherlv_8= ';' )? ) + // InternalStatemachine.g:1164:3: otherlv_0= 'import' ( ( ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) ) | ( ( ruleQualifiedName ) ) | ( (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) ) ) (otherlv_8= ';' )? + { + otherlv_0=(Token)match(input,29,FOLLOW_25); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_0, grammarAccess.getXImportDeclarationAccess().getImportKeyword_0()); + + } + // InternalStatemachine.g:1168:3: ( ( ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) ) | ( ( ruleQualifiedName ) ) | ( (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) ) ) + int alt22=3; + alt22 = dfa22.predict(input); + switch (alt22) { + case 1 : + // InternalStatemachine.g:1169:4: ( ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) ) + { + // InternalStatemachine.g:1169:4: ( ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) ) + // InternalStatemachine.g:1170:5: ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) + { + // InternalStatemachine.g:1170:5: ( (lv_static_1_0= 'static' ) ) + // InternalStatemachine.g:1171:6: (lv_static_1_0= 'static' ) + { + // InternalStatemachine.g:1171:6: (lv_static_1_0= 'static' ) + // InternalStatemachine.g:1172:7: lv_static_1_0= 'static' + { + lv_static_1_0=(Token)match(input,30,FOLLOW_26); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(lv_static_1_0, grammarAccess.getXImportDeclarationAccess().getStaticStaticKeyword_1_0_0_0()); + + } + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + setWithLastConsumed(current, "static", lv_static_1_0 != null, "static"); + + } + + } + + + } + + // InternalStatemachine.g:1184:5: ( (lv_extension_2_0= 'extension' ) )? + int alt20=2; + int LA20_0 = input.LA(1); + + if ( (LA20_0==31) ) { + alt20=1; + } + switch (alt20) { + case 1 : + // InternalStatemachine.g:1185:6: (lv_extension_2_0= 'extension' ) + { + // InternalStatemachine.g:1185:6: (lv_extension_2_0= 'extension' ) + // InternalStatemachine.g:1186:7: lv_extension_2_0= 'extension' + { + lv_extension_2_0=(Token)match(input,31,FOLLOW_26); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(lv_extension_2_0, grammarAccess.getXImportDeclarationAccess().getExtensionExtensionKeyword_1_0_1_0()); + + } + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + setWithLastConsumed(current, "extension", lv_extension_2_0 != null, "extension"); + + } + + } + + + } + break; + + } + + // InternalStatemachine.g:1198:5: ( ( ruleQualifiedNameInStaticImport ) ) + // InternalStatemachine.g:1199:6: ( ruleQualifiedNameInStaticImport ) + { + // InternalStatemachine.g:1199:6: ( ruleQualifiedNameInStaticImport ) + // InternalStatemachine.g:1200:7: ruleQualifiedNameInStaticImport + { + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + + } + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getXImportDeclarationAccess().getImportedTypeJvmDeclaredTypeCrossReference_1_0_2_0()); + + } + pushFollow(FOLLOW_27); + ruleQualifiedNameInStaticImport(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + afterParserOrEnumRuleCall(); + + } + + } + + + } + + // InternalStatemachine.g:1214:5: ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) + int alt21=2; + int LA21_0 = input.LA(1); + + if ( (LA21_0==28) ) { + alt21=1; + } + else if ( (LA21_0==RULE_ID) ) { + alt21=2; + } + else { + if (state.backtracking>0) {state.failed=true; return current;} + NoViableAltException nvae = + new NoViableAltException("", 21, 0, input); + + throw nvae; + } + switch (alt21) { + case 1 : + // InternalStatemachine.g:1215:6: ( (lv_wildcard_4_0= '*' ) ) + { + // InternalStatemachine.g:1215:6: ( (lv_wildcard_4_0= '*' ) ) + // InternalStatemachine.g:1216:7: (lv_wildcard_4_0= '*' ) + { + // InternalStatemachine.g:1216:7: (lv_wildcard_4_0= '*' ) + // InternalStatemachine.g:1217:8: lv_wildcard_4_0= '*' + { + lv_wildcard_4_0=(Token)match(input,28,FOLLOW_28); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(lv_wildcard_4_0, grammarAccess.getXImportDeclarationAccess().getWildcardAsteriskKeyword_1_0_3_0_0()); + + } + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + setWithLastConsumed(current, "wildcard", lv_wildcard_4_0 != null, "*"); + + } + + } + + + } + + + } + break; + case 2 : + // InternalStatemachine.g:1230:6: ( (lv_memberName_5_0= ruleValidID ) ) + { + // InternalStatemachine.g:1230:6: ( (lv_memberName_5_0= ruleValidID ) ) + // InternalStatemachine.g:1231:7: (lv_memberName_5_0= ruleValidID ) + { + // InternalStatemachine.g:1231:7: (lv_memberName_5_0= ruleValidID ) + // InternalStatemachine.g:1232:8: lv_memberName_5_0= ruleValidID + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getXImportDeclarationAccess().getMemberNameValidIDParserRuleCall_1_0_3_1_0()); + + } + pushFollow(FOLLOW_28); + lv_memberName_5_0=ruleValidID(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getXImportDeclarationRule()); + } + set( + current, + "memberName", + lv_memberName_5_0, + "org.eclipse.xtext.xbase.Xtype.ValidID"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + break; + + } + + + } + + + } + break; + case 2 : + // InternalStatemachine.g:1252:4: ( ( ruleQualifiedName ) ) + { + // InternalStatemachine.g:1252:4: ( ( ruleQualifiedName ) ) + // InternalStatemachine.g:1253:5: ( ruleQualifiedName ) + { + // InternalStatemachine.g:1253:5: ( ruleQualifiedName ) + // InternalStatemachine.g:1254:6: ruleQualifiedName + { + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElement(grammarAccess.getXImportDeclarationRule()); + } + + } + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getXImportDeclarationAccess().getImportedTypeJvmDeclaredTypeCrossReference_1_1_0()); + + } + pushFollow(FOLLOW_28); + ruleQualifiedName(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + break; + case 3 : + // InternalStatemachine.g:1269:4: ( (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) ) + { + // InternalStatemachine.g:1269:4: ( (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) ) + // InternalStatemachine.g:1270:5: (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) + { + // InternalStatemachine.g:1270:5: (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) + // InternalStatemachine.g:1271:6: lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getXImportDeclarationAccess().getImportedNamespaceQualifiedNameWithWildcardParserRuleCall_1_2_0()); + + } + pushFollow(FOLLOW_28); + lv_importedNamespace_7_0=ruleQualifiedNameWithWildcard(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + if (current==null) { + current = createModelElementForParent(grammarAccess.getXImportDeclarationRule()); + } + set( + current, + "importedNamespace", + lv_importedNamespace_7_0, + "org.eclipse.xtext.xbase.Xtype.QualifiedNameWithWildcard"); + afterParserOrEnumRuleCall(); + + } + + } + + + } + + + } + break; + + } + + // InternalStatemachine.g:1289:3: (otherlv_8= ';' )? + int alt23=2; + int LA23_0 = input.LA(1); + + if ( (LA23_0==32) ) { + alt23=1; + } + switch (alt23) { + case 1 : + // InternalStatemachine.g:1290:4: otherlv_8= ';' + { + otherlv_8=(Token)match(input,32,FOLLOW_2); if (state.failed) return current; + if ( state.backtracking==0 ) { + + newLeafNode(otherlv_8, grammarAccess.getXImportDeclarationAccess().getSemicolonKeyword_2()); + + } + + } + break; + + } + + + } + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleXImportDeclaration" + + + // $ANTLR start "entryRuleQualifiedNameInStaticImport" + // InternalStatemachine.g:1299:1: entryRuleQualifiedNameInStaticImport returns [String current=null] : iv_ruleQualifiedNameInStaticImport= ruleQualifiedNameInStaticImport EOF ; + public final String entryRuleQualifiedNameInStaticImport() throws RecognitionException { + String current = null; + + AntlrDatatypeRuleToken iv_ruleQualifiedNameInStaticImport = null; + + + try { + // InternalStatemachine.g:1299:67: (iv_ruleQualifiedNameInStaticImport= ruleQualifiedNameInStaticImport EOF ) + // InternalStatemachine.g:1300:2: iv_ruleQualifiedNameInStaticImport= ruleQualifiedNameInStaticImport EOF + { + if ( state.backtracking==0 ) { + newCompositeNode(grammarAccess.getQualifiedNameInStaticImportRule()); + } + pushFollow(FOLLOW_1); + iv_ruleQualifiedNameInStaticImport=ruleQualifiedNameInStaticImport(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + current =iv_ruleQualifiedNameInStaticImport.getText(); + } + match(input,EOF,FOLLOW_2); if (state.failed) return current; + + } + + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "entryRuleQualifiedNameInStaticImport" + + + // $ANTLR start "ruleQualifiedNameInStaticImport" + // InternalStatemachine.g:1306:1: ruleQualifiedNameInStaticImport returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ValidID_0= ruleValidID kw= '.' )+ ; + public final AntlrDatatypeRuleToken ruleQualifiedNameInStaticImport() throws RecognitionException { + AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); + + Token kw=null; + AntlrDatatypeRuleToken this_ValidID_0 = null; + + + + enterRule(); + + try { + // InternalStatemachine.g:1312:2: ( (this_ValidID_0= ruleValidID kw= '.' )+ ) + // InternalStatemachine.g:1313:2: (this_ValidID_0= ruleValidID kw= '.' )+ + { + // InternalStatemachine.g:1313:2: (this_ValidID_0= ruleValidID kw= '.' )+ + int cnt24=0; + loop24: + do { + int alt24=2; + int LA24_0 = input.LA(1); + + if ( (LA24_0==RULE_ID) ) { + int LA24_2 = input.LA(2); + + if ( (LA24_2==23) ) { + alt24=1; + } + + + } + + + switch (alt24) { + case 1 : + // InternalStatemachine.g:1314:3: this_ValidID_0= ruleValidID kw= '.' + { + if ( state.backtracking==0 ) { + + newCompositeNode(grammarAccess.getQualifiedNameInStaticImportAccess().getValidIDParserRuleCall_0()); + + } + pushFollow(FOLLOW_23); + this_ValidID_0=ruleValidID(); + + state._fsp--; + if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(this_ValidID_0); + + } + if ( state.backtracking==0 ) { + + afterParserOrEnumRuleCall(); + + } + kw=(Token)match(input,23,FOLLOW_29); if (state.failed) return current; + if ( state.backtracking==0 ) { + + current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameInStaticImportAccess().getFullStopKeyword_1()); + + } + + } + break; + + default : + if ( cnt24 >= 1 ) break loop24; + if (state.backtracking>0) {state.failed=true; return current;} + EarlyExitException eee = + new EarlyExitException(24, input); + throw eee; + } + cnt24++; + } while (true); + + + } + + if ( state.backtracking==0 ) { + + leaveRule(); + + } + } + + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } + finally { + } + return current; + } + // $ANTLR end "ruleQualifiedNameInStaticImport" + + // $ANTLR start synpred1_InternalStatemachine + public final void synpred1_InternalStatemachine_fragment() throws RecognitionException { + // InternalStatemachine.g:371:5: ( ( () ruleArrayBrackets ) ) + // InternalStatemachine.g:371:6: ( () ruleArrayBrackets ) + { + // InternalStatemachine.g:371:6: ( () ruleArrayBrackets ) + // InternalStatemachine.g:372:6: () ruleArrayBrackets + { + // InternalStatemachine.g:372:6: () + // InternalStatemachine.g:373:6: + { + } + + pushFollow(FOLLOW_2); + ruleArrayBrackets(); + + state._fsp--; + if (state.failed) return ; + + } + + + } + } + // $ANTLR end synpred1_InternalStatemachine + + // $ANTLR start synpred2_InternalStatemachine + public final void synpred2_InternalStatemachine_fragment() throws RecognitionException { + // InternalStatemachine.g:568:5: ( '<' ) + // InternalStatemachine.g:568:6: '<' + { + match(input,21,FOLLOW_2); if (state.failed) return ; + + } + } + // $ANTLR end synpred2_InternalStatemachine + + // $ANTLR start synpred3_InternalStatemachine + public final void synpred3_InternalStatemachine_fragment() throws RecognitionException { + // InternalStatemachine.g:624:6: ( ( () '.' ) ) + // InternalStatemachine.g:624:7: ( () '.' ) + { + // InternalStatemachine.g:624:7: ( () '.' ) + // InternalStatemachine.g:625:7: () '.' + { + // InternalStatemachine.g:625:7: () + // InternalStatemachine.g:626:7: + { + } + + match(input,23,FOLLOW_2); if (state.failed) return ; + + } + + + } + } + // $ANTLR end synpred3_InternalStatemachine + + // $ANTLR start synpred4_InternalStatemachine + public final void synpred4_InternalStatemachine_fragment() throws RecognitionException { + // InternalStatemachine.g:662:7: ( '<' ) + // InternalStatemachine.g:662:8: '<' + { + match(input,21,FOLLOW_2); if (state.failed) return ; + + } + } + // $ANTLR end synpred4_InternalStatemachine + + // Delegated rules + + public final boolean synpred4_InternalStatemachine() { + state.backtracking++; + int start = input.mark(); + try { + synpred4_InternalStatemachine_fragment(); // can never throw exception + } catch (RecognitionException re) { + System.err.println("impossible: "+re); + } + boolean success = !state.failed; + input.rewind(start); + state.backtracking--; + state.failed=false; + return success; + } + public final boolean synpred2_InternalStatemachine() { + state.backtracking++; + int start = input.mark(); + try { + synpred2_InternalStatemachine_fragment(); // can never throw exception + } catch (RecognitionException re) { + System.err.println("impossible: "+re); + } + boolean success = !state.failed; + input.rewind(start); + state.backtracking--; + state.failed=false; + return success; + } + public final boolean synpred3_InternalStatemachine() { + state.backtracking++; + int start = input.mark(); + try { + synpred3_InternalStatemachine_fragment(); // can never throw exception + } catch (RecognitionException re) { + System.err.println("impossible: "+re); + } + boolean success = !state.failed; + input.rewind(start); + state.backtracking--; + state.failed=false; + return success; + } + public final boolean synpred1_InternalStatemachine() { + state.backtracking++; + int start = input.mark(); + try { + synpred1_InternalStatemachine_fragment(); // can never throw exception + } catch (RecognitionException re) { + System.err.println("impossible: "+re); + } + boolean success = !state.failed; + input.rewind(start); + state.backtracking--; + state.failed=false; + return success; + } + + + protected DFA22 dfa22 = new DFA22(this); + static final String dfa_1s = "\7\uffff"; + static final String dfa_2s = "\2\uffff\1\4\2\uffff\1\4\1\uffff"; + static final String dfa_3s = "\1\4\1\uffff\1\27\1\4\1\uffff\1\27\1\uffff"; + static final String dfa_4s = "\1\36\1\uffff\1\40\1\34\1\uffff\1\40\1\uffff"; + static final String dfa_5s = "\1\uffff\1\1\2\uffff\1\2\1\uffff\1\3"; + static final String dfa_6s = "\7\uffff}>"; + static final String[] dfa_7s = { + "\1\2\31\uffff\1\1", + "", + "\1\3\10\uffff\1\4", + "\1\5\27\uffff\1\6", + "", + "\1\3\10\uffff\1\4", + "" + }; + + static final short[] dfa_1 = DFA.unpackEncodedString(dfa_1s); + static final short[] dfa_2 = DFA.unpackEncodedString(dfa_2s); + static final char[] dfa_3 = DFA.unpackEncodedStringToUnsignedChars(dfa_3s); + static final char[] dfa_4 = DFA.unpackEncodedStringToUnsignedChars(dfa_4s); + static final short[] dfa_5 = DFA.unpackEncodedString(dfa_5s); + static final short[] dfa_6 = DFA.unpackEncodedString(dfa_6s); + static final short[][] dfa_7 = unpackEncodedStringArray(dfa_7s); + + class DFA22 extends DFA { + + public DFA22(BaseRecognizer recognizer) { + this.recognizer = recognizer; + this.decisionNumber = 22; + this.eot = dfa_1; + this.eof = dfa_2; + this.min = dfa_3; + this.max = dfa_4; + this.accept = dfa_5; + this.special = dfa_6; + this.transition = dfa_7; + } + public String getDescription() { + return "1168:3: ( ( ( (lv_static_1_0= 'static' ) ) ( (lv_extension_2_0= 'extension' ) )? ( ( ruleQualifiedNameInStaticImport ) ) ( ( (lv_wildcard_4_0= '*' ) ) | ( (lv_memberName_5_0= ruleValidID ) ) ) ) | ( ( ruleQualifiedName ) ) | ( (lv_importedNamespace_7_0= ruleQualifiedNameWithWildcard ) ) )"; + } + } + + + public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L}); + public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000000000004402L}); + public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000004002L}); + public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000000010L}); + public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000001800L}); + public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000000006000L}); + public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000008000L}); + public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x0000000000002000L}); + public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000000000010002L}); + public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x0000000000020000L}); + public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x00000000001C0010L}); + public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x0000000000088000L}); + public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x0000000000140010L}); + public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000100000L}); + public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000000000200002L}); + public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x0000000001140010L}); + public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000000408000L}); + public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000000800002L}); + public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x0000000000A00002L}); + public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x000000000A000002L}); + public static final BitSet FOLLOW_22 = new BitSet(new long[]{0x0000000004000002L}); + public static final BitSet FOLLOW_23 = new BitSet(new long[]{0x0000000000800000L}); + public static final BitSet FOLLOW_24 = new BitSet(new long[]{0x0000000010000000L}); + public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x0000000040000010L}); + public static final BitSet FOLLOW_26 = new BitSet(new long[]{0x0000000080000010L}); + public static final BitSet FOLLOW_27 = new BitSet(new long[]{0x0000000010000010L}); + public static final BitSet FOLLOW_28 = new BitSet(new long[]{0x0000000100000002L}); + public static final BitSet FOLLOW_29 = new BitSet(new long[]{0x0000000000000012L}); + +} \ No newline at end of file diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/scoping/AbstractStatemachineScopeProvider.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/scoping/AbstractStatemachineScopeProvider.java new file mode 100644 index 000000000..6f22991fd --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/scoping/AbstractStatemachineScopeProvider.java @@ -0,0 +1,9 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.scoping; + +import org.eclipse.xtext.xbase.scoping.XtypeScopeProvider; + +public abstract class AbstractStatemachineScopeProvider extends XtypeScopeProvider { +} diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/serializer/StatemachineSemanticSequencer.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/serializer/StatemachineSemanticSequencer.java new file mode 100644 index 000000000..d42705d7d --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/serializer/StatemachineSemanticSequencer.java @@ -0,0 +1,196 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.serializer; + +import com.google.inject.Inject; +import de.cognicrypt.order.editor.services.StatemachineGrammarAccess; +import de.cognicrypt.order.editor.statemachine.Event; +import de.cognicrypt.order.editor.statemachine.State; +import de.cognicrypt.order.editor.statemachine.Statemachine; +import de.cognicrypt.order.editor.statemachine.StatemachinePackage; +import de.cognicrypt.order.editor.statemachine.Transition; +import java.util.Set; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.xtext.Action; +import org.eclipse.xtext.Parameter; +import org.eclipse.xtext.ParserRule; +import org.eclipse.xtext.common.types.JvmGenericArrayTypeReference; +import org.eclipse.xtext.common.types.JvmInnerTypeReference; +import org.eclipse.xtext.common.types.JvmLowerBound; +import org.eclipse.xtext.common.types.JvmParameterizedTypeReference; +import org.eclipse.xtext.common.types.JvmTypeParameter; +import org.eclipse.xtext.common.types.JvmUpperBound; +import org.eclipse.xtext.common.types.JvmWildcardTypeReference; +import org.eclipse.xtext.common.types.TypesPackage; +import org.eclipse.xtext.serializer.ISerializationContext; +import org.eclipse.xtext.serializer.acceptor.SequenceFeeder; +import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient; +import org.eclipse.xtext.xbase.serializer.XtypeSemanticSequencer; +import org.eclipse.xtext.xtype.XFunctionTypeRef; +import org.eclipse.xtext.xtype.XImportDeclaration; +import org.eclipse.xtext.xtype.XImportSection; +import org.eclipse.xtext.xtype.XtypePackage; + +@SuppressWarnings("all") +public class StatemachineSemanticSequencer extends XtypeSemanticSequencer { + + @Inject + private StatemachineGrammarAccess grammarAccess; + + @Override + public void sequence(ISerializationContext context, EObject semanticObject) { + EPackage epackage = semanticObject.eClass().getEPackage(); + ParserRule rule = context.getParserRule(); + Action action = context.getAssignedAction(); + Set parameters = context.getEnabledBooleanParameters(); + if (epackage == StatemachinePackage.eINSTANCE) + switch (semanticObject.eClass().getClassifierID()) { + case StatemachinePackage.EVENT: + sequence_Event(context, (Event) semanticObject); + return; + case StatemachinePackage.STATE: + sequence_State(context, (State) semanticObject); + return; + case StatemachinePackage.STATEMACHINE: + sequence_Statemachine(context, (Statemachine) semanticObject); + return; + case StatemachinePackage.TRANSITION: + sequence_Transition(context, (Transition) semanticObject); + return; + } + else if (epackage == TypesPackage.eINSTANCE) + switch (semanticObject.eClass().getClassifierID()) { + case TypesPackage.JVM_GENERIC_ARRAY_TYPE_REFERENCE: + sequence_JvmTypeReference(context, (JvmGenericArrayTypeReference) semanticObject); + return; + case TypesPackage.JVM_INNER_TYPE_REFERENCE: + sequence_JvmParameterizedTypeReference(context, (JvmInnerTypeReference) semanticObject); + return; + case TypesPackage.JVM_LOWER_BOUND: + if (rule == grammarAccess.getJvmLowerBoundAndedRule()) { + sequence_JvmLowerBoundAnded(context, (JvmLowerBound) semanticObject); + return; + } + else if (rule == grammarAccess.getJvmLowerBoundRule()) { + sequence_JvmLowerBound(context, (JvmLowerBound) semanticObject); + return; + } + else break; + case TypesPackage.JVM_PARAMETERIZED_TYPE_REFERENCE: + if (action == grammarAccess.getJvmParameterizedTypeReferenceAccess().getJvmInnerTypeReferenceOuterAction_1_4_0_0_0()) { + sequence_JvmParameterizedTypeReference_JvmInnerTypeReference_1_4_0_0_0(context, (JvmParameterizedTypeReference) semanticObject); + return; + } + else if (rule == grammarAccess.getJvmTypeReferenceRule() + || action == grammarAccess.getJvmTypeReferenceAccess().getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0() + || rule == grammarAccess.getJvmParameterizedTypeReferenceRule() + || rule == grammarAccess.getJvmArgumentTypeReferenceRule()) { + sequence_JvmParameterizedTypeReference(context, (JvmParameterizedTypeReference) semanticObject); + return; + } + else break; + case TypesPackage.JVM_TYPE_PARAMETER: + sequence_JvmTypeParameter(context, (JvmTypeParameter) semanticObject); + return; + case TypesPackage.JVM_UPPER_BOUND: + if (rule == grammarAccess.getJvmUpperBoundAndedRule()) { + sequence_JvmUpperBoundAnded(context, (JvmUpperBound) semanticObject); + return; + } + else if (rule == grammarAccess.getJvmUpperBoundRule()) { + sequence_JvmUpperBound(context, (JvmUpperBound) semanticObject); + return; + } + else break; + case TypesPackage.JVM_WILDCARD_TYPE_REFERENCE: + sequence_JvmWildcardTypeReference(context, (JvmWildcardTypeReference) semanticObject); + return; + } + else if (epackage == XtypePackage.eINSTANCE) + switch (semanticObject.eClass().getClassifierID()) { + case XtypePackage.XFUNCTION_TYPE_REF: + sequence_XFunctionTypeRef(context, (XFunctionTypeRef) semanticObject); + return; + case XtypePackage.XIMPORT_DECLARATION: + sequence_XImportDeclaration(context, (XImportDeclaration) semanticObject); + return; + case XtypePackage.XIMPORT_SECTION: + sequence_XImportSection(context, (XImportSection) semanticObject); + return; + } + if (errorAcceptor != null) + errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context)); + } + + /** + * Contexts: + * Event returns Event + * + * Constraint: + * name=ID + */ + protected void sequence_Event(ISerializationContext context, Event semanticObject) { + if (errorAcceptor != null) { + if (transientValues.isValueTransient(semanticObject, StatemachinePackage.Literals.EVENT__NAME) == ValueTransient.YES) + errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, StatemachinePackage.Literals.EVENT__NAME)); + } + SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); + feeder.accept(grammarAccess.getEventAccess().getNameIDTerminalRuleCall_0(), semanticObject.getName()); + feeder.finish(); + } + + + /** + * Contexts: + * State returns State + * + * Constraint: + * (name=ID isFinal?='true'? transitions+=Transition*) + */ + protected void sequence_State(ISerializationContext context, State semanticObject) { + genericSequencer.createSequence(context, semanticObject); + } + + + /** + * Contexts: + * Statemachine returns Statemachine + * + * Constraint: + * (states+=State* transitions+=Transition*) + */ + protected void sequence_Statemachine(ISerializationContext context, Statemachine semanticObject) { + genericSequencer.createSequence(context, semanticObject); + } + + + /** + * Contexts: + * Transition returns Transition + * + * Constraint: + * (name=ID fromState=[State|ID] event=Event endState=[State|ID]) + */ + protected void sequence_Transition(ISerializationContext context, Transition semanticObject) { + if (errorAcceptor != null) { + if (transientValues.isValueTransient(semanticObject, StatemachinePackage.Literals.TRANSITION__NAME) == ValueTransient.YES) + errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, StatemachinePackage.Literals.TRANSITION__NAME)); + if (transientValues.isValueTransient(semanticObject, StatemachinePackage.Literals.TRANSITION__FROM_STATE) == ValueTransient.YES) + errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, StatemachinePackage.Literals.TRANSITION__FROM_STATE)); + if (transientValues.isValueTransient(semanticObject, StatemachinePackage.Literals.TRANSITION__EVENT) == ValueTransient.YES) + errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, StatemachinePackage.Literals.TRANSITION__EVENT)); + if (transientValues.isValueTransient(semanticObject, StatemachinePackage.Literals.TRANSITION__END_STATE) == ValueTransient.YES) + errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, StatemachinePackage.Literals.TRANSITION__END_STATE)); + } + SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); + feeder.accept(grammarAccess.getTransitionAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName()); + feeder.accept(grammarAccess.getTransitionAccess().getFromStateStateIDTerminalRuleCall_2_0_1(), semanticObject.eGet(StatemachinePackage.Literals.TRANSITION__FROM_STATE, false)); + feeder.accept(grammarAccess.getTransitionAccess().getEventEventParserRuleCall_4_0(), semanticObject.getEvent()); + feeder.accept(grammarAccess.getTransitionAccess().getEndStateStateIDTerminalRuleCall_6_0_1(), semanticObject.eGet(StatemachinePackage.Literals.TRANSITION__END_STATE, false)); + feeder.finish(); + } + + +} diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/serializer/StatemachineSyntacticSequencer.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/serializer/StatemachineSyntacticSequencer.java new file mode 100644 index 000000000..6ca9529a3 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/serializer/StatemachineSyntacticSequencer.java @@ -0,0 +1,91 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.serializer; + +import com.google.inject.Inject; +import de.cognicrypt.order.editor.services.StatemachineGrammarAccess; +import java.util.List; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.xtext.IGrammarAccess; +import org.eclipse.xtext.RuleCall; +import org.eclipse.xtext.nodemodel.INode; +import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias; +import org.eclipse.xtext.serializer.analysis.GrammarAlias.GroupAlias; +import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias; +import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable; +import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition; +import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer; + +@SuppressWarnings("all") +public class StatemachineSyntacticSequencer extends AbstractSyntacticSequencer { + + protected StatemachineGrammarAccess grammarAccess; + protected AbstractElementAlias match_XFunctionTypeRef___LeftParenthesisKeyword_0_0_RightParenthesisKeyword_0_2__q; + protected AbstractElementAlias match_XImportDeclaration_SemicolonKeyword_2_q; + + @Inject + protected void init(IGrammarAccess access) { + grammarAccess = (StatemachineGrammarAccess) access; + match_XFunctionTypeRef___LeftParenthesisKeyword_0_0_RightParenthesisKeyword_0_2__q = new GroupAlias(false, true, new TokenAlias(false, false, grammarAccess.getXFunctionTypeRefAccess().getLeftParenthesisKeyword_0_0()), new TokenAlias(false, false, grammarAccess.getXFunctionTypeRefAccess().getRightParenthesisKeyword_0_2())); + match_XImportDeclaration_SemicolonKeyword_2_q = new TokenAlias(false, true, grammarAccess.getXImportDeclarationAccess().getSemicolonKeyword_2()); + } + + @Override + protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) { + if (ruleCall.getRule() == grammarAccess.getArrayBracketsRule()) + return getArrayBracketsToken(semanticObject, ruleCall, node); + return ""; + } + + /** + * ArrayBrackets : + * '[' ']' + * ; + */ + protected String getArrayBracketsToken(EObject semanticObject, RuleCall ruleCall, INode node) { + if (node != null) + return getTokenText(node); + return "[ ]"; + } + + @Override + protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) { + if (transition.getAmbiguousSyntaxes().isEmpty()) return; + List transitionNodes = collectNodes(fromNode, toNode); + for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) { + List syntaxNodes = getNodesFor(transitionNodes, syntax); + if (match_XFunctionTypeRef___LeftParenthesisKeyword_0_0_RightParenthesisKeyword_0_2__q.equals(syntax)) + emit_XFunctionTypeRef___LeftParenthesisKeyword_0_0_RightParenthesisKeyword_0_2__q(semanticObject, getLastNavigableState(), syntaxNodes); + else if (match_XImportDeclaration_SemicolonKeyword_2_q.equals(syntax)) + emit_XImportDeclaration_SemicolonKeyword_2_q(semanticObject, getLastNavigableState(), syntaxNodes); + else acceptNodes(getLastNavigableState(), syntaxNodes); + } + } + + /** + * Ambiguous syntax: + * ('(' ')')? + * + * This ambiguous syntax occurs at: + * (rule start) (ambiguity) '=>' returnType=JvmTypeReference + */ + protected void emit_XFunctionTypeRef___LeftParenthesisKeyword_0_0_RightParenthesisKeyword_0_2__q(EObject semanticObject, ISynNavigable transition, List nodes) { + acceptNodes(transition, nodes); + } + + /** + * Ambiguous syntax: + * ';'? + * + * This ambiguous syntax occurs at: + * importedNamespace=QualifiedNameWithWildcard (ambiguity) (rule end) + * importedType=[JvmDeclaredType|QualifiedName] (ambiguity) (rule end) + * memberName=ValidID (ambiguity) (rule end) + * wildcard?='*' (ambiguity) (rule end) + */ + protected void emit_XImportDeclaration_SemicolonKeyword_2_q(EObject semanticObject, ISynNavigable transition, List nodes) { + acceptNodes(transition, nodes); + } + +} diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/services/StatemachineGrammarAccess.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/services/StatemachineGrammarAccess.java new file mode 100644 index 000000000..95ff74e49 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/services/StatemachineGrammarAccess.java @@ -0,0 +1,522 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.services; + +import com.google.inject.Inject; +import com.google.inject.Singleton; +import java.util.List; +import org.eclipse.xtext.Action; +import org.eclipse.xtext.Alternatives; +import org.eclipse.xtext.Assignment; +import org.eclipse.xtext.CrossReference; +import org.eclipse.xtext.Grammar; +import org.eclipse.xtext.GrammarUtil; +import org.eclipse.xtext.Group; +import org.eclipse.xtext.Keyword; +import org.eclipse.xtext.ParserRule; +import org.eclipse.xtext.RuleCall; +import org.eclipse.xtext.TerminalRule; +import org.eclipse.xtext.service.AbstractElementFinder; +import org.eclipse.xtext.service.GrammarProvider; +import org.eclipse.xtext.xbase.services.XtypeGrammarAccess; + +@Singleton +public class StatemachineGrammarAccess extends AbstractElementFinder.AbstractGrammarElementFinder { + + public class StatemachineElements extends AbstractParserRuleElementFinder { + private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "de.cognicrypt.order.editor.Statemachine.Statemachine"); + private final Group cGroup = (Group)rule.eContents().get(1); + private final Action cStatemachineAction_0 = (Action)cGroup.eContents().get(0); + private final Assignment cStatesAssignment_1 = (Assignment)cGroup.eContents().get(1); + private final RuleCall cStatesStateParserRuleCall_1_0 = (RuleCall)cStatesAssignment_1.eContents().get(0); + private final Assignment cTransitionsAssignment_2 = (Assignment)cGroup.eContents().get(2); + private final RuleCall cTransitionsTransitionParserRuleCall_2_0 = (RuleCall)cTransitionsAssignment_2.eContents().get(0); + + //Statemachine : + // {Statemachine} + // states+=State* + // transitions+=Transition* + //; + @Override public ParserRule getRule() { return rule; } + + //{Statemachine} + //states+=State* + //transitions+=Transition* + public Group getGroup() { return cGroup; } + + //{Statemachine} + public Action getStatemachineAction_0() { return cStatemachineAction_0; } + + //states+=State* + public Assignment getStatesAssignment_1() { return cStatesAssignment_1; } + + //State + public RuleCall getStatesStateParserRuleCall_1_0() { return cStatesStateParserRuleCall_1_0; } + + //transitions+=Transition* + public Assignment getTransitionsAssignment_2() { return cTransitionsAssignment_2; } + + //Transition + public RuleCall getTransitionsTransitionParserRuleCall_2_0() { return cTransitionsTransitionParserRuleCall_2_0; } + } + public class StateElements extends AbstractParserRuleElementFinder { + private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "de.cognicrypt.order.editor.Statemachine.State"); + private final Group cGroup = (Group)rule.eContents().get(1); + private final Keyword cStateKeyword_0 = (Keyword)cGroup.eContents().get(0); + private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); + private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); + private final Alternatives cAlternatives_2 = (Alternatives)cGroup.eContents().get(2); + private final Assignment cIsFinalAssignment_2_0 = (Assignment)cAlternatives_2.eContents().get(0); + private final Keyword cIsFinalTrueKeyword_2_0_0 = (Keyword)cIsFinalAssignment_2_0.eContents().get(0); + private final Keyword cFalseKeyword_2_1 = (Keyword)cAlternatives_2.eContents().get(1); + private final Assignment cTransitionsAssignment_3 = (Assignment)cGroup.eContents().get(3); + private final RuleCall cTransitionsTransitionParserRuleCall_3_0 = (RuleCall)cTransitionsAssignment_3.eContents().get(0); + private final Keyword cEndKeyword_4 = (Keyword)cGroup.eContents().get(4); + + //State: + // 'state' name=ID (isFinal?='true'|'false') + // transitions+=Transition* + // 'end' + //; + @Override public ParserRule getRule() { return rule; } + + //'state' name=ID (isFinal?='true'|'false') + // transitions+=Transition* + //'end' + public Group getGroup() { return cGroup; } + + //'state' + public Keyword getStateKeyword_0() { return cStateKeyword_0; } + + //name=ID + public Assignment getNameAssignment_1() { return cNameAssignment_1; } + + //ID + public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } + + //(isFinal?='true'|'false') + public Alternatives getAlternatives_2() { return cAlternatives_2; } + + //isFinal?='true' + public Assignment getIsFinalAssignment_2_0() { return cIsFinalAssignment_2_0; } + + //'true' + public Keyword getIsFinalTrueKeyword_2_0_0() { return cIsFinalTrueKeyword_2_0_0; } + + //'false' + public Keyword getFalseKeyword_2_1() { return cFalseKeyword_2_1; } + + //transitions+=Transition* + public Assignment getTransitionsAssignment_3() { return cTransitionsAssignment_3; } + + //Transition + public RuleCall getTransitionsTransitionParserRuleCall_3_0() { return cTransitionsTransitionParserRuleCall_3_0; } + + //'end' + public Keyword getEndKeyword_4() { return cEndKeyword_4; } + } + public class TransitionElements extends AbstractParserRuleElementFinder { + private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "de.cognicrypt.order.editor.Statemachine.Transition"); + private final Group cGroup = (Group)rule.eContents().get(1); + private final Keyword cTransitionKeyword_0 = (Keyword)cGroup.eContents().get(0); + private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); + private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); + private final Assignment cFromStateAssignment_2 = (Assignment)cGroup.eContents().get(2); + private final CrossReference cFromStateStateCrossReference_2_0 = (CrossReference)cFromStateAssignment_2.eContents().get(0); + private final RuleCall cFromStateStateIDTerminalRuleCall_2_0_1 = (RuleCall)cFromStateStateCrossReference_2_0.eContents().get(1); + private final Keyword cCommaKeyword_3 = (Keyword)cGroup.eContents().get(3); + private final Assignment cEventAssignment_4 = (Assignment)cGroup.eContents().get(4); + private final RuleCall cEventEventParserRuleCall_4_0 = (RuleCall)cEventAssignment_4.eContents().get(0); + private final Keyword cCommaKeyword_5 = (Keyword)cGroup.eContents().get(5); + private final Assignment cEndStateAssignment_6 = (Assignment)cGroup.eContents().get(6); + private final CrossReference cEndStateStateCrossReference_6_0 = (CrossReference)cEndStateAssignment_6.eContents().get(0); + private final RuleCall cEndStateStateIDTerminalRuleCall_6_0_1 = (RuleCall)cEndStateStateCrossReference_6_0.eContents().get(1); + private final Keyword cEndKeyword_7 = (Keyword)cGroup.eContents().get(7); + + //Transition: + // 'transition' name=ID + // fromState=[State] ',' event=Event ',' endState=[State] + // 'end' + //; + @Override public ParserRule getRule() { return rule; } + + //'transition' name=ID + //fromState=[State] ',' event=Event ',' endState=[State] + //'end' + public Group getGroup() { return cGroup; } + + //'transition' + public Keyword getTransitionKeyword_0() { return cTransitionKeyword_0; } + + //name=ID + public Assignment getNameAssignment_1() { return cNameAssignment_1; } + + //ID + public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } + + //fromState=[State] + public Assignment getFromStateAssignment_2() { return cFromStateAssignment_2; } + + //[State] + public CrossReference getFromStateStateCrossReference_2_0() { return cFromStateStateCrossReference_2_0; } + + //ID + public RuleCall getFromStateStateIDTerminalRuleCall_2_0_1() { return cFromStateStateIDTerminalRuleCall_2_0_1; } + + //',' + public Keyword getCommaKeyword_3() { return cCommaKeyword_3; } + + //event=Event + public Assignment getEventAssignment_4() { return cEventAssignment_4; } + + //Event + public RuleCall getEventEventParserRuleCall_4_0() { return cEventEventParserRuleCall_4_0; } + + //',' + public Keyword getCommaKeyword_5() { return cCommaKeyword_5; } + + //endState=[State] + public Assignment getEndStateAssignment_6() { return cEndStateAssignment_6; } + + //[State] + public CrossReference getEndStateStateCrossReference_6_0() { return cEndStateStateCrossReference_6_0; } + + //ID + public RuleCall getEndStateStateIDTerminalRuleCall_6_0_1() { return cEndStateStateIDTerminalRuleCall_6_0_1; } + + //'end' + public Keyword getEndKeyword_7() { return cEndKeyword_7; } + } + public class EventElements extends AbstractParserRuleElementFinder { + private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "de.cognicrypt.order.editor.Statemachine.Event"); + private final Assignment cNameAssignment = (Assignment)rule.eContents().get(1); + private final RuleCall cNameIDTerminalRuleCall_0 = (RuleCall)cNameAssignment.eContents().get(0); + + //Event: + // name=ID + //; + @Override public ParserRule getRule() { return rule; } + + //name=ID + public Assignment getNameAssignment() { return cNameAssignment; } + + //ID + public RuleCall getNameIDTerminalRuleCall_0() { return cNameIDTerminalRuleCall_0; } + } + + + private final StatemachineElements pStatemachine; + private final StateElements pState; + private final TransitionElements pTransition; + private final EventElements pEvent; + + private final Grammar grammar; + + private final XtypeGrammarAccess gaXtype; + + @Inject + public StatemachineGrammarAccess(GrammarProvider grammarProvider, + XtypeGrammarAccess gaXtype) { + this.grammar = internalFindGrammar(grammarProvider); + this.gaXtype = gaXtype; + this.pStatemachine = new StatemachineElements(); + this.pState = new StateElements(); + this.pTransition = new TransitionElements(); + this.pEvent = new EventElements(); + } + + protected Grammar internalFindGrammar(GrammarProvider grammarProvider) { + Grammar grammar = grammarProvider.getGrammar(this); + while (grammar != null) { + if ("de.cognicrypt.order.editor.Statemachine".equals(grammar.getName())) { + return grammar; + } + List grammars = grammar.getUsedGrammars(); + if (!grammars.isEmpty()) { + grammar = grammars.iterator().next(); + } else { + return null; + } + } + return grammar; + } + + @Override + public Grammar getGrammar() { + return grammar; + } + + + public XtypeGrammarAccess getXtypeGrammarAccess() { + return gaXtype; + } + + + //Statemachine : + // {Statemachine} + // states+=State* + // transitions+=Transition* + //; + public StatemachineElements getStatemachineAccess() { + return pStatemachine; + } + + public ParserRule getStatemachineRule() { + return getStatemachineAccess().getRule(); + } + + //State: + // 'state' name=ID (isFinal?='true'|'false') + // transitions+=Transition* + // 'end' + //; + public StateElements getStateAccess() { + return pState; + } + + public ParserRule getStateRule() { + return getStateAccess().getRule(); + } + + //Transition: + // 'transition' name=ID + // fromState=[State] ',' event=Event ',' endState=[State] + // 'end' + //; + public TransitionElements getTransitionAccess() { + return pTransition; + } + + public ParserRule getTransitionRule() { + return getTransitionAccess().getRule(); + } + + //Event: + // name=ID + //; + public EventElements getEventAccess() { + return pEvent; + } + + public ParserRule getEventRule() { + return getEventAccess().getRule(); + } + + //JvmTypeReference: + // JvmParameterizedTypeReference =>({JvmGenericArrayTypeReference.componentType=current} ArrayBrackets)* + // | XFunctionTypeRef; + public XtypeGrammarAccess.JvmTypeReferenceElements getJvmTypeReferenceAccess() { + return gaXtype.getJvmTypeReferenceAccess(); + } + + public ParserRule getJvmTypeReferenceRule() { + return getJvmTypeReferenceAccess().getRule(); + } + + //ArrayBrackets : + // '[' ']' + //; + public XtypeGrammarAccess.ArrayBracketsElements getArrayBracketsAccess() { + return gaXtype.getArrayBracketsAccess(); + } + + public ParserRule getArrayBracketsRule() { + return getArrayBracketsAccess().getRule(); + } + + //XFunctionTypeRef: + // ('(' (paramTypes+=JvmTypeReference (',' paramTypes+=JvmTypeReference)*)? ')')? '=>' returnType=JvmTypeReference; + public XtypeGrammarAccess.XFunctionTypeRefElements getXFunctionTypeRefAccess() { + return gaXtype.getXFunctionTypeRefAccess(); + } + + public ParserRule getXFunctionTypeRefRule() { + return getXFunctionTypeRefAccess().getRule(); + } + + //JvmParameterizedTypeReference: + // type=[JvmType|QualifiedName] ( + // =>'<' arguments+=JvmArgumentTypeReference (',' arguments+=JvmArgumentTypeReference)* '>' + // (=>({JvmInnerTypeReference.outer=current} '.') type=[JvmType|ValidID] (=>'<' arguments+=JvmArgumentTypeReference (',' arguments+=JvmArgumentTypeReference)* '>')?)* + // )?; + public XtypeGrammarAccess.JvmParameterizedTypeReferenceElements getJvmParameterizedTypeReferenceAccess() { + return gaXtype.getJvmParameterizedTypeReferenceAccess(); + } + + public ParserRule getJvmParameterizedTypeReferenceRule() { + return getJvmParameterizedTypeReferenceAccess().getRule(); + } + + //JvmArgumentTypeReference returns JvmTypeReference: + // JvmTypeReference | JvmWildcardTypeReference; + public XtypeGrammarAccess.JvmArgumentTypeReferenceElements getJvmArgumentTypeReferenceAccess() { + return gaXtype.getJvmArgumentTypeReferenceAccess(); + } + + public ParserRule getJvmArgumentTypeReferenceRule() { + return getJvmArgumentTypeReferenceAccess().getRule(); + } + + //JvmWildcardTypeReference: + // {JvmWildcardTypeReference} '?' ( + // constraints+=JvmUpperBound (constraints+=JvmUpperBoundAnded)* + // | constraints+=JvmLowerBound (constraints+=JvmLowerBoundAnded)* + // )?; + public XtypeGrammarAccess.JvmWildcardTypeReferenceElements getJvmWildcardTypeReferenceAccess() { + return gaXtype.getJvmWildcardTypeReferenceAccess(); + } + + public ParserRule getJvmWildcardTypeReferenceRule() { + return getJvmWildcardTypeReferenceAccess().getRule(); + } + + //JvmUpperBound : + // 'extends' typeReference=JvmTypeReference; + public XtypeGrammarAccess.JvmUpperBoundElements getJvmUpperBoundAccess() { + return gaXtype.getJvmUpperBoundAccess(); + } + + public ParserRule getJvmUpperBoundRule() { + return getJvmUpperBoundAccess().getRule(); + } + + //JvmUpperBoundAnded returns JvmUpperBound: + // '&' typeReference=JvmTypeReference; + public XtypeGrammarAccess.JvmUpperBoundAndedElements getJvmUpperBoundAndedAccess() { + return gaXtype.getJvmUpperBoundAndedAccess(); + } + + public ParserRule getJvmUpperBoundAndedRule() { + return getJvmUpperBoundAndedAccess().getRule(); + } + + //JvmLowerBound : + // 'super' typeReference=JvmTypeReference; + public XtypeGrammarAccess.JvmLowerBoundElements getJvmLowerBoundAccess() { + return gaXtype.getJvmLowerBoundAccess(); + } + + public ParserRule getJvmLowerBoundRule() { + return getJvmLowerBoundAccess().getRule(); + } + + //JvmLowerBoundAnded returns JvmLowerBound: + // '&' typeReference=JvmTypeReference; + public XtypeGrammarAccess.JvmLowerBoundAndedElements getJvmLowerBoundAndedAccess() { + return gaXtype.getJvmLowerBoundAndedAccess(); + } + + public ParserRule getJvmLowerBoundAndedRule() { + return getJvmLowerBoundAndedAccess().getRule(); + } + + //JvmTypeParameter : + // name=ValidID + // (constraints+=JvmUpperBound (constraints+=JvmUpperBoundAnded)*)?; + public XtypeGrammarAccess.JvmTypeParameterElements getJvmTypeParameterAccess() { + return gaXtype.getJvmTypeParameterAccess(); + } + + public ParserRule getJvmTypeParameterRule() { + return getJvmTypeParameterAccess().getRule(); + } + + //QualifiedName: + // ValidID ('.' ValidID)*; + public XtypeGrammarAccess.QualifiedNameElements getQualifiedNameAccess() { + return gaXtype.getQualifiedNameAccess(); + } + + public ParserRule getQualifiedNameRule() { + return getQualifiedNameAccess().getRule(); + } + + //QualifiedNameWithWildcard : + // QualifiedName '.' '*'; + public XtypeGrammarAccess.QualifiedNameWithWildcardElements getQualifiedNameWithWildcardAccess() { + return gaXtype.getQualifiedNameWithWildcardAccess(); + } + + public ParserRule getQualifiedNameWithWildcardRule() { + return getQualifiedNameWithWildcardAccess().getRule(); + } + + //ValidID: + // ID; + public XtypeGrammarAccess.ValidIDElements getValidIDAccess() { + return gaXtype.getValidIDAccess(); + } + + public ParserRule getValidIDRule() { + return getValidIDAccess().getRule(); + } + + //XImportSection: + // importDeclarations+=XImportDeclaration+; + public XtypeGrammarAccess.XImportSectionElements getXImportSectionAccess() { + return gaXtype.getXImportSectionAccess(); + } + + public ParserRule getXImportSectionRule() { + return getXImportSectionAccess().getRule(); + } + + //XImportDeclaration: + // 'import' ( + // (static?='static' extension?='extension'? importedType=[JvmDeclaredType|QualifiedNameInStaticImport] (wildcard?='*' | memberName=ValidID)) + // | importedType=[JvmDeclaredType|QualifiedName] + // | importedNamespace=QualifiedNameWithWildcard) ';'? + //; + public XtypeGrammarAccess.XImportDeclarationElements getXImportDeclarationAccess() { + return gaXtype.getXImportDeclarationAccess(); + } + + public ParserRule getXImportDeclarationRule() { + return getXImportDeclarationAccess().getRule(); + } + + //QualifiedNameInStaticImport: + // (ValidID '.')+ + //; + public XtypeGrammarAccess.QualifiedNameInStaticImportElements getQualifiedNameInStaticImportAccess() { + return gaXtype.getQualifiedNameInStaticImportAccess(); + } + + public ParserRule getQualifiedNameInStaticImportRule() { + return getQualifiedNameInStaticImportAccess().getRule(); + } + + //terminal ID: + // '^'? ('a'..'z'|'A'..'Z'|'$'|'_') ('a'..'z'|'A'..'Z'|'$'|'_'|'0'..'9')*; + public TerminalRule getIDRule() { + return gaXtype.getIDRule(); + } + + //terminal STRING: + // '"' ( '\\' . /* ('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\') */ | !('\\'|'"') )* '"'? | + // "'" ( '\\' . /* ('b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\') */ | !('\\'|"'") )* "'"?; + public TerminalRule getSTRINGRule() { + return gaXtype.getSTRINGRule(); + } + + //terminal ML_COMMENT: '/*' -> '*/'; + public TerminalRule getML_COMMENTRule() { + return gaXtype.getML_COMMENTRule(); + } + + //terminal SL_COMMENT: '//' !('\n'|'\r')* ('\r'? '\n')?; + public TerminalRule getSL_COMMENTRule() { + return gaXtype.getSL_COMMENTRule(); + } + + //terminal WS: (' '|'\t'|'\r'|'\n')+; + public TerminalRule getWSRule() { + return gaXtype.getWSRule(); + } + + //terminal ANY_OTHER: .; + public TerminalRule getANY_OTHERRule() { + return gaXtype.getANY_OTHERRule(); + } +} diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/Event.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/Event.java new file mode 100644 index 000000000..20d3d1333 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/Event.java @@ -0,0 +1,48 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Event'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link de.cognicrypt.order.editor.statemachine.Event#getName Name}
  • + *
+ * + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getEvent() + * @model + * @generated + */ +public interface Event extends EObject +{ + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getEvent_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link de.cognicrypt.order.editor.statemachine.Event#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // Event diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/State.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/State.java new file mode 100644 index 000000000..2b21a6075 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/State.java @@ -0,0 +1,86 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'State'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link de.cognicrypt.order.editor.statemachine.State#getName Name}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.State#isIsFinal Is Final}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.State#getTransitions Transitions}
  • + *
+ * + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getState() + * @model + * @generated + */ +public interface State extends EObject +{ + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getState_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link de.cognicrypt.order.editor.statemachine.State#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Is Final' attribute. + * + * + * @return the value of the 'Is Final' attribute. + * @see #setIsFinal(boolean) + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getState_IsFinal() + * @model + * @generated + */ + boolean isIsFinal(); + + /** + * Sets the value of the '{@link de.cognicrypt.order.editor.statemachine.State#isIsFinal Is Final}' attribute. + * + * + * @param value the new value of the 'Is Final' attribute. + * @see #isIsFinal() + * @generated + */ + void setIsFinal(boolean value); + + /** + * Returns the value of the 'Transitions' containment reference list. + * The list contents are of type {@link de.cognicrypt.order.editor.statemachine.Transition}. + * + * + * @return the value of the 'Transitions' containment reference list. + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getState_Transitions() + * @model containment="true" + * @generated + */ + EList getTransitions(); + +} // State diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/Statemachine.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/Statemachine.java new file mode 100644 index 000000000..07168ed69 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/Statemachine.java @@ -0,0 +1,53 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Statemachine'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link de.cognicrypt.order.editor.statemachine.Statemachine#getStates States}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.Statemachine#getTransitions Transitions}
  • + *
+ * + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getStatemachine() + * @model + * @generated + */ +public interface Statemachine extends EObject +{ + /** + * Returns the value of the 'States' containment reference list. + * The list contents are of type {@link de.cognicrypt.order.editor.statemachine.State}. + * + * + * @return the value of the 'States' containment reference list. + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getStatemachine_States() + * @model containment="true" + * @generated + */ + EList getStates(); + + /** + * Returns the value of the 'Transitions' containment reference list. + * The list contents are of type {@link de.cognicrypt.order.editor.statemachine.Transition}. + * + * + * @return the value of the 'Transitions' containment reference list. + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getStatemachine_Transitions() + * @model containment="true" + * @generated + */ + EList getTransitions(); + +} // Statemachine diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/StatemachineFactory.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/StatemachineFactory.java new file mode 100644 index 000000000..2025afe5c --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/StatemachineFactory.java @@ -0,0 +1,71 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage + * @generated + */ +public interface StatemachineFactory extends EFactory +{ + /** + * The singleton instance of the factory. + * + * + * @generated + */ + StatemachineFactory eINSTANCE = de.cognicrypt.order.editor.statemachine.impl.StatemachineFactoryImpl.init(); + + /** + * Returns a new object of class 'Statemachine'. + * + * + * @return a new object of class 'Statemachine'. + * @generated + */ + Statemachine createStatemachine(); + + /** + * Returns a new object of class 'State'. + * + * + * @return a new object of class 'State'. + * @generated + */ + State createState(); + + /** + * Returns a new object of class 'Transition'. + * + * + * @return a new object of class 'Transition'. + * @generated + */ + Transition createTransition(); + + /** + * Returns a new object of class 'Event'. + * + * + * @return a new object of class 'Event'. + * @generated + */ + Event createEvent(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + StatemachinePackage getStatemachinePackage(); + +} //StatemachineFactory diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/StatemachinePackage.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/StatemachinePackage.java new file mode 100644 index 000000000..936ac269f --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/StatemachinePackage.java @@ -0,0 +1,522 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see de.cognicrypt.order.editor.statemachine.StatemachineFactory + * @model kind="package" + * @generated + */ +public interface StatemachinePackage extends EPackage +{ + /** + * The package name. + * + * + * @generated + */ + String eNAME = "statemachine"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.cognicrypt.de/order/editor/Statemachine"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "statemachine"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + StatemachinePackage eINSTANCE = de.cognicrypt.order.editor.statemachine.impl.StatemachinePackageImpl.init(); + + /** + * The meta object id for the '{@link de.cognicrypt.order.editor.statemachine.impl.StatemachineImpl Statemachine}' class. + * + * + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachineImpl + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachinePackageImpl#getStatemachine() + * @generated + */ + int STATEMACHINE = 0; + + /** + * The feature id for the 'States' containment reference list. + * + * + * @generated + * @ordered + */ + int STATEMACHINE__STATES = 0; + + /** + * The feature id for the 'Transitions' containment reference list. + * + * + * @generated + * @ordered + */ + int STATEMACHINE__TRANSITIONS = 1; + + /** + * The number of structural features of the 'Statemachine' class. + * + * + * @generated + * @ordered + */ + int STATEMACHINE_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link de.cognicrypt.order.editor.statemachine.impl.StateImpl State}' class. + * + * + * @see de.cognicrypt.order.editor.statemachine.impl.StateImpl + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachinePackageImpl#getState() + * @generated + */ + int STATE = 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int STATE__NAME = 0; + + /** + * The feature id for the 'Is Final' attribute. + * + * + * @generated + * @ordered + */ + int STATE__IS_FINAL = 1; + + /** + * The feature id for the 'Transitions' containment reference list. + * + * + * @generated + * @ordered + */ + int STATE__TRANSITIONS = 2; + + /** + * The number of structural features of the 'State' class. + * + * + * @generated + * @ordered + */ + int STATE_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link de.cognicrypt.order.editor.statemachine.impl.TransitionImpl Transition}' class. + * + * + * @see de.cognicrypt.order.editor.statemachine.impl.TransitionImpl + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachinePackageImpl#getTransition() + * @generated + */ + int TRANSITION = 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int TRANSITION__NAME = 0; + + /** + * The feature id for the 'From State' reference. + * + * + * @generated + * @ordered + */ + int TRANSITION__FROM_STATE = 1; + + /** + * The feature id for the 'Event' containment reference. + * + * + * @generated + * @ordered + */ + int TRANSITION__EVENT = 2; + + /** + * The feature id for the 'End State' reference. + * + * + * @generated + * @ordered + */ + int TRANSITION__END_STATE = 3; + + /** + * The number of structural features of the 'Transition' class. + * + * + * @generated + * @ordered + */ + int TRANSITION_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link de.cognicrypt.order.editor.statemachine.impl.EventImpl Event}' class. + * + * + * @see de.cognicrypt.order.editor.statemachine.impl.EventImpl + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachinePackageImpl#getEvent() + * @generated + */ + int EVENT = 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int EVENT__NAME = 0; + + /** + * The number of structural features of the 'Event' class. + * + * + * @generated + * @ordered + */ + int EVENT_FEATURE_COUNT = 1; + + + /** + * Returns the meta object for class '{@link de.cognicrypt.order.editor.statemachine.Statemachine Statemachine}'. + * + * + * @return the meta object for class 'Statemachine'. + * @see de.cognicrypt.order.editor.statemachine.Statemachine + * @generated + */ + EClass getStatemachine(); + + /** + * Returns the meta object for the containment reference list '{@link de.cognicrypt.order.editor.statemachine.Statemachine#getStates States}'. + * + * + * @return the meta object for the containment reference list 'States'. + * @see de.cognicrypt.order.editor.statemachine.Statemachine#getStates() + * @see #getStatemachine() + * @generated + */ + EReference getStatemachine_States(); + + /** + * Returns the meta object for the containment reference list '{@link de.cognicrypt.order.editor.statemachine.Statemachine#getTransitions Transitions}'. + * + * + * @return the meta object for the containment reference list 'Transitions'. + * @see de.cognicrypt.order.editor.statemachine.Statemachine#getTransitions() + * @see #getStatemachine() + * @generated + */ + EReference getStatemachine_Transitions(); + + /** + * Returns the meta object for class '{@link de.cognicrypt.order.editor.statemachine.State State}'. + * + * + * @return the meta object for class 'State'. + * @see de.cognicrypt.order.editor.statemachine.State + * @generated + */ + EClass getState(); + + /** + * Returns the meta object for the attribute '{@link de.cognicrypt.order.editor.statemachine.State#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see de.cognicrypt.order.editor.statemachine.State#getName() + * @see #getState() + * @generated + */ + EAttribute getState_Name(); + + /** + * Returns the meta object for the attribute '{@link de.cognicrypt.order.editor.statemachine.State#isIsFinal Is Final}'. + * + * + * @return the meta object for the attribute 'Is Final'. + * @see de.cognicrypt.order.editor.statemachine.State#isIsFinal() + * @see #getState() + * @generated + */ + EAttribute getState_IsFinal(); + + /** + * Returns the meta object for the containment reference list '{@link de.cognicrypt.order.editor.statemachine.State#getTransitions Transitions}'. + * + * + * @return the meta object for the containment reference list 'Transitions'. + * @see de.cognicrypt.order.editor.statemachine.State#getTransitions() + * @see #getState() + * @generated + */ + EReference getState_Transitions(); + + /** + * Returns the meta object for class '{@link de.cognicrypt.order.editor.statemachine.Transition Transition}'. + * + * + * @return the meta object for class 'Transition'. + * @see de.cognicrypt.order.editor.statemachine.Transition + * @generated + */ + EClass getTransition(); + + /** + * Returns the meta object for the attribute '{@link de.cognicrypt.order.editor.statemachine.Transition#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see de.cognicrypt.order.editor.statemachine.Transition#getName() + * @see #getTransition() + * @generated + */ + EAttribute getTransition_Name(); + + /** + * Returns the meta object for the reference '{@link de.cognicrypt.order.editor.statemachine.Transition#getFromState From State}'. + * + * + * @return the meta object for the reference 'From State'. + * @see de.cognicrypt.order.editor.statemachine.Transition#getFromState() + * @see #getTransition() + * @generated + */ + EReference getTransition_FromState(); + + /** + * Returns the meta object for the containment reference '{@link de.cognicrypt.order.editor.statemachine.Transition#getEvent Event}'. + * + * + * @return the meta object for the containment reference 'Event'. + * @see de.cognicrypt.order.editor.statemachine.Transition#getEvent() + * @see #getTransition() + * @generated + */ + EReference getTransition_Event(); + + /** + * Returns the meta object for the reference '{@link de.cognicrypt.order.editor.statemachine.Transition#getEndState End State}'. + * + * + * @return the meta object for the reference 'End State'. + * @see de.cognicrypt.order.editor.statemachine.Transition#getEndState() + * @see #getTransition() + * @generated + */ + EReference getTransition_EndState(); + + /** + * Returns the meta object for class '{@link de.cognicrypt.order.editor.statemachine.Event Event}'. + * + * + * @return the meta object for class 'Event'. + * @see de.cognicrypt.order.editor.statemachine.Event + * @generated + */ + EClass getEvent(); + + /** + * Returns the meta object for the attribute '{@link de.cognicrypt.order.editor.statemachine.Event#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see de.cognicrypt.order.editor.statemachine.Event#getName() + * @see #getEvent() + * @generated + */ + EAttribute getEvent_Name(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + StatemachineFactory getStatemachineFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals + { + /** + * The meta object literal for the '{@link de.cognicrypt.order.editor.statemachine.impl.StatemachineImpl Statemachine}' class. + * + * + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachineImpl + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachinePackageImpl#getStatemachine() + * @generated + */ + EClass STATEMACHINE = eINSTANCE.getStatemachine(); + + /** + * The meta object literal for the 'States' containment reference list feature. + * + * + * @generated + */ + EReference STATEMACHINE__STATES = eINSTANCE.getStatemachine_States(); + + /** + * The meta object literal for the 'Transitions' containment reference list feature. + * + * + * @generated + */ + EReference STATEMACHINE__TRANSITIONS = eINSTANCE.getStatemachine_Transitions(); + + /** + * The meta object literal for the '{@link de.cognicrypt.order.editor.statemachine.impl.StateImpl State}' class. + * + * + * @see de.cognicrypt.order.editor.statemachine.impl.StateImpl + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachinePackageImpl#getState() + * @generated + */ + EClass STATE = eINSTANCE.getState(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute STATE__NAME = eINSTANCE.getState_Name(); + + /** + * The meta object literal for the 'Is Final' attribute feature. + * + * + * @generated + */ + EAttribute STATE__IS_FINAL = eINSTANCE.getState_IsFinal(); + + /** + * The meta object literal for the 'Transitions' containment reference list feature. + * + * + * @generated + */ + EReference STATE__TRANSITIONS = eINSTANCE.getState_Transitions(); + + /** + * The meta object literal for the '{@link de.cognicrypt.order.editor.statemachine.impl.TransitionImpl Transition}' class. + * + * + * @see de.cognicrypt.order.editor.statemachine.impl.TransitionImpl + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachinePackageImpl#getTransition() + * @generated + */ + EClass TRANSITION = eINSTANCE.getTransition(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute TRANSITION__NAME = eINSTANCE.getTransition_Name(); + + /** + * The meta object literal for the 'From State' reference feature. + * + * + * @generated + */ + EReference TRANSITION__FROM_STATE = eINSTANCE.getTransition_FromState(); + + /** + * The meta object literal for the 'Event' containment reference feature. + * + * + * @generated + */ + EReference TRANSITION__EVENT = eINSTANCE.getTransition_Event(); + + /** + * The meta object literal for the 'End State' reference feature. + * + * + * @generated + */ + EReference TRANSITION__END_STATE = eINSTANCE.getTransition_EndState(); + + /** + * The meta object literal for the '{@link de.cognicrypt.order.editor.statemachine.impl.EventImpl Event}' class. + * + * + * @see de.cognicrypt.order.editor.statemachine.impl.EventImpl + * @see de.cognicrypt.order.editor.statemachine.impl.StatemachinePackageImpl#getEvent() + * @generated + */ + EClass EVENT = eINSTANCE.getEvent(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute EVENT__NAME = eINSTANCE.getEvent_Name(); + + } + +} //StatemachinePackage diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/Transition.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/Transition.java new file mode 100644 index 000000000..dad6fe78c --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/Transition.java @@ -0,0 +1,117 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Transition'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link de.cognicrypt.order.editor.statemachine.Transition#getName Name}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.Transition#getFromState From State}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.Transition#getEvent Event}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.Transition#getEndState End State}
  • + *
+ * + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getTransition() + * @model + * @generated + */ +public interface Transition extends EObject +{ + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getTransition_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link de.cognicrypt.order.editor.statemachine.Transition#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'From State' reference. + * + * + * @return the value of the 'From State' reference. + * @see #setFromState(State) + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getTransition_FromState() + * @model + * @generated + */ + State getFromState(); + + /** + * Sets the value of the '{@link de.cognicrypt.order.editor.statemachine.Transition#getFromState From State}' reference. + * + * + * @param value the new value of the 'From State' reference. + * @see #getFromState() + * @generated + */ + void setFromState(State value); + + /** + * Returns the value of the 'Event' containment reference. + * + * + * @return the value of the 'Event' containment reference. + * @see #setEvent(Event) + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getTransition_Event() + * @model containment="true" + * @generated + */ + Event getEvent(); + + /** + * Sets the value of the '{@link de.cognicrypt.order.editor.statemachine.Transition#getEvent Event}' containment reference. + * + * + * @param value the new value of the 'Event' containment reference. + * @see #getEvent() + * @generated + */ + void setEvent(Event value); + + /** + * Returns the value of the 'End State' reference. + * + * + * @return the value of the 'End State' reference. + * @see #setEndState(State) + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#getTransition_EndState() + * @model + * @generated + */ + State getEndState(); + + /** + * Sets the value of the '{@link de.cognicrypt.order.editor.statemachine.Transition#getEndState End State}' reference. + * + * + * @param value the new value of the 'End State' reference. + * @see #getEndState() + * @generated + */ + void setEndState(State value); + +} // Transition diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/EventImpl.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/EventImpl.java new file mode 100644 index 000000000..3ce6e3f40 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/EventImpl.java @@ -0,0 +1,180 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine.impl; + +import de.cognicrypt.order.editor.statemachine.Event; +import de.cognicrypt.order.editor.statemachine.StatemachinePackage; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Event'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.EventImpl#getName Name}
  • + *
+ * + * @generated + */ +public class EventImpl extends MinimalEObjectImpl.Container implements Event +{ + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * + * + * @generated + */ + protected EventImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return StatemachinePackage.Literals.EVENT; + } + + /** + * + * + * @generated + */ + @Override + public String getName() + { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) + { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, StatemachinePackage.EVENT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case StatemachinePackage.EVENT__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case StatemachinePackage.EVENT__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case StatemachinePackage.EVENT__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case StatemachinePackage.EVENT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //EventImpl diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StateImpl.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StateImpl.java new file mode 100644 index 000000000..01f123572 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StateImpl.java @@ -0,0 +1,302 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine.impl; + +import de.cognicrypt.order.editor.statemachine.State; +import de.cognicrypt.order.editor.statemachine.StatemachinePackage; +import de.cognicrypt.order.editor.statemachine.Transition; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'State'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.StateImpl#getName Name}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.StateImpl#isIsFinal Is Final}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.StateImpl#getTransitions Transitions}
  • + *
+ * + * @generated + */ +public class StateImpl extends MinimalEObjectImpl.Container implements State +{ + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #isIsFinal() Is Final}' attribute. + * + * + * @see #isIsFinal() + * @generated + * @ordered + */ + protected static final boolean IS_FINAL_EDEFAULT = false; + + /** + * The cached value of the '{@link #isIsFinal() Is Final}' attribute. + * + * + * @see #isIsFinal() + * @generated + * @ordered + */ + protected boolean isFinal = IS_FINAL_EDEFAULT; + + /** + * The cached value of the '{@link #getTransitions() Transitions}' containment reference list. + * + * + * @see #getTransitions() + * @generated + * @ordered + */ + protected EList transitions; + + /** + * + * + * @generated + */ + protected StateImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return StatemachinePackage.Literals.STATE; + } + + /** + * + * + * @generated + */ + @Override + public String getName() + { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) + { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, StatemachinePackage.STATE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isIsFinal() + { + return isFinal; + } + + /** + * + * + * @generated + */ + @Override + public void setIsFinal(boolean newIsFinal) + { + boolean oldIsFinal = isFinal; + isFinal = newIsFinal; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, StatemachinePackage.STATE__IS_FINAL, oldIsFinal, isFinal)); + } + + /** + * + * + * @generated + */ + @Override + public EList getTransitions() + { + if (transitions == null) + { + transitions = new EObjectContainmentEList(Transition.class, this, StatemachinePackage.STATE__TRANSITIONS); + } + return transitions; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case StatemachinePackage.STATE__TRANSITIONS: + return ((InternalEList)getTransitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case StatemachinePackage.STATE__NAME: + return getName(); + case StatemachinePackage.STATE__IS_FINAL: + return isIsFinal(); + case StatemachinePackage.STATE__TRANSITIONS: + return getTransitions(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case StatemachinePackage.STATE__NAME: + setName((String)newValue); + return; + case StatemachinePackage.STATE__IS_FINAL: + setIsFinal((Boolean)newValue); + return; + case StatemachinePackage.STATE__TRANSITIONS: + getTransitions().clear(); + getTransitions().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case StatemachinePackage.STATE__NAME: + setName(NAME_EDEFAULT); + return; + case StatemachinePackage.STATE__IS_FINAL: + setIsFinal(IS_FINAL_EDEFAULT); + return; + case StatemachinePackage.STATE__TRANSITIONS: + getTransitions().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case StatemachinePackage.STATE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case StatemachinePackage.STATE__IS_FINAL: + return isFinal != IS_FINAL_EDEFAULT; + case StatemachinePackage.STATE__TRANSITIONS: + return transitions != null && !transitions.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", isFinal: "); + result.append(isFinal); + result.append(')'); + return result.toString(); + } + +} //StateImpl diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StatemachineFactoryImpl.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StatemachineFactoryImpl.java new file mode 100644 index 000000000..61b420462 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StatemachineFactoryImpl.java @@ -0,0 +1,148 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine.impl; + +import de.cognicrypt.order.editor.statemachine.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class StatemachineFactoryImpl extends EFactoryImpl implements StatemachineFactory +{ + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static StatemachineFactory init() + { + try + { + StatemachineFactory theStatemachineFactory = (StatemachineFactory)EPackage.Registry.INSTANCE.getEFactory(StatemachinePackage.eNS_URI); + if (theStatemachineFactory != null) + { + return theStatemachineFactory; + } + } + catch (Exception exception) + { + EcorePlugin.INSTANCE.log(exception); + } + return new StatemachineFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public StatemachineFactoryImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) + { + switch (eClass.getClassifierID()) + { + case StatemachinePackage.STATEMACHINE: return createStatemachine(); + case StatemachinePackage.STATE: return createState(); + case StatemachinePackage.TRANSITION: return createTransition(); + case StatemachinePackage.EVENT: return createEvent(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Statemachine createStatemachine() + { + StatemachineImpl statemachine = new StatemachineImpl(); + return statemachine; + } + + /** + * + * + * @generated + */ + @Override + public State createState() + { + StateImpl state = new StateImpl(); + return state; + } + + /** + * + * + * @generated + */ + @Override + public Transition createTransition() + { + TransitionImpl transition = new TransitionImpl(); + return transition; + } + + /** + * + * + * @generated + */ + @Override + public Event createEvent() + { + EventImpl event = new EventImpl(); + return event; + } + + /** + * + * + * @generated + */ + @Override + public StatemachinePackage getStatemachinePackage() + { + return (StatemachinePackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static StatemachinePackage getPackage() + { + return StatemachinePackage.eINSTANCE; + } + +} //StatemachineFactoryImpl diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StatemachineImpl.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StatemachineImpl.java new file mode 100644 index 000000000..ed8b84edf --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StatemachineImpl.java @@ -0,0 +1,209 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine.impl; + +import de.cognicrypt.order.editor.statemachine.State; +import de.cognicrypt.order.editor.statemachine.Statemachine; +import de.cognicrypt.order.editor.statemachine.StatemachinePackage; +import de.cognicrypt.order.editor.statemachine.Transition; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Statemachine'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.StatemachineImpl#getStates States}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.StatemachineImpl#getTransitions Transitions}
  • + *
+ * + * @generated + */ +public class StatemachineImpl extends MinimalEObjectImpl.Container implements Statemachine +{ + /** + * The cached value of the '{@link #getStates() States}' containment reference list. + * + * + * @see #getStates() + * @generated + * @ordered + */ + protected EList states; + + /** + * The cached value of the '{@link #getTransitions() Transitions}' containment reference list. + * + * + * @see #getTransitions() + * @generated + * @ordered + */ + protected EList transitions; + + /** + * + * + * @generated + */ + protected StatemachineImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return StatemachinePackage.Literals.STATEMACHINE; + } + + /** + * + * + * @generated + */ + @Override + public EList getStates() + { + if (states == null) + { + states = new EObjectContainmentEList(State.class, this, StatemachinePackage.STATEMACHINE__STATES); + } + return states; + } + + /** + * + * + * @generated + */ + @Override + public EList getTransitions() + { + if (transitions == null) + { + transitions = new EObjectContainmentEList(Transition.class, this, StatemachinePackage.STATEMACHINE__TRANSITIONS); + } + return transitions; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case StatemachinePackage.STATEMACHINE__STATES: + return ((InternalEList)getStates()).basicRemove(otherEnd, msgs); + case StatemachinePackage.STATEMACHINE__TRANSITIONS: + return ((InternalEList)getTransitions()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case StatemachinePackage.STATEMACHINE__STATES: + return getStates(); + case StatemachinePackage.STATEMACHINE__TRANSITIONS: + return getTransitions(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case StatemachinePackage.STATEMACHINE__STATES: + getStates().clear(); + getStates().addAll((Collection)newValue); + return; + case StatemachinePackage.STATEMACHINE__TRANSITIONS: + getTransitions().clear(); + getTransitions().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case StatemachinePackage.STATEMACHINE__STATES: + getStates().clear(); + return; + case StatemachinePackage.STATEMACHINE__TRANSITIONS: + getTransitions().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case StatemachinePackage.STATEMACHINE__STATES: + return states != null && !states.isEmpty(); + case StatemachinePackage.STATEMACHINE__TRANSITIONS: + return transitions != null && !transitions.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //StatemachineImpl diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StatemachinePackageImpl.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StatemachinePackageImpl.java new file mode 100644 index 000000000..b20a6acf6 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/StatemachinePackageImpl.java @@ -0,0 +1,376 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine.impl; + +import de.cognicrypt.order.editor.statemachine.Event; +import de.cognicrypt.order.editor.statemachine.State; +import de.cognicrypt.order.editor.statemachine.Statemachine; +import de.cognicrypt.order.editor.statemachine.StatemachineFactory; +import de.cognicrypt.order.editor.statemachine.StatemachinePackage; +import de.cognicrypt.order.editor.statemachine.Transition; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class StatemachinePackageImpl extends EPackageImpl implements StatemachinePackage +{ + /** + * + * + * @generated + */ + private EClass statemachineEClass = null; + + /** + * + * + * @generated + */ + private EClass stateEClass = null; + + /** + * + * + * @generated + */ + private EClass transitionEClass = null; + + /** + * + * + * @generated + */ + private EClass eventEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage#eNS_URI + * @see #init() + * @generated + */ + private StatemachinePackageImpl() + { + super(eNS_URI, StatemachineFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link StatemachinePackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static StatemachinePackage init() + { + if (isInited) return (StatemachinePackage)EPackage.Registry.INSTANCE.getEPackage(StatemachinePackage.eNS_URI); + + // Obtain or create and register package + Object registeredStatemachinePackage = EPackage.Registry.INSTANCE.get(eNS_URI); + StatemachinePackageImpl theStatemachinePackage = registeredStatemachinePackage instanceof StatemachinePackageImpl ? (StatemachinePackageImpl)registeredStatemachinePackage : new StatemachinePackageImpl(); + + isInited = true; + + // Create package meta-data objects + theStatemachinePackage.createPackageContents(); + + // Initialize created meta-data + theStatemachinePackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theStatemachinePackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(StatemachinePackage.eNS_URI, theStatemachinePackage); + return theStatemachinePackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getStatemachine() + { + return statemachineEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getStatemachine_States() + { + return (EReference)statemachineEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getStatemachine_Transitions() + { + return (EReference)statemachineEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getState() + { + return stateEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getState_Name() + { + return (EAttribute)stateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getState_IsFinal() + { + return (EAttribute)stateEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getState_Transitions() + { + return (EReference)stateEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTransition() + { + return transitionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTransition_Name() + { + return (EAttribute)transitionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTransition_FromState() + { + return (EReference)transitionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTransition_Event() + { + return (EReference)transitionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTransition_EndState() + { + return (EReference)transitionEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getEvent() + { + return eventEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getEvent_Name() + { + return (EAttribute)eventEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public StatemachineFactory getStatemachineFactory() + { + return (StatemachineFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() + { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + statemachineEClass = createEClass(STATEMACHINE); + createEReference(statemachineEClass, STATEMACHINE__STATES); + createEReference(statemachineEClass, STATEMACHINE__TRANSITIONS); + + stateEClass = createEClass(STATE); + createEAttribute(stateEClass, STATE__NAME); + createEAttribute(stateEClass, STATE__IS_FINAL); + createEReference(stateEClass, STATE__TRANSITIONS); + + transitionEClass = createEClass(TRANSITION); + createEAttribute(transitionEClass, TRANSITION__NAME); + createEReference(transitionEClass, TRANSITION__FROM_STATE); + createEReference(transitionEClass, TRANSITION__EVENT); + createEReference(transitionEClass, TRANSITION__END_STATE); + + eventEClass = createEClass(EVENT); + createEAttribute(eventEClass, EVENT__NAME); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() + { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes and features; add operations and parameters + initEClass(statemachineEClass, Statemachine.class, "Statemachine", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getStatemachine_States(), this.getState(), null, "states", null, 0, -1, Statemachine.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getStatemachine_Transitions(), this.getTransition(), null, "transitions", null, 0, -1, Statemachine.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(stateEClass, State.class, "State", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getState_Name(), ecorePackage.getEString(), "name", null, 0, 1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getState_IsFinal(), ecorePackage.getEBoolean(), "isFinal", null, 0, 1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getState_Transitions(), this.getTransition(), null, "transitions", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(transitionEClass, Transition.class, "Transition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTransition_Name(), ecorePackage.getEString(), "name", null, 0, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTransition_FromState(), this.getState(), null, "fromState", null, 0, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTransition_Event(), this.getEvent(), null, "event", null, 0, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTransition_EndState(), this.getState(), null, "endState", null, 0, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(eventEClass, Event.class, "Event", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getEvent_Name(), ecorePackage.getEString(), "name", null, 0, 1, Event.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //StatemachinePackageImpl diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/TransitionImpl.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/TransitionImpl.java new file mode 100644 index 000000000..011c73841 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/impl/TransitionImpl.java @@ -0,0 +1,405 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine.impl; + +import de.cognicrypt.order.editor.statemachine.Event; +import de.cognicrypt.order.editor.statemachine.State; +import de.cognicrypt.order.editor.statemachine.StatemachinePackage; +import de.cognicrypt.order.editor.statemachine.Transition; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Transition'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.TransitionImpl#getName Name}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.TransitionImpl#getFromState From State}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.TransitionImpl#getEvent Event}
  • + *
  • {@link de.cognicrypt.order.editor.statemachine.impl.TransitionImpl#getEndState End State}
  • + *
+ * + * @generated + */ +public class TransitionImpl extends MinimalEObjectImpl.Container implements Transition +{ + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getFromState() From State}' reference. + * + * + * @see #getFromState() + * @generated + * @ordered + */ + protected State fromState; + + /** + * The cached value of the '{@link #getEvent() Event}' containment reference. + * + * + * @see #getEvent() + * @generated + * @ordered + */ + protected Event event; + + /** + * The cached value of the '{@link #getEndState() End State}' reference. + * + * + * @see #getEndState() + * @generated + * @ordered + */ + protected State endState; + + /** + * + * + * @generated + */ + protected TransitionImpl() + { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return StatemachinePackage.Literals.TRANSITION; + } + + /** + * + * + * @generated + */ + @Override + public String getName() + { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) + { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, StatemachinePackage.TRANSITION__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public State getFromState() + { + if (fromState != null && fromState.eIsProxy()) + { + InternalEObject oldFromState = (InternalEObject)fromState; + fromState = (State)eResolveProxy(oldFromState); + if (fromState != oldFromState) + { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, StatemachinePackage.TRANSITION__FROM_STATE, oldFromState, fromState)); + } + } + return fromState; + } + + /** + * + * + * @generated + */ + public State basicGetFromState() + { + return fromState; + } + + /** + * + * + * @generated + */ + @Override + public void setFromState(State newFromState) + { + State oldFromState = fromState; + fromState = newFromState; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, StatemachinePackage.TRANSITION__FROM_STATE, oldFromState, fromState)); + } + + /** + * + * + * @generated + */ + @Override + public Event getEvent() + { + return event; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetEvent(Event newEvent, NotificationChain msgs) + { + Event oldEvent = event; + event = newEvent; + if (eNotificationRequired()) + { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StatemachinePackage.TRANSITION__EVENT, oldEvent, newEvent); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setEvent(Event newEvent) + { + if (newEvent != event) + { + NotificationChain msgs = null; + if (event != null) + msgs = ((InternalEObject)event).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StatemachinePackage.TRANSITION__EVENT, null, msgs); + if (newEvent != null) + msgs = ((InternalEObject)newEvent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StatemachinePackage.TRANSITION__EVENT, null, msgs); + msgs = basicSetEvent(newEvent, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, StatemachinePackage.TRANSITION__EVENT, newEvent, newEvent)); + } + + /** + * + * + * @generated + */ + @Override + public State getEndState() + { + if (endState != null && endState.eIsProxy()) + { + InternalEObject oldEndState = (InternalEObject)endState; + endState = (State)eResolveProxy(oldEndState); + if (endState != oldEndState) + { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, StatemachinePackage.TRANSITION__END_STATE, oldEndState, endState)); + } + } + return endState; + } + + /** + * + * + * @generated + */ + public State basicGetEndState() + { + return endState; + } + + /** + * + * + * @generated + */ + @Override + public void setEndState(State newEndState) + { + State oldEndState = endState; + endState = newEndState; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, StatemachinePackage.TRANSITION__END_STATE, oldEndState, endState)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case StatemachinePackage.TRANSITION__EVENT: + return basicSetEvent(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case StatemachinePackage.TRANSITION__NAME: + return getName(); + case StatemachinePackage.TRANSITION__FROM_STATE: + if (resolve) return getFromState(); + return basicGetFromState(); + case StatemachinePackage.TRANSITION__EVENT: + return getEvent(); + case StatemachinePackage.TRANSITION__END_STATE: + if (resolve) return getEndState(); + return basicGetEndState(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case StatemachinePackage.TRANSITION__NAME: + setName((String)newValue); + return; + case StatemachinePackage.TRANSITION__FROM_STATE: + setFromState((State)newValue); + return; + case StatemachinePackage.TRANSITION__EVENT: + setEvent((Event)newValue); + return; + case StatemachinePackage.TRANSITION__END_STATE: + setEndState((State)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case StatemachinePackage.TRANSITION__NAME: + setName(NAME_EDEFAULT); + return; + case StatemachinePackage.TRANSITION__FROM_STATE: + setFromState((State)null); + return; + case StatemachinePackage.TRANSITION__EVENT: + setEvent((Event)null); + return; + case StatemachinePackage.TRANSITION__END_STATE: + setEndState((State)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case StatemachinePackage.TRANSITION__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case StatemachinePackage.TRANSITION__FROM_STATE: + return fromState != null; + case StatemachinePackage.TRANSITION__EVENT: + return event != null; + case StatemachinePackage.TRANSITION__END_STATE: + return endState != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //TransitionImpl diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/util/StatemachineAdapterFactory.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/util/StatemachineAdapterFactory.java new file mode 100644 index 000000000..769f3b1b8 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/util/StatemachineAdapterFactory.java @@ -0,0 +1,193 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine.util; + +import de.cognicrypt.order.editor.statemachine.*; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage + * @generated + */ +public class StatemachineAdapterFactory extends AdapterFactoryImpl +{ + /** + * The cached model package. + * + * + * @generated + */ + protected static StatemachinePackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public StatemachineAdapterFactory() + { + if (modelPackage == null) + { + modelPackage = StatemachinePackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) + { + if (object == modelPackage) + { + return true; + } + if (object instanceof EObject) + { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected StatemachineSwitch modelSwitch = + new StatemachineSwitch() + { + @Override + public Adapter caseStatemachine(Statemachine object) + { + return createStatemachineAdapter(); + } + @Override + public Adapter caseState(State object) + { + return createStateAdapter(); + } + @Override + public Adapter caseTransition(Transition object) + { + return createTransitionAdapter(); + } + @Override + public Adapter caseEvent(Event object) + { + return createEventAdapter(); + } + @Override + public Adapter defaultCase(EObject object) + { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) + { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link de.cognicrypt.order.editor.statemachine.Statemachine Statemachine}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see de.cognicrypt.order.editor.statemachine.Statemachine + * @generated + */ + public Adapter createStatemachineAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link de.cognicrypt.order.editor.statemachine.State State}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see de.cognicrypt.order.editor.statemachine.State + * @generated + */ + public Adapter createStateAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link de.cognicrypt.order.editor.statemachine.Transition Transition}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see de.cognicrypt.order.editor.statemachine.Transition + * @generated + */ + public Adapter createTransitionAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link de.cognicrypt.order.editor.statemachine.Event Event}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see de.cognicrypt.order.editor.statemachine.Event + * @generated + */ + public Adapter createEventAdapter() + { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() + { + return null; + } + +} //StatemachineAdapterFactory diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/util/StatemachineSwitch.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/util/StatemachineSwitch.java new file mode 100644 index 000000000..01f2a158f --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/statemachine/util/StatemachineSwitch.java @@ -0,0 +1,189 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.statemachine.util; + +import de.cognicrypt.order.editor.statemachine.*; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see de.cognicrypt.order.editor.statemachine.StatemachinePackage + * @generated + */ +public class StatemachineSwitch extends Switch +{ + /** + * The cached model package + * + * + * @generated + */ + protected static StatemachinePackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public StatemachineSwitch() + { + if (modelPackage == null) + { + modelPackage = StatemachinePackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) + { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) + { + switch (classifierID) + { + case StatemachinePackage.STATEMACHINE: + { + Statemachine statemachine = (Statemachine)theEObject; + T result = caseStatemachine(statemachine); + if (result == null) result = defaultCase(theEObject); + return result; + } + case StatemachinePackage.STATE: + { + State state = (State)theEObject; + T result = caseState(state); + if (result == null) result = defaultCase(theEObject); + return result; + } + case StatemachinePackage.TRANSITION: + { + Transition transition = (Transition)theEObject; + T result = caseTransition(transition); + if (result == null) result = defaultCase(theEObject); + return result; + } + case StatemachinePackage.EVENT: + { + Event event = (Event)theEObject; + T result = caseEvent(event); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Statemachine'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Statemachine'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseStatemachine(Statemachine object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'State'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'State'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseState(State object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Transition'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Transition'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTransition(Transition object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Event'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Event'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEvent(Event object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) + { + return null; + } + +} //StatemachineSwitch diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/validation/AbstractStatemachineValidator.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/validation/AbstractStatemachineValidator.java new file mode 100644 index 000000000..53adaaf07 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/validation/AbstractStatemachineValidator.java @@ -0,0 +1,21 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.validation; + +import java.util.ArrayList; +import java.util.List; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.xtext.xbase.validation.XtypeValidator; + +public abstract class AbstractStatemachineValidator extends XtypeValidator { + + @Override + protected List getEPackages() { + List result = new ArrayList(super.getEPackages()); + result.add(de.cognicrypt.order.editor.statemachine.StatemachinePackage.eINSTANCE); + result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/xtext/common/JavaVMTypes")); + result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/xtext/xbase/Xtype")); + return result; + } +} diff --git a/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/validation/StatemachineConfigurableIssueCodesProvider.java b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/validation/StatemachineConfigurableIssueCodesProvider.java new file mode 100644 index 000000000..bc9f3a571 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src-gen/de/cognicrypt/order/editor/validation/StatemachineConfigurableIssueCodesProvider.java @@ -0,0 +1,22 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.validation; + +import org.eclipse.xtext.preferences.PreferenceKey; +import org.eclipse.xtext.util.IAcceptor; +import org.eclipse.xtext.validation.ConfigurableIssueCodesProvider; +import org.eclipse.xtext.validation.SeverityConverter; + +@SuppressWarnings("restriction") +public class StatemachineConfigurableIssueCodesProvider extends ConfigurableIssueCodesProvider { + protected static final String ISSUE_CODE_PREFIX = "de.cognicrypt.order.editor."; + + public static final String DEPRECATED_MODEL_PART = ISSUE_CODE_PREFIX + "deprecatedModelPart"; + + @Override + protected void initialize(IAcceptor acceptor) { + super.initialize(acceptor); + acceptor.accept(create(DEPRECATED_MODEL_PART, SeverityConverter.SEVERITY_WARNING)); + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/Activator.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/Activator.java new file mode 100644 index 000000000..dd8e056e9 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/Activator.java @@ -0,0 +1,75 @@ +/******************************************************************************** + * Copyright (c) 2015-2019 TU Darmstadt, Paderborn University + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + ********************************************************************************/ + +package de.cognicrypt.order.editor; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "de.cognicrypt.order.editor"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() {} + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + private void log(final int severity, final String message, final Exception ex) { + getLog().log(new Status(severity, Activator.PLUGIN_ID, message, ex)); + } + + public void logError(final Exception ex) { + logError(ex, ex.getMessage()); + } + + public void logError(final Exception ex, final String message) { + log(IStatus.ERROR, message, ex); + } + + public void logError(final String message) { + log(IStatus.ERROR, message, null); + } + + public void logInfo(final String message) { + log(IStatus.INFO, message, null); + } + +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/Constants.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/Constants.java new file mode 100644 index 000000000..c83fabe4a --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/Constants.java @@ -0,0 +1,30 @@ +/******************************************************************************** + * Copyright (c) 2015-2019 TU Darmstadt, Paderborn University + * + + * http://www.eclipse.org/legal/epl-2.0. SPDX-License-Identifier: EPL-2.0 + ********************************************************************************/ + +package de.cognicrypt.order.editor; + +/** + * This class comprises all constants that are used by the plugin. + */ +public class Constants { + + public static final String innerFileSeparator = "/"; + //public static final String rsrcPath = "src" + innerFileSeparator + "main" + innerFileSeparator + "resources" + innerFileSeparator; + + public final static String RELATIVE_STATEMACHINE_CONFIG_DIR = "config" + innerFileSeparator; + public final static String RELATIVE_STATEMACHINE_MODELS_DIR = "output" + innerFileSeparator; + + public static final String STATEMACHINE_EXTENSION = ".statemachine"; + public static final String XML_EXTENSION = ".xml"; + + public final static String RELATIVE_JCA_FOLDER = innerFileSeparator + "git" + innerFileSeparator + "Crypto-API-Rules" + innerFileSeparator + "JavaCryptographicArchitecture" + innerFileSeparator + "src"; + public final static String RELATIVE_BC_FOLDER = innerFileSeparator + "git" + innerFileSeparator + "Crypto-API-Rules" + innerFileSeparator + "BouncyCastle" + innerFileSeparator + "src"; + public final static String RELATIVE_BC_JCA_FOLDER = innerFileSeparator + "git" + innerFileSeparator + "Crypto-API-Rules" + innerFileSeparator + "BouncyCastle-JCA" + innerFileSeparator + "src"; + public final static String RELATIVE_TINK_FOLDER = innerFileSeparator + "git" + innerFileSeparator + "Crypto-API-Rules" + innerFileSeparator + "Tink" + innerFileSeparator + "src"; + + public static final String ERROR_MESSAGE_NO_FILE = "No file found"; +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/GenerateStatemachine.mwe2 b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/GenerateStatemachine.mwe2 new file mode 100644 index 000000000..4e209519c --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/GenerateStatemachine.mwe2 @@ -0,0 +1,60 @@ +module de.cognicrypt.order.editor.GenerateStatemachine + +import org.eclipse.xtext.xtext.generator.* +import org.eclipse.xtext.xtext.generator.model.project.* + +var rootPath = ".." + +Workflow { + + component = XtextGenerator { + configuration = { + project = StandardProjectConfig { + baseName = "de.cognicrypt.order.editor" + rootPath = rootPath + runtimeTest = { + enabled = false + } + eclipsePlugin = { + enabled = false + } + eclipsePluginTest = { + enabled = false + } + createEclipseMetaData = true + } + code = { + encoding = "windows-1252" + lineDelimiter = "\r\n" + fileHeader = "/*\n * generated by Xtext \${version}\n */" + preferXtendStubs = false + } + } + language = StandardLanguage { + name = "de.cognicrypt.order.editor.Statemachine" + fileExtensions = "statemachine" + scopeProvider = { + generateXtendStub = false + } + + serializer = { + generateStub = false + } + validator = { + // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" + // Generates checks for @Deprecated grammar annotations, an IssueProvider and a corresponding PropertyPage + generateDeprecationValidation = true + } + generator = { + generateXtendStub = true + generateJavaMain = true + } + fileWizard = { + generate = true + } + junitSupport = { + junitVersion = "5" + } + } + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/Statemachine.xtext b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/Statemachine.xtext new file mode 100644 index 000000000..daabfb83c --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/Statemachine.xtext @@ -0,0 +1,28 @@ +grammar de.cognicrypt.order.editor.Statemachine with org.eclipse.xtext.xbase.Xtype // with org.eclipse.xtext.common.Terminals + +generate statemachine "http://www.cognicrypt.de/order/editor/Statemachine" + +Statemachine : + {Statemachine} + states+=State* + transitions+=Transition* +; + +State: + 'state' name=ID (isFinal?='true'|'false') + transitions+=Transition* + 'end' +; + +Transition: + 'transition' name=ID + fromState=[State] ',' event=Event ',' endState=[State] + 'end' +; + +Event: + name=ID +; + + + \ No newline at end of file diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/StatemachineRuntimeModule.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/StatemachineRuntimeModule.java new file mode 100644 index 000000000..353dbb68a --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/StatemachineRuntimeModule.java @@ -0,0 +1,11 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor; + + +/** + * Use this class to register components to be used at runtime / without the Equinox extension registry. + */ +public class StatemachineRuntimeModule extends AbstractStatemachineRuntimeModule { +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/StatemachineStandaloneSetup.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/StatemachineStandaloneSetup.java new file mode 100644 index 000000000..523319819 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/StatemachineStandaloneSetup.java @@ -0,0 +1,15 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor; + + +/** + * Initialization support for running Xtext languages without Equinox extension registry. + */ +public class StatemachineStandaloneSetup extends StatemachineStandaloneSetupGenerated { + + public static void doSetup() { + new StatemachineStandaloneSetup().createInjectorAndDoEMFRegistration(); + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/actions/RunOrderEditorHandler.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/actions/RunOrderEditorHandler.java new file mode 100644 index 000000000..9380dfd97 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/actions/RunOrderEditorHandler.java @@ -0,0 +1,32 @@ +/******************************************************************************** + * Copyright (c) 2015-2019 TU Darmstadt, Paderborn University + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + ********************************************************************************/ + +package de.cognicrypt.order.editor.actions; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.PlatformUI; + +import de.cognicrypt.core.Constants; +import de.cognicrypt.order.editor.wizard.OrderEditorWizard; +import de.cognicrypt.order.editor.wizard.OrderEditorWizardDialog; + +public class RunOrderEditorHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + Constants.WizardActionFromContextMenuFlag = true; + final OrderEditorWizardDialog dialog = new OrderEditorWizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), new OrderEditorWizard()); + dialog.setHelpAvailable(false); + return dialog.open(); + } + +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/config/CryslFile.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/config/CryslFile.java new file mode 100644 index 000000000..c07dcb4ed --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/config/CryslFile.java @@ -0,0 +1,27 @@ +package de.cognicrypt.order.editor.config; + +public class CryslFile { //represents a CryslFile object from config.xml + + private String rule; + private String path; + + public String getRule() { + return rule; + } + + public String getRuleName() { + return rule.substring(0, rule.length()-6); + } + + public void setRule(String rule) { + this.rule = rule; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/config/StaxParser.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/config/StaxParser.java new file mode 100644 index 000000000..c647058c7 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/config/StaxParser.java @@ -0,0 +1,70 @@ +package de.cognicrypt.order.editor.config; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.EndElement; +import javax.xml.stream.events.StartElement; +import javax.xml.stream.events.XMLEvent; + + +import de.cognicrypt.order.editor.parser.StatemachineParser; + + +public class StaxParser { + + static final String CRYSLFILE = "cryslFile"; + static final String RULE = "rule"; + static final String PATH = "path"; + + @SuppressWarnings({ "unchecked", "null" }) + public List readConfig(String configFile) { + List cryslFileList = new ArrayList(); + try { + XMLInputFactory inputFactory = XMLInputFactory.newInstance(); + InputStream in = new FileInputStream(configFile); + XMLEventReader eventReader = inputFactory.createXMLEventReader(in); + CryslFile cryslFile = null; + + while (eventReader.hasNext()) { + XMLEvent event = eventReader.nextEvent(); + + if (event.isStartElement()) { + StartElement startElement = event.asStartElement(); + String elementName = startElement.getName().getLocalPart(); + switch (elementName) { + case CRYSLFILE: + cryslFile = new CryslFile(); + break; + case RULE: + event = eventReader.nextEvent(); + cryslFile.setRule(event.asCharacters().getData()); + break; + case PATH: + event = eventReader.nextEvent(); + cryslFile.setPath(event.asCharacters().getData()); + break; + } + } + if (event.isEndElement()) { + EndElement endElement = event.asEndElement(); + if (endElement.getName().getLocalPart().equals(CRYSLFILE)) { + cryslFileList.add(cryslFile); + } + } + + } + } catch (FileNotFoundException | XMLStreamException e) { + e.printStackTrace(); + } + StatemachineParser.generate(cryslFileList); + return cryslFileList; + } +} + diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/config/StaxWriter.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/config/StaxWriter.java new file mode 100644 index 000000000..4b04aeb43 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/config/StaxWriter.java @@ -0,0 +1,178 @@ +package de.cognicrypt.order.editor.config; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLConnection; +import java.util.Arrays; +import java.util.Enumeration; + +import javax.xml.stream.XMLEventFactory; +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.Characters; +import javax.xml.stream.events.EndElement; +import javax.xml.stream.events.StartDocument; +import javax.xml.stream.events.StartElement; +import javax.xml.stream.events.XMLEvent; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Platform; +import org.osgi.framework.Bundle; + +import de.cognicrypt.order.editor.Activator; +import de.cognicrypt.order.editor.Constants; +import de.cognicrypt.utils.Utils; + +public class StaxWriter { + private File f; + + public void setFile(String configFile) { + + final Bundle bundle = Platform.getBundle(de.cognicrypt.order.editor.Activator.PLUGIN_ID); + + URL entry = null; + URL resolvedURL = null; + if (bundle == null) { + } + else { + entry = bundle.getEntry(Constants.RELATIVE_STATEMACHINE_CONFIG_DIR); + } + if (entry == null) { + } + try { + resolvedURL = FileLocator.toFileURL(entry); + } catch (IOException e8) { + e8.printStackTrace(); + } + java.net.URI resolvedURI = null; + if (!(resolvedURL == null)) { + try { + resolvedURI = new java.net.URI(resolvedURL.getProtocol(), resolvedURL.getPath(), null); + } catch (URISyntaxException e) { + e.printStackTrace(); + }finally { + + }} + else { + try { + resolvedURI = FileLocator.resolve(entry).toURI(); + } catch (URISyntaxException e1) { + e1.printStackTrace(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + + java.net.URI fileUri = null; + + try { + fileUri = new java.net.URI(resolvedURI + configFile); + } catch (URISyntaxException e8) { + e8.printStackTrace(); + } + + File file = new File(fileUri); + + if(!file.exists()) { + try { + file.createNewFile(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + f = file; + } + + public void saveConfig() throws Exception { + + File folderJCA = new File(System.getProperty("user.home") + Constants.RELATIVE_JCA_FOLDER); + File folderBC = new File(System.getProperty("user.home") + Constants.RELATIVE_BC_FOLDER); + File folderBCJCA = new File(System.getProperty("user.home") + Constants.RELATIVE_BC_JCA_FOLDER); + File folderTink = new File(System.getProperty("user.home") + Constants.RELATIVE_TINK_FOLDER); + + File[] listOfFilesJCA = folderJCA.listFiles(); + File[] listOfFilesBC = folderBC.listFiles(); + File[] listOfFilesBCJCA = folderBCJCA.listFiles(); + File[] listOfFilesTink = folderTink.listFiles(); + File[] all = concatAll(listOfFilesJCA, listOfFilesBC, listOfFilesBCJCA, listOfFilesTink); + + XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); + XMLEventWriter eventWriter = outputFactory + .createXMLEventWriter(new FileOutputStream(f)); + XMLEventFactory eventFactory = XMLEventFactory.newInstance(); + XMLEvent end = eventFactory.createDTD("\n"); + + StartDocument startDocument = eventFactory.createStartDocument(); + eventWriter.add(startDocument); + + eventWriter.add(eventFactory.createStartElement("", + "", "folders")); + + for (int i = 0; i < all.length; i++) { + if (all[i].isFile()) { + if(all[i].getName().contains("crysl")) { + + StartElement folderStartElement = eventFactory.createStartElement("", + "", "cryslFile"); + eventWriter.add(folderStartElement); + createNode(eventWriter, "rule", all[i].getName()); + createNode(eventWriter, "path", all[i].getAbsolutePath()); + eventWriter.add(eventFactory.createEndElement("", "", "cryslFile")); + eventWriter.add(end); + } + } + } + + eventWriter.add(end); + + eventWriter.add(eventFactory.createEndElement("", "", "folders")); + eventWriter.add(end); + + eventWriter.add(eventFactory.createEndDocument()); + eventWriter.close(); + } + + private void createNode(XMLEventWriter eventWriter, String name, + String value) throws XMLStreamException { + + XMLEventFactory eventFactory = XMLEventFactory.newInstance(); + XMLEvent end = eventFactory.createDTD("\n"); + XMLEvent tab = eventFactory.createDTD("\t"); + + StartElement sElement = eventFactory.createStartElement("", "", name); + eventWriter.add(tab); + eventWriter.add(sElement); + + Characters characters = eventFactory.createCharacters(value); + eventWriter.add(characters); + + EndElement eElement = eventFactory.createEndElement("", "", name); + eventWriter.add(eElement); + eventWriter.add(end); + } + + public static T[] concatAll(T[] head, T[]... tail) { + int totalLength = head.length; + for (T[] array : tail) { + totalLength += array.length; + } + T[] result = Arrays.copyOf(head, totalLength); + int offset = head.length; + for (T[] array : tail) { + System.arraycopy(array, 0, result, offset, array.length); + offset += array.length; + } + return result; + } + + public File getFile() { + return f; + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/generator/Main.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/generator/Main.java new file mode 100644 index 000000000..16df1ba4d --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/generator/Main.java @@ -0,0 +1,68 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.generator; + +import com.google.inject.Inject; +import com.google.inject.Injector; +import com.google.inject.Provider; +import de.cognicrypt.order.editor.StatemachineStandaloneSetup; +import java.util.List; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.xtext.generator.GeneratorContext; +import org.eclipse.xtext.generator.GeneratorDelegate; +import org.eclipse.xtext.generator.JavaIoFileSystemAccess; +import org.eclipse.xtext.util.CancelIndicator; +import org.eclipse.xtext.validation.CheckMode; +import org.eclipse.xtext.validation.IResourceValidator; +import org.eclipse.xtext.validation.Issue; + +public class Main { + + public static void main(String[] args) { + if (args.length == 0) { + System.err.println("Aborting: no path to EMF resource provided!"); + return; + } + Injector injector = new StatemachineStandaloneSetup().createInjectorAndDoEMFRegistration(); + Main main = injector.getInstance(Main.class); + main.runGenerator(args[0]); + } + + @Inject + private Provider resourceSetProvider; + + @Inject + private IResourceValidator validator; + + @Inject + private GeneratorDelegate generator; + + @Inject + private JavaIoFileSystemAccess fileAccess; + + protected void runGenerator(String string) { + // Load the resource + ResourceSet set = resourceSetProvider.get(); + Resource resource = set.getResource(URI.createFileURI(string), true); + + // Validate the resource + List list = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl); + if (!list.isEmpty()) { + for (Issue issue : list) { + System.err.println(issue); + } + return; + } + + // Configure and start the generator + fileAccess.setOutputPath("src-gen/"); + GeneratorContext context = new GeneratorContext(); + context.setCancelIndicator(CancelIndicator.NullImpl); + generator.generate(resource, fileAccess, context); + + System.out.println("Code generation finished."); + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/generator/StatemachineGenerator.xtend b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/generator/StatemachineGenerator.xtend new file mode 100644 index 000000000..e621c60de --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/generator/StatemachineGenerator.xtend @@ -0,0 +1,25 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.generator + +import org.eclipse.emf.ecore.resource.Resource +import org.eclipse.xtext.generator.AbstractGenerator +import org.eclipse.xtext.generator.IFileSystemAccess2 +import org.eclipse.xtext.generator.IGeneratorContext + +/** + * Generates code from your model files on save. + * + * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation + */ +class StatemachineGenerator extends AbstractGenerator { + + override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) { +// fsa.generateFile('greetings.txt', 'People to greet: ' + +// resource.allContents +// .filter(Greeting) +// .map[name] +// .join(', ')) + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/parser/StatemachineParser.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/parser/StatemachineParser.java new file mode 100644 index 000000000..ead0a24ce --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/parser/StatemachineParser.java @@ -0,0 +1,250 @@ +package de.cognicrypt.order.editor.parser; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Platform; +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.xtext.common.types.access.impl.ClasspathTypeProvider; +import org.eclipse.xtext.resource.SaveOptions; +import org.eclipse.xtext.resource.XtextResource; +import org.eclipse.xtext.resource.XtextResourceSet; +import org.osgi.framework.Bundle; + +import com.google.inject.Injector; + +import de.cognicrypt.order.editor.Activator; +import de.cognicrypt.order.editor.Constants; +import de.cognicrypt.order.editor.config.CryslFile; +import de.cognicrypt.order.editor.statemachine.Statemachine; +import de.cognicrypt.order.editor.statemachine.StatemachineFactory; +import de.cognicrypt.order.editor.statemachine.StatemachinePackage; +import de.darmstadt.tu.crossing.CrySLStandaloneSetup; +import de.cognicrypt.order.editor.StatemachineStandaloneSetup; +import de.darmstadt.tu.crossing.crySL.Domainmodel; +import de.darmstadt.tu.crossing.crySL.Expression; +import de.darmstadt.tu.crossing.crySL.SuperType; +import de.cognicrypt.order.editor.statemachine.Event; +import de.cognicrypt.order.editor.statemachine.State; +import de.cognicrypt.order.editor.statemachine.Transition; +import de.cognicrypt.order.editor.statemachine.StateMachineGraph; +import de.cognicrypt.order.editor.statemachine.StateMachineGraphBuilder; +import de.cognicrypt.order.editor.statemachine.StateNode; +import de.cognicrypt.order.editor.statemachine.TransitionEdge; + +public class StatemachineParser { + + public static void generate(List cryslFileList) { + HashMap selfs = new HashMap(); + for(CryslFile f : cryslFileList) { + + try { + EObject self = provideCrySLEObject(f.getPath()); + generateStatemachineXtextResource(self, f.getRuleName()); + } catch (MalformedURLException e2) { + e2.printStackTrace(); + } + } + } + + public static void generateStatemachineXtextResource(EObject self, String ruleName) { + final Domainmodel dm = (Domainmodel) self; + Expression order = dm.getOrder(); + + StateMachineGraph smgb = new StateMachineGraphBuilder(order).buildSMG(); + Set stateNodes = smgb.getNodes(); + java.util.List transitionEdges = smgb.getEdges(); + java.util.List myTransitionEvents = new ArrayList(); + + for(TransitionEdge e : transitionEdges) { + myTransitionEvents.add((de.darmstadt.tu.crossing.crySL.Event) e.getLabel()); + } + + StatemachineStandaloneSetup.doSetup(); + + StatemachineStandaloneSetup stmStandaloneSetup = new StatemachineStandaloneSetup(); + final Injector injector = stmStandaloneSetup.createInjectorAndDoEMFRegistration(); + stmStandaloneSetup.register(injector); + + ResourceSet resourceSet = new ResourceSetImpl(); + StatemachinePackage.eINSTANCE.eClass(); + + String path = Activator.PLUGIN_ID + "/output/" + ruleName + Constants.STATEMACHINE_EXTENSION; + Resource resource = createAndAddXtextResourcePlatformPluginURI(path, resourceSet); + + resourceSet.getResources().add(resource); + + Statemachine statemachine = StatemachineFactory.eINSTANCE.createStatemachine(); + + State state = null; + Event event = null; + //de.darmstadt.tu.crossing.statemachine.Transition transition = null; + Transition transition = null; + HashMap stateNodeMap = new HashMap(); + + SuperType ev = null; + int counter = 0; + + //process stateNodes separately, still unsorted + for(StateNode s: stateNodes) { + state = (State) StatemachineFactory.eINSTANCE.createState(); + state.setName("s" + s.getName()); + if(s.getAccepting().equals(true)) { + state.setIsFinal(true); + } + else { + state.setIsFinal(false); + } + statemachine.getStates().add((de.cognicrypt.order.editor.statemachine.State) state); + counter++; + stateNodeMap.put(s, state); + } + + //process transition edges for states and transitions + for(int i = 0; i < transitionEdges.size(); i++) { + if(transitionEdges.get(i).getLabel() instanceof SuperType) { + ev = (SuperType) transitionEdges.get(i).getLabel(); + event = (Event) StatemachineFactory.eINSTANCE.createEvent(); + // check for duplicate events to avoid same naming for different edges (causes serialization error) + if(sameEvent(transitionEdges, transitionEdges.get(i))) { + event.setName(((SuperType) ev).getName() + i); + } + else { + event.setName(((SuperType) ev).getName()); + } + } + + transition = StatemachineFactory.eINSTANCE.createTransition(); + + transition.setName("t" + i); + transition.setEvent(event); + transition.setFromState(stateNodeMap.get(transitionEdges.get(i).from())); + transition.setEndState(stateNodeMap.get(transitionEdges.get(i).to())); + transition.getFromState().getTransitions().add(transition); + statemachine.getTransitions().add(transition); + } + + resource.getContents().add(statemachine); + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + + try { + resource.save(outputStream, SaveOptions.newBuilder().format().getOptions().toOptionsMap()); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + outputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + // store in file + java.net.URI resolvedURI = null; + + try { + final Bundle bundle = Platform.getBundle(de.cognicrypt.order.editor.Activator.PLUGIN_ID); + final URL entry = bundle.getEntry(Constants.RELATIVE_STATEMACHINE_MODELS_DIR); + final URL resolvedURL = FileLocator.toFileURL(entry); + if (!(resolvedURL == null)) { + resolvedURI = new URI(resolvedURL.getProtocol(), resolvedURL.getPath(), null); + } else { + resolvedURI = FileLocator.resolve(entry).toURI(); + } + } + catch (final IOException ex) { + Activator.getDefault().logError(ex, Constants.ERROR_MESSAGE_NO_FILE); + } catch (URISyntaxException ex) { + Activator.getDefault().logError(ex); + } + java.net.URI fileURI = null; + + try { + fileURI = new java.net.URI(resolvedURI + ruleName + Constants.STATEMACHINE_EXTENSION); + } catch (URISyntaxException e3) { + e3.printStackTrace(); + } + + File file = new File(fileURI); + + if(!file.exists()) { + try { + file.createNewFile(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + + try (OutputStream fileOutputStream = new FileOutputStream(file)) { + try { + outputStream.writeTo(fileOutputStream); + } catch (IOException ioe) { + ioe.printStackTrace(); + } finally { + fileOutputStream.close(); + } + } catch (IOException e2) { + e2.printStackTrace(); + } + } + + // method for checking whether events occur more frequently + public static boolean sameEvent(List edges, TransitionEdge e) { + int counter = 0; + for(TransitionEdge ed: edges) { + if(ed != e) { + if(ed.getLabel().equals(e.getLabel())) { + counter++; + } + } + } + if(counter > 0) { + return true; + } + return false; + } + + public static XtextResource createAndAddXtextResourcePlatformPluginURI(String outputFile, ResourceSet resourceSet) { + // parsing a plug-in-based path string, with an option to encode the created URI + org.eclipse.emf.common.util.URI uri = org.eclipse.emf.common.util.URI.createPlatformPluginURI(outputFile, false); + XtextResource resource = (XtextResource) resourceSet.createResource(uri); + return resource; + } + + public static EObject provideCrySLEObject(String pathToCryslFile) throws MalformedURLException { + // Loading model + CrySLStandaloneSetup crySLStandaloneSetup = new CrySLStandaloneSetup(); + final Injector injector = crySLStandaloneSetup.createInjectorAndDoEMFRegistration(); + XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class); + String a = System.getProperty("java.class.path"); + String[] l = a.split(";"); + URL[] classpath = new URL[l.length]; + for (int i = 0; i < classpath.length; i++) { + classpath[i] = new File(l[i]).toURI().toURL(); + } + URLClassLoader ucl = new URLClassLoader(classpath); + resourceSet.setClasspathURIContext(new URLClassLoader(classpath)); + new ClasspathTypeProvider(ucl, resourceSet, null, null); + resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE); + final Resource resource = resourceSet.getResource(org.eclipse.emf.common.util.URI.createFileURI(pathToCryslFile), true); + final EObject eObject = resource.getContents().get(0); + return eObject; + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/scoping/StatemachineScopeProvider.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/scoping/StatemachineScopeProvider.java new file mode 100644 index 000000000..c5af0d9e8 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/scoping/StatemachineScopeProvider.java @@ -0,0 +1,15 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.scoping; + + +/** + * This class contains custom scoping description. + * + * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping + * on how and when to use it. + */ +public class StatemachineScopeProvider extends AbstractStatemachineScopeProvider { + +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/CrySLEvent.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/CrySLEvent.java new file mode 100644 index 000000000..96b1743eb --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/CrySLEvent.java @@ -0,0 +1,25 @@ +package de.cognicrypt.order.editor.statemachine; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.TreeIterator; +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.ecore.resource.Resource; + +import de.darmstadt.tu.crossing.crySL.Event; +import de.darmstadt.tu.crossing.crySL.impl.EventImpl; + +public class CrySLEvent extends EventImpl { + + + public CrySLEvent() { + super(); + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/CrySLMethod.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/CrySLMethod.java new file mode 100644 index 000000000..4ebb6bac5 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/CrySLMethod.java @@ -0,0 +1,110 @@ +package de.cognicrypt.order.editor.statemachine; + +import java.io.Serializable; +import java.util.List; +import java.util.Map.Entry; + +public class CrySLMethod implements Serializable { + + private static final long serialVersionUID = 1L; + private final String methodName; + private final Entry retObject; + private final List> parameters; + private final List backward; + + public CrySLMethod(String methName, List> pars, List backw, Entry returnObject) { + methodName = methName; + parameters = pars; + backward = backw; + retObject = returnObject; + } + + /** + * @return the FQ methodName + */ + public String getMethodName() { + return methodName; + } + + /** + * @return the short methodName + */ + public String getShortMethodName() { + return methodName.substring(methodName.lastIndexOf(".") + 1); + } + + + /** + * @return the parameters + */ + public List> getParameters() { + return parameters; + } + + /** + * @return the backward + */ + public List getBackward() { + return backward; + } + + + public Entry getRetObject() { + return retObject; + } + public String toString() { + return getName(); + } + + public String getName() { + StringBuilder stmntBuilder = new StringBuilder(); + String returnValue = retObject.getKey(); + if (!"_".equals(returnValue)) { + stmntBuilder.append(returnValue); + stmntBuilder.append(" = "); + } + + stmntBuilder.append(this.methodName); + stmntBuilder.append("("); + + + for (Entry par: parameters) { + stmntBuilder.append(" "); + stmntBuilder.append(par.getKey()); +// if (backward != null && backward.size() == parameters.size()) { +// stmntBuilder.append(" ("); +// stmntBuilder.append(backward.get(parameters.indexOf(par))); +// stmntBuilder.append("),"); +// } + } + + stmntBuilder.append(");"); + return stmntBuilder.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((backward == null) ? 0 : backward.hashCode()); + result = prime * result + ((methodName == null) ? 0 : methodName.hashCode()); + result = prime * result + ((parameters == null) ? 0 : parameters.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof CrySLMethod)) { + return false; + } + CrySLMethod other = (CrySLMethod) obj; + return this.getMethodName().equals(other.getMethodName()) && parameters.equals(other.parameters); + } + +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/CryslReaderUtils.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/CryslReaderUtils.java new file mode 100644 index 000000000..3c97ad123 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/CryslReaderUtils.java @@ -0,0 +1,76 @@ +package de.cognicrypt.order.editor.statemachine; + +import java.util.AbstractMap.SimpleEntry; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map.Entry; + +import de.darmstadt.tu.crossing.crySL.Aggregate; +import de.darmstadt.tu.crossing.crySL.Event; +import de.darmstadt.tu.crossing.crySL.Method; +import de.darmstadt.tu.crossing.crySL.ObjectDecl; +import de.darmstadt.tu.crossing.crySL.Par; +import de.darmstadt.tu.crossing.crySL.ParList; +import de.darmstadt.tu.crossing.crySL.SuperType; + +public class CryslReaderUtils { + protected static Event resolveAggregateToMethodeNames(final Event leaf) { + if (leaf instanceof Aggregate) { + final Aggregate ev = (Aggregate) leaf; + return ev; + } else { + final ArrayList statements = new ArrayList<>(); + CrySLMethod stringifyMethodSignature = stringifyMethodSignature(leaf); + if (stringifyMethodSignature != null) { + statements.add(stringifyMethodSignature); + } + return leaf; + } + } + + protected static CrySLMethod stringifyMethodSignature(final Event lab) { + if (!(lab instanceof SuperType)) { + return null; + } + final Method method = ((SuperType) lab).getMeth(); + + String methodName = method.getMethName().getSimpleName(); + if (methodName == null) { + methodName = ((de.darmstadt.tu.crossing.crySL.Domainmodel) (method.eContainer().eContainer().eContainer())).getJavaType().getSimpleName(); + } + final String qualifiedName = + ((de.darmstadt.tu.crossing.crySL.Domainmodel) (method.eContainer().eContainer().eContainer())).getJavaType().getQualifiedName() + "." + methodName; // method.getMethName().getQualifiedName(); + // qualifiedName = removeSPI(qualifiedName); + final List> pars = new ArrayList<>(); + final de.darmstadt.tu.crossing.crySL.Object returnValue = method.getLeftSide(); + Entry returnObject = null; + if (returnValue != null && returnValue.getName() != null) { + final ObjectDecl v = ((ObjectDecl) returnValue.eContainer()); + returnObject = new SimpleEntry<>(returnValue.getName(), v.getObjectType().getQualifiedName() + ((v.getArray() != null) ? v.getArray() : "")); + } else { + returnObject = new SimpleEntry<>("_", "void"); + } + final ParList parList = method.getParList(); + if (parList != null) { + for (final Par par : parList.getParameters()) { + String parValue = "_"; + if (par.getVal() != null && par.getVal().getName() != null) { + final ObjectDecl objectDecl = (ObjectDecl) par.getVal().eContainer(); + parValue = par.getVal().getName(); + final String parType = objectDecl.getObjectType().getIdentifier() + ((objectDecl.getArray() != null) ? objectDecl.getArray() : ""); + pars.add(new SimpleEntry<>(parValue, parType)); + } else { + pars.add(new SimpleEntry<>(parValue, "AnyType")); + } + } + } + return new CrySLMethod(qualifiedName, pars, new ArrayList(), returnObject); + } + + public static File getResourceFromWithin(final String inputPath) { + return new File(inputPath); + } +} + + diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateMachineGraph.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateMachineGraph.java new file mode 100644 index 000000000..e96fc3e17 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateMachineGraph.java @@ -0,0 +1,127 @@ +package de.cognicrypt.order.editor.statemachine; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import de.darmstadt.tu.crossing.crySL.CrySLFactory; +import de.darmstadt.tu.crossing.crySL.Expression; +import de.darmstadt.tu.crossing.crySL.Order; +import de.darmstadt.tu.crossing.crySL.SimpleOrder; +import de.darmstadt.tu.crossing.crySL.impl.ExpressionImpl; + +public final class StateMachineGraph{ + /** + * + */ + private static final long serialVersionUID = 1L; + private final Set nodes; + private final List edges; + + private final HashMap nodemaps; + public StateMachineGraph() { + nodes = new HashSet(); + edges = new ArrayList(); + nodemaps = new HashMap(); + } + + public Boolean addEdge(TransitionEdge edge) { + final StateNode right = edge.getRight(); + final StateNode left = edge.getLeft(); + if(edge.getLeft().getName().equals("init")) { + //remove initial node (Order) and put an expression instead of it + Expression newElement = CrySLFactory.eINSTANCE.createExpression(); + nodemaps.put("init", newElement); + + } + if (!(nodes.parallelStream().anyMatch(e -> e.equals(left)) || nodes.parallelStream().anyMatch(e -> e.equals(right)))) { + return false; + } + if (edges.contains(edge)) { + return false; + } + edges.add(edge); + return true; + } + + public void wrapUpCreation() { + getAcceptingStates().parallelStream().forEach(e -> { + e.setHopsToAccepting(0); + updateHops(e); + }); + } + + private void updateHops(StateNode node) { + int newPath = node.getHopsToAccepting() + 1; + getAllTransitions().parallelStream().forEach(e -> { + StateNode theNewRight = e.getLeft(); + if (e.getRight().equals(node) && theNewRight.getHopsToAccepting() > newPath) { + theNewRight.setHopsToAccepting(newPath); + updateHops(theNewRight); + } + }); + } + + public Boolean addNode(StateNode node, Expression expression) { + for (StateNode innerNode : nodes) { + if (innerNode.getName().equals(node.getName())) { + return false; + } + } + nodes.add(node); + nodemaps.put(node.getName(), expression); + return true; + } + + public String toString() { + StringBuilder graphSB = new StringBuilder(); + for (StateNode node : nodes) { + graphSB.append(node.toString()); + graphSB.append(System.lineSeparator()); + } + + for (TransitionEdge te : edges) { + graphSB.append(te.toString()); + graphSB.append(System.lineSeparator()); + } + + return graphSB.toString(); + } + + public Set getNodes() { + return nodes; + } + + public HashMap getNodeMap() { + return nodemaps; + } + + public List getEdges() { + return edges; + } + + public TransitionEdge getInitialTransition() { + return edges.get(0); + } + + public Collection getAcceptingStates() { + Collection accNodes = new ArrayList(); + for (StateNode node : nodes) { + if (node.getAccepting()) { + accNodes.add(node); + } + } + + return accNodes; + } + + public Collection getAllTransitions() { + return getEdges(); + } + +} + diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateMachineGraphBuilder.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateMachineGraphBuilder.java new file mode 100644 index 000000000..f91f0a244 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateMachineGraphBuilder.java @@ -0,0 +1,473 @@ +package de.cognicrypt.order.editor.statemachine; + +import java.util.AbstractMap.SimpleEntry; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.stream.Collectors; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + +import de.darmstadt.tu.crossing.crySL.Event; +import de.darmstadt.tu.crossing.crySL.Expression; +import de.darmstadt.tu.crossing.crySL.Order; +import de.darmstadt.tu.crossing.crySL.SimpleOrder; + +public class StateMachineGraphBuilder { + + private final Expression head; + private final StateMachineGraph result = new StateMachineGraph(); + private int nodeNameCounter = 0; + + public StateMachineGraphBuilder(final Expression order) { + this.head = order; + this.result.addNode(new StateNode("init", true, true), order); + + } + + private StateNode addRegularEdge(final Expression leaf, final StateNode prevNode, final StateNode nextNode) { + return addRegularEdge(leaf, prevNode, nextNode, false); + } + + private StateNode addRegularEdge(final Expression leaf, final StateNode prevNode, final StateNode nextNode, final Boolean isStillAccepting) { + final Event label = CryslReaderUtils.resolveAggregateToMethodeNames(leaf.getOrderEv().get(0)); + return addRegularEdge(leaf,label, prevNode, nextNode, isStillAccepting); + } + + + private StateNode addRegularEdge(Expression leaf,final Event label, final StateNode prevNode, StateNode nextNode, final Boolean isStillAccepting) { + if (nextNode == null) { + nextNode = getNewNode(); + this.result.addNode(nextNode, leaf); + } + if (!isStillAccepting) { + prevNode.setAccepting(false); + } + boolean added = this.result.addEdge(new TransitionEdge(label, prevNode, nextNode)); + return nextNode; + } + + public StateMachineGraph buildSMG() { + StateNode initialNode = null; + for (final StateNode n : this.result.getNodes()) { + initialNode = n; + } + if (this.head != null) { + processHead(this.head, 0, HashMultimap.create(), initialNode); + } else { + //see the implementation in CryptoAnalysis StateMachineGraphBuilder + // may be required to keep it as it is. + //this.result.addEdge(new TransitionEdge(new ArrayList(), initialNode, initialNode)); + this.result.addEdge(new TransitionEdge(new CrySLEvent(), initialNode, initialNode)); + } + return this.result; + } + + private StateNode getNewNode() { + return new StateNode(String.valueOf(this.nodeNameCounter++), false, true); + } + + private List getOutgoingEdges(final StateNode curNode, final StateNode notTo) { + final List outgoingEdges = new ArrayList<>(); + for (final TransitionEdge comp : this.result.getAllTransitions()) { + if (comp.getLeft().equals(curNode) && !(comp.getRight().equals(curNode) || comp.getRight().equals(notTo))) { + outgoingEdges.add(comp); + } + } + return outgoingEdges; + } + + private StateNode isGeneric(final String el, final int level, final Multimap> leftOvers) { + for (final Entry entry : leftOvers.get(level)) { + if (el.equals(entry.getKey())) { + return entry.getValue(); + } + } + return null; + } + + private StateNode isOr(final int level, final Multimap> leftOvers) { + return isGeneric("|", level, leftOvers); + } + + private StateNode isQM(final int level, final Multimap> leftOvers) { + return isGeneric("?", level, leftOvers); + } + + private StateNode process(final Expression curLevel, final int level, final Multimap> leftOvers, StateNode prevNode) { + final Expression left = curLevel.getLeft(); + final Expression right = curLevel.getRight(); + final String leftElOp = (left != null) ? left.getElementop() : ""; + final String rightElOp = (right != null) ? right.getElementop() : ""; + final String orderOp = curLevel.getOrderop(); + // case 1 = left & right = non-leaf + // case 2 = left = non-leaf & right = leaf + // case 3 = left = leaf & right = non-leaf + // case 4 = left = leaf & right = leaf + + if (left == null && right == null) { + addRegularEdge(left, prevNode, null); + } else if ((left instanceof Order || left instanceof SimpleOrder) && (right instanceof Order || right instanceof SimpleOrder)) { + final StateNode leftPrev = prevNode; + prevNode = process(left, level + 1, leftOvers, prevNode); + + final StateNode rightPrev = prevNode; + StateNode returnToNode = null; + if ("|".equals(orderOp)) { + leftOvers.put(level + 1, new HashMap.SimpleEntry<>(orderOp, prevNode)); + prevNode = process(right, level + 1, leftOvers, leftPrev); + } else if ((returnToNode = isOr(level, leftOvers)) != null) { + prevNode = process(right, level + 1, leftOvers, returnToNode); + } else { + prevNode = process(right, level + 1, leftOvers, prevNode); + } + + if (rightElOp != null && ("+".equals(rightElOp) || "*".equals(rightElOp))) { + final List outgoingEdges = new ArrayList(); + if ("|".equals(orderOp)) { + final List tmpOutgoingEdges = getOutgoingEdges(leftPrev, null); + for (final TransitionEdge outgoingEdge : tmpOutgoingEdges) { + if (isReachable(outgoingEdge.to(), prevNode, new ArrayList())) { + outgoingEdges.addAll(getOutgoingEdges(outgoingEdge.to(), prevNode)); + } + } + for (final TransitionEdge outgoingEdge : outgoingEdges) { + if (isReachable(prevNode, outgoingEdge.from(), new ArrayList())) { + addRegularEdge(right,outgoingEdge.getLabel(), prevNode, outgoingEdge.from(), true); + } + } + + } else { + outgoingEdges.addAll(getOutgoingEdges(rightPrev, prevNode)); + for (final TransitionEdge outgoingEdge : outgoingEdges) { + addRegularEdge(right,outgoingEdge.getLabel(), prevNode, outgoingEdge.to(), true); + } + } + } + + if (leftElOp != null && ("?".equals(leftElOp) || "*".equals(leftElOp))) { + addRegularEdge(right, leftPrev, prevNode, true); + } + + } else if ((left instanceof Order || left instanceof SimpleOrder) && !(right instanceof Order || right instanceof SimpleOrder)) { + StateNode leftPrev = prevNode; + + Optional> optionalOrLevel = leftOvers.get(level).stream().filter(e -> "|".equals(e.getKey())).findFirst(); + if (optionalOrLevel.isPresent()) { + Entry orLevel = optionalOrLevel.get(); + StateNode p = orLevel.getValue(); + List orEdges = getOutgoingEdges(prevNode, null); + if (!orEdges.isEmpty()) { + Optional edge = orEdges.stream().filter(e -> e.getRight().equals(p)).findFirst(); + if (edge.isPresent() && edge.get().getLabel().equals(CryslReaderUtils.resolveAggregateToMethodeNames(getLeftMostChild(left).getOrderEv().get(0)))) { + leftOvers.put(level + 1, orLevel); + } + } + } + prevNode = process(left, level + 1, leftOvers, prevNode); + + if (rightElOp != null && ("?".equals(rightElOp) || "*".equals(rightElOp))) { + leftOvers.put(level - 1, new HashMap.SimpleEntry<>(rightElOp, prevNode)); + prevNode = addRegularEdge(right, prevNode, null, true); + } else { + prevNode = addRegularEdge(right, prevNode, null); + } + + if (rightElOp != null && ("+".equals(rightElOp) || "*".equals(rightElOp))) { + addRegularEdge(right, prevNode, prevNode, true); + } + + } else if (!(left instanceof Order || left instanceof SimpleOrder) && (right instanceof Order || right instanceof SimpleOrder)) { + StateNode leftPrev = prevNode; + prevNode = addRegularEdge(left, prevNode, null); + + if (leftElOp != null && ("+".equals(leftElOp) || "*".equals(leftElOp))) { + addRegularEdge(left, prevNode, prevNode, true); + } + + if (rightElOp != null && ("?".equals(rightElOp) || "*".equals(rightElOp))) { + leftOvers.put(level - 1, new HashMap.SimpleEntry<>(rightElOp, prevNode)); + } + final StateNode rightPrev = prevNode; + if ("|".equals(orderOp)) { + leftOvers.put(level + 1, new HashMap.SimpleEntry<>(orderOp, prevNode)); + prevNode = process(right, level + 1, leftOvers, leftPrev); + } else { + prevNode = process(right, level + 1, leftOvers, prevNode); + } + + if (rightElOp != null && ("+".equals(rightElOp) || "*".equals(rightElOp))) { + final List outgoingEdges = getOutgoingEdges(rightPrev, prevNode); + for (final TransitionEdge outgoingEdge : outgoingEdges) { + addRegularEdge(right,outgoingEdge.getLabel(), prevNode, outgoingEdge.to(), true); + } + } + + if (leftElOp != null && ("?".equals(leftElOp) || "*".equals(leftElOp))) { + addRegularEdge(right, leftPrev, prevNode, true); + } + + } else if (!(left instanceof Order || left instanceof SimpleOrder) && !(right instanceof Order || right instanceof SimpleOrder)) { + StateNode leftPrev = null; + leftPrev = prevNode; + + boolean sameName = false; + List orEdges = getOutgoingEdges(prevNode, null); + Optional> alternative = leftOvers.get(level).stream().filter(e -> "|".equals(e.getKey())).findFirst(); + if (alternative.isPresent()) { + Entry orLevel = alternative.get(); + StateNode p = orLevel.getValue(); + if (!orEdges.isEmpty()) { + Optional edge = orEdges.stream().filter(e -> e.getRight().equals(p)).findFirst(); + if (edge.isPresent() && edge.get().getLabel().equals(CryslReaderUtils.resolveAggregateToMethodeNames(getLeftMostChild(left).getOrderEv().get(0)))) { + sameName = true; + prevNode = p; + leftOvers.remove(level, orLevel); + } + } + } + if (!sameName) { + prevNode = addRegularEdge(left, prevNode, null); + } + + StateNode returnToNode = isOr(level, leftOvers); + if (leftElOp != null && ("+".equals(leftElOp) || "*".equals(leftElOp))) { + addRegularEdge(left, prevNode, prevNode, true); + } + + if (rightElOp != null && ("?".equals(rightElOp) || "*".equals(rightElOp))) { + leftOvers.put(level - 1, new HashMap.SimpleEntry<>(rightElOp, prevNode)); + } + if (returnToNode != null || "|".equals(orderOp)) { + if ("|".equals(orderOp)) { + addRegularEdge(right, leftPrev, prevNode); + } + if ((returnToNode = isOr(level, leftOvers)) != null) { + prevNode = addRegularEdge(right, prevNode, returnToNode); + } + } else { + prevNode = addRegularEdge(right, prevNode, null); + } + + if (rightElOp != null && ("+".equals(rightElOp) || "*".equals(rightElOp))) { + addRegularEdge(right, prevNode, prevNode, true); + } + + if (leftElOp != null && ("?".equals(leftElOp) || "*".equals(leftElOp))) { + addRegularEdge(right, leftPrev, prevNode, true); + } + + if (sameName) { + setAcceptingState(alternative.get().getValue()); + } + + } + leftOvers.removeAll(level); + return prevNode; + } + + private boolean isReachable(final StateNode stateNode, final StateNode prevNode, final List skippable) { + for (final TransitionEdge edge : getOutgoingEdges(stateNode, stateNode)) { + if (edge.to().equals(prevNode)) { + return true; + } else if (!skippable.contains(edge.to())) { + skippable.add(edge.to()); + return isReachable(edge.to(), prevNode, skippable); + } + } + return false; + } + + private void processHead(final Expression curLevel, final int level, final Multimap> leftOvers, StateNode prevNode) { + final Expression left = curLevel.getLeft(); + final Expression right = curLevel.getRight(); + final String leftElOp = (left != null) ? left.getElementop() : ""; + final String rightElOp = (right != null) ? right.getElementop() : ""; + final String orderOp = curLevel.getOrderop(); + + if (left == null && right == null) { + final String elOp = curLevel.getElementop(); + if ("*".equals(elOp) || "?".equals(elOp)) { + prevNode = addRegularEdge(curLevel, prevNode, null, true); + } else { + addRegularEdge(curLevel, prevNode, null); + } + if ("*".equals(elOp) || "+".equals(elOp)) { + addRegularEdge(curLevel, prevNode, prevNode, true); + } + } else if ((left instanceof Order || left instanceof SimpleOrder) && (right instanceof Order || right instanceof SimpleOrder)) { + final StateNode leftPrev = prevNode; + prevNode = process(left, level + 1, leftOvers, prevNode); + final StateNode rightPrev = prevNode; + if ("|".equals(orderOp)) { + prevNode = process(right, level + 1, leftOvers, leftPrev); + } else { + prevNode = process(right, level + 1, leftOvers, prevNode); + } + for (Entry a : leftOvers.get(level).stream().filter(e -> "?".equals(e.getKey())).collect(Collectors.toList())) { + if ("*".equals(rightElOp) || "?".equals(rightElOp)) { + setAcceptingState(a.getValue()); + for (TransitionEdge l : getOutgoingEdges(rightPrev, null)) { + addRegularEdge(right, l.getLabel(), a.getValue(), l.getRight(), true); + } + } + } + + if ("*".equals(rightElOp) || "?".equals(rightElOp)) { + setAcceptingState(rightPrev); + } + if (rightElOp != null && ("+".equals(rightElOp) || "*".equals(rightElOp))) { + final String orderop = right.getOrderop(); + List outgoingEdges = null; + if (orderop != null && "|".equals(orderop)) { + outgoingEdges = getOutgoingEdges(rightPrev, null); + } else { + outgoingEdges = getOutgoingEdges(rightPrev, prevNode); + } + for (final TransitionEdge outgoingEdge : outgoingEdges) { + addRegularEdge(right, outgoingEdge.getLabel(), prevNode, outgoingEdge.to(), true); + } + } + + if (leftElOp != null && ("?".equals(leftElOp) || "*".equals(leftElOp))) { + addRegularEdge(right, leftPrev, prevNode, true); + } + } else if ((left instanceof Order || left instanceof SimpleOrder) && !(right instanceof Order || right instanceof SimpleOrder)) { + final StateNode leftPrev = prevNode; + prevNode = process(left, level + 1, leftOvers, prevNode); + final StateNode rightPrev = prevNode; + if ("|".equals(orderOp)) { + prevNode = addRegularEdge(right, leftPrev, prevNode); + } else { + prevNode = addRegularEdge(right, prevNode, null); + } + for (Entry a : leftOvers.get(level).stream().filter(e -> "*".equals(e.getKey())).collect(Collectors.toList())) { + addRegularEdge(right, a.getValue(), prevNode, true); + } + boolean isOptional = "*".equals(rightElOp) || "?".equals(rightElOp); + if (isOptional) { + setAcceptingState(rightPrev); + if ("?".equals(left.getRight().getElementop()) || "*".equals(left.getRight().getElementop())) { + final List outgoingEdges = getOutgoingEdges(leftPrev, null); + for (final TransitionEdge outgoingEdge : outgoingEdges) { + setAcceptingState(outgoingEdge.to()); + } + } + } + + if (rightElOp != null && ("+".equals(rightElOp) || "*".equals(rightElOp))) { + final List outgoingEdges = getOutgoingEdges(rightPrev, null); + for (final TransitionEdge outgoingEdge : outgoingEdges) { + addRegularEdge(right, outgoingEdge.getLabel(), prevNode, outgoingEdge.to(), true); + } + } + if (leftOvers.containsKey(level)) { + for (Entry entry : leftOvers.get(level).stream().filter(e -> "*".equals(e.getKey()) || "?".equals(e.getKey())).collect(Collectors.toList())) { + addRegularEdge(right, entry.getValue(), prevNode, isOptional); + } + } + StateNode returnToNode = null; + if ((returnToNode = isQM(level, leftOvers)) != null) { + addRegularEdge(right, returnToNode, prevNode, true); + } + } else if (!(left instanceof Order || left instanceof SimpleOrder) && (right instanceof Order || right instanceof SimpleOrder)) { + StateNode leftPrev = null; + leftPrev = prevNode; + prevNode = addRegularEdge(left, prevNode, null); + + if (leftElOp != null && ("+".equals(leftElOp) || "*".equals(leftElOp))) { + addRegularEdge(left, prevNode, prevNode); + } + + final StateNode rightPrev = prevNode; + StateNode returnToNode = null; + if (rightElOp != null && ("?".equals(rightElOp) || "*".equals(rightElOp))) { + setAcceptingState(rightPrev); + } + if ("|".equals(orderOp)) { + setAcceptingState(prevNode); + SimpleEntry entry = new HashMap.SimpleEntry<>(orderOp, prevNode); + leftOvers.put(level + 1, entry); + prevNode = process(right, level + 1, leftOvers, leftPrev); + + } else if ((returnToNode = isOr(level, leftOvers)) != null) { + prevNode = process(right, level + 1, leftOvers, returnToNode); + } else { + prevNode = process(right, level + 1, leftOvers, prevNode); + } + + if (rightElOp != null && ("+".equals(rightElOp) || "*".equals(rightElOp))) { + final List outgoingEdges = getOutgoingEdges(rightPrev, null); + for (final TransitionEdge outgoingEdge : outgoingEdges) { + addRegularEdge(right, outgoingEdge.getLabel(), prevNode, outgoingEdge.to(), true); + } + } + + if (leftElOp != null && ("?".equals(leftElOp) || "*".equals(leftElOp))) { + setAcceptingState(leftPrev); + final List outgoingEdges = getOutgoingEdges(rightPrev, null); + for (final TransitionEdge outgoingEdge : outgoingEdges) { + setAcceptingState(outgoingEdge.to()); + addRegularEdge(right, outgoingEdge.getLabel(), leftPrev, outgoingEdge.to(), true); + } + } + if (rightElOp != null && ("?".equals(rightElOp) || "*".equals(rightElOp))) { + setAcceptingState(rightPrev); + if (leftOvers.containsKey(level)) { + leftOvers.get(level).stream().filter(e -> "*".equals(e.getKey()) || "?".equals(e.getKey())).forEach(e -> setAcceptingState(e.getValue())); + } + } + + } else if (!(left instanceof Order || left instanceof SimpleOrder) && !(right instanceof Order || right instanceof SimpleOrder)) { + StateNode leftPrev = null; + leftPrev = prevNode; + StateNode returnToNode = isOr(level, leftOvers); + + final boolean leftOptional = "?".equals(leftElOp) || "*".equals(leftElOp); + prevNode = addRegularEdge(left, prevNode, null, leftOptional); + + if (leftElOp != null && ("+".equals(leftElOp) || "*".equals(leftElOp))) { + addRegularEdge(left, prevNode, prevNode, true); + } + + final boolean rightoptional = "?".equals(rightElOp) || "*".equals(rightElOp); + if (returnToNode != null || "|".equals(orderOp)) { + if ("|".equals(orderOp)) { + addRegularEdge(right, leftPrev, prevNode, rightoptional); + } + if ((returnToNode = isOr(level, leftOvers)) != null) { + prevNode = addRegularEdge(right, prevNode, returnToNode, rightoptional); + } + } else { + prevNode = addRegularEdge(right, prevNode, null, rightoptional); + } + + if (rightElOp != null && ("+".equals(rightElOp) || "*".equals(rightElOp))) { + addRegularEdge(right, prevNode, prevNode, true); + } + + if (leftElOp != null && ("?".equals(leftElOp) || "*".equals(leftElOp))) { + addRegularEdge(right, leftPrev, prevNode, true); + } + } + } + + private void setAcceptingState(final StateNode prevNode) { + prevNode.setAccepting(true); + } + + private Expression getLeftMostChild(Expression ex) { + if (ex.getOrderEv().size() > 0) { + return ex; + } + if (ex.getLeft() != null) { + return getLeftMostChild(ex.getLeft()); + } + return null; + } + + +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateNode.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateNode.java new file mode 100644 index 000000000..9e0ff311e --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateNode.java @@ -0,0 +1,112 @@ +package de.cognicrypt.order.editor.statemachine; + + +public class StateNode implements java.io.Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + + private final String name; + + private Boolean init = false; + private Boolean accepting = false; + private int hopsToAccepting = Integer.MAX_VALUE; + + public StateNode(String _name) { + name = _name; + } + + public StateNode(String _name, Boolean _init) { + this(_name); + init = _init; + } + + public StateNode(String _name, Boolean _init, Boolean _accepting) { + this(_name, _init); + accepting = _accepting; + } + + public String getName() { + return name; + } + + public Boolean getInit() { + return init; + } + + public Boolean getAccepting() { + return accepting; + } + + public void setAccepting(Boolean _accepting) { + accepting = _accepting; + } + + public String toString() { + StringBuilder nodeSB = new StringBuilder(); + nodeSB.append("Name: "); + nodeSB.append(name); + nodeSB.append(" ("); + if (!accepting) { + nodeSB.append(hopsToAccepting + "hops to "); + } + nodeSB.append("accepting)"); + return nodeSB.toString(); + } + + public boolean isErrorState() { + return !accepting; + } + + public boolean isInitialState() { + return init; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((accepting == null) ? 0 : accepting.hashCode()); + result = prime * result + ((init == null) ? 0 : init.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + StateNode other = (StateNode) obj; + if (accepting == null) { + if (other.accepting != null) + return false; + } else if (!accepting.equals(other.accepting)) + return false; + if (init == null) { + if (other.init != null) + return false; + } else if (!init.equals(other.init)) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + return true; + } + + public void setHopsToAccepting(int hops) { + hopsToAccepting = hops; + } + + public int getHopsToAccepting() { + return hopsToAccepting; + } + +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateTransition.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateTransition.java new file mode 100644 index 000000000..2630dfa58 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/StateTransition.java @@ -0,0 +1,11 @@ +package de.cognicrypt.order.editor.statemachine; + +import java.util.List; + +import de.darmstadt.tu.crossing.crySL.Event; + +public interface StateTransition{ + State from(); + State to(); + Event getLabel(); +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/TransitionEdge.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/TransitionEdge.java new file mode 100644 index 000000000..354092759 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/statemachine/TransitionEdge.java @@ -0,0 +1,90 @@ +package de.cognicrypt.order.editor.statemachine; + +import java.util.List; + +import de.darmstadt.tu.crossing.crySL.Event; + +public class TransitionEdge implements StateTransition, java.io.Serializable { + + private static final long serialVersionUID = 1L; + private StateNode left = null; + private StateNode right = null; + private Event method = null; + + // see the implementation in CryptoAnalysis TransitionEdge + // may be it is required to keep it as in CryptoAnalysis. + public TransitionEdge(Event _method, StateNode _left, StateNode _right) { + left = _left; + right = _right; + method = _method; + } + + public StateNode getLeft() { + return left; + } + + public StateNode getRight() { + return right; + } + + public Event getLabel() { + return method; + } + + public String toString() { + StringBuilder edgeSB = new StringBuilder(); + edgeSB.append("Left: "); + edgeSB.append(this.left.getName()); + edgeSB.append(" ===="); + edgeSB.append(method); + edgeSB.append("====> Right:"); + edgeSB.append(this.right.getName()); + return edgeSB.toString(); + } + + public StateNode from() { + return left; + } + + public StateNode to() { + return right; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((method == null) ? 0 : method.hashCode()); + result = prime * result + ((left == null) ? 0 : left.hashCode()); + result = prime * result + ((right == null) ? 0 : right.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + TransitionEdge other = (TransitionEdge) obj; + if (method == null) { + if (other.method != null) + return false; + } else if (!method.equals(other.method)) + return false; + if (left == null) { + if (other.left != null) + return false; + } else if (!left.equals(other.left)) + return false; + if (right == null) { + if (other.right != null) + return false; + } else if (!right.equals(other.right)) + return false; + return true; + } + +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/validation/StatemachineValidator.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/validation/StatemachineValidator.java new file mode 100644 index 000000000..bb828f593 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/validation/StatemachineValidator.java @@ -0,0 +1,25 @@ +/* + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.validation; + + +/** + * This class contains custom validation rules. + * + * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation + */ +public class StatemachineValidator extends AbstractStatemachineValidator { + +// public static final String INVALID_NAME = "invalidName"; +// +// @Check +// public void checkGreetingStartsWithCapital(Greeting greeting) { +// if (!Character.isUpperCase(greeting.getName().charAt(0))) { +// warning("Name should start with a capital", +// StatemachinePackage.Literals.GREETING__NAME, +// INVALID_NAME); +// } +// } + +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/wizard/OrderEditorWizard.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/wizard/OrderEditorWizard.java new file mode 100644 index 000000000..536a98507 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/wizard/OrderEditorWizard.java @@ -0,0 +1,32 @@ +/******************************************************************************** + * Copyright (c) 2015-2019 TU Darmstadt, Paderborn University + * + + * http://www.eclipse.org/legal/epl-2.0. SPDX-License-Identifier: EPL-2.0 + ********************************************************************************/ + +package de.cognicrypt.order.editor.wizard; + +import org.eclipse.jface.wizard.Wizard; +import de.cognicrypt.core.Constants; + +public class OrderEditorWizard extends Wizard { + + public OrderEditorWizard() { + + } + + @Override + public void addPages() { + addPage(new PageForOrderDiagramWizard(Constants.PAGE_NAME_FOR_MODE_OF_WIZARD, Constants.PAGE_TITLE_FOR_MODE_OF_WIZARD, Constants.PAGE_DESCRIPTION_FOR_MODE_OF_WIZARD)); + + //addPage(new PageForTaskIntegratorWizard(Constants.PAGE_NAME_FOR_LINK_ANSWERS, Constants.PAGE_TITLE_FOR_LINK_ANSWERS, Constants.PAGE_DESCIPTION_FOR_LINK_ANSWERS)); + + } + + @Override + public boolean performFinish() { + // TODO Auto-generated method stub + return false; + } +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/wizard/OrderEditorWizardDialog.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/wizard/OrderEditorWizardDialog.java new file mode 100644 index 000000000..9c9837904 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/wizard/OrderEditorWizardDialog.java @@ -0,0 +1,33 @@ +/******************************************************************************** + * Copyright (c) 2015-2019 TU Darmstadt, Paderborn University + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + ********************************************************************************/ + +package de.cognicrypt.order.editor.wizard; + +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.wizard.IWizard; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Shell; + +public class OrderEditorWizardDialog extends WizardDialog { + + public OrderEditorWizardDialog(final Shell parentShell, final IWizard newWizard) { + super(parentShell, newWizard); + } + + @Override + protected void createButtonsForButtonBar(final Composite parent) { + super.createButtonsForButtonBar(parent); + final Button finishButton = getButton(IDialogConstants.FINISH_ID); + finishButton.setText("Generate"); + } + +} diff --git a/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/wizard/PageForOrderDiagramWizard.java b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/wizard/PageForOrderDiagramWizard.java new file mode 100644 index 000000000..ff96659a7 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/src/de/cognicrypt/order/editor/wizard/PageForOrderDiagramWizard.java @@ -0,0 +1,83 @@ +/******************************************************************************** + * Copyright (c) 2015-2019 TU Darmstadt, Paderborn University + * + + * http://www.eclipse.org/legal/epl-2.0. SPDX-License-Identifier: EPL-2.0 + ********************************************************************************/ + +/** + * + */ +package de.cognicrypt.order.editor.wizard; + +import java.util.List; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +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 de.cognicrypt.order.editor.Constants; +import de.cognicrypt.order.editor.config.CryslFile; +import de.cognicrypt.order.editor.config.StaxParser; +import de.cognicrypt.order.editor.config.StaxWriter; + +public class PageForOrderDiagramWizard extends WizardPage { + + /** + * Create the wizard. + */ + public PageForOrderDiagramWizard(final String name, final String title, final String description) { + super(name); + setTitle(title); + setDescription(description); + setPageComplete(false); + } + + /** + * Create contents of the wizard. + * + * @param parent + */ + @Override + public void createControl(final Composite parent) { + final Composite container = new Composite(parent, SWT.NONE); + setControl(container); + + container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + container.setLayout(new GridLayout(2, false)); + + // needs to be replaced by file selection drop down menu later + final Button button = new Button(container, SWT.PUSH); + button.setText("Generate Statemachine Models"); + + button.addSelectionListener(new SelectionListener() { + + + @Override + public void widgetSelected(SelectionEvent e) { + // TODO Auto-generated method stub + + StaxWriter configFile = new StaxWriter(); + + configFile.setFile("config" + Constants.XML_EXTENSION); + try { + configFile.saveConfig(); + } catch (Exception ex) { + ex.printStackTrace(); + } + StaxParser read = new StaxParser(); + List readConfig = read.readConfig(configFile.getFile().getPath()); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + + } + }); + } +} diff --git a/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/.StatemachineGenerator.java._trace b/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/.StatemachineGenerator.java._trace new file mode 100644 index 000000000..ee36e84c1 Binary files /dev/null and b/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/.StatemachineGenerator.java._trace differ diff --git a/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/.StatemachineGenerator.xtendbin b/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/.StatemachineGenerator.xtendbin new file mode 100644 index 000000000..4e3482dde Binary files /dev/null and b/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/.StatemachineGenerator.xtendbin differ diff --git a/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/.gitignore b/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/.gitignore new file mode 100644 index 000000000..d68d8ef39 --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/.gitignore @@ -0,0 +1,3 @@ +/.StatemachineGenerator.java._trace +/.StatemachineGenerator.xtendbin +/StatemachineGenerator.java diff --git a/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/StatemachineGenerator.java b/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/StatemachineGenerator.java new file mode 100644 index 000000000..8e31ae68d --- /dev/null +++ b/plugins/de.cognicrypt.order.editor/xtend-gen/de/cognicrypt/order/editor/generator/StatemachineGenerator.java @@ -0,0 +1,21 @@ +/** + * generated by Xtext 2.25.0 + */ +package de.cognicrypt.order.editor.generator; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.xtext.generator.AbstractGenerator; +import org.eclipse.xtext.generator.IFileSystemAccess2; +import org.eclipse.xtext.generator.IGeneratorContext; + +/** + * Generates code from your model files on save. + * + * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation + */ +@SuppressWarnings("all") +public class StatemachineGenerator extends AbstractGenerator { + @Override + public void doGenerate(final Resource resource, final IFileSystemAccess2 fsa, final IGeneratorContext context) { + } +} diff --git a/pom.xml b/pom.xml index bcf0a5b92..f3a9562b9 100644 --- a/pom.xml +++ b/pom.xml @@ -95,6 +95,7 @@ plugins/de.cognicrypt.staticanalyzer/ plugins/de.cognicrypt.integrator.task/ plugins/de.cognicrypt.integrator.primitive/ + plugins/de.cognicrypt.order.editor/ features/de.cognicrypt.core.feature/ features/de.cognicrypt.codegenerator.feature/ features/de.cognicrypt.cryslhandler.feature/