-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adopted syntax, added code generator example, added gitignore
- Loading branch information
1 parent
521c6a5
commit 73e51fb
Showing
71 changed files
with
1,036 additions
and
108,044 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="plugins/com.yakindu.sct.domain.scenario.lang.ui/src"/> | ||
<classpathentry kind="src" path="plugins/com.yakindu.sct.domain.scenario.lang.ui/src-gen"/> | ||
<classpathentry kind="src" path="plugins/com.yakindu.sct.domain.scenario.lang.ui/xtend-gen"/> | ||
<classpathentry kind="src" path="plugins/com.yakindu.sct.domain.scenario.lang/src"/> | ||
<classpathentry kind="src" path="plugins/com.yakindu.sct.domain.scenario.lang/src-gen"/> | ||
<classpathentry kind="src" path="plugins/com.yakindu.sct.domain.scenario.lang/xtend-gen"/> | ||
<classpathentry kind="src" path="plugins/com.yakindu.sct.domain.scenario.ui/src"/> | ||
<classpathentry kind="src" path="plugins/com.yakindu.sct.domain.scenario/src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="output" path="plugins/com.yakindu.sct.domain.scenario/bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>SBPinSC</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
8 changes: 8 additions & 0 deletions
8
examples/com.yakindu.sct.domain.scenario.generator.example/.classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="xtend-gen"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
4 changes: 4 additions & 0 deletions
4
examples/com.yakindu.sct.domain.scenario.generator.example/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/bin/ | ||
/target/ | ||
/xtend-gen/ | ||
/src-gen/ |
40 changes: 40 additions & 0 deletions
40
examples/com.yakindu.sct.domain.scenario.generator.example/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>com.yakindu.sct.domain.scenario.generator.example</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.xtend.shared.ui.xtendBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.xtend.shared.ui.xtendXPandNature</nature> | ||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | ||
</natures> | ||
</projectDescription> |
11 changes: 11 additions & 0 deletions
11
....yakindu.sct.domain.scenario.generator.example/.settings/org.eclipse.core.resources.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
eclipse.preferences.version=1 | ||
encoding/.classpath=Cp1252 | ||
encoding//.settings/org.eclipse.core.resources.prefs=Cp1252 | ||
encoding//.settings/org.eclipse.jdt.core.prefs=Cp1252 | ||
encoding//.settings/org.eclipse.xtend.shared.ui.prefs=Cp1252 | ||
encoding//META-INF/MANIFEST.MF=Cp1252 | ||
encoding//src/com/yakindu/sct/domain/scenario/generator/example/ScenarioExampleGenerator.xtend=Cp1252 | ||
encoding//src/com/yakindu/sct/domain/scenario/generator/example/ScenarioExampleGeneratorModule.java=Cp1252 | ||
encoding/<project>=Cp1252 | ||
encoding/build.properties=Cp1252 | ||
encoding/plugin.xml=Cp1252 |
4 changes: 4 additions & 0 deletions
4
...es/com.yakindu.sct.domain.scenario.generator.example/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 | ||
org.eclipse.jdt.core.compiler.compliance=1.5 | ||
org.eclipse.jdt.core.compiler.source=1.5 |
3 changes: 3 additions & 0 deletions
3
...yakindu.sct.domain.scenario.generator.example/.settings/org.eclipse.xtend.shared.ui.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
eclipse.preferences.version=1 | ||
project.specific.metamodel=true | ||
metamodelContributor=org.eclipse.xtend.typesystem.emf.ui.EmfMetamodelContributor |
26 changes: 26 additions & 0 deletions
26
examples/com.yakindu.sct.domain.scenario.generator.example/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: com.yakindu.sct.domain.scenario.generator.example | ||
Bundle-SymbolicName: com.yakindu.sct.domain.scenario.generator.example; singleton:=true | ||
Bundle-Version: 1.0.0 | ||
Require-Bundle: org.eclipse.jdt.core, | ||
org.apache.commons.logging, | ||
org.apache.log4j;resolution:=optional, | ||
com.ibm.icu, | ||
org.antlr.runtime, | ||
org.eclipse.core.runtime, | ||
org.eclipse.emf.mwe.utils, | ||
org.eclipse.emf.ecore.xmi, | ||
org.eclipse.jface.text, | ||
org.eclipse.xtend;bundle-version="0.7.0", | ||
org.eclipse.xtend.typesystem.emf;bundle-version="0.7.0", | ||
org.eclipse.xtext.xbase.lib, | ||
org.eclipse.xtend.lib, | ||
org.yakindu.sct.generator.core, | ||
org.yakindu.sct.model.sgen, | ||
org.yakindu.sct.model.sexec, | ||
org.yakindu.sct.model.stext, | ||
org.yakindu.sct.model.sgraph, | ||
com.yakindu.sct.domain.scenario.lang, | ||
org.yakindu.sct.generator.java | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 |
3 changes: 3 additions & 0 deletions
3
examples/com.yakindu.sct.domain.scenario.generator.example/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source.. = src/,\ | ||
xtend-gen | ||
bin.includes = META-INF/,.,plugin.xml |
23 changes: 23 additions & 0 deletions
23
examples/com.yakindu.sct.domain.scenario.generator.example/plugin.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.4"?> | ||
<plugin> | ||
<extension | ||
point="org.yakindu.sct.generator.core.generator"> | ||
<SCTGenerator | ||
executor="org.yakindu.sct.generator.core.execution.SGraphGeneratorEntryExecutor" | ||
bindings="com.yakindu.sct.domain.scenario.generator.example.ScenarioExampleGeneratorModule" | ||
description="" | ||
id="example::Scenario" | ||
name="Example Scenario Generator" | ||
contentType="statechart" | ||
elementRefType="org.yakindu.sct.model.sgraph.Statechart"> | ||
<FeatureLibrary | ||
library_id="org.yakindu.generator.core.features"> | ||
</FeatureLibrary> | ||
</SCTGenerator> | ||
</extension> | ||
<extension point="org.yakindu.sct.generator.core.extensions"> | ||
<ExtensionGeneratorMapping fileExtension="sct" generatorId="example::Scenario"> | ||
</ExtensionGeneratorMapping> | ||
</extension> | ||
</plugin> |
47 changes: 47 additions & 0 deletions
47
...mple/src/com/yakindu/sct/domain/scenario/generator/example/ScenarioExampleGenerator.xtend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.yakindu.sct.domain.scenario.generator.example | ||
|
||
import com.yakindu.sct.domain.scenario.scenarioText.BlockedEventSet | ||
import com.yakindu.sct.domain.scenario.scenarioText.RequestedEventSet | ||
import com.yakindu.sct.domain.scenario.scenarioText.StateScope | ||
import org.eclipse.xtext.generator.IFileSystemAccess | ||
import org.yakindu.sct.generator.core.ISGraphGenerator | ||
import org.yakindu.sct.model.sgen.GeneratorEntry | ||
import org.yakindu.sct.model.sgraph.State | ||
import org.yakindu.sct.model.sgraph.Statechart | ||
|
||
/** | ||
* Simple example how to use Blocks / Requested Event sets in code generator based on SGraph Meta Model | ||
*/ | ||
class ScenarioExampleGenerator implements ISGraphGenerator { | ||
|
||
override generate(Statechart sc, GeneratorEntry entry, IFileSystemAccess access) { | ||
access.generateFile(sc.name + '.txt', sc.info); | ||
} | ||
|
||
def info( | ||
Statechart sc) { | ||
''' | ||
The name of the state machine is '«sc.name»' | ||
The state machine has the following states: | ||
«FOR State state : sc.regions.map[vertices].flatten.filter(State)» | ||
«state.name» | ||
The state blocks the following events: | ||
«FOR blockedEventSet : state.scopes.filter(StateScope).map[scenarios.filter(BlockedEventSet)].flatten» | ||
«FOR event : blockedEventSet.events» | ||
«event.name» | ||
«ENDFOR» | ||
«ENDFOR» | ||
The state requested the following events: | ||
«FOR requestedEventSet : state.scopes.filter(StateScope).map[scenarios.filter(RequestedEventSet)].flatten» | ||
«FOR event : requestedEventSet.events» | ||
«event.name» | ||
«ENDFOR» | ||
«ENDFOR» | ||
«ENDFOR» | ||
'''.toString | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...src/com/yakindu/sct/domain/scenario/generator/example/ScenarioExampleGeneratorModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.yakindu.sct.domain.scenario.generator.example; | ||
|
||
import org.eclipse.xtext.naming.IQualifiedNameProvider; | ||
import org.yakindu.sct.generator.core.GeneratorModule; | ||
import org.yakindu.sct.generator.core.ISGraphGenerator; | ||
import org.yakindu.sct.model.sgen.GeneratorEntry; | ||
import org.yakindu.sct.model.stext.naming.StextNameProvider; | ||
|
||
import com.google.inject.Binder; | ||
|
||
public class ScenarioExampleGeneratorModule implements GeneratorModule { | ||
|
||
public void configure(GeneratorEntry entry, Binder binder) { | ||
binder.bind(ISGraphGenerator.class).to(ScenarioExampleGenerator.class); | ||
binder.bind(IQualifiedNameProvider.class).to(StextNameProvider.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
/bin/ | ||
/target/ | ||
.antlr-generator-3.2.0-patch.jar | ||
.antlr-generator-3.2.0.jar |
Oops, something went wrong.