Pārlūkot izejas kodu

Merge pull request #209 from m-sonntag/devel

Initial commit of C# Generator for Yakindu SCR
Andreas Mülder 9 gadi atpakaļ
vecāks
revīzija
9cf7d76653
100 mainītis faili ar 14625 papildinājumiem un 0 dzēšanām
  1. 2 0
      features/org.yakindu.sct.generator.csharp-feature/.gitignore
  2. 28 0
      features/org.yakindu.sct.generator.csharp-feature/.project
  3. 2 0
      features/org.yakindu.sct.generator.csharp-feature/.settings/org.eclipse.core.resources.prefs
  4. 2 0
      features/org.yakindu.sct.generator.csharp-feature/.settings/org.eclipse.core.runtime.prefs
  5. 6 0
      features/org.yakindu.sct.generator.csharp-feature/build.properties
  6. 328 0
      features/org.yakindu.sct.generator.csharp-feature/epl-v10.html
  7. 153 0
      features/org.yakindu.sct.generator.csharp-feature/feature.properties
  8. 32 0
      features/org.yakindu.sct.generator.csharp-feature/feature.xml
  9. 107 0
      features/org.yakindu.sct.generator.csharp-feature/license.html
  10. 16 0
      features/org.yakindu.sct.generator.csharp-feature/pom.xml
  11. 328 0
      features/org.yakindu.sct.generator.csharp-feature/sourceTemplateFeature/epl-v10.html
  12. 157 0
      features/org.yakindu.sct.generator.csharp-feature/sourceTemplateFeature/feature.properties
  13. 107 0
      features/org.yakindu.sct.generator.csharp-feature/sourceTemplateFeature/license.html
  14. 8 0
      plugins/org.yakindu.sct.generator.csharp/.classpath
  15. 2 0
      plugins/org.yakindu.sct.generator.csharp/.gitignore
  16. 51 0
      plugins/org.yakindu.sct.generator.csharp/.project
  17. 3 0
      plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.core.resources.prefs
  18. 2 0
      plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.core.runtime.prefs
  19. 11 0
      plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.jdt.core.prefs
  20. 3 0
      plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.xtend.shared.ui.prefs
  21. 32 0
      plugins/org.yakindu.sct.generator.csharp/META-INF/MANIFEST.MF
  22. 7 0
      plugins/org.yakindu.sct.generator.csharp/build.properties
  23. BIN
      plugins/org.yakindu.sct.generator.csharp/icons/sct.png
  24. 49 0
      plugins/org.yakindu.sct.generator.csharp/library/FeatureTypeLibrary.xmi
  25. 41 0
      plugins/org.yakindu.sct.generator.csharp/plugin.xml
  26. 47 0
      plugins/org.yakindu.sct.generator.csharp/pom.xml
  27. 36 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Beautifier.java
  28. 53 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpCodeGenerator.java
  29. 62 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpGenerator.xtend
  30. 29 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpKeywords.java
  31. 48 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpNamingService.xtend
  32. 289 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/ExpressionCode.xtend
  33. 148 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/FlowCode.xtend
  34. 125 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/GenmodelEntries.xtend
  35. 75 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/IStatemachine.xtend
  36. 76 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/ITimer.xtend
  37. 51 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/ITimerCallback.xtend
  38. 186 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Naming.xtend
  39. 100 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Navigation.xtend
  40. 36 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RunnableFeature.xtend
  41. 334 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RunnableWrapper.xtend
  42. 238 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RuntimeService.xtend
  43. 631 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Statemachine.xtend
  44. 223 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/StatemachineInterface.xtend
  45. 136 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/TimerService.xtend
  46. 72 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/features/CSharpFeatureConstants.java
  47. 87 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/features/CSharpFeatureValueProvider.java
  48. 70 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/features/ICSharpFeatureConstants.java
  49. 38 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/types/CSharpTypeSystemAccess.xtend
  50. 39 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/types/OldCSharpTypeSystemAccess.xtend
  51. 5 0
      plugins/org.yakindu.sct.generator.csharp/xtend-gen/.gitignore
  52. 9 0
      test-plugins/org.yakindu.sct.generator.csharp.test/.classpath
  53. 2 0
      test-plugins/org.yakindu.sct.generator.csharp.test/.gitignore
  54. 51 0
      test-plugins/org.yakindu.sct.generator.csharp.test/.project
  55. 2 0
      test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.core.resources.prefs
  56. 2 0
      test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.core.runtime.prefs
  57. 11 0
      test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.jdt.core.prefs
  58. 8 0
      test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.xtend.core.Xtend.prefs
  59. 16 0
      test-plugins/org.yakindu.sct.generator.csharp.test/META-INF/MANIFEST.MF
  60. 19 0
      test-plugins/org.yakindu.sct.generator.csharp.test/all C# generator tests.launch
  61. 5 0
      test-plugins/org.yakindu.sct.generator.csharp.test/build.properties
  62. 1472 0
      test-plugins/org.yakindu.sct.generator.csharp.test/model/model.sgen
  63. 472 0
      test-plugins/org.yakindu.sct.generator.csharp.test/model/test.sgen
  64. 37 0
      test-plugins/org.yakindu.sct.generator.csharp.test/pom.xml
  65. 39 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/IStatemachine.java
  66. 38 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/ITimer.java
  67. 15 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/ITimerCallback.java
  68. 207 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/RuntimeService.java
  69. 91 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/TimerService.java
  70. 278 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/alwaysoncycle/AlwaysOncycleStatemachine.java
  71. 15 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/alwaysoncycle/IAlwaysOncycleStatemachine.java
  72. 926 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/assignmentasexpression/AssignmentAsExpressionStatemachine.java
  73. 57 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/assignmentasexpression/IAssignmentAsExpressionStatemachine.java
  74. 380 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/bitexpressions/BitExpressionsStatemachine.java
  75. 28 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/bitexpressions/IBitExpressionsStatemachine.java
  76. 362 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/booleanexpressions/BooleanExpressionsStatemachine.java
  77. 26 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/booleanexpressions/IBooleanExpressionsStatemachine.java
  78. 286 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/castexpressions/CastExpressionsStatemachine.java
  79. 15 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/castexpressions/ICastExpressionsStatemachine.java
  80. 447 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/choice/ChoiceStatemachine.java
  81. 17 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/choice/IChoiceStatemachine.java
  82. 909 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/ckeywords/CKeywordsStatemachine.java
  83. 65 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/ckeywords/ICKeywordsStatemachine.java
  84. 262 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/conditionalexpressions/ConditionalExpressionsStatemachine.java
  85. 16 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/conditionalexpressions/IConditionalExpressionsStatemachine.java
  86. 350 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/constants/ConstantsStatemachine.java
  87. 31 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/constants/IConstantsStatemachine.java
  88. 629 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/declarations/DeclarationsStatemachine.java
  89. 54 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/declarations/IDeclarationsStatemachine.java
  90. 662 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/deepentry/DeepEntryStatemachine.java
  91. 19 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/deepentry/IDeepEntryStatemachine.java
  92. 738 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/deephistory/DeepHistoryStatemachine.java
  93. 20 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/deephistory/IDeepHistoryStatemachine.java
  94. 285 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/dynamicchoice/DynamicChoiceStatemachine.java
  95. 14 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/dynamicchoice/IDynamicChoiceStatemachine.java
  96. 171 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/emptytransition/EmptyTransitionStatemachine.java
  97. 5 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/emptytransition/IEmptyTransitionStatemachine.java
  98. 337 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/enterstate/EnterStateStatemachine.java
  99. 14 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/enterstate/IEnterStateStatemachine.java
  100. 0 0
      test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/entrychoice/EntryChoiceStatemachine.java

+ 2 - 0
features/org.yakindu.sct.generator.csharp-feature/.gitignore

@@ -0,0 +1,2 @@
+/bin/
+/target/

+ 28 - 0
features/org.yakindu.sct.generator.csharp-feature/.project

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.generator.csharp-feature</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.FeatureBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.FeatureNature</nature>
+	</natures>
+	<filteredResources>
+		<filter>
+			<id>1363185104704</id>
+			<name></name>
+			<type>10</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-target</arguments>
+			</matcher>
+		</filter>
+	</filteredResources>
+</projectDescription>

+ 2 - 0
features/org.yakindu.sct.generator.csharp-feature/.settings/org.eclipse.core.resources.prefs

@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8

+ 2 - 0
features/org.yakindu.sct.generator.csharp-feature/.settings/org.eclipse.core.runtime.prefs

@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n

+ 6 - 0
features/org.yakindu.sct.generator.csharp-feature/build.properties

@@ -0,0 +1,6 @@
+bin.includes = feature.xml,\
+               feature.properties,\
+               epl-v10.html,\
+               license.html
+src.includes = epl-v10.html,\
+               license.html

+ 328 - 0
features/org.yakindu.sct.generator.csharp-feature/epl-v10.html

@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+  <o:Revision>2</o:Revision>
+  <o:TotalTime>3</o:TotalTime>
+  <o:Created>2004-03-05T23:03:00Z</o:Created>
+  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+  <o:Pages>4</o:Pages>
+  <o:Words>1626</o:Words>
+  <o:Characters>9270</o:Characters>
+   <o:Lines>77</o:Lines>
+  <o:Paragraphs>18</o:Paragraphs>
+  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+  <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+  <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-parent:"";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p
+	{margin-right:0in;
+	mso-margin-top-alt:auto;
+	mso-margin-bottom-alt:auto;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+	{mso-style-name:"Balloon Text";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:Tahoma;
+	mso-fareast-font-family:"Times New Roman";}
+@page Section1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.Section1
+	{page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html>

+ 153 - 0
features/org.yakindu.sct.generator.csharp-feature/feature.properties

@@ -0,0 +1,153 @@
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+featureName=YAKINDU SCT Generator C#
+
+# "updateSiteName" property - label for the update site
+updateSiteName=YAKINDU Statechart Tools 2
+
+# "description" property - description of the feature
+description=Generator for Java of the YAKINDU Statechart Tools 2.
+
+# "licenseURL" property - URL of the "Feature License"
+licenseURL=license.html
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2011 committers of YAKINDU and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors:\n\
+    committers of YAKINDU and others - initial API and implementation\n
+################ end of copyright property ####################################
+
+license=\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+       - Content may be structured and packaged into modules to facilitate delivering,\n\
+         extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+         plug-in fragments ("Fragments"), and features ("Features").\n\
+       - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+         in a directory named "plugins".\n\
+       - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+         Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+         Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+         numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+       - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+         named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+       - The top-level (root) directory\n\
+       - Plug-in and Fragment directories\n\
+       - Inside Plug-ins and Fragments packaged as JARs\n\
+       - Sub-directories of the directory named "src" of certain Plug-ins\n\
+       - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+       - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+       - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+       - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+       - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+       - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+       1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+          the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+          extending or updating the functionality of an Eclipse-based product.\n\
+       2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+          Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+       3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+          govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+          Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+          with the Specification. Such Installable Software Agreement must inform the user of the\n\
+          terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+          the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+          indication of agreement by the user, the provisioning Technology will complete installation\n\
+          of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
+########### end of license property ##########################################

+ 32 - 0
features/org.yakindu.sct.generator.csharp-feature/feature.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.yakindu.sct.generator.csharp"
+      label="Yakindu Statechart Tools (SCT) C# Generator Feature"
+      version="2.5.0.qualifier"
+      provider-name="statecharts.org"
+      plugin="org.yakindu.sct.doc.user">
+
+   <description>
+      %description
+   </description>
+
+   <copyright url="%licenseURL">
+      %copyright
+   </copyright>
+
+   <license url="%licenseURL">
+      %license
+   </license>
+
+   <requires>
+      <import feature="org.yakindu.sct" version="2.5.0.qualifier"/>
+   </requires>
+
+   <plugin
+         id="org.yakindu.sct.generator.csharp"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+</feature>

+ 107 - 0
features/org.yakindu.sct.generator.csharp-feature/license.html

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+      and/or Fragments associated with that Feature.</li>
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+       <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>

+ 16 - 0
features/org.yakindu.sct.generator.csharp-feature/pom.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.yakindu.sct</groupId>
+		<artifactId>org.yakindu.sct.releng</artifactId>
+		<version>2.5.0-SNAPSHOT</version>
+		<relativePath>../../releng/org.yakindu.sct.releng/pom.xml</relativePath>
+	</parent>
+	<artifactId>org.yakindu.sct.generator.csharp</artifactId>
+	<packaging>eclipse-feature</packaging>
+	<groupId>org.yakindu.sct.features</groupId>
+
+</project>

+ 328 - 0
features/org.yakindu.sct.generator.csharp-feature/sourceTemplateFeature/epl-v10.html

@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+  <o:Revision>2</o:Revision>
+  <o:TotalTime>3</o:TotalTime>
+  <o:Created>2004-03-05T23:03:00Z</o:Created>
+  <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+  <o:Pages>4</o:Pages>
+  <o:Words>1626</o:Words>
+  <o:Characters>9270</o:Characters>
+   <o:Lines>77</o:Lines>
+  <o:Paragraphs>18</o:Paragraphs>
+  <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+  <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+  <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-parent:"";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p
+	{margin-right:0in;
+	mso-margin-top-alt:auto;
+	mso-margin-bottom-alt:auto;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman";
+	mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+	{mso-style-name:"Balloon Text";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:Tahoma;
+	mso-fareast-font-family:"Times New Roman";}
+@page Section1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.Section1
+	{page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html>

+ 157 - 0
features/org.yakindu.sct.generator.csharp-feature/sourceTemplateFeature/feature.properties

@@ -0,0 +1,157 @@
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=YAKINDU SCT) Generator C# (Source)
+
+# "providerName" property - name of the company that provides the feature
+providerName=YAKINDU
+
+# "updateSiteName" property - label for the update site
+updateSiteName=YAKINDU Statechart Tools 2
+
+# "description" property - description of the feature
+description=API documentation and source code for YAKINDU Statechart Tools 2.
+
+# "licenseURL" property - URL of the "Feature License"
+licenseURL=license.html
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2011 committers of YAKINDU and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors:\n\
+    committers of YAKINDU and others - initial API and implementation\n
+################ end of copyright property ####################################
+
+license=\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+       - Content may be structured and packaged into modules to facilitate delivering,\n\
+         extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+         plug-in fragments ("Fragments"), and features ("Features").\n\
+       - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+         in a directory named "plugins".\n\
+       - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+         Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+         Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+         numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+       - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+         named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+       - The top-level (root) directory\n\
+       - Plug-in and Fragment directories\n\
+       - Inside Plug-ins and Fragments packaged as JARs\n\
+       - Sub-directories of the directory named "src" of certain Plug-ins\n\
+       - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+       - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+       - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+       - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+       - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+       - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+       1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+          the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+          extending or updating the functionality of an Eclipse-based product.\n\
+       2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+          Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+       3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+          govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+          Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+          with the Specification. Such Installable Software Agreement must inform the user of the\n\
+          terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+          the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+          indication of agreement by the user, the provisioning Technology will complete installation\n\
+          of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
+########### end of license property ##########################################

+ 107 - 0
features/org.yakindu.sct.generator.csharp-feature/sourceTemplateFeature/license.html

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+      and/or Fragments associated with that Feature.</li>
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+       <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>

+ 8 - 0
plugins/org.yakindu.sct.generator.csharp/.classpath

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="xtend-gen"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 2 - 0
plugins/org.yakindu.sct.generator.csharp/.gitignore

@@ -0,0 +1,2 @@
+/bin/
+/target/

+ 51 - 0
plugins/org.yakindu.sct.generator.csharp/.project

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.generator.csharp</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.xtend.shared.ui.xtendBuilder</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>
+	<filteredResources>
+		<filter>
+			<id>1375978341680</id>
+			<name></name>
+			<type>10</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-target</arguments>
+			</matcher>
+		</filter>
+	</filteredResources>
+</projectDescription>

+ 3 - 0
plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.core.resources.prefs

@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+encoding//.settings/org.eclipse.xtend.shared.ui.prefs=Cp1252
+encoding/<project>=UTF-8

+ 2 - 0
plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.core.runtime.prefs

@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n

+ 11 - 0
plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

+ 3 - 0
plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.xtend.shared.ui.prefs

@@ -0,0 +1,3 @@
+#Thu Dec 22 16:18:38 CET 2011
+eclipse.preferences.version=1
+project.specific.metamodel=true

+ 32 - 0
plugins/org.yakindu.sct.generator.csharp/META-INF/MANIFEST.MF

@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Yakindu Statechart Tools (SCT) C# Generator
+Bundle-SymbolicName: org.yakindu.sct.generator.csharp;singleton:=true
+Bundle-Version: 2.5.0.qualifier
+Require-Bundle: org.eclipse.jdt.core;bundle-version="3.5.0",
+ org.apache.commons.logging,
+ org.apache.log4j;resolution:=optional,
+ com.ibm.icu;bundle-version="4.0.1",
+ org.antlr.runtime;bundle-version="3.0.0",
+ org.eclipse.core.runtime;bundle-version="3.5.0",
+ org.eclipse.emf.mwe.utils;bundle-version="0.7.0",
+ org.eclipse.emf.ecore.xmi;bundle-version="2.5.0",
+ org.eclipse.jface.text;bundle-version="3.5.0",
+ org.eclipse.xpand;bundle-version="0.7.0",
+ org.eclipse.xtend;bundle-version="0.7.0",
+ org.eclipse.xtend.typesystem.emf;bundle-version="0.7.0",
+ org.yakindu.sct.model.stext;bundle-version="1.0.0",
+ org.yakindu.sct.generator.core;bundle-version="1.0.0",
+ org.eclipse.jdt.launching;bundle-version="3.6.0",
+ org.yakindu.sct.generator.genmodel;bundle-version="1.0.0",
+ org.eclipse.xtext.xbase;bundle-version="2.0.0",
+ org.yakindu.sct.model.resource;bundle-version="1.0.0",
+ org.eclipse.xtend.lib,
+ com.google.guava,
+ org.eclipse.xtext.xbase.lib
+Bundle-Vendor: statecharts.org
+Export-Package: org.yakindu.sct.generator.csharp,
+ org.yakindu.sct.generator.csharp.features
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+

+ 7 - 0
plugins/org.yakindu.sct.generator.csharp/build.properties

@@ -0,0 +1,7 @@
+source.. = src/,\
+		xtend-gen/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               library/,\
+               icons/

BIN
plugins/org.yakindu.sct.generator.csharp/icons/sct.png


+ 49 - 0
plugins/org.yakindu.sct.generator.csharp/library/FeatureTypeLibrary.xmi

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="ASCII"?>
+<sgen:FeatureTypeLibrary
+    xmi:version="2.0"
+    xmlns:xmi="http://www.omg.org/XMI"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:sgen="http://www.yakindu.org/sct/statechart/SGen"
+    xsi:schemaLocation="http://www.yakindu.org/sct/statechart/SGen ../../org.yakindu.sct.model.sgen/model/emf/sgen.ecore"
+    name="C# Generator">
+  <types name="Naming"
+      optional="true">
+    <parameters
+        name="implementationSuffix"
+        optional="true"/>
+    <parameters
+        name="namespaceName"
+        comment="Namespace the state chart and all its utility functions live in"/>
+  </types>
+  <types name="GeneralFeatures"
+      optional="true">
+    <parameters
+        name="InterfaceObserverSupport"
+        optional="true"
+        parameterType="BOOLEAN"/>
+    <parameters
+        name="RuntimeService"
+        optional="true"
+        parameterType="BOOLEAN"/>
+    <parameters
+        name="TimerService"
+        optional="true"
+        parameterType="BOOLEAN"/>
+    <parameters
+        name="UseCSharpIntForInteger"
+        optional="true"
+        parameterType="BOOLEAN"/>
+  </types>
+  <types name="RunnableWrapper"
+      comment="Generates a runnable wrapper for the statemachine"
+      optional="true">
+    <parameters
+        name="namePrefix"
+        comment="Name prefix"
+        optional="true"/>
+    <parameters
+        name="nameSuffix"
+        comment="Name suffix"
+        optional="true"/>
+  </types>
+</sgen:FeatureTypeLibrary>

+ 41 - 0
plugins/org.yakindu.sct.generator.csharp/plugin.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.yakindu.sct.generator.core.generator">
+       <SCTGenerator
+            class="org.yakindu.sct.generator.csharp.CSharpCodeGenerator"
+            description="YAKINDU SCT C# Code Generator"
+            contentType="statechart"
+            elementRefType="org.yakindu.sct.model.sgraph.Statechart"
+            icon="icons/sct.png"
+            id="yakindu::csharp"
+            name="YAKINDU SCT C# Code Generator">
+          <FeatureLibrary
+                library_id="org.yakindu.generator.core.features">
+          </FeatureLibrary>
+          <FeatureLibrary
+                library_id="org.yakindu.generator.core.features.sctbase">
+          </FeatureLibrary>
+          <FeatureLibrary
+                library_id="org.yakindu.sct.generator.feature.csharp">
+          </FeatureLibrary>
+      </SCTGenerator>
+   </extension>
+   <extension
+         point="org.yakindu.sct.generator.core.featuretypes">
+      <FeatureLibrary
+            defaultProvider="org.yakindu.sct.generator.csharp.features.CSharpFeatureValueProvider"
+            library_id="org.yakindu.sct.generator.feature.csharp"
+            uri="platform:/plugin/org.yakindu.sct.generator.csharp/library/FeatureTypeLibrary.xmi">
+      </FeatureLibrary>
+   </extension>
+   <extension
+         point="org.yakindu.sct.generator.core.extensions">
+      <ExtensionGeneratorMapping
+            fileExtension="sct"
+            generatorId="yakindu::csharp">
+      </ExtensionGeneratorMapping>
+   </extension>
+
+</plugin>

+ 47 - 0
plugins/org.yakindu.sct.generator.csharp/pom.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.yakindu.sct</groupId>
+		<artifactId>org.yakindu.sct.releng</artifactId>
+		<version>2.5.0-SNAPSHOT</version>
+		<relativePath>../../releng/org.yakindu.sct.releng/pom.xml</relativePath>
+	</parent>
+	<artifactId>org.yakindu.sct.generator.csharp</artifactId>
+	<groupId>org.yakindu.sct.plugins</groupId>
+	<packaging>eclipse-plugin</packaging>
+	<build>
+		<plugins>
+			<plugin>
+				<artifactId>maven-clean-plugin</artifactId>
+				<configuration>
+					<filesets>
+						<fileset>
+							<directory>xtend-gen</directory>
+							<includes>
+								<include>**</include>
+							</includes>
+							<excludes>
+								<exclude>.gitignore</exclude>
+								<exclude>.svn/</exclude>
+							</excludes>
+						</fileset>
+					</filesets>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.eclipse.xtend</groupId>
+				<artifactId>xtend-maven-plugin</artifactId>
+				<executions>
+					<execution>
+						<goals>
+							<goal>compile</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>

+ 36 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Beautifier.java

@@ -0,0 +1,36 @@
+package org.yakindu.sct.generator.csharp;
+
+import 	java.io.File;
+
+import org.eclipse.xpand2.output.FileHandle;
+import org.eclipse.xpand2.output.FileHandleImpl;
+import org.eclipse.xpand2.output.JavaBeautifier;
+import org.eclipse.xpand2.output.Outlet;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+@Singleton
+public class Beautifier {
+
+	@Inject
+	JavaBeautifier csharpBeautifier;
+
+	/**
+	 * Format code with PostProcessor (XPand style).
+	 */
+	public CharSequence format(String fileName, CharSequence code) {
+
+		// create fileHandle with dummy outlet.
+		File file = new File(fileName);
+		FileHandle fileHandle = new FileHandleImpl(new Outlet(), file);
+		fileHandle.setBuffer(code);
+
+		// call postProcessor for formatting the code.
+		csharpBeautifier.beforeWriteAndClose(fileHandle);
+
+		// return formatted results.
+		return fileHandle.getBuffer();
+
+	}
+}

+ 53 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpCodeGenerator.java

@@ -0,0 +1,53 @@
+/**
+  Copyright (c) 2012-2015 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+ */
+package org.yakindu.sct.generator.csharp;
+
+import static org.yakindu.sct.generator.core.util.GeneratorUtils.isDumpSexec;
+
+import org.yakindu.sct.generator.csharp.CSharpNamingService;
+import org.yakindu.sct.generator.csharp.CSharpGenerator;
+import org.yakindu.sct.generator.core.impl.GenericJavaBasedGenerator;
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess;
+import org.yakindu.sct.generator.csharp.types.CSharpTypeSystemAccess;
+import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.naming.INamingService;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+import org.yakindu.sct.model.sgraph.Statechart;
+
+import com.google.inject.Binder;
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+public class CSharpCodeGenerator extends GenericJavaBasedGenerator {
+
+	@Override
+	public void runGenerator(Statechart statechart, GeneratorEntry entry) {
+		CSharpGenerator delegate = getInjector(entry).getInstance(
+				CSharpGenerator.class);
+		ExecutionFlow flow = createExecutionFlow(statechart, entry);
+		if (isDumpSexec(entry)) {
+			dumpSexec(entry, flow);
+		}
+		delegate.generate(flow, entry, getFileSystemAccess(entry));
+	}
+
+	@Override
+	protected Module getChildInjectorModule(final GeneratorEntry entry) {
+		Module module = super.getChildInjectorModule(entry);
+		return Modules.override(module).with(new Module() {
+			public void configure(Binder binder) {
+				binder.bind(ICodegenTypeSystemAccess.class)
+				.to(CSharpTypeSystemAccess.class);
+				binder.bind(INamingService.class).to(CSharpNamingService.class);
+				binder.bind(GeneratorEntry.class).toInstance(entry);
+			}
+		});
+	}
+}

+ 62 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpGenerator.xtend

@@ -0,0 +1,62 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+ */
+package org.yakindu.sct.generator.csharp
+
+import com.google.inject.Inject
+import org.eclipse.xtext.generator.IFileSystemAccess
+import org.yakindu.sct.generator.core.impl.IExecutionFlowGenerator
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.GeneratorEntry
+
+/**
+ * This is the C# code generators main class. 
+ * 
+ * @author Markus Mühlbrandt
+ * @author Axel Terfloth - extensions
+ */
+class CSharpGenerator implements IExecutionFlowGenerator {
+
+	@Inject extension GenmodelEntries
+	@Inject extension RunnableFeature
+
+	@Inject extension Navigation
+	@Inject extension IStatemachine
+	@Inject extension ITimerCallback
+	@Inject extension ITimer
+	@Inject extension TimerService
+	@Inject extension RuntimeService
+	@Inject extension StatemachineInterface
+	@Inject extension Statemachine
+	@Inject extension RunnableWrapper
+ 	
+	override generate(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
+
+		flow.generateIStatemachine(entry, fsa)
+		
+		if (flow.timed) {
+			flow.generateITimerCallback(entry, fsa)
+			flow.generateITimer(entry, fsa)
+			if (entry.createTimerService) {
+				flow.generateTimerService(entry, fsa);
+			}
+		}
+		
+		if (entry.createRuntimeService) {
+			flow.generateRuntimeService(entry, fsa)
+		}
+		
+		flow.generateStatemachineInterface(entry, fsa)
+		flow.generateStatemachine(entry, fsa)
+		
+		if (entry.hasFeatureRunnable) {
+			flow.generateRunnableWrapper(entry, fsa)
+		}
+	}
+}

+ 29 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpKeywords.java

@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2012 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.csharp;
+
+public interface CSharpKeywords {
+	
+	public static final String[] KEYWORDS = { 
+			"abstract", "as", "base", "bool", "break", "byte", 
+			"case", "catch", "char", "checked", "class", "const", 
+			"continue", "default", "delegate", "do", "double", "else", 
+			"enum", "event", "explicit", "extern", "false", "finally", 
+			"fixed", "float", "for", "foreach", "goto", "if", 
+			"implicit", "in", "int", "interface", "internal", "is", 
+			"lock", "long", "namespace", "new", "null", "object", 
+			"operator", "out", "override", "params", "private", "protected", 
+			"public", "readonly", "ref", "return", "sbyte", "sealed", 
+			"short", "sizeof", "stackalloc", "static", "string", "struct", 
+			"switch", "this", "throw", "true", "try", "typeof", 
+			"uint", "ulong", "unchecked", "unsafe", "ushort", "using", 
+			"virtual", "void", "volatile", "while" };
+}

+ 48 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpNamingService.xtend

@@ -0,0 +1,48 @@
+/*
+  Copyright (c) 2014-2015 committers of YAKINDU Statechart Tools.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  
+  Contributors:
+  	Axel Terfloth - Initial contribution
+*/
+package org.yakindu.sct.generator.csharp
+
+import com.google.inject.Inject
+import java.util.Arrays
+import org.yakindu.sct.model.sexec.Step
+import org.yakindu.sct.model.sexec.extensions.SExecExtensions
+import org.yakindu.sct.model.sexec.naming.DefaultNamingService
+
+/** 
+ * Specific adaption of the default naming service to the needs of the C# code generator.
+ * 
+ * @author axel terfloth (terfloth@itemis.de)
+ */
+class CSharpNamingService extends DefaultNamingService implements CSharpKeywords {
+	
+	@Inject extension SExecExtensions
+	
+  override protected prefix(Step it, char separator) {
+		switch (it) {
+			case isCheckFunction: "check"
+			case isEntryAction: "entryAction"
+			case isExitAction: "exitAction"
+			case isEffect: "effect"
+			case isEnterSequence: "enterSequence"
+			case isDeepEnterSequence: "deepEnterSequence"
+			case isShallowEnterSequence: "shallowEnterSequence"
+			case isExitSequence: "exitSequence"
+			case isReactSequence: "react"
+			default: ""
+		}
+	}
+
+		
+	override boolean isKeyword(String name) {
+		return !Arrays::asList(KEYWORDS).findFirst[it.equalsIgnoreCase(name)].nullOrEmpty
+	}
+
+}

+ 289 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/ExpressionCode.xtend

@@ -0,0 +1,289 @@
+package org.yakindu.sct.generator.csharp
+
+import com.google.inject.Inject
+import java.util.List
+import org.eclipse.emf.ecore.EObject
+import org.yakindu.base.expressions.expressions.AdditiveOperator
+import org.yakindu.base.expressions.expressions.AssignmentExpression
+import org.yakindu.base.expressions.expressions.AssignmentOperator
+import org.yakindu.base.expressions.expressions.BitwiseAndExpression
+import org.yakindu.base.expressions.expressions.BitwiseOrExpression
+import org.yakindu.base.expressions.expressions.BitwiseXorExpression
+import org.yakindu.base.expressions.expressions.BoolLiteral
+import org.yakindu.base.expressions.expressions.ConditionalExpression
+import org.yakindu.base.expressions.expressions.DoubleLiteral
+import org.yakindu.base.expressions.expressions.ElementReferenceExpression
+import org.yakindu.base.expressions.expressions.FeatureCall
+import org.yakindu.base.expressions.expressions.FloatLiteral
+import org.yakindu.base.expressions.expressions.HexLiteral
+import org.yakindu.base.expressions.expressions.IntLiteral
+import org.yakindu.base.expressions.expressions.LogicalAndExpression
+import org.yakindu.base.expressions.expressions.LogicalNotExpression
+import org.yakindu.base.expressions.expressions.LogicalOrExpression
+import org.yakindu.base.expressions.expressions.LogicalRelationExpression
+import org.yakindu.base.expressions.expressions.MultiplicativeOperator
+import org.yakindu.base.expressions.expressions.NullLiteral
+import org.yakindu.base.expressions.expressions.NumericalAddSubtractExpression
+import org.yakindu.base.expressions.expressions.NumericalMultiplyDivideExpression
+import org.yakindu.base.expressions.expressions.NumericalUnaryExpression
+import org.yakindu.base.expressions.expressions.ParenthesizedExpression
+import org.yakindu.base.expressions.expressions.PrimitiveValueExpression
+import org.yakindu.base.expressions.expressions.RelationalOperator
+import org.yakindu.base.expressions.expressions.ShiftExpression
+import org.yakindu.base.expressions.expressions.ShiftOperator
+import org.yakindu.base.expressions.expressions.StringLiteral
+import org.yakindu.base.expressions.expressions.TypeCastExpression
+import org.yakindu.base.expressions.expressions.UnaryOperator
+import org.yakindu.base.types.Declaration
+import org.yakindu.base.types.Event
+import org.yakindu.base.types.Operation
+import org.yakindu.base.types.Property
+import org.yakindu.base.types.inferrer.ITypeSystemInferrer
+import org.yakindu.base.types.typesystem.GenericTypeSystem
+import org.yakindu.base.types.typesystem.ITypeSystem
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
+import org.yakindu.sct.model.sexec.TimeEvent
+import org.yakindu.sct.model.stext.stext.ActiveStateReferenceExpression
+import org.yakindu.sct.model.stext.stext.EventRaisingExpression
+import org.yakindu.sct.model.stext.stext.EventValueReferenceExpression
+import org.yakindu.sct.model.stext.stext.OperationDefinition
+
+class ExpressionCode {
+
+	@Inject extension Naming
+	@Inject extension Navigation
+	@Inject extension ITypeSystem
+	@Inject extension ITypeSystemInferrer
+	@Inject extension ICodegenTypeSystemAccess
+
+	private var List<TimeEvent> timeEvents;
+
+	def private getTimeEvents(TimeEvent it) {
+		if (timeEvents == null) {
+			timeEvents = flow.timeEvents
+		}
+		return timeEvents
+	}
+
+	def dispatch String code(EObject it) '''
+		//ERROR: Template in ExpressionCode.xtend for class '«getClass().name»' not defined.
+		//Container: «eContainer?.getClass().name»
+	'''
+
+	def dispatch String code(OperationDefinition it) {
+		return context + "operationCallback." + name.asEscapedIdentifier;
+	}
+
+	def dispatch String code(PrimitiveValueExpression primValue) {
+		primValue.value.code;
+	}
+
+	def dispatch String code(ParenthesizedExpression e) {
+		"(" + e.expression.code + ")";
+	}
+
+	/* Assignment */
+	def dispatch String code(AssignmentExpression it) {
+		varRef.code + operator.code + expression.code
+	}
+
+	/* Literals */
+	def dispatch String code(BoolLiteral expression) {
+		expression.value.toString()
+	}
+
+	def dispatch String code(IntLiteral expression) {
+		expression.value.toString();
+	}
+
+	def dispatch String code(HexLiteral expression) {
+		expression.value.toString();
+	}
+
+	def dispatch String code(DoubleLiteral expression) {
+		expression.value.toString();
+	}
+
+	def dispatch String code(FloatLiteral expression) {
+		expression.value.toString();
+	}
+
+	def dispatch String code(NullLiteral expression) {
+		'null'
+	}
+
+	def dispatch String code(StringLiteral expression) {
+		"\"" + expression.value.toString().escaped + "\""
+	}
+
+	def String escaped(String it) {
+		return it.replace("\"", "\\\"");
+	}
+
+	/* Logical Expressions */
+	def dispatch String code(LogicalOrExpression expression) {
+		expression.leftOperand.code + " || " + expression.rightOperand.code
+	}
+
+	def dispatch String code(ConditionalExpression expression) {
+		expression.condition.code + ' ? ' + expression.trueCase.code + ' : ' + expression.falseCase.code
+	}
+
+	def dispatch String code(LogicalAndExpression expression) {
+		expression.leftOperand.code + " && " + expression.rightOperand.code
+	}
+
+	def dispatch String code(LogicalNotExpression expression) {
+		" !" + expression.operand.code
+	}
+
+	def dispatch String code(LogicalRelationExpression expression) {
+		if (isSame(expression.leftOperand.inferType(null), getType(GenericTypeSystem.STRING))) {
+			expression.logicalString
+		} else
+			expression.leftOperand.code + expression.operator.code + expression.rightOperand.code;
+	}
+
+	def String logicalString(LogicalRelationExpression expression) {
+		if (expression.operator == RelationalOperator::EQUALS) {
+			"(" + expression.leftOperand.code + "== null?" + expression.rightOperand.code + " ==null :" +
+				expression.leftOperand.code + ".Equals(" + expression.rightOperand.code + "))"
+		} else if (expression.operator == RelationalOperator::NOT_EQUALS) {
+			"(" + expression.leftOperand.code + "== null?" + expression.rightOperand.code + " !=null : !" +
+				expression.leftOperand.code + ".Equals(" + expression.rightOperand.code + "))"
+		}
+	}
+
+	def dispatch String code(BitwiseAndExpression expression) {
+		expression.leftOperand.code + " & " + expression.rightOperand.code
+	}
+
+	def dispatch String code(BitwiseOrExpression expression) {
+		expression.leftOperand.code + " | " + expression.rightOperand.code
+	}
+
+	def dispatch String code(BitwiseXorExpression expression) {
+		expression.leftOperand.code + " ^ " + expression.rightOperand.code
+	}
+
+	def dispatch String code(ShiftExpression expression) {
+		expression.leftOperand.code + expression.operator.code + expression.rightOperand.code
+	}
+
+	def dispatch String code(NumericalAddSubtractExpression expression) {
+		expression.leftOperand.code + expression.operator.code + expression.rightOperand.code
+	}
+
+	def dispatch String code(NumericalMultiplyDivideExpression expression) {
+		expression.leftOperand.code + expression.operator.code + expression.rightOperand.code
+	}
+
+	def dispatch String code(NumericalUnaryExpression expression) {
+		expression.operator.code + expression.operand.code
+	}
+
+	def dispatch String code(ActiveStateReferenceExpression it) {
+		"isStateActive(State." + value.stateName.asEscapedIdentifier + ")";
+	}
+
+	def dispatch String code(AdditiveOperator operator) {
+		operator.literal
+	}
+
+	def dispatch String code(ShiftOperator operator) {
+		operator.literal
+	}
+
+	def dispatch String code(UnaryOperator operator) {
+		operator.literal
+	}
+
+	def dispatch String code(MultiplicativeOperator operator) {
+		operator.literal
+	}
+
+	def dispatch String code(RelationalOperator operator) {
+		operator.literal
+	}
+
+	def dispatch String code(AssignmentOperator operator) {
+		operator.literal
+	}
+
+	def dispatch String code(EventRaisingExpression it) {
+		if (value != null) {
+			event.definition.context + "raise" + event.definition.name.toFirstUpper + "(" + value.code + ")"
+		} else {
+			event.definition.context + "raise" + event.definition.name.toFirstUpper + "()"
+		}
+	}
+
+	def dispatch String code(EventValueReferenceExpression it) {
+		value.definition.context + value.definition.event.valueIdentifier
+	}
+
+	def dispatch String code(ElementReferenceExpression it) '''
+		«IF it.reference instanceof OperationDefinition»
+			«reference.code»(«FOR arg : args SEPARATOR ", "»«arg.code»«ENDFOR»)
+		«ELSE»
+			«definition.code»
+		«ENDIF»
+	'''
+
+	def dispatch String code(FeatureCall it) '''
+		«IF feature instanceof Operation»
+			«feature.code»(«FOR arg : args SEPARATOR ", "»«arg.code»«ENDFOR»)
+		«ELSE»
+			«definition.context + definition.name.asEscapedIdentifier»
+		«ENDIF»
+	'''
+
+	def dispatch String code(Declaration it) {
+		context + name.asEscapedIdentifier
+	}
+
+	def dispatch String code(TimeEvent it) {
+		"timeEvents[" + getTimeEvents.indexOf(it) + "]"
+	}
+
+	def dispatch String code(TypeCastExpression it) {
+		'''((«type.getTargetLanguageName») «operand.code»)'''
+	}
+
+	def dispatch String getContext(Property it) {
+		if (it.const) {
+			return getConstContext(it)
+		}
+		if (scope != null) {
+			return scope.interfaceName.asEscapedIdentifier + "."
+		}
+		return ""
+	}
+	
+	def getConstContext(Property it){
+		if (scope != null) {
+			return scope.interfaceName + "."
+		}else{
+			return it.flow.statemachineInterfaceName + "."
+		}
+	}
+
+	def dispatch String getContext(Event it) {
+		if (scope != null) {
+			return scope.interfaceName.asEscapedIdentifier + "."
+		}
+		return ""
+	}
+
+	def dispatch String getContext(OperationDefinition it) {
+		if (scope != null) {
+			return scope.interfaceName.asEscapedIdentifier + "."
+		}
+		return ""
+	}
+
+	def dispatch String getContext(EObject it) {
+		return "//ERROR: No context for " + it
+	}
+
+}

+ 148 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/FlowCode.xtend

@@ -0,0 +1,148 @@
+package org.yakindu.sct.generator.csharp
+
+import com.google.inject.Inject
+import org.yakindu.sct.model.sexec.Call
+import org.yakindu.sct.model.sexec.Check
+import org.yakindu.sct.model.sexec.CheckRef
+import org.yakindu.sct.model.sexec.EnterState
+import org.yakindu.sct.model.sexec.Execution
+import org.yakindu.sct.model.sexec.ExitState
+import org.yakindu.sct.model.sexec.HistoryEntry
+import org.yakindu.sct.model.sexec.If
+import org.yakindu.sct.model.sexec.Reaction
+import org.yakindu.sct.model.sexec.SaveHistory
+import org.yakindu.sct.model.sexec.ScheduleTimeEvent
+import org.yakindu.sct.model.sexec.Sequence
+import org.yakindu.sct.model.sexec.StateSwitch
+import org.yakindu.sct.model.sexec.Step
+import org.yakindu.sct.model.sexec.UnscheduleTimeEvent
+import org.yakindu.sct.model.sexec.extensions.SExecExtensions
+import java.util.List
+import org.yakindu.sct.model.sexec.TimeEvent
+
+class FlowCode {
+	
+	@Inject extension Naming
+	@Inject extension ExpressionCode
+	@Inject extension SExecExtensions
+	
+	private var List<TimeEvent> timeEvents;
+	
+	def stepComment(Step it) '''
+		«IF comment != null && ! comment.empty»
+			/* «comment» */
+		«ENDIF»
+	'''
+	
+	def dispatch code(Step it) '''
+		//ERROR: FlowCode for Step '«getClass().name»' not defined
+	'''
+	
+	def dispatch CharSequence code(StateSwitch it) '''
+		«IF historyRegion != null»
+			switch(historyVector[«historyRegion.historyVector.offset»]) {
+		«ELSE»
+			switch(stateVector[«stateConfigurationIdx»]) {
+		«ENDIF»
+			«FOR stateCase : cases»
+				case State.«stateCase.state.stateName.asEscapedIdentifier» : 
+					«stateCase.step.code»
+					break;
+				
+			«ENDFOR»
+			default: 
+				break;
+		}
+	'''
+	
+	def dispatch CharSequence code(ScheduleTimeEvent it) '''
+		«stepComment»
+		
+		timer.setTimer(this, «getTimeEvents.indexOf(timeEvent)», «timeValue.code», «IF timeEvent.periodic»true«ELSE»false«ENDIF»);
+	'''
+	
+	def dispatch CharSequence code(UnscheduleTimeEvent it) '''
+		«stepComment»
+		timer.unsetTimer(this, «getTimeEvents.indexOf(timeEvent)»);
+	'''
+	
+	def dispatch CharSequence code(Execution it) {
+		'''
+		«statement.code»;
+		'''
+	}
+	
+	def dispatch CharSequence code(Call it) '''
+		«step.functionName()»();
+	'''
+	
+	def dispatch CharSequence code(Sequence it) {
+		steps.map[code].join('\n')
+	}
+	
+	def dispatch CharSequence code(Check it) '''
+		«IF this != null»
+			«condition.code()»
+		«ELSE»
+			true
+ 		«ENDIF»
+	'''
+	
+	def dispatch CharSequence code(CheckRef it) '''
+		«IF check != null»
+			«comment»
+			«check.functionName()»()
+		«ELSE»
+			true
+		«ENDIF»
+	'''
+	
+	def dispatch CharSequence code(Reaction it) {
+		effect.code
+	}
+	
+	def dispatch CharSequence code(If it) '''
+		«stepComment»
+		if («check.code») { 
+			«thenStep.code»
+		}
+		«IF elseStep != null»
+		else {
+			«elseStep.code»
+		}
+		«ENDIF»
+	'''
+	
+	def dispatch CharSequence code(EnterState it) '''
+		«stepComment»
+		nextStateIndex = «state.stateVector.offset»;
+		stateVector[«state.stateVector.offset»] = State.«state.stateName.asEscapedIdentifier»;
+	'''
+	
+	def dispatch CharSequence code(ExitState it) '''
+		«stepComment»
+		nextStateIndex = «state.stateVector.offset»;
+		stateVector[«state.stateVector.offset»] = State.«getNullStateName()»;
+	'''
+	
+	def dispatch CharSequence code(HistoryEntry it) '''
+		«stepComment»
+		if (historyVector[«region.historyVector.offset»] != State.$NullState$) {
+			«historyStep.code»
+		} «IF initialStep != null»else {
+			«initialStep.code»
+		} «ENDIF»
+	'''
+	
+	def dispatch CharSequence code(SaveHistory it) '''
+		«stepComment»
+		historyVector[«region.historyVector.offset»] = stateVector[«region.stateVector.offset»];
+	'''
+	
+	def private getTimeEvents(Step it) {
+		if (timeEvents==null) {
+			timeEvents = flow.timeEvents
+		}
+		return timeEvents
+	}
+}

+ 125 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/GenmodelEntries.xtend

@@ -0,0 +1,125 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+ */
+package org.yakindu.sct.generator.csharp
+
+import com.google.inject.Inject
+import org.yakindu.sct.generator.core.features.ICoreFeatureConstants
+import org.yakindu.sct.generator.csharp.features.ICSharpFeatureConstants
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.FeatureParameterValue
+import org.yakindu.sct.model.sgen.GeneratorEntry
+
+class GenmodelEntries {
+
+	@Inject extension Naming
+
+	def private getLicenseFeature(GeneratorEntry it) {
+		getFeatureConfiguration(ICoreFeatureConstants::LICENSE_HEADER)
+	}
+
+	def private getNamingFeature(GeneratorEntry it) {
+		getFeatureConfiguration(ICSharpFeatureConstants::NAMING_FEATURE)
+	}
+
+	def private getGeneralFeatures(GeneratorEntry it) {
+		getFeatureConfiguration(ICSharpFeatureConstants::GENERAL_FEATURES)
+	}
+	
+	def private FeatureParameterValue getNamespaceNameParameter(GeneratorEntry it) {
+		namingFeature?.getParameterValue(ICSharpFeatureConstants::NAMESPACE_NAME)
+	}
+	
+	def private FeatureParameterValue getImplementationSuffixParameter(GeneratorEntry it) {
+		namingFeature?.getParameterValue(ICSharpFeatureConstants::IMPLEMENTATION_SUFFIX)
+	}
+
+	def private FeatureParameterValue getLicenseTextParameter(GeneratorEntry it) {
+		licenseFeature?.getParameterValue(ICoreFeatureConstants::LICENSE_TEXT)
+	}
+
+	def private FeatureParameterValue getTimerServiceParameter(GeneratorEntry it) {
+		generalFeatures?.getParameterValue(ICSharpFeatureConstants::TIMER_SERVICE)
+	}
+
+	def private FeatureParameterValue getRuntimeServiceParameter(GeneratorEntry it) {
+		generalFeatures?.getParameterValue(ICSharpFeatureConstants::RUNTIME_SERVICE)
+	}
+
+	def private FeatureParameterValue getInterfaceObserverSupportParameter(GeneratorEntry it) {
+		generalFeatures?.getParameterValue(ICSharpFeatureConstants::INTERFACE_OBSERVER_SUPPORT)
+	}
+
+	def private FeatureParameterValue getUseCSharpIntForInteger(GeneratorEntry it) {
+		generalFeatures?.getParameterValue(ICSharpFeatureConstants::USE_CSHARP_INT_FOR_INTEGER)
+	}
+
+	def getLicenseText(GeneratorEntry it) {
+		if (licenseTextParameter != null) {
+			return "/**" + licenseTextParameter.stringValue + "*/"
+		}
+		return null
+	}
+
+	def getNamespaceName(GeneratorEntry it) {
+		if (namespaceNameParameter != null) {
+			return namespaceNameParameter.stringValue
+		}
+		return "Yakindu.SCR"
+	}
+
+	def getImplementationSuffix(GeneratorEntry it, ExecutionFlow flow) {
+		if (implementationSuffixParameter != null) {
+			return flow.statemachineName + implementationSuffixParameter.stringValue
+		}
+		return flow.statemachineName
+	}
+
+	def getImplementationPackageName(ExecutionFlow it, GeneratorEntry entry) {
+		entry.namespaceName + "." + entry.getImplementationSuffix(it).toLowerCase();
+	}
+
+	def getBasePackagePath(GeneratorEntry it) {
+		return namespaceName.replace('.', '/')
+	}
+
+	def getImplementationPackagePath(ExecutionFlow it, GeneratorEntry entry) {
+		getImplementationPackageName(entry).replace('.', '/')
+
+	//entry.basePackagePath+"/"+entry.getImplementationSuffix(it).toLowerCase
+	}
+
+	def createTimerService(GeneratorEntry it) {
+		if (timerServiceParameter != null) {
+			return timerServiceParameter.booleanValue
+		}
+		return false
+	}
+
+	def createRuntimeService(GeneratorEntry it) {
+		if (runtimeServiceParameter != null) {
+			return runtimeServiceParameter.booleanValue
+		}
+		return false
+	}
+
+	def createInterfaceObserver(GeneratorEntry it) {
+		if (interfaceObserverSupportParameter != null) {
+			return interfaceObserverSupportParameter.booleanValue
+		}
+		return false
+	}
+
+	def useCSharpInt(GeneratorEntry it) {
+		if (useCSharpIntForInteger != null) {
+			return useCSharpIntForInteger.booleanValue
+		}
+		return false
+	}
+}

+ 75 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/IStatemachine.xtend

@@ -0,0 +1,75 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+ */
+package org.yakindu.sct.generator.csharp
+
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.eclipse.xtext.generator.IFileSystemAccess
+import com.google.inject.Inject
+
+class IStatemachine {
+	
+	@Inject
+	extension Naming 
+	
+	@Inject
+	extension GenmodelEntries
+	
+	def generateIStatemachine(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
+		fsa.generateFile(entry.basePackagePath + '/' + iStatemachine.csharp, content(entry))
+	}
+	
+	def private content(GeneratorEntry entry) {
+		'''
+		«entry.licenseText»
+		namespace «entry.getNamespaceName()»
+		{
+
+			/**
+			 * Basic interface for statemachines.
+			 */
+			public interface IStatemachine {
+			
+				/**
+				 * Initializes the statemachine. Use to init internal variables etc.
+				 */
+				void init();
+			
+				/**
+				 * Enters the statemachine. Sets the statemachine in a defined state.
+				 */
+				void enter();
+			
+				/**
+				 * Exits the statemachine. Leaves the statemachine with a defined state.
+				 */
+				void exit();
+			
+				/**
+				 * Checks if the statemachine is active. 
+				 * A statemachine is active if it was entered. It is inactive if it has not been entered at all or if it was exited.
+				 */
+				bool isActive();
+			
+				/**
+				 * Checks if all active states are final. 
+				 * If there are no active states then the statemachine is considered as incative and this method returns false.
+				 */
+				bool isFinal();
+			
+				/**
+				* Start a run-to-completion cycle.
+				*/
+				void runCycle();
+			}
+		}
+		'''
+	}
+}

+ 76 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/ITimer.xtend

@@ -0,0 +1,76 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+ */
+package org.yakindu.sct.generator.csharp
+
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.eclipse.xtext.generator.IFileSystemAccess
+import com.google.inject.Inject
+
+class ITimer {
+	
+	@Inject
+	extension Naming 
+	
+	@Inject
+	extension GenmodelEntries
+	
+	def generateITimer(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
+		fsa.generateFile(entry.basePackagePath + '/' + iTimer.csharp, content(entry))
+	}
+	
+	def private content(GeneratorEntry entry) {
+		'''
+		«entry.licenseText»
+		using «entry.getNamespaceName()»;
+		
+		namespace «entry.getNamespaceName()»
+		{
+
+			/**
+			 * Interface a timer has to implement. Use to implement your own timer
+			 * service.
+			 * 
+			 */
+			public interface ITimer {
+			
+				/**
+				 * Starts the timing for a given time event id.
+				 * 
+				 * @param callback
+				 * 			  : The target callback where the time event has to be raised.
+				 * 
+				 * @param eventID
+				 *            : The eventID the timer should use if timed out.
+				 *            
+				 * @param time
+				 *            : Time in milliseconds after the given time event should be
+				 *            triggered
+				 *            
+				 * @param isPeriodic
+				 * 			  : Set to true if the time event should be triggered periodically
+				 */
+				void setTimer(ITimerCallback callback, int eventID, long time, bool isPeriodic);
+			
+				/**
+				 * Unset a time event.
+				 * 
+				 * @param callback
+				 * 			: The target callback for which the time event has to be unset.
+				 * 
+				 * @param eventID
+				 * 			: The time event id.
+				 */
+				void unsetTimer(ITimerCallback callback, int eventID);
+			}
+		}
+		'''
+	}
+}

+ 51 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/ITimerCallback.xtend

@@ -0,0 +1,51 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+ */
+package org.yakindu.sct.generator.csharp
+
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.eclipse.xtext.generator.IFileSystemAccess
+import com.google.inject.Inject
+
+class ITimerCallback {
+	
+	@Inject
+	extension Naming 
+	
+	@Inject
+	extension GenmodelEntries
+	
+	def generateITimerCallback(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
+		fsa.generateFile(entry.basePackagePath + '/' + iTimerCallback.csharp, content(entry))
+	}
+	
+	def private content(GeneratorEntry entry) {
+		'''
+		«entry.licenseText»
+		namespace «entry.getNamespaceName()»
+		{
+
+			/**
+			* Interface for state machines which use timed event triggers.
+			*/
+			public interface ITimerCallback {
+				
+				/**
+				* Callback method if a time event occurred.
+				* 
+				* @param eventID
+				* 			:The id of the occurred event.
+				*/
+				void timeElapsed(int eventID);
+			}
+		}
+		'''
+	}
+}

+ 186 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Naming.xtend

@@ -0,0 +1,186 @@
+package org.yakindu.sct.generator.csharp
+
+import com.google.inject.Inject
+import java.util.Arrays
+import java.util.regex.Matcher
+import java.util.regex.Pattern
+import org.yakindu.base.types.Event
+import org.yakindu.base.types.Property
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sexec.ExecutionState
+import org.yakindu.sct.model.sexec.Step
+import org.yakindu.sct.model.sexec.naming.INamingService
+import org.yakindu.sct.model.sgraph.State
+import org.yakindu.sct.model.stext.naming.StextNameProvider
+import org.yakindu.sct.model.stext.stext.EventDefinition
+import org.yakindu.sct.model.stext.stext.InterfaceScope
+import org.yakindu.sct.model.stext.stext.InternalScope
+import org.yakindu.sct.model.stext.stext.VariableDefinition
+
+class Naming implements CSharpKeywords {
+
+	@Inject extension INamingService namingService;
+	@Inject StextNameProvider provider;
+
+	def iStatemachine() {
+		"IStatemachine"
+	}
+
+	def iTimerCallback() {
+		"ITimerCallback"
+	}
+
+	def iTimer() {
+		"ITimer"
+	}
+
+	def timerServiceClass() {
+		"TimerService"
+	}
+
+	def timeEventClass() {
+		"TimeEvent"
+	}
+
+	def runtimeServiceClass() {
+		"RuntimeService"
+	}
+
+	def csharp(String it) {
+		it + ".cs"
+	}
+
+	def asPrivate(String it) {
+		"private " + it
+	}
+
+	def asPublic(String it) {
+		"public " + it
+	}
+
+	def String getInternalOperationCallbackName(InternalScope it) {
+		"InternalOperationCallback"
+	}
+
+	def boolean isCSharpKeyword(String name) {
+		var String lowName = name.toLowerCase();
+		for (String keyword : Arrays::asList(KEYWORDS)) {
+			var Pattern pattern = Pattern::compile("^" + keyword + "$");
+			var Matcher matcher = pattern.matcher(lowName);
+			if (matcher.find()) {
+				return true;
+			}
+		}
+		return false;
+	}
+
+	def dispatch String statemachineName(String name) {
+
+		// remove whitespaces;
+		var String newName = name.replace(" ", "")
+		if (isCSharpKeyword(name)) {
+			return newName + "SM"
+		}
+		return newName
+	}
+
+	def dispatch String statemachineName(ExecutionFlow it) {
+		return name.statemachineName.toFirstUpper()
+	}
+
+	def statemachineClassName(ExecutionFlow it) {
+		statemachineName + "Statemachine"
+	}
+
+	def statemachineInterfaceName(ExecutionFlow it) {
+		"I" + statemachineClassName
+	}
+
+	def String getInterfaceName(InterfaceScope it) {
+		if (name != null) {
+			return "SCI" + name.toFirstUpper()
+		} else {
+			return "SCInterface";
+		}
+	}
+
+	def dispatch getSymbol(VariableDefinition it) {
+		name.asEscapedIdentifier
+	}
+
+	def dispatch getSymbol(EventDefinition it) {
+		name.asEscapedIdentifier
+	}
+
+	def String getInterfaceImplName(InterfaceScope it) {
+		getInterfaceName() + "Impl";
+	}
+
+	def String getInterfaceListenerName(InterfaceScope it) {
+		interfaceName + "Listener";
+	}
+
+	def String getInterfaceOperationCallbackName(InterfaceScope it) {
+		interfaceName + "OperationCallback"
+	}
+
+	def private String fullQualifiedStateName(String name) {
+		name.substring(name.indexOf(".") + 1).replace(".", "_")
+	}
+
+	def dispatch String stateName(State state) {
+		val String name = provider.getFullyQualifiedName(state).toString();
+		name.fullQualifiedStateName
+	}
+
+	def dispatch String stateName(ExecutionState it) {
+		name.fullQualifiedStateName
+	}
+
+	def asIdentifier(String it) {
+		replaceAll('[^a-z&&[^A-Z&&[^0-9]]]', '_').toFirstLower
+	}
+
+	def asName(String it) {
+		asIdentifier.toFirstUpper
+	}
+
+	def asEscapedIdentifier(String it) {
+		var s = it
+		if (s.isCSharpKeyword) {
+			s = s + '_ID'
+		}
+		return s.asIdentifier
+	}
+
+	def asEscapedName(String it) {
+		asEscapedIdentifier.toFirstUpper
+	}
+
+	def String getValueIdentifier(Event it) {
+		name.asIdentifier + "Value"
+	}
+
+	def private varName(Property it) {
+		if (name.equalsIgnoreCase("class")) {
+			name.asEscapedName
+		} else {
+			name.asName
+		}
+	}
+
+	def String getter(Property it) {
+		return "get" + varName + "()"
+	}
+
+	def String setter(Property it) {
+		"set" + varName
+	}
+
+	def String getNullStateName() {
+		"NullState";
+	}
+
+	def functionName(Step it) { shortName }
+
+}

+ 100 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Navigation.xtend

@@ -0,0 +1,100 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Commiters of Yakindu - Initial contribution and API
+ */
+package org.yakindu.sct.generator.csharp
+
+import java.util.ArrayList
+import java.util.List
+import org.yakindu.base.types.Event
+import org.yakindu.base.types.Property
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sexec.extensions.SExecExtensions
+import org.yakindu.sct.model.sgraph.Scope
+import org.yakindu.sct.model.stext.stext.EventDefinition
+import org.yakindu.sct.model.stext.stext.InterfaceScope
+import org.yakindu.sct.model.stext.stext.InternalScope
+import org.yakindu.sct.model.stext.stext.OperationDefinition
+import org.yakindu.sct.model.stext.stext.VariableDefinition
+
+class Navigation extends SExecExtensions {
+	
+	
+	def List<EventDefinition> getOutgoingEvents(ExecutionFlow flow) {
+		val events = new ArrayList<EventDefinition>()
+		for (scope: flow.scopes) {
+			events.addAll(scope.outgoingEvents)
+		}
+		return events
+	}
+	
+	def boolean hasOutgoingEvents(ExecutionFlow it) {
+		return !outgoingEvents.empty
+	}
+	
+	def getInternalScopeEvents(ExecutionFlow flow) {
+		val events = new ArrayList<EventDefinition>
+		flow.internalScopes.forEach[events.addAll(eventDefinitions)]
+		return events
+	}
+	
+	def getInternalScopeVariables(ExecutionFlow flow) {
+		val variables = new ArrayList<VariableDefinition>
+		flow.internalScopes.forEach[variables.addAll(variableDefinitions)]
+		return variables
+	}
+	
+	
+	def getDefaultScope(ExecutionFlow it) {
+		interfaceScopes.filter[name == null || name.empty].head
+	}
+	
+	def Iterable<InternalScope> getInternalScopes(ExecutionFlow it) {
+		return scopes.filter(typeof(InternalScope))
+	}
+	
+	def boolean hasEvents(Scope it) {
+		return !eventDefinitions.empty
+	}
+	
+	def getEventDefinitions(Scope scope) {
+		scope.declarations.filter(typeof(EventDefinition))
+	}
+	
+	def getOperations(Scope it) {
+		declarations.filter(typeof(OperationDefinition));
+	}
+	
+	def hasOperations(Scope it) {
+		!operations.isEmpty;
+	}
+	
+	
+	def dispatch scope(Property it) {
+		if (eContainer instanceof InterfaceScope)
+			eContainer as InterfaceScope
+		else
+			null
+	}
+	
+	def dispatch scope(Event it) {
+		if (eContainer instanceof InterfaceScope)
+			eContainer as InterfaceScope
+		else
+			null
+	}
+	
+	def dispatch scope(OperationDefinition it) {
+		if (eContainer instanceof InterfaceScope)
+			eContainer as InterfaceScope
+		else
+			null
+	}
+	
+	
+}

+ 36 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RunnableFeature.xtend

@@ -0,0 +1,36 @@
+package org.yakindu.sct.generator.csharp
+
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.yakindu.sct.generator.csharp.features.ICSharpFeatureConstants
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import com.google.inject.Inject
+
+class RunnableFeature {
+	
+	@Inject extension Naming
+	
+	
+	def getFeatureRunnable(GeneratorEntry it) {
+		getFeatureConfiguration(ICSharpFeatureConstants::RUNNABLE_WRAPPER);
+	}
+	
+	def hasFeatureRunnable(GeneratorEntry it) {
+		featureRunnable != null
+	}
+	
+	def getNamePrefix(GeneratorEntry it) {
+		if (featureRunnable != null) featureRunnable.getParameterValue(ICSharpFeatureConstants::NAME_PREFIX).stringValue
+		else ""	
+	}
+	
+	def getNameSuffix(GeneratorEntry it) {
+		if (featureRunnable != null) featureRunnable.getParameterValue(ICSharpFeatureConstants::NAME_SUFFIX).stringValue
+		else ""	
+	}
+	
+	
+	def runnableWrapperClassName(ExecutionFlow it, GeneratorEntry entry) {
+		 entry.namePrefix + statemachineName + entry.nameSuffix 
+	}
+	
+}

+ 334 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RunnableWrapper.xtend

@@ -0,0 +1,334 @@
+/**
+  Copyright (c) 2015 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Axel Terfloth - Initial contribution and API
+*/
+
+package org.yakindu.sct.generator.csharp
+
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.eclipse.xtext.generator.IFileSystemAccess
+import com.google.inject.Inject
+import org.yakindu.sct.model.stext.stext.InterfaceScope
+import org.yakindu.base.types.typesystem.ITypeSystem
+import org.yakindu.base.types.Direction
+import org.yakindu.base.types.typesystem.GenericTypeSystem
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
+
+/**
+ * Generates the runnable wrapper for the statemachine. This wrapper implies event based execution semantics. 
+ */
+class RunnableWrapper {
+
+	@Inject protected extension GenmodelEntries
+	@Inject protected extension RunnableFeature
+
+	@Inject protected extension Naming
+	@Inject protected extension Navigation
+	@Inject protected extension ITypeSystem
+	@Inject protected extension ICodegenTypeSystemAccess
+	
+	
+	@Inject Beautifier beautifier
+	
+	
+	def generateRunnableWrapper(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
+		
+		var filename = flow.getImplementationPackagePath(entry) + '/' + flow.runnableWrapperClassName(entry).csharp
+		var content = content(flow, entry)
+//		var content = beautifier.format(filename, content(flow, entry))
+		fsa.generateFile(filename, content)
+	}
+	
+	
+	def protected content(ExecutionFlow flow, GeneratorEntry entry) '''
+		«entry.licenseText»
+		«flow.createImports(entry)»
+		
+		/**
+		 * ThreadStart wrapper of «flow.statemachineClassName». This wrapper provides a thread safe, runnable instance of the statemachine.
+		 * The wrapper implements the {@link ThreadStart} interface and can be started in a thread by the client code. 
+		 * The run method then starts the main event processing loop for this statemachine.
+		 * 
+		 * This feature is in beta state. Currently not supported are
+		 * - interface observer
+		 * - operation callbacks
+		 * 
+		 * Please report bugs and issues... 
+		 */
+		
+		namespace «entry.getNamespaceName()»
+		{
+		
+			public class «flow.runnableWrapperClassName(entry)» : «flow.statemachineInterfaceName» {
+				
+				«flow.createFieldDeclarations(entry)»
+				«flow.interfaceAccessors»
+				«flow.timingFunctions(entry)»
+				private readonly Object syncLock = new Object();
+				
+				/**
+				 * init() will be delegated thread safe to the wrapped statemachine. 
+				 */ 
+				public void init() {
+					lock(syncLock) {
+						statemachine.init();
+					}
+				}
+				
+				/**
+				 * enter() will be delegated thread safe to the wrapped statemachine.  
+				 */ 
+				public void enter() {
+					lock(syncLock) {
+						statemachine.enter();
+					}
+				}
+				
+				/**
+				 * exit() will be delegated thread safe to the wrapped statemachine.  
+				 */ 
+				public void exit() {
+					lock(syncLock) {
+						statemachine.exit();
+					}
+				}
+				
+				/**
+				 * isActive() will be delegated thread safe to the wrapped statemachine.  
+				 */ 
+				public boolean isActive() {
+					lock(syncLock) {
+						return statemachine.isActive();
+					}
+				}
+				
+				/**
+				 * isFinal() will be delegated thread safe to the wrapped statemachine.  
+				 */ 
+				public boolean isFinal() {
+					lock(syncLock) {
+						return statemachine.isFinal();
+					}
+				}
+				
+				
+				/**
+				 * runCycle() will be delegated thread safe to the wrapped statemachine.  
+				 */ 
+				@Override
+				public void runCycle() {
+					lock(syncLock) {
+						statemachine.runCycle();
+					}
+				}
+	
+				/**
+				 * This method will start the main execution loop for the statemachine. 
+				 * First it will init and enter the statemachine implicitly and then will start processing events 
+				 * from the event queue until the thread is interrupted. 
+				 */
+				@Override
+				public void run() {
+				
+					boolean terminate = false;
+					
+					while(!(terminate || Thread.currentThread().isInterrupted())) {
+				
+						try {
+							
+							Runnable eventProcessor = eventQueue.take();
+							eventProcessor.run();
+							
+						} catch (InterruptedException e) {
+							terminate = true;
+						}
+					}			
+				}
+	
+				
+			}
+		}
+	'''
+	
+	def protected createImports(ExecutionFlow flow, GeneratorEntry entry) '''
+		//import java.util.concurrent.BlockingQueue;
+		//import java.util.concurrent.LinkedBlockingQueue;
+
+		«IF entry.createInterfaceObserver && flow.hasOutgoingEvents»
+		using System.Collections.Generic;
+		using System.Collections.Concurrent;
+		«ENDIF»
+		«IF flow.timed»
+			// import «/*entry.getBasePackageName()*/».ITimer;
+			// import «/*entry.getBasePackageName()*/».ITimerCallback;
+		«ENDIF»
+	'''
+	
+	def protected createFieldDeclarations(ExecutionFlow flow, GeneratorEntry entry) '''
+		
+		/** 
+		 * The events are queued using a blocking queue without capacity restriction. This queue holds
+		 * Runnable instances that process the events. 
+		 */
+		protected BlockingCollection<Runnable> eventQueue = new BlockingCollection<Runnable>();
+
+		/**
+		 * The core statemachine is simply wrapped and the event processing will be delegated to that statemachine instance.
+		 * This instance will be created implicitly.
+		 */
+		protected «flow.statemachineClassName» statemachine = new «flow.statemachineClassName»();
+		
+		«FOR scope : flow.interfaceScopes»
+		/**
+		 * Interface object for «scope.interfaceName»
+		 */		
+		protected «scope.interfaceName» «scope.interfaceName.asEscapedIdentifier» = new «scope.interfaceName»() {
+			«scope.toImplementation(entry)»
+		};
+		
+		«ENDFOR»
+		
+	'''
+	
+	
+	def protected toImplementation(InterfaceScope scope, GeneratorEntry entry) '''				
+		«FOR event : scope.eventDefinitions»
+			«IF event.direction == Direction::IN»
+				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+					public void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+						
+						eventQueue.Add( new Runnable() {
+							
+							public override void run() {
+								lock (statemachine) {
+									statemachine.get«scope.interfaceName»().raise«event.name.asName»(value);
+									statemachine.runCycle();
+								}
+							}
+						});
+					}
+					
+				«ELSE»
+					public void raise«event.name.asName»() {
+						eventQueue.Add( new Runnable() {
+							
+							public override void run() {
+								lock (statemachine) {
+									statemachine.get«scope.interfaceName»().raise«event.name.asName»();
+									statemachine.runCycle();
+								}
+							}
+						});
+					}
+					
+				«ENDIF»
+			«ENDIF»
+			«IF event.direction == Direction::OUT»
+				public bool isRaised«event.name.asName»() {
+					lock(statemachine) {
+						return statemachine.get«scope.interfaceName»().isRaised«event.name.asName»();
+					}
+				}
+				
+				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+					public «event.type.targetLanguageName» get«event.name.asName»Value() {
+						lock(statemachine) {
+							return statemachine.get«scope.interfaceName»().get«event.name.asName»Value();
+						}
+					}
+				«ENDIF»
+			«ENDIF»
+		«ENDFOR»
+		«FOR variable : scope.variableDefinitions»
+			public «variable.type.targetLanguageName» «variable.getter» {
+				lock(statemachine) {
+					return statemachine.get«scope.interfaceName»().«variable.getter»;
+				}
+			}
+			
+			«IF !variable.readonly && !variable.const»
+				public void «variable.setter»(«variable.type.targetLanguageName» value) {
+					lock(statemachine) {
+						statemachine.get«scope.interfaceName»().«variable.setter»(value);
+					}
+				}
+				
+			«ENDIF»
+		«ENDFOR»
+	'''
+
+	def protected interfaceAccessors(ExecutionFlow flow) '''
+		«FOR scope : flow.interfaceScopes»
+			public «scope.interfaceName» get«scope.interfaceName»() {
+				return «scope.interfaceName.asEscapedIdentifier»;
+			}
+		«ENDFOR»
+	'''
+
+
+	def protected timingFunctions(ExecutionFlow flow, GeneratorEntry entry) '''
+		«IF flow.timed»
+			/*========== TIME EVENT HANDLING ================
+			
+			/** An external timer instance is required. */
+			protected ITimer externalTimer;
+			
+			/** Internally we use a timer proxy that queues time events together with other input events. */
+			protected ITimer timerProxy = new ITimer() {
+				/** Simply delegate to external timer with a modified callback. */
+				public override void setTimer(ITimerCallback callback, int eventID, long time,
+						bool isPeriodic) {
+					externalTimer.setTimer(«flow.runnableWrapperClassName(entry)».this, eventID, time, isPeriodic);
+				}
+				
+				public override void unsetTimer(ITimerCallback callback, int eventID) {
+					externalTimer.unsetTimer(«flow.runnableWrapperClassName(entry)».this, eventID);
+				}
+			};
+			
+			/**
+			 * Set the {@link ITimer} for the state machine. It must be set
+			 * externally on a timed state machine before a run cycle can be correct
+			 * executed.
+			 * 
+			 * @param timer
+			 */
+			public void setTimer(ITimer timer) {
+				lock(statemachine) {
+					this.externalTimer = timer;
+					/* the wrapped statemachine uses timer proxy as timer */
+					statemachine.setTimer(timerProxy);
+				}
+			}
+			
+			/**
+			* Returns the currently used timer.
+			* 
+			* @return {@link ITimer}
+			*/
+			public ITimer getTimer() {
+				return externalTimer;
+			}
+			
+			public void timeElapsed(int eventID) {
+				eventQueue.Add(new Runnable() {
+
+					public override void run() {
+						lock (statemachine) {
+							statemachine.timeElapsed(eventID);
+							statemachine.runCycle();
+						}
+					}
+				});
+			}
+			
+		«ENDIF»
+	'''
+	
+}

+ 238 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RuntimeService.xtend

@@ -0,0 +1,238 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+ */
+package org.yakindu.sct.generator.csharp
+
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.eclipse.xtext.generator.IFileSystemAccess
+import com.google.inject.Inject
+
+class RuntimeService {
+	
+	@Inject
+	extension Naming 
+	
+	@Inject
+	extension GenmodelEntries
+	
+	def generateRuntimeService(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
+		fsa.generateFile(entry.basePackagePath + '/' + runtimeServiceClass.csharp, content(entry))
+	}
+	
+	def private content(GeneratorEntry entry) {
+		'''
+		«entry.licenseText»
+		
+		using System.Threading;
+		using System.Collections.Generic;
+		
+		namespace «entry.getNamespaceName()»
+		{
+		
+			/**
+			 * Runtime service for state machines to execute a run to completion step
+			 * periodically.
+			 * 
+			 */
+			public class RuntimeService {
+	
+				private static RuntimeService runtimeService;
+	
+				private Timer timer = null;
+	
+				private Dictionary<Long, StatemachineTimerTask> timerTasks = new Dictionary<Long, StatemachineTimerTask>();
+	
+				private class StatemachineTimerTask extends TimerTask {
+	
+					private List<IStatemachine> statemachineList = new List<IStatemachine>();
+	
+					private ReaderWriterLock lock = new ReaderWriterLock();
+	
+					private bool isPaused = false;
+	
+					public override void run() {
+						lock.AcquireReaderLock(-1);
+						if (!isPaused) {
+							foreach( IStatemachine statemachine in statemachineList) {
+								statemachine.runCycle();
+							}
+						}
+						lock.ReleaseReaderLock();
+					}
+	
+					/**
+					 * Adds the given state machine to the TimerTask.
+					 * 
+					 * @param statemachine
+					 * @return {@code true} if state machine is added properly.
+					 */
+					public bool addStatemachine(IStatemachine statemachine) {
+						lock.AcquireWriterLock(-1);
+						statemachineList.Add(statemachine);
+						lock.ReleaseWriterLock();
+						return true;
+					}
+	
+					/**
+					 * Removes the given state machine from the TimerTask.
+					 * 
+					 * @param statemachine
+					 * @return {@code true} if state machine is removed properly.
+					 */
+					public boolean removeStatemachine(IStatemachine statemachine) {
+						lock.AcquireWriterLock(-1);
+						bool ret = statemachineList.Remove(statemachine);
+						lock.ReleaseWriterLock(-1);
+						return ret;
+					}
+	
+					public void pause() {
+						isPaused = true;
+					}
+	
+					public void resume() {
+						isPaused = false;
+					}
+				}
+	
+				private RuntimeService() {
+					// Not intended to be instantiated.
+				}
+	
+				/**
+				 * Returns the {@code RuntimeService} instance as singleton.
+				 * 
+				 * @return The singleton {@code RuntimeService} instance
+				 */
+				public static RuntimeService getInstance() {
+					if (runtimeService == null) {
+						runtimeService = new RuntimeService();
+					}
+					return runtimeService;
+				}
+	
+				/**
+				 * Registers an {@link IStatemachine} for scheduled fixed rate execution
+				 * 
+				 * @param statemachine
+				 *            - The statemachine to execute
+				 * @param cyclePeriod
+				 *            - the fixed rate cycle period for scheduling
+				 * @return {@code true} if state machine is added properly.
+				 */
+				public boolean registerStatemachine(IStatemachine statemachine,
+						long cyclePeriod) {
+			
+					if (timerTasks.containsKey(cyclePeriod)) {
+						// TimerTask for cycle time already existing -> add statemachine
+						return timerTasks.get(cyclePeriod).addStatemachine(statemachine);
+					} else {
+						// Create new TimerTask for cycle period and add statemachine
+						StatemachineTimerTask timerTask = new StatemachineTimerTask();
+						timerTasks.put(cyclePeriod, timerTask);
+						boolean ret = timerTask.addStatemachine(statemachine);
+						// Create a new Timer instance if runtime service was cancelled
+						// before
+						if (timer == null) {
+							timer = new Timer();
+						}
+						timer.scheduleAtFixedRate(timerTask, 0, cyclePeriod);
+						return ret;
+					}
+				}
+	
+				/**
+				 * Removes the given state machine from runtime service.
+				 * 
+				 * @param statemachine
+				 *            - the statemachine which should be removed
+				 * @param cyclePeriod
+				 *            - the scheduling cycle period of the statemachine
+				 * @return {@code true} if state machine is removed properly.
+				 */
+				public boolean unregisterStatemachine(IStatemachine statemachine,
+						long cyclePeriod) {
+					if (timerTasks.containsKey(cyclePeriod)) {
+						boolean ret = timerTasks.get(cyclePeriod).removeStatemachine(
+								statemachine);
+			
+						return ret;
+					}
+					return false;
+				}
+	
+				/**
+				 * Cancels the execution of statemachines for the given cycle period. This
+				 * stops the execution of statemachines which are registered for the given
+				 * cycle period and cancels the executing {@link TimerTask}.
+				 * 
+				 * @return {@code true} if poperly cancelled
+				 */
+				public boolean cancelAll(long cyclePeriod) {
+					if (timer != null && timerTasks.containsKey(cyclePeriod)) {
+						TimerTask task = timerTasks.get(cyclePeriod);
+						task.cancel();
+						timer.purge();
+						timerTasks.remove(cyclePeriod);
+						return true;
+					}
+					return false;
+				}
+	
+				/**
+				 * Pauses the execution of all statemachines which are registered for the
+				 * given cyclePeriod.
+				 * 
+				 * @param cyclePeriod
+				 * @return {@code true} if properly paused
+				 * 
+				 */
+				public boolean pauseAll(long cyclePeriod) {
+					if (timerTasks.containsKey(cyclePeriod)) {
+						timerTasks.get(cyclePeriod).pause();
+						return true;
+					}
+					return false;
+				}
+	
+				/**
+				 * Resumes the execution of all statemachines which are registered for the
+				 * given cyclePeriod.
+				 * 
+				 * @param cyclePeriod
+				 * @return {@code true} if properly resumed
+				 * 
+				 */
+				public boolean resumeAll(long cyclePeriod) {
+					if (timerTasks.containsKey(cyclePeriod)) {
+						timerTasks.get(cyclePeriod).resume();
+						return true;
+					}
+					return false;
+				}
+	
+				/**
+				 * Cancels the execution of all registered statemachines. This cancels the
+				 * executing {@link Timer} freeing all allocated resources and terminates
+				 * all existing execution threads.
+				 */
+				public void cancelTimer() {
+					if (timer != null) {
+						timer.cancel();
+						timer.purge();
+						timerTasks.clear();
+						timer = null;
+					}
+				}
+			}
+		}
+		'''
+	}
+}

+ 631 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Statemachine.xtend

@@ -0,0 +1,631 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+  	Andreas Muelder - Added generation of constants
+*/
+package org.yakindu.sct.generator.csharp
+
+import com.google.inject.Inject
+import java.util.List
+import org.eclipse.xtext.generator.IFileSystemAccess
+import org.yakindu.base.types.Direction
+import org.yakindu.base.types.typesystem.GenericTypeSystem
+import org.yakindu.base.types.typesystem.ITypeSystem
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
+import org.yakindu.sct.model.sexec.Check
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sexec.Step
+import org.yakindu.sct.model.sexec.extensions.StateVectorExtensions
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.yakindu.sct.model.stext.stext.EventDefinition
+import org.yakindu.sct.model.stext.stext.InterfaceScope
+import org.yakindu.sct.model.stext.stext.VariableDefinition
+
+import static org.eclipse.xtext.util.Strings.*
+
+class Statemachine {
+	
+	@Inject protected extension Naming
+	@Inject protected extension GenmodelEntries
+	@Inject protected extension Navigation
+	@Inject protected extension ICodegenTypeSystemAccess
+	@Inject protected extension ITypeSystem
+	@Inject protected extension FlowCode
+	@Inject protected extension StateVectorExtensions
+	
+	@Inject Beautifier beautifier
+	
+	def generateStatemachine(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
+		var filename = flow.statemachineClassName.csharp
+		var content = beautifier.format(filename, content(flow, entry))
+		fsa.generateFile(filename, content)
+	}
+	
+	def protected content(ExecutionFlow flow, GeneratorEntry entry) '''
+		«entry.licenseText»
+		using «entry.namespaceName»;
+		«flow.createImports(entry)»
+		
+		namespace «entry.namespaceName»
+		{
+		
+			public class «flow.statemachineClassName» : «flow.statemachineInterfaceName» 
+			{
+				«flow.createFieldDeclarations(entry)»
+			
+					
+				«flow.createConstructor»
+				
+				«flow.initFunction»
+				
+				«flow.enterFunction»
+				
+				«flow.exitFunction»
+				
+				«flow.activeFunction»
+				
+				«flow.finalFunction»
+				
+				«flow.clearInEventsFunction»
+				
+				«flow.clearOutEventsFunction»
+				
+				«flow.stateActiveFunction»
+				
+				«flow.timingFunctions»
+				
+				«flow.interfaceAccessors»
+				
+				«flow.internalScopeFunctions»
+				
+				«flow.defaultInterfaceFunctions(entry)»
+				
+				«flow.functionImplementations»
+				
+				«flow.runCycleFunction»
+			}
+		}
+	'''
+	
+	def protected createImports(ExecutionFlow flow, GeneratorEntry entry) '''
+		using System;
+		«IF entry.createInterfaceObserver && flow.hasOutgoingEvents»
+		using System.Collections.Generic;
+		«ENDIF»
+	'''
+	
+	def protected createFieldDeclarations(ExecutionFlow flow, GeneratorEntry entry) '''
+		«FOR event : flow.internalScopeEvents»
+		private bool «event.symbol»;
+		
+		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+			private «event.type.targetLanguageName» «event.valueIdentifier»;
+		«ENDIF»
+		«ENDFOR»
+		«IF flow.timed»
+			private bool[] timeEvents = new bool[«flow.timeEvents.size»];
+		«ENDIF»
+	
+		«FOR scope : flow.interfaceScopes»
+			«scope.toImplementation(entry)»
+			private «scope.interfaceImplName» «scope.interfaceName.asEscapedIdentifier»;
+			
+		«ENDFOR»
+	
+		public enum State {
+			«FOR state : flow.states»
+				«state.stateName.asEscapedIdentifier»,
+			«ENDFOR»
+			«getNullStateName()»
+		};
+		
+		«FOR variable : flow.internalScopeVariables»
+			«IF !variable.const»
+				«variable.writeableFieldDeclaration»
+			«ENDIF»
+		«ENDFOR»
+		
+		«IF flow.hasHistory»
+		private State[] historyVector = new State[«flow.historyVector.size»];
+		«ENDIF»
+		private readonly State[] stateVector = new State[«flow.stateVector.size»];
+		
+		private int nextStateIndex;
+		
+		«IF flow.timed»
+		private ITimer timer;
+		«ENDIF»
+		
+		«FOR internal : flow.internalScopes»
+		«IF internal.hasOperations()»
+			private «internal.getInternalOperationCallbackName()» operationCallback;
+		«ENDIF»
+		«ENDFOR»
+	'''
+	
+	def protected writeableFieldDeclaration(VariableDefinition variable){
+		'''public	 «variable.type.targetLanguageName» «variable.symbol»;'''
+	}
+	
+	
+	
+	def protected createConstructor(ExecutionFlow flow) '''
+		public «flow.statemachineClassName»() {
+			
+			«FOR scope : flow.interfaceScopes»
+			«scope.interfaceName.asEscapedIdentifier» = new «scope.getInterfaceImplName()»();
+			«ENDFOR»
+		}
+	'''
+	
+	def protected initFunction(ExecutionFlow flow) '''
+		public void init() {
+			«IF flow.timed»
+			if (timer == null) {
+				throw new System.InvalidOperationException("timer not set.");
+			}
+			«ENDIF»
+			for (int i = 0; i < «flow.stateVector.size»; i++) {
+				stateVector[i] = State.NullState;
+			}
+			
+			«IF flow.hasHistory»
+			for (int i = 0; i < «flow.historyVector.size»; i++) {
+				historyVector[i] = State.NullState;
+			
+			«ENDIF»
+			clearEvents();
+			clearOutEvents();
+			
+			«flow.initSequence.code»
+		}
+	'''
+	
+	def protected clearInEventsFunction(ExecutionFlow flow) '''
+		/**
+		* This method resets the incoming events (time events included).
+		*/
+		protected void clearEvents() {
+			«FOR scope : flow.interfaceScopes»
+				«IF scope.hasEvents»
+					«scope.interfaceName.asEscapedIdentifier».clearEvents();
+				«ENDIF»
+			«ENDFOR»
+			«FOR scope : flow.internalScopes»
+				«FOR event : scope.eventDefinitions»
+					«event.symbol» = false;
+				«ENDFOR»
+			«ENDFOR»
+			
+			«IF flow.timed»
+			for (int i = 0; i < timeEvents.Length; i++) {
+				timeEvents[i] = false;
+			}
+			«ENDIF»
+		}
+	'''
+	
+	def protected clearOutEventsFunction(ExecutionFlow flow) '''
+		/**
+		* This method resets the outgoing events.
+		*/
+		protected void clearOutEvents() {
+			«FOR scope : flow.interfaceScopes»
+				«IF scope.hasOutgoingEvents»
+					«scope.interfaceName.asEscapedIdentifier».clearOutEvents();
+				«ENDIF»
+			«ENDFOR»
+		}
+	'''
+	
+	def protected isStateActiveFunction(ExecutionFlow flow) '''
+		/**
+		* Returns true if the given state is currently active otherwise false.
+		*/
+		public bool isStateActive(State state){
+			switch (state) {
+				«FOR s : flow.states»
+				case State.«s.stateName.asEscapedIdentifier»: 
+					return «IF s.leaf»stateVector[«s.stateVector.offset»] == State.«s.stateName.asEscapedIdentifier»
+					«ELSE»stateVector[«s.stateVector.offset»] >= State.«s.stateName.asEscapedIdentifier»
+						&& stateVector[«s.stateVector.offset»] <= State.«s.subStates.last.stateName.asEscapedIdentifier»«ENDIF»;
+				«ENDFOR»
+				default: return false;
+			}
+		}
+	'''
+	
+	def protected isActiveFunction(ExecutionFlow flow) '''
+		/**
+		 * @see IStatemachine#isActive()
+		 */
+		public bool isActive(){
+			
+			return 
+				«FOR i : 0 ..< flow.stateVector.size SEPARATOR '||'»
+				stateVector[«i»] != State.«nullStateName» 
+				«ENDFOR»;
+		}
+	'''
+
+	def protected isFinalFunction(ExecutionFlow flow) {
+		val finalStateImpactVector = flow.finalStateImpactVector
+
+		'''
+			/** 
+			«IF !finalStateImpactVector.isCompletelyCovered»
+			 * Always returns 'false' since this state machine can never become final.
+			 *
+			«ENDIF»
+			 * @see IStatemachine#isFinal() 
+			 */
+			public bool isFinal(){
+		''' +
+		
+		// only if the impact vector is completely covered by final states the state machine 
+		// can become final
+		{if (finalStateImpactVector.isCompletelyCovered) {'''
+			return «FOR i : 0 ..<finalStateImpactVector.size SEPARATOR ' && '»
+				(«FOR fs : finalStateImpactVector.get(i) SEPARATOR ' || '» 
+					stateVector[«i»] == «
+					IF fs.stateVector.offset == i
+						»State.«fs.stateName.asEscapedIdentifier»«
+					ELSE
+						»State.«nullStateName»«
+					ENDIF»«
+				ENDFOR»)
+			«ENDFOR»;
+		'''} else {'''
+			return false;
+		'''} }
+		
+		+ '''}'''
+	}
+	
+	
+	def protected timingFunctions(ExecutionFlow flow) '''
+		«IF flow.timed»
+			/**
+			* Set the {@link ITimer} for the state machine. It must be set
+			* externally on a timed state machine before a run cycle can be correctly
+			* executed.
+			* 
+			* @param timer
+			*/
+			public void setTimer(ITimer timer) {
+				this.timer = timer;
+			}
+			
+			/**
+			* Returns the currently used timer.
+			* 
+			* @return {@link ITimer}
+			*/
+			public ITimer getTimer() {
+				return timer;
+			}
+			
+			public void timeElapsed(int eventID) {
+				timeEvents[eventID] = true;
+			}
+		«ENDIF»
+	'''
+	
+	def protected interfaceAccessors(ExecutionFlow flow) '''
+		«FOR scope : flow.interfaceScopes»
+			public «scope.interfaceName» get«scope.interfaceName»() {
+				return «scope.interfaceName.toFirstLower()»;
+			}
+		«ENDFOR»
+	'''
+	
+	def protected toImplementation(InterfaceScope scope, GeneratorEntry entry) '''
+		private sealed class «scope.getInterfaceImplName» : «scope.getInterfaceName» {
+		
+		«IF entry.createInterfaceObserver && scope.hasOutgoingEvents»
+			«scope.generateListeners»
+		«ENDIF»
+		
+		«IF scope.hasOperations»
+			«scope.generateOperationCallback»
+		«ENDIF»
+		
+		«FOR event : scope.eventDefinitions BEFORE newLine SEPARATOR newLine»
+			«generateEventDefinition(event, entry, scope)»
+		«ENDFOR»
+		
+		«FOR variable : scope.variableDefinitions BEFORE newLine SEPARATOR newLine»
+			«generateVariableDefinition(variable)»
+		«ENDFOR»
+		
+		«IF scope.hasEvents»
+			«scope.generateClearEvents»
+		«ENDIF»
+		
+		«IF scope.hasOutgoingEvents()»
+			«generateClearOutEvents(scope)»
+		«ENDIF»
+		}
+	'''
+	
+	protected def generateClearOutEvents(InterfaceScope scope) '''
+		public void clearOutEvents() {
+		«FOR event : scope.eventDefinitions»
+			«IF event.direction == Direction::OUT»
+				«event.symbol» = false;
+			«ENDIF»
+		«ENDFOR»
+		}
+	'''
+	
+	
+	protected def generateClearEvents(InterfaceScope scope) '''
+		public void clearEvents() {
+		«FOR event : scope.eventDefinitions»
+			«IF event.direction != Direction::OUT»
+			«event.symbol» = false;
+			«ENDIF»
+		«ENDFOR»
+		}
+	'''
+	
+	protected def generateVariableDefinition(VariableDefinition variable) '''
+		«IF !variable.const»
+			«variable.writeableFieldDeclaration»
+		«ENDIF»
+		public «variable.type.targetLanguageName» «variable.getter» {
+			return «variable.symbol»;
+		}
+		
+		«IF !variable.readonly && !variable.const»
+			public void «variable.setter»(«variable.type.targetLanguageName» value) {
+				this.«variable.symbol» = value;
+			}
+		«ENDIF»
+	'''
+	
+	protected def generateEventDefinition(EventDefinition event, GeneratorEntry entry, InterfaceScope scope) '''
+		public bool «event.symbol»;
+		
+		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+			public «event.type.targetLanguageName» «event.valueIdentifier»;
+		«ENDIF»
+		
+		«IF event.direction == Direction::IN»
+			«event.generateInEventDefinition»
+		«ENDIF»
+		
+		«IF event.direction == Direction::OUT»
+			«event.generateOutEventDefinition(entry, scope)»
+		«ENDIF»
+	'''
+			
+	protected def generateOutEventDefinition(EventDefinition event, GeneratorEntry entry, InterfaceScope scope) '''
+		
+		public bool isRaised«event.name.asName»() {
+			return «event.symbol»;
+		}
+		
+		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+			private void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+				«event.symbol» = true;
+				«event.valueIdentifier» = value;
+				«IF entry.createInterfaceObserver»
+				foreach («scope.interfaceListenerName» listener in listeners) {
+					listener.on«event.name.asEscapedName»Raised(value);
+				}
+				«ENDIF»
+			}
+			
+			public «event.type.targetLanguageName» get«event.name.asName»Value() {
+				«event.getIllegalAccessValidation()»
+				return «event.valueIdentifier»;
+			}
+		«ELSE»
+			private void raise«event.name.asName»() {
+				«event.symbol» = true;
+				«IF entry.createInterfaceObserver»
+					foreach («scope.interfaceListenerName» listener in listeners) {
+						listener.on«event.name.asEscapedName»Raised();
+					}
+				«ENDIF»
+			}
+		«ENDIF»
+	'''
+
+	protected def generateInEventDefinition(EventDefinition event) '''
+		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+			public void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+				«event.symbol» = true;
+				«event.valueIdentifier» = value;
+			}
+			
+			private «event.type.targetLanguageName» get«event.name.asName»Value() {
+				«event.getIllegalAccessValidation()»
+				return «event.valueIdentifier»;
+			}
+			
+		«ELSE»
+			public void raise«event.name.asName»() {
+				«event.symbol» = true;
+			}
+			
+		«ENDIF»
+	'''
+	
+	protected def generateOperationCallback(InterfaceScope scope) '''
+		public «scope.getInterfaceOperationCallbackName()» operationCallback;
+		
+		public void set«scope.getInterfaceOperationCallbackName»(
+				«scope.getInterfaceOperationCallbackName» operationCallback) {
+			this.operationCallback = operationCallback;
+		}
+	'''
+	
+	
+	protected def generateListeners(InterfaceScope scope) '''
+		public List<«scope.getInterfaceListenerName»> listeners = new List<«scope.getInterfaceListenerName»>();
+		
+		public List<«scope.getInterfaceListenerName»> getListeners() {
+			return listeners;
+		}
+	'''
+
+	
+	def protected getIllegalAccessValidation(EventDefinition it) '''
+		if (! «name.asEscapedIdentifier» ) 
+			throw new InvalidOperationException("Illegal event value acces. Event «name.asEscapedName» is not raised!");
+	'''
+	
+	def protected internalScopeFunctions (ExecutionFlow flow) '''
+		«FOR event : flow.internalScopeEvents»
+			«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+				private void raise«event.name.asEscapedName»(«event.type.targetLanguageName» value) {
+					«event.valueIdentifier» = value;
+					«event.symbol» = true;
+				}
+				
+				private «event.type.targetLanguageName» get«event.name.asEscapedName»Value() {
+					«event.getIllegalAccessValidation()»
+					return «event.valueIdentifier»;
+				}
+			«ELSE»
+			
+				private void raise«event.name.asEscapedName»() {
+					«event.symbol» = true;
+				}
+				
+			«ENDIF»
+		«ENDFOR»
+		
+		«FOR internal : flow.internalScopes»
+			«IF internal.hasOperations»
+				public void set«internal.internalOperationCallbackName»(
+						«internal.internalOperationCallbackName» operationCallback) {
+					this.operationCallback = operationCallback;
+				}
+			«ENDIF»
+		«ENDFOR»
+	'''
+	
+	def protected defaultInterfaceFunctions(ExecutionFlow flow, GeneratorEntry entry) '''
+		«IF flow.defaultScope != null»
+			«var InterfaceScope scope = flow.defaultScope»
+			«FOR event : scope.eventDefinitions»
+				«IF event.direction == Direction::IN»
+					«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+					public void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+						«scope.interfaceName.asEscapedIdentifier».raise«event.name.asName»(value);
+					}
+					«ELSE»
+					public void raise«event.name.asName»() {
+						«scope.interfaceName.asEscapedIdentifier».raise«event.name.asName»();
+					}
+					«ENDIF»
+				«ENDIF»
+				«IF event.direction ==  Direction::OUT»
+					public bool isRaised«event.name.asName»() {
+						return «scope.interfaceName.asEscapedIdentifier».isRaised«event.name.asName»();
+					}
+					«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+						public «event.type.targetLanguageName» get«event.name.asName»Value() {
+							return «scope.interfaceName.asEscapedIdentifier».get«event.name.asName»Value();
+						}
+					«ENDIF»
+				«ENDIF»
+			«ENDFOR»
+			
+			«FOR variable : scope.variableDefinitions»
+					public «variable.type.targetLanguageName» «variable.getter()» {
+						return «scope.interfaceName.asEscapedIdentifier».«variable.getter()»;
+					}
+					
+					«IF !variable.const && !variable.readonly»
+						public void «variable.setter»(«variable.type.targetLanguageName» value) {
+						«scope.interfaceName.asEscapedIdentifier».«variable.setter»(value);
+						}	
+					«ENDIF»
+			«ENDFOR»
+		«ENDIF»
+		
+	'''
+	
+	def protected runCycleFunction(ExecutionFlow flow) '''
+		public void runCycle() {
+			
+			clearOutEvents();
+			
+			for (nextStateIndex = 0; nextStateIndex < stateVector.Length; nextStateIndex++) {
+				
+				switch (stateVector[nextStateIndex]) {
+				«FOR state : flow.states»
+					«IF state.reactSequence!=null»
+						case State.«state.stateName.asEscapedIdentifier»:
+							«state.reactSequence.functionName»();
+							break;
+					«ENDIF»
+				«ENDFOR»
+				default:
+					// «getNullStateName()»
+					break;
+				}
+			}
+			
+			clearEvents();
+		}
+	'''
+	
+	def protected enterFunction(ExecutionFlow it) '''
+		public void enter() {
+			«IF timed»
+			if (timer == null) {
+				throw new InvalidOperationException("timer not set.");
+			}
+			«ENDIF»
+			«enterSequences.defaultSequence.code»
+		}
+	'''
+	
+	def protected exitFunction(ExecutionFlow it) '''
+		public void exit(){
+			«exitSequence.code»
+		}
+	'''
+	
+	def protected functionImplementations(ExecutionFlow it) '''
+		«checkFunctions.toImplementation»
+		«effectFunctions.toImplementation»
+		«entryActionFunctions.toImplementation»
+		«exitActionFunctions.toImplementation»
+		«enterSequenceFunctions.toImplementation»
+		«exitSequenceFunctions.toImplementation»
+		«reactFunctions.toImplementation»
+	'''
+	
+	def toImplementation(List<Step> steps) '''
+		«FOR s : steps»
+			«s.functionImplementation»
+		«ENDFOR»
+	'''
+	
+	def dispatch functionImplementation(Check it) '''
+		«stepComment»
+		private bool «functionName»() {
+			return «code»;
+		}
+		
+	'''
+	
+	def dispatch functionImplementation(Step it) '''
+		«stepComment»
+		private void «functionName»() {
+			«code»
+		}
+		
+	'''
+}

+ 223 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/StatemachineInterface.xtend

@@ -0,0 +1,223 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+*/
+package org.yakindu.sct.generator.csharp
+
+import com.google.inject.Inject
+import org.eclipse.xtext.generator.IFileSystemAccess
+import org.yakindu.base.types.Direction
+import org.yakindu.base.types.Parameter
+import org.yakindu.base.types.typesystem.GenericTypeSystem
+import org.yakindu.base.types.typesystem.ITypeSystem
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.yakindu.sct.model.sgraph.Scope
+import org.yakindu.sct.model.stext.stext.InterfaceScope
+import org.yakindu.sct.model.stext.stext.InternalScope
+import org.yakindu.sct.model.stext.stext.OperationDefinition
+import org.yakindu.sct.model.stext.stext.VariableDefinition
+
+class StatemachineInterface {
+
+	@Inject extension Naming
+	@Inject extension GenmodelEntries
+	@Inject extension Navigation
+	@Inject extension ITypeSystem
+	@Inject extension ICodegenTypeSystemAccess
+	@Inject extension ExpressionCode
+	@Inject Beautifier beautifier
+
+	def generateStatemachineInterface(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
+		var filename = flow.statemachineInterfaceName.csharp
+		var content = content(flow, entry)
+		fsa.generateFile(filename, content)
+	}
+
+	def protected content(ExecutionFlow flow, GeneratorEntry entry) {
+		'''
+			«entry.licenseText»
+			«IF entry.createInterfaceObserver && flow.hasOutgoingEvents»
+				using System.Collections.Generic;
+			«ENDIF»
+			using «entry.namespaceName»;
+			
+			namespace «entry.namespaceName»
+			{
+				public interface «flow.statemachineInterfaceName» : «flow.statemachineInterfaceExtensions» {
+					«IF flow.internalScope != null»
+					
+					«var constants = flow.internalScope.declarations.filter(VariableDefinition).filter[const]»
+					«FOR constant : constants»
+						«constant.constantFieldDeclaration()»
+					«ENDFOR»
+					«ENDIF»
+					«FOR scope : flow.scopes»
+						«scope.createIFaceGetter()»
+					«ENDFOR»
+				}
+				
+				«FOR scope : flow.scopes»
+					«scope.createScope(entry)»
+				«ENDFOR»
+			}
+		'''
+	}
+	
+	def protected createIFaceGetter(Scope scope) {
+		switch scope {
+			InterfaceScope:
+			'''
+				«scope.interfaceName» get«scope.interfaceName»();
+			'''
+		}
+	}
+	
+	def protected constantFieldDeclaration(VariableDefinition variable){
+		'''static readonly «variable.type.targetLanguageName» «variable.symbol» = «variable.initialValue.code»;'''
+	}
+
+	def protected createScope(Scope scope, GeneratorEntry entry) {
+		switch scope {
+			InterfaceScope: scope.createScope(entry)
+			InternalScope: scope.createScope
+		}
+	}
+
+	def protected createScope(InterfaceScope scope, GeneratorEntry entry) {
+		'''
+			«scope.createInterface(entry)»
+			«scope.createListenerInterface(entry)»
+			«scope.createOperationCallbackInterface»
+		'''
+	}
+
+	def protected createScope(InternalScope scope) {
+		'''
+			«IF scope.hasOperations()»
+				public interface «scope.internalOperationCallbackName» {
+					«FOR operation : scope.operations»
+						«operation.operationSignature»
+					«ENDFOR»
+				}
+				
+				void set«scope.internalOperationCallbackName»(«scope.internalOperationCallbackName» operationCallback);
+			«ENDIF»
+		'''
+	}
+
+	def protected createInterface(InterfaceScope scope, GeneratorEntry entry) {
+		'''
+				public interface «scope.interfaceName» {
+				«var constants = scope.declarations.filter(VariableDefinition).filter[const]»
+				«FOR constant : constants»
+					«constant.constantFieldDeclaration()»
+				«ENDFOR»
+				«scope.eventAccessors»
+				«scope.variableAccessors»
+				«IF entry.createInterfaceObserver && scope.hasOutgoingEvents»
+				List<«scope.getInterfaceListenerName()»> getListeners();
+				«ENDIF»
+			
+					«IF scope.hasOperations()»
+						void set«scope.getInterfaceOperationCallbackName()»(«scope.getInterfaceOperationCallbackName()» operationCallback);
+					«ENDIF»
+				}
+		'''
+	}
+
+	def protected createListenerInterface(InterfaceScope scope, GeneratorEntry entry) {
+		'''
+			«IF entry.createInterfaceObserver && scope.hasOutgoingEvents»
+				
+				public interface «scope.getInterfaceListenerName()» {
+					«FOR event : scope.eventDefinitions»
+						«IF event.direction == Direction::OUT»
+							«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+								void on«event.name.toFirstUpper()»Raised(«event.type.targetLanguageName» value);
+							«ELSE»
+								void on«event.name.toFirstUpper()»Raised();
+							«ENDIF»	
+						«ENDIF»
+					«ENDFOR»
+					}
+			«ENDIF»
+		'''
+	}
+
+	def protected createOperationCallbackInterface(InterfaceScope scope) {
+		'''
+			«IF scope.hasOperations»
+				
+				public interface «scope.getInterfaceOperationCallbackName()» {
+				«FOR operation : scope.operations»
+					«operation.operationSignature»
+				«ENDFOR»
+				}
+			«ENDIF»
+		'''
+	}
+
+	def protected eventAccessors(InterfaceScope scope) {
+		'''
+			«FOR event : scope.eventDefinitions»
+				«IF event.direction == Direction::IN»
+				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+						void raise«event.name.asName»(«event.type.targetLanguageName» value);
+					«ELSE»
+						void raise«event.name.asName»();
+					«ENDIF»
+				«ELSEIF event.direction == Direction::OUT»
+					bool isRaised«event.name.asName»();
+					««« IMPORTANT: An event not specifying a type is regarded to have a void type
+				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
+						«event.type.targetLanguageName» get«event.name.asName»Value();
+					«ENDIF»	
+				«ENDIF»
+			«ENDFOR»
+		'''
+	}
+
+	def protected variableAccessors(InterfaceScope scope) '''
+		«FOR variable : scope.variableDefinitions»
+			«variable.type.targetLanguageName» «variable.getter»;
+			«IF !variable.readonly && !variable.const»
+				void «variable.setter»(«variable.type.targetLanguageName» value);	
+			«ENDIF»
+		«ENDFOR»
+	'''
+
+	def protected getStatemachineInterfaceExtensions(ExecutionFlow flow) {
+
+		var String interfaces = "";
+
+		if (flow.timed) {
+			interfaces = interfaces + iTimerCallback + ","
+		}
+
+		interfaces = interfaces + iStatemachine
+
+		return interfaces;
+	}
+
+	def protected operationSignature(OperationDefinition it) {
+		'''
+			«type.targetLanguageName» «name.asEscapedIdentifier»(«FOR parameter : parameters SEPARATOR ', '»«parameter.
+				type.targetLanguageName» «parameter.identifier»«ENDFOR»);
+		'''
+	}
+
+	def protected identifier(Parameter parameter) {
+		if (parameter.name.isCSharpKeyword()) {
+			return parameter.name + "Arg"
+		} else {
+			parameter.name
+		}
+	}
+}

+ 136 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/TimerService.xtend

@@ -0,0 +1,136 @@
+/**
+  Copyright (c) 2012 committers of YAKINDU and others.
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  which accompanies this distribution, and is available at
+  http://www.eclipse.org/legal/epl-v10.html
+  Contributors:
+  	Markus Muehlbrandt - Initial contribution and API
+ */
+package org.yakindu.sct.generator.csharp
+
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.eclipse.xtext.generator.IFileSystemAccess
+import com.google.inject.Inject
+
+class TimerService {
+	
+	@Inject
+	extension Naming 
+	
+	@Inject
+	extension GenmodelEntries
+	
+	def generateTimerService(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
+		fsa.generateFile(entry.basePackagePath + '/' + timerServiceClass.csharp, content(entry))
+	}
+	
+	def private content(GeneratorEntry entry) '''
+		«entry.licenseText»
+		
+		using System;
+		using System.Collections.Generic;
+		using System.Timers;
+		using «entry.getNamespaceName()»;
+		
+		/**
+		 * Default timer service implementation.
+		 * 
+		 */
+		namespace «entry.getNamespaceName()»
+		{
+			public class TimerService : ITimer {
+			
+				private readonly List<TimeEventTask> timerTaskList = new List<TimeEventTask>();
+				
+				/**
+				 * Timer task that reflects a time event. It's internally used by
+				 * {@link TimerService}.
+				 * 
+				 */
+				private class TimeEventTask : Timer {
+				
+					private ITimerCallback callback;
+				
+					int eventID;
+				
+					/**
+					 * Constructor for a time event.
+					 * 
+					 * @param callback
+					 *            : Set to {@code true} if event should be repeated
+					 *            periodically.
+					 * 
+					 * @param eventID
+					 *            : Index position within the state machine's timeEvent
+					 *            array.
+					 */
+					public TimeEventTask(ITimerCallback callback, int eventID) {
+						// Add to base classes Elapsed event
+						this.Elapsed += (sender, e) => {
+						    	callback.timeElapsed(eventID);
+							};  
+						this.callback = callback;
+						this.eventID = eventID;
+					}
+				
+					public void Run() {
+						callback.timeElapsed(eventID);
+					}
+				
+					public override bool Equals(Object obj) {
+						if (obj is TimeEventTask) {
+							return ((TimeEventTask) obj).callback.Equals(callback)
+									&& ((TimeEventTask) obj).eventID == eventID;
+						}
+						return base.Equals(obj);
+					}
+					
+					public void Cancel() {
+						this.Stop();
+					}
+				}
+				
+				public void setTimer(ITimerCallback callback, int eventID,
+						long time, bool isPeriodic) {
+				
+					// Create a new TimerTask for given event and store it.
+					TimeEventTask timerTask = new TimeEventTask(callback, eventID);
+					timerTaskList.Add(timerTask);
+				
+					// start scheduling the timer
+					if (isPeriodic) {
+						timerTask.Interval = time;
+						timerTask.AutoReset = true;
+					} else {
+						timerTask.Interval = time;
+						timerTask.AutoReset = false;
+					}
+					
+					timerTask.Start();
+				}
+				
+				public void unsetTimer(ITimerCallback callback, int eventID) {
+					int index = timerTaskList.FindIndex( x => x.Equals(new TimeEventTask(callback, eventID)) );
+					if (index != -1) {
+						timerTaskList[index].Cancel();
+						timerTaskList.RemoveAt(index);
+					}
+				}
+				
+				/**
+				 * Cancel timer service. Use this to end possible timing threads and free
+				 * memory resources.
+				 */
+				public void cancel() {
+					foreach( TimeEventTask tet in timerTaskList )
+					{
+						tet.Cancel();
+					}
+				}
+			}
+		}
+
+	'''
+}

+ 72 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/features/CSharpFeatureConstants.java

@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.csharp.features;
+
+import static org.yakindu.sct.generator.core.features.ICoreFeatureConstants.LICENSE_HEADER;
+import static org.yakindu.sct.generator.core.features.ICoreFeatureConstants.LICENSE_TEXT;
+/**
+ * 
+ * @author muehlbrandt
+ */
+public final class CSharpFeatureConstants implements ICSharpFeatureConstants {
+	
+	public static final String getNamingFeature() {
+		return NAMING_FEATURE;
+	}
+	
+	public static final String getNamespaceName() {
+		return NAMESPACE_NAME;
+	}
+	
+	public static final String getImplementationSuffix() {
+		return IMPLEMENTATION_SUFFIX;
+	}
+		
+	public static final String getLicenseHeader() {
+		return LICENSE_HEADER;
+	}
+	
+	public static final String getLicenseText() {
+		return LICENSE_TEXT;
+	}
+	
+	public static final String getGeneralFeature() {
+		return GENERAL_FEATURES;
+	}
+	
+	public static final String getEventBasedStatemachine() {
+		return CREATE_EVENTBASEDSTATEMACHINE;
+	}
+	
+	public static final String getRuntimeService() {
+		return RUNTIME_SERVICE;
+	}
+	
+	public static final String getTimerService() {
+		return TIMER_SERVICE;
+	}
+	
+	public static final String getInterfaceObserverSupport() {
+		return INTERFACE_OBSERVER_SUPPORT;
+	}
+	
+	public static final String getGenericInterfaceSupport() {
+		return GENERIC_INTERFACE_SUPPORT;
+	}
+	
+	public static final String getStatemachineFactorySupport() {
+		return STATEMACHINE_FACTORY_SUPPORT;
+	}
+	
+	public static final String getUseCSharpIntForInteger() {
+		return USE_CSHARP_INT_FOR_INTEGER;
+	}
+}

+ 87 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/features/CSharpFeatureValueProvider.java

@@ -0,0 +1,87 @@
+/**
+ * Copyright (c) 2011-2015 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.csharp.features;
+
+import static org.yakindu.sct.generator.csharp.features.ICSharpFeatureConstants.*;
+
+import java.util.Arrays;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.yakindu.sct.generator.core.features.AbstractDefaultFeatureValueProvider;
+import org.yakindu.sct.model.sgen.FeatureParameterValue;
+import org.yakindu.sct.model.sgen.FeatureTypeLibrary;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * @author terfloth - extensions
+ * 
+ */
+public class CSharpFeatureValueProvider extends
+		AbstractDefaultFeatureValueProvider {
+
+	private static final String PACKAGE_NAME_REGEX = "([a-zA-Z_][a-zA-Z0-9_]*\\.)+[a-zA-Z_][a-zA-Z0-9_]*";
+	private static final String SUFFIX_REGEX = "[a-zA-Z0-9_]*";
+
+	@Override
+	protected void setDefaultValue(FeatureParameterValue parameterValue,
+			EObject contextElement) {
+		if (parameterValue.getParameter().getName().equals(NAMESPACE_NAME)) {
+			parameterValue.setValue("Yakindu.SCT");
+		} else if (parameterValue.getParameter().getName()
+				.equals(IMPLEMENTATION_SUFFIX)) {
+			parameterValue.setValue("impl");
+		} else if (parameterValue.getParameter().getName().equals(NAME_PREFIX)) {
+			parameterValue.setValue("Runnable");
+		} else if (parameterValue.getParameter().getName().equals(NAME_SUFFIX)) {
+			parameterValue.setValue("");
+		}
+	}
+
+	public boolean isProviderFor(FeatureTypeLibrary library) {
+		return library.getName().equals(LIBRARY_NAME);
+	}
+
+	public IStatus validateParameterValue(FeatureParameterValue value) {
+		String name = value.getParameter().getName();
+		if (NAMESPACE_NAME.equals(name)) {
+			// Filter out C# keywords
+			for (String keyword : Arrays.asList(CSHARP_KEYWORDS)) {
+				Pattern pattern = Pattern.compile("(?:^|\\.)" + keyword
+						+ "(?:$|\\.)");
+				Matcher matcher = pattern.matcher(value.getStringValue());
+				while (matcher.find()) {
+					return error("C# keyword '" + matcher.group()
+							+ "' is not allowed in package names.");
+				}
+			}
+		}
+		if (IMPLEMENTATION_SUFFIX.equals(name)) {
+			if (!value.getStringValue().matches(SUFFIX_REGEX)) {
+				return error("Invalid value");
+			}
+			for (String keyword : Arrays.asList(CSHARP_KEYWORDS)) {
+				Pattern pattern = Pattern.compile("^" + keyword + "$");
+				Matcher matcher = pattern.matcher(value.getStringValue());
+				while (matcher.find()) {
+					return error("C# keyword '" + matcher.group()
+							+ "' is not allowed as suffix.");
+				}
+			}
+
+		}
+		return Status.OK_STATUS;
+	}
+}

+ 70 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/features/ICSharpFeatureConstants.java

@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2011-2015 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.csharp.features;
+
+/**
+ * 
+ * @author muelder
+ * @author terfloth
+ * 
+ */
+public interface ICSharpFeatureConstants {
+
+	public static final String LIBRARY_NAME = "C# Generator";
+
+	public static final String NAMING_FEATURE = "Naming";
+	
+	public static final String NAMESPACE_NAME = "namespaceName";
+
+	public static final String IMPLEMENTATION_SUFFIX = "implementationSuffix";
+	
+	public static final String GENERAL_FEATURES = "GeneralFeatures";
+	
+	public static final String CREATE_EVENTBASEDSTATEMACHINE = "EventBasedStatemachine";
+	
+	public static final String RUNTIME_SERVICE = "RuntimeService";
+	
+	public static final String TIMER_SERVICE = "TimerService";
+	
+	public static final String INTERFACE_OBSERVER_SUPPORT = "InterfaceObserverSupport";
+	
+	public static final String GENERIC_INTERFACE_SUPPORT = "GenericInterfaceSupport";
+	
+	public static final String STATEMACHINE_FACTORY_SUPPORT = "StatemachineFactorySupport";
+	
+	public static final String USE_CSHARP_INT_FOR_INTEGER = "UseCSharpIntForInteger";
+	
+	/* Constants related to the RunnableWrapper feature */
+	
+	public static final String RUNNABLE_WRAPPER = "RunnableWrapper";
+	
+	public static final String NAME_PREFIX = "namePrefix";
+	
+	public static final String NAME_SUFFIX = "nameSuffix";
+	
+	
+	
+	
+	public static final String[] CSHARP_KEYWORDS = { 
+			"abstract", "as", "base", "bool", "break", "byte", 
+			"case", "catch", "char", "checked", "class", "const", 
+			"continue", "default", "delegate", "do", "double", "else", 
+			"enum", "event", "explicit", "extern", "false", "finally", 
+			"fixed", "float", "for", "foreach", "goto", "if", 
+			"implicit", "in", "int", "interface", "internal", "is", 
+			"lock", "long", "namespace", "new", "null", "object", 
+			"operator", "out", "override", "params", "private", "protected", 
+			"public", "readonly", "ref", "return", "sbyte", "sealed", 
+			"short", "sizeof", "stackalloc", "static", "string", "struct", 
+			"switch", "this", "throw", "true", "try", "typeof", 
+			"uint", "ulong", "unchecked", "unsafe", "ushort", "using", 
+			"virtual", "void", "volatile", "while" };
+}

+ 38 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/types/CSharpTypeSystemAccess.xtend

@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2012 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.csharp.types
+
+import com.google.inject.Inject
+import org.yakindu.base.types.Type
+import org.yakindu.base.types.typesystem.ITypeSystem
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
+
+import static org.yakindu.base.types.typesystem.ITypeSystem.*
+
+/**
+ * @author andreas muelder
+ */
+class CSharpTypeSystemAccess implements ICodegenTypeSystemAccess {
+
+	@Inject
+	private extension ITypeSystem ts
+
+	override String getTargetLanguageName(Type type) {
+		switch (type) {
+			case type == null || ts.isSame(type, getType(VOID)) : 'void'
+			case ts.isSame(type, getType(REAL)): "double"
+			case ts.isSame(type, getType(INTEGER)): "long"
+			case ts.isSame(type, getType(BOOLEAN)): "bool"
+			case ts.isSame(type, getType(STRING)): "string"
+			default: "//" + this
+		};
+	}
+}

+ 39 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/types/OldCSharpTypeSystemAccess.xtend

@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2012 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.csharp.types
+
+import com.google.inject.Inject
+import org.yakindu.base.types.Type
+import org.yakindu.base.types.typesystem.ITypeSystem
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
+
+import static org.yakindu.base.types.typesystem.ITypeSystem.*
+
+/**
+ * @author andreas muelder
+ * @author Alexander Nyßen - Adopted to type system changes
+ */
+class OldCSharpTypeSystemAccess implements ICodegenTypeSystemAccess {
+
+	@Inject
+	private extension ITypeSystem ts
+
+	override String getTargetLanguageName(Type type) {
+		switch (type) {
+			case type == null || ts.isSame(type, getType(VOID)) : 'void'
+			case ts.isSame(type, getType(REAL)): "double"
+			case ts.isSame(type, getType(INTEGER)): "int"
+			case ts.isSame(type, getType(BOOLEAN)): "boolean"
+			case ts.isSame(type, getType(STRING)): "String"
+			default: "//" + this
+		};
+	}
+}

+ 5 - 0
plugins/org.yakindu.sct.generator.csharp/xtend-gen/.gitignore

@@ -0,0 +1,5 @@
+# Ignore those directories
+*
+
+# And never this file
+!.gitignore

+ 9 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/.classpath

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="src-gen"/>
+	<classpathentry kind="src" path="test-gen"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 2 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/.gitignore

@@ -0,0 +1,2 @@
+/bin/
+/target/

+ 51 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/.project

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.generator.csharp.test</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.xtext.ui.shared.xtextBuilder</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.yakindu.sct.builder.SCTBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.yakindu.sct.builder.SCTNature</nature>
+	</natures>
+	<filteredResources>
+		<filter>
+			<id>1375978357015</id>
+			<name></name>
+			<type>10</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-target</arguments>
+			</matcher>
+		</filter>
+	</filteredResources>
+</projectDescription>

+ 2 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.core.resources.prefs

@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8

+ 2 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.core.runtime.prefs

@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n

+ 11 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

+ 8 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.xtend.core.Xtend.prefs

@@ -0,0 +1,8 @@
+autobuilding=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.cleanDirectory=false
+outlet.DEFAULT_OUTPUT.cleanupDerived=true
+outlet.DEFAULT_OUTPUT.createDirectory=true
+outlet.DEFAULT_OUTPUT.derived=false
+outlet.DEFAULT_OUTPUT.override=true

+ 16 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/META-INF/MANIFEST.MF

@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Yakindu Statechart Tools (SCT) C# Generator Tests
+Bundle-SymbolicName: org.yakindu.sct.generator.csharp.test
+Bundle-Version: 2.5.0.qualifier
+Require-Bundle: org.yakindu.sct.test.models;bundle-version="1.0.0",
+ org.junit;bundle-version="4.8.2",
+ org.yakindu.sct.generator.csharp;bundle-version="2.5.0",
+ org.yakindu.sct.generator.core;bundle-version="1.0.0",
+ com.google.inject;bundle-version="2.0.0",
+ org.eclipse.xtext.junit4;bundle-version="2.0.1",
+ org.yakindu.sct.generator.genmodel;bundle-version="1.0.0",
+ org.eclipse.jdt.core;bundle-version="3.7.3",
+ org.eclipse.ui;bundle-version="3.7.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: statecharts.org

+ 19 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/all C# generator tests.launch

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.yakindu.sct.generator.csharp.test/test-gen/org/yakindu/sct/generator/csharp/test/AllTestsTest.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.yakindu.sct.generator.csharp.test.AllTestsTest"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.yakindu.sct.generator.csharp.test"/>
+</launchConfiguration>

+ 5 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/build.properties

@@ -0,0 +1,5 @@
+source.. = src/,\
+           src-gen/,\
+           test-gen/
+bin.includes = META-INF/,\
+               .

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1472 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/model/model.sgen


+ 472 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/model/test.sgen

@@ -0,0 +1,472 @@
+GeneratorModel for sctunit::csharp {
+
+	test AllTests{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
+	test AlwaysOncycle{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test AssignmentAsExpression{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test BitExpressions{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test BooleanExpressions{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test Choice{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test CastExpressions{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
+	test CKeywords{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
+	test ConditionalExpression{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test ConstantsTests{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test Declarations{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test DeepHistory{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test DeepEntry{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test DynamicChoice{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+		
+	test EmptyTransition{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}	
+		
+	test EnterState{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test EntryChoice{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test EntryExitSelfTransition{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test ExitOnSelfTransition{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test ExitState{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test FeatureCalls{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test FinalState{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test Guard{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test GuardedEntry{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test GuardedExit{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test HistoryWithExitPoint {
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test HistoryWithoutInitialStep{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test InEventLifeCycle{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test IntegerExpressions{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}	
+	
+	test InternalEventLifeCycle{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+		
+		
+	test LocalReactions{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}	
+		
+		
+	test LogicalAndTests{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+		
+	test LogicalOrTests{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+		
+	test NamedInterfaceAccess{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
+	test NullCheck{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test OutEventLifeCycle{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}	
+	
+	test Parenthesis{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+		
+	test PerformanceTests{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test PriorityValues{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}	
+	
+	test RaiseEvent{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test ReadOnlyVariable{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+			
+	test SameNameDifferentRegion{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}	
+	
+	
+	test ShallowHistory{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test ShallowHistoryWithDeepEntry{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test SimpleEvent{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test SimpleHierachy{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test StatechartLocalReactions{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test StatechartActive {
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test StateIsActive{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test StaticChoice{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test STextKeywordsInStatesAndRegions{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test StringExpressions{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test SyncFork{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+	
+	test SyncJoin{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
+	test TimedTransitions{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
+
+	test TransitionWithoutCondition{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
+
+	test TriggerGuardExpressions {
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}
+
+
+	test ValuedEvents{
+		
+		feature Outlet{ 
+			targetProject = "org.yakindu.sct.generator.csharp.test" 
+			targetFolder = "test-gen"			
+		}			
+	}		
+}

+ 37 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/pom.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.yakindu.sct</groupId>
+		<artifactId>org.yakindu.sct.releng</artifactId>
+		<version>2.5.0-SNAPSHOT</version>
+		<relativePath>../../releng/org.yakindu.sct.releng/pom.xml</relativePath>
+	</parent>
+	<artifactId>org.yakindu.sct.generator.csharp.test</artifactId>
+	<groupId>org.yakindu.sct.plugins</groupId>
+	<packaging>eclipse-test-plugin</packaging>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.eclipse.tycho</groupId>
+				<artifactId>tycho-surefire-plugin</artifactId>
+				<version>${tycho-version}</version>
+				<configuration>
+					 						 		
+					<includes>
+						<include>**/AllTestsTest.class</include>
+						<include>**/AllTestsTestCustom.class</include>
+					</includes>
+					 	 		
+					<useUIHarness>false</useUIHarness>
+					<useUIThread>false</useUIThread>
+					<testFailureIgnore>${testFailureIgnore}</testFailureIgnore>
+					<argLine>${test.vmargs}</argLine>
+				</configuration>
+			</plugin>
+			
+		</plugins>
+	</build>
+</project>

+ 39 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/IStatemachine.java

@@ -0,0 +1,39 @@
+package org.yakindu.scr;
+
+/**
+ * Basic interface for statemachines.
+ */
+public interface IStatemachine {
+
+	/**
+	 * Initializes the statemachine. Use to init internal variables etc.
+	 */
+	public void init();
+
+	/**
+	 * Enters the statemachine. Sets the statemachine in a defined state.
+	 */
+	public void enter();
+
+	/**
+	 * Exits the statemachine. Leaves the statemachine with a defined state.
+	 */
+	public void exit();
+
+	/**
+	 * Checks if the statemachine is active. 
+	 * A statemachine is active if it was entered. It is inactive if it has not been entered at all or if it was exited.
+	 */
+	public boolean isActive();
+
+	/**
+	 * Checks if all active states are final. 
+	 * If there are no active states then the statemachine is considered as incative and this method returns false.
+	 */
+	public boolean isFinal();
+
+	/**
+	* Start a run-to-completion cycle.
+	*/
+	public void runCycle();
+}

+ 38 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/ITimer.java

@@ -0,0 +1,38 @@
+package org.yakindu.scr;
+
+/**
+ * Interface a timer has to implement. Use to implement your own timer
+ * service.
+ * 
+ */
+public interface ITimer {
+
+	/**
+	 * Starts the timing for a given time event id.
+	 * 
+	 * @param callback
+	 * 			  : The target callback where the time event has to be raised.
+	 * 
+	 * @param eventID
+	 *            : The eventID the timer should use if timed out.
+	 *            
+	 * @param time
+	 *            : Time in milliseconds after the given time event should be
+	 *            triggered
+	 *            
+	 * @param isPeriodic
+	 * 			  : Set to true if the time event should be triggered periodically
+	 */
+	public void setTimer(ITimerCallback callback, int eventID, long time, boolean isPeriodic);
+
+	/**
+	 * Unset a time event.
+	 * 
+	 * @param callback
+	 * 			: The target callback for which the time event has to be unset.
+	 * 
+	 * @param eventID
+	 * 			: The time event id.
+	 */
+	public void unsetTimer(ITimerCallback callback, int eventID);
+}

+ 15 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/ITimerCallback.java

@@ -0,0 +1,15 @@
+package org.yakindu.scr;
+
+/**
+* Interface for state machines which use timed event triggers.
+*/
+public interface ITimerCallback {
+	
+	/**
+	* Callback method if a time event occurred.
+	* 
+	* @param eventID
+	* 			:The id of the occurred event.
+	*/
+	public void timeElapsed(int eventID);
+}

+ 207 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/RuntimeService.java

@@ -0,0 +1,207 @@
+package org.yakindu.scr;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/**
+ * Runtime service for state machines to execute a run to completion step
+ * periodically.
+ * 
+ */
+public class RuntimeService {
+
+	private static RuntimeService runtimeService;
+
+	private Timer timer = null;
+
+	private Map<Long, StatemachineTimerTask> timerTasks = new HashMap<Long, StatemachineTimerTask>();
+
+	private class StatemachineTimerTask extends TimerTask {
+
+		private List<IStatemachine> statemachineList = new LinkedList<IStatemachine>();
+
+		private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
+
+		private boolean isPaused = false;
+
+		@Override
+		public void run() {
+			lock.readLock().lock();
+			if (!isPaused) {
+				for (IStatemachine statemachine : statemachineList) {
+					statemachine.runCycle();
+				}
+			}
+			lock.readLock().unlock();
+		}
+
+		/**
+		 * Adds the given state machine to the TimerTask.
+		 * 
+		 * @param statemachine
+		 * @return {@code true} if state machine is added properly.
+		 */
+		public boolean addStatemachine(IStatemachine statemachine) {
+			lock.writeLock().lock();
+			boolean ret = statemachineList.add(statemachine);
+			lock.writeLock().unlock();
+			return ret;
+		}
+
+		/**
+		 * Removes the given state machine from the TimerTask.
+		 * 
+		 * @param statemachine
+		 * @return {@code true} if state machine is removed properly.
+		 */
+		public boolean removeStatemachine(IStatemachine statemachine) {
+			lock.writeLock().lock();
+			boolean ret = statemachineList.remove(statemachine);
+			lock.writeLock().unlock();
+			return ret;
+		}
+
+		public void pause() {
+			isPaused = true;
+		}
+
+		public void resume() {
+			isPaused = false;
+		}
+	}
+
+	private RuntimeService() {
+		// Not intended to be instantiated.
+	}
+
+	/**
+	 * Returns the {@code RuntimeService} instance as singleton.
+	 * 
+	 * @return The singleton {@code RuntimeService} instance
+	 */
+	public static RuntimeService getInstance() {
+		if (runtimeService == null) {
+			runtimeService = new RuntimeService();
+		}
+		return runtimeService;
+	}
+
+	/**
+	 * Registers an {@link IStatemachine} for scheduled fixed rate execution
+	 * 
+	 * @param statemachine
+	 *            - The statemachine to execute
+	 * @param cyclePeriod
+	 *            - the fixed rate cycle period for scheduling
+	 * @return {@code true} if state machine is added properly.
+	 */
+	public boolean registerStatemachine(IStatemachine statemachine,
+			long cyclePeriod) {
+
+		if (timerTasks.containsKey(cyclePeriod)) {
+			// TimerTask for cycle time already existing -> add statemachine
+			return timerTasks.get(cyclePeriod).addStatemachine(statemachine);
+		} else {
+			// Create new TimerTask for cycle period and add statemachine
+			StatemachineTimerTask timerTask = new StatemachineTimerTask();
+			timerTasks.put(cyclePeriod, timerTask);
+			boolean ret = timerTask.addStatemachine(statemachine);
+			// Create a new Timer instance if runtime service was cancelled
+			// before
+			if (timer == null) {
+				timer = new Timer();
+			}
+			timer.scheduleAtFixedRate(timerTask, 0, cyclePeriod);
+			return ret;
+		}
+	}
+
+	/**
+	 * Removes the given state machine from runtime service.
+	 * 
+	 * @param statemachine
+	 *            - the statemachine which should be removed
+	 * @param cyclePeriod
+	 *            - the scheduling cycle period of the statemachine
+	 * @return {@code true} if state machine is removed properly.
+	 */
+	public boolean unregisterStatemachine(IStatemachine statemachine,
+			long cyclePeriod) {
+		if (timerTasks.containsKey(cyclePeriod)) {
+			boolean ret = timerTasks.get(cyclePeriod).removeStatemachine(
+					statemachine);
+
+			return ret;
+		}
+		return false;
+	}
+
+	/**
+	 * Cancels the execution of statemachines for the given cycle period. This
+	 * stops the execution of statemachines which are registered for the given
+	 * cycle period and cancels the executing {@link TimerTask}.
+	 * 
+	 * @return {@code true} if poperly cancelled
+	 */
+	public boolean cancelAll(long cyclePeriod) {
+		if (timer != null && timerTasks.containsKey(cyclePeriod)) {
+			TimerTask task = timerTasks.get(cyclePeriod);
+			task.cancel();
+			timer.purge();
+			timerTasks.remove(cyclePeriod);
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Pauses the execution of all statemachines which are registered for the
+	 * given cyclePeriod.
+	 * 
+	 * @param cyclePeriod
+	 * @return {@code true} if properly paused
+	 * 
+	 */
+	public boolean pauseAll(long cyclePeriod) {
+		if (timerTasks.containsKey(cyclePeriod)) {
+			timerTasks.get(cyclePeriod).pause();
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Resumes the execution of all statemachines which are registered for the
+	 * given cyclePeriod.
+	 * 
+	 * @param cyclePeriod
+	 * @return {@code true} if properly resumed
+	 * 
+	 */
+	public boolean resumeAll(long cyclePeriod) {
+		if (timerTasks.containsKey(cyclePeriod)) {
+			timerTasks.get(cyclePeriod).resume();
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Cancels the execution of all registered statemachines. This cancels the
+	 * executing {@link Timer} freeing all allocated resources and terminates
+	 * all existing execution threads.
+	 */
+	public void cancelTimer() {
+		if (timer != null) {
+			timer.cancel();
+			timer.purge();
+			timerTasks.clear();
+			timer = null;
+		}
+	}
+}

+ 91 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/TimerService.java

@@ -0,0 +1,91 @@
+package org.yakindu.scr;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * Default timer service implementation.
+ * 
+ */
+public class TimerService implements ITimer {
+
+	private final Timer timer = new Timer();
+	
+	private final List<TimeEventTask> timerTaskList = new ArrayList<TimeEventTask>();
+	
+	/**
+	 * Timer task that reflects a time event. It's internally used by
+	 * {@link TimerService}.
+	 * 
+	 */
+	private class TimeEventTask extends TimerTask {
+	
+		private ITimerCallback callback;
+	
+		int eventID;
+	
+		/**
+		 * Constructor for a time event.
+		 * 
+		 * @param callback
+		 *            : Set to {@code true} if event should be repeated
+		 *            periodically.
+		 * 
+		 * @param eventID
+		 *            : Index position within the state machine's timeEvent
+		 *            array.
+		 */
+		public TimeEventTask(ITimerCallback callback, int eventID) {
+			this.callback = callback;
+			this.eventID = eventID;
+		}
+	
+		public void run() {
+			callback.timeElapsed(eventID);
+		}
+	
+		public boolean equals(Object obj) {
+			if (obj instanceof TimeEventTask) {
+				return ((TimeEventTask) obj).callback.equals(callback)
+						&& ((TimeEventTask) obj).eventID == eventID;
+			}
+			return super.equals(obj);
+		}
+	}
+	
+	public void setTimer(final ITimerCallback callback, final int eventID,
+			long time, boolean isPeriodic) {
+	
+		// Create a new TimerTask for given event and store it.
+		TimeEventTask timerTask = new TimeEventTask(callback, eventID);
+		timerTaskList.add(timerTask);
+	
+		// start scheduling the timer
+		if (isPeriodic) {
+			timer.scheduleAtFixedRate(timerTask, time, time);
+		} else {
+			timer.schedule(timerTask, time);
+		}
+	}
+	
+	public void unsetTimer(ITimerCallback callback, int eventID) {
+		int index = timerTaskList.indexOf(new TimeEventTask(callback, eventID));
+		if (index != -1) {
+			timerTaskList.get(index).cancel();
+			timer.purge();
+			timerTaskList.remove(index);
+		}
+	}
+	
+	/**
+	 * Cancel timer service. Use this to end possible timing threads and free
+	 * memory resources.
+	 */
+	public void cancel() {
+		timer.cancel();
+		timer.purge();
+	}
+}
+

+ 278 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/alwaysoncycle/AlwaysOncycleStatemachine.java

@@ -0,0 +1,278 @@
+package org.yakindu.scr.alwaysoncycle;
+
+public class AlwaysOncycleStatemachine implements IAlwaysOncycleStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private long value;
+		public long getValue() {
+			return value;
+		}
+
+		public void setValue(long value) {
+			this.value = value;
+		}
+
+		private boolean v2;
+		public boolean getV2() {
+			return v2;
+		}
+
+		public void setV2(boolean value) {
+			this.v2 = value;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		main_region_StateA, main_region_StateB, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public AlwaysOncycleStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.value = 0;
+
+		sCInterface.v2 = false;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_StateA :
+				return stateVector[0] == State.main_region_StateA;
+			case main_region_StateB :
+				return stateVector[0] == State.main_region_StateB;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public long getValue() {
+		return sCInterface.getValue();
+	}
+
+	public void setValue(long value) {
+		sCInterface.setValue(value);
+	}
+	public boolean getV2() {
+		return sCInterface.getV2();
+	}
+
+	public void setV2(boolean value) {
+		sCInterface.setV2(value);
+	}
+
+	private boolean check_main_region_StateA_tr0_tr0() {
+		return sCInterface.value == 5;
+	}
+
+	private boolean check_main_region_StateA_lr1_lr1() {
+		return true;
+	}
+
+	private boolean check_main_region_StateB_tr0_tr0() {
+		return sCInterface.value == 5;
+	}
+
+	private boolean check_main_region_StateB_lr0_lr0() {
+		return true;
+	}
+
+	private void effect_main_region_StateA_tr0() {
+		exitSequence_main_region_StateA();
+
+		enterSequence_main_region_StateB_default();
+	}
+
+	private void effect_main_region_StateA_lr1_lr1() {
+		sCInterface.value += 1;
+	}
+
+	private void effect_main_region_StateB_tr0() {
+		exitSequence_main_region_StateB();
+
+		enterSequence_main_region_StateA_default();
+	}
+
+	private void effect_main_region_StateB_lr0_lr0() {
+		sCInterface.value += 1;
+	}
+
+	/* Entry action for statechart 'AlwaysOncycle'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'StateA'. */
+	private void entryAction_main_region_StateA() {
+		sCInterface.value = 0;
+	}
+
+	/* Exit action for state 'AlwaysOncycle'. */
+	private void exitAction() {
+	}
+
+	/* Exit action for state 'StateA'. */
+	private void exitAction_main_region_StateA() {
+		sCInterface.value = 0;
+	}
+
+	/* 'default' enter sequence for state StateA */
+	private void enterSequence_main_region_StateA_default() {
+		entryAction_main_region_StateA();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_StateA;
+	}
+
+	/* 'default' enter sequence for state StateB */
+	private void enterSequence_main_region_StateB_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_StateB;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state StateA */
+	private void exitSequence_main_region_StateA() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+
+		exitAction_main_region_StateA();
+	}
+
+	/* Default exit sequence for state StateB */
+	private void exitSequence_main_region_StateB() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_StateA :
+				exitSequence_main_region_StateA();
+				break;
+
+			case main_region_StateB :
+				exitSequence_main_region_StateB();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state StateA. */
+	private void react_main_region_StateA() {
+		if (check_main_region_StateA_tr0_tr0()) {
+			effect_main_region_StateA_tr0();
+		} else {
+			effect_main_region_StateA_lr1_lr1();
+		}
+	}
+
+	/* The reactions of state StateB. */
+	private void react_main_region_StateB() {
+		if (check_main_region_StateB_tr0_tr0()) {
+			effect_main_region_StateB_tr0();
+		} else {
+			effect_main_region_StateB_lr0_lr0();
+		}
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_StateA_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_StateA :
+					react_main_region_StateA();
+					break;
+				case main_region_StateB :
+					react_main_region_StateB();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 15 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/alwaysoncycle/IAlwaysOncycleStatemachine.java

@@ -0,0 +1,15 @@
+package org.yakindu.scr.alwaysoncycle;
+import org.yakindu.scr.IStatemachine;
+
+public interface IAlwaysOncycleStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public long getValue();
+		public void setValue(long value);
+		public boolean getV2();
+		public void setV2(boolean value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 926 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/assignmentasexpression/AssignmentAsExpressionStatemachine.java

@@ -0,0 +1,926 @@
+package org.yakindu.scr.assignmentasexpression;
+
+public class AssignmentAsExpressionStatemachine
+		implements
+			IAssignmentAsExpressionStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private long a;
+		public long getA() {
+			return a;
+		}
+
+		public void setA(long value) {
+			this.a = value;
+		}
+
+		private long b;
+		public long getB() {
+			return b;
+		}
+
+		public void setB(long value) {
+			this.b = value;
+		}
+
+		private long c;
+		public long getC() {
+			return c;
+		}
+
+		public void setC(long value) {
+			this.c = value;
+		}
+
+		private long d;
+		public long getD() {
+			return d;
+		}
+
+		public void setD(long value) {
+			this.d = value;
+		}
+
+		private long e;
+		public long getE() {
+			return e;
+		}
+
+		public void setE(long value) {
+			this.e = value;
+		}
+
+		private long f;
+		public long getF() {
+			return f;
+		}
+
+		public void setF(long value) {
+			this.f = value;
+		}
+
+		private long g;
+		public long getG() {
+			return g;
+		}
+
+		public void setG(long value) {
+			this.g = value;
+		}
+
+		private long h;
+		public long getH() {
+			return h;
+		}
+
+		public void setH(long value) {
+			this.h = value;
+		}
+
+		private long i;
+		public long getI() {
+			return i;
+		}
+
+		public void setI(long value) {
+			this.i = value;
+		}
+
+		private long i1;
+		public long getI1() {
+			return i1;
+		}
+
+		public void setI1(long value) {
+			this.i1 = value;
+		}
+
+		private long j;
+		public long getJ() {
+			return j;
+		}
+
+		public void setJ(long value) {
+			this.j = value;
+		}
+
+		private long j1;
+		public long getJ1() {
+			return j1;
+		}
+
+		public void setJ1(long value) {
+			this.j1 = value;
+		}
+
+		private long k;
+		public long getK() {
+			return k;
+		}
+
+		public void setK(long value) {
+			this.k = value;
+		}
+
+		private long k1;
+		public long getK1() {
+			return k1;
+		}
+
+		public void setK1(long value) {
+			this.k1 = value;
+		}
+
+		private long l;
+		public long getL() {
+			return l;
+		}
+
+		public void setL(long value) {
+			this.l = value;
+		}
+
+		private long m;
+		public long getM() {
+			return m;
+		}
+
+		public void setM(long value) {
+			this.m = value;
+		}
+
+		private long n;
+		public long getN() {
+			return n;
+		}
+
+		public void setN(long value) {
+			this.n = value;
+		}
+
+		private long p;
+		public long getP() {
+			return p;
+		}
+
+		public void setP(long value) {
+			this.p = value;
+		}
+
+		private long r;
+		public long getR() {
+			return r;
+		}
+
+		public void setR(long value) {
+			this.r = value;
+		}
+
+		private long t;
+		public long getT() {
+			return t;
+		}
+
+		public void setT(long value) {
+			this.t = value;
+		}
+
+		private long u;
+		public long getU() {
+			return u;
+		}
+
+		public void setU(long value) {
+			this.u = value;
+		}
+
+		private long v;
+		public long getV() {
+			return v;
+		}
+
+		public void setV(long value) {
+			this.v = value;
+		}
+
+		private long w;
+		public long getW() {
+			return w;
+		}
+
+		public void setW(long value) {
+			this.w = value;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		main_region_Add, main_region_Multiply, main_region_Divide, main_region_Modulo, main_region_Shift, main_region_boolean_And, main_region_boolean_Or, main_region_boolean_Xor, main_region_Subtract, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public AssignmentAsExpressionStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.a = 0;
+
+		sCInterface.b = 0;
+
+		sCInterface.c = 0;
+
+		sCInterface.d = 0;
+
+		sCInterface.e = 1;
+
+		sCInterface.f = 1;
+
+		sCInterface.g = 4;
+
+		sCInterface.h = 32;
+
+		sCInterface.i = 7;
+
+		sCInterface.i1 = 7;
+
+		sCInterface.j = 8;
+
+		sCInterface.j1 = 2;
+
+		sCInterface.k = 8;
+
+		sCInterface.k1 = 4;
+
+		sCInterface.l = 3;
+
+		sCInterface.m = 7;
+
+		sCInterface.n = 5;
+
+		sCInterface.p = 0;
+
+		sCInterface.r = 7;
+
+		sCInterface.t = 10;
+
+		sCInterface.u = 6;
+
+		sCInterface.v = 13;
+
+		sCInterface.w = 7;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_Add :
+				return stateVector[0] == State.main_region_Add;
+			case main_region_Multiply :
+				return stateVector[0] == State.main_region_Multiply;
+			case main_region_Divide :
+				return stateVector[0] == State.main_region_Divide;
+			case main_region_Modulo :
+				return stateVector[0] == State.main_region_Modulo;
+			case main_region_Shift :
+				return stateVector[0] == State.main_region_Shift;
+			case main_region_boolean_And :
+				return stateVector[0] == State.main_region_boolean_And;
+			case main_region_boolean_Or :
+				return stateVector[0] == State.main_region_boolean_Or;
+			case main_region_boolean_Xor :
+				return stateVector[0] == State.main_region_boolean_Xor;
+			case main_region_Subtract :
+				return stateVector[0] == State.main_region_Subtract;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public long getA() {
+		return sCInterface.getA();
+	}
+
+	public void setA(long value) {
+		sCInterface.setA(value);
+	}
+	public long getB() {
+		return sCInterface.getB();
+	}
+
+	public void setB(long value) {
+		sCInterface.setB(value);
+	}
+	public long getC() {
+		return sCInterface.getC();
+	}
+
+	public void setC(long value) {
+		sCInterface.setC(value);
+	}
+	public long getD() {
+		return sCInterface.getD();
+	}
+
+	public void setD(long value) {
+		sCInterface.setD(value);
+	}
+	public long getE() {
+		return sCInterface.getE();
+	}
+
+	public void setE(long value) {
+		sCInterface.setE(value);
+	}
+	public long getF() {
+		return sCInterface.getF();
+	}
+
+	public void setF(long value) {
+		sCInterface.setF(value);
+	}
+	public long getG() {
+		return sCInterface.getG();
+	}
+
+	public void setG(long value) {
+		sCInterface.setG(value);
+	}
+	public long getH() {
+		return sCInterface.getH();
+	}
+
+	public void setH(long value) {
+		sCInterface.setH(value);
+	}
+	public long getI() {
+		return sCInterface.getI();
+	}
+
+	public void setI(long value) {
+		sCInterface.setI(value);
+	}
+	public long getI1() {
+		return sCInterface.getI1();
+	}
+
+	public void setI1(long value) {
+		sCInterface.setI1(value);
+	}
+	public long getJ() {
+		return sCInterface.getJ();
+	}
+
+	public void setJ(long value) {
+		sCInterface.setJ(value);
+	}
+	public long getJ1() {
+		return sCInterface.getJ1();
+	}
+
+	public void setJ1(long value) {
+		sCInterface.setJ1(value);
+	}
+	public long getK() {
+		return sCInterface.getK();
+	}
+
+	public void setK(long value) {
+		sCInterface.setK(value);
+	}
+	public long getK1() {
+		return sCInterface.getK1();
+	}
+
+	public void setK1(long value) {
+		sCInterface.setK1(value);
+	}
+	public long getL() {
+		return sCInterface.getL();
+	}
+
+	public void setL(long value) {
+		sCInterface.setL(value);
+	}
+	public long getM() {
+		return sCInterface.getM();
+	}
+
+	public void setM(long value) {
+		sCInterface.setM(value);
+	}
+	public long getN() {
+		return sCInterface.getN();
+	}
+
+	public void setN(long value) {
+		sCInterface.setN(value);
+	}
+	public long getP() {
+		return sCInterface.getP();
+	}
+
+	public void setP(long value) {
+		sCInterface.setP(value);
+	}
+	public long getR() {
+		return sCInterface.getR();
+	}
+
+	public void setR(long value) {
+		sCInterface.setR(value);
+	}
+	public long getT() {
+		return sCInterface.getT();
+	}
+
+	public void setT(long value) {
+		sCInterface.setT(value);
+	}
+	public long getU() {
+		return sCInterface.getU();
+	}
+
+	public void setU(long value) {
+		sCInterface.setU(value);
+	}
+	public long getV() {
+		return sCInterface.getV();
+	}
+
+	public void setV(long value) {
+		sCInterface.setV(value);
+	}
+	public long getW() {
+		return sCInterface.getW();
+	}
+
+	public void setW(long value) {
+		sCInterface.setW(value);
+	}
+
+	private boolean check_main_region_Add_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region_Multiply_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region_Divide_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region_Modulo_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region_Shift_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region_boolean_And_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region_boolean_Or_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region_Subtract_tr0_tr0() {
+		return true;
+	}
+
+	private void effect_main_region_Add_tr0() {
+		exitSequence_main_region_Add();
+
+		enterSequence_main_region_Subtract_default();
+	}
+
+	private void effect_main_region_Multiply_tr0() {
+		exitSequence_main_region_Multiply();
+
+		enterSequence_main_region_Divide_default();
+	}
+
+	private void effect_main_region_Divide_tr0() {
+		exitSequence_main_region_Divide();
+
+		enterSequence_main_region_Modulo_default();
+	}
+
+	private void effect_main_region_Modulo_tr0() {
+		exitSequence_main_region_Modulo();
+
+		enterSequence_main_region_Shift_default();
+	}
+
+	private void effect_main_region_Shift_tr0() {
+		exitSequence_main_region_Shift();
+
+		enterSequence_main_region_boolean_And_default();
+	}
+
+	private void effect_main_region_boolean_And_tr0() {
+		exitSequence_main_region_boolean_And();
+
+		enterSequence_main_region_boolean_Or_default();
+	}
+
+	private void effect_main_region_boolean_Or_tr0() {
+		exitSequence_main_region_boolean_Or();
+
+		enterSequence_main_region_boolean_Xor_default();
+	}
+
+	private void effect_main_region_Subtract_tr0() {
+		exitSequence_main_region_Subtract();
+
+		enterSequence_main_region_Multiply_default();
+	}
+
+	/* Entry action for statechart 'AssignmentAsExpression'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'Add'. */
+	private void entryAction_main_region_Add() {
+		sCInterface.a = (sCInterface.b = 5) + 4;
+	}
+
+	/* Entry action for state 'Multiply'. */
+	private void entryAction_main_region_Multiply() {
+		sCInterface.e *= (sCInterface.f *= 5) * 3;
+	}
+
+	/* Entry action for state 'Divide'. */
+	private void entryAction_main_region_Divide() {
+		sCInterface.g /= (sCInterface.h /= 2) / 4;
+	}
+
+	/* Entry action for state 'Modulo'. */
+	private void entryAction_main_region_Modulo() {
+		sCInterface.i %= (sCInterface.i1 %= 4) % 4;
+	}
+
+	/* Entry action for state 'Shift'. */
+	private void entryAction_main_region_Shift() {
+		sCInterface.j <<= (sCInterface.j1 >>= 1);
+
+		sCInterface.k >>= (sCInterface.k1 >>= 2);
+	}
+
+	/* Entry action for state 'boolean And'. */
+	private void entryAction_main_region_boolean_And() {
+		sCInterface.l &= (sCInterface.n &= sCInterface.m);
+	}
+
+	/* Entry action for state 'boolean Or'. */
+	private void entryAction_main_region_boolean_Or() {
+		sCInterface.p |= (sCInterface.r |= sCInterface.t);
+	}
+
+	/* Entry action for state 'boolean Xor'. */
+	private void entryAction_main_region_boolean_Xor() {
+		sCInterface.u ^= (sCInterface.v ^= sCInterface.w);
+	}
+
+	/* Entry action for state 'Subtract'. */
+	private void entryAction_main_region_Subtract() {
+		sCInterface.d -= (sCInterface.c -= 5) - 1;
+	}
+
+	/* Exit action for state 'AssignmentAsExpression'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state Add */
+	private void enterSequence_main_region_Add_default() {
+		entryAction_main_region_Add();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_Add;
+	}
+
+	/* 'default' enter sequence for state Multiply */
+	private void enterSequence_main_region_Multiply_default() {
+		entryAction_main_region_Multiply();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_Multiply;
+	}
+
+	/* 'default' enter sequence for state Divide */
+	private void enterSequence_main_region_Divide_default() {
+		entryAction_main_region_Divide();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_Divide;
+	}
+
+	/* 'default' enter sequence for state Modulo */
+	private void enterSequence_main_region_Modulo_default() {
+		entryAction_main_region_Modulo();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_Modulo;
+	}
+
+	/* 'default' enter sequence for state Shift */
+	private void enterSequence_main_region_Shift_default() {
+		entryAction_main_region_Shift();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_Shift;
+	}
+
+	/* 'default' enter sequence for state boolean And */
+	private void enterSequence_main_region_boolean_And_default() {
+		entryAction_main_region_boolean_And();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_boolean_And;
+	}
+
+	/* 'default' enter sequence for state boolean Or */
+	private void enterSequence_main_region_boolean_Or_default() {
+		entryAction_main_region_boolean_Or();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_boolean_Or;
+	}
+
+	/* 'default' enter sequence for state boolean Xor */
+	private void enterSequence_main_region_boolean_Xor_default() {
+		entryAction_main_region_boolean_Xor();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_boolean_Xor;
+	}
+
+	/* 'default' enter sequence for state Subtract */
+	private void enterSequence_main_region_Subtract_default() {
+		entryAction_main_region_Subtract();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_Subtract;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state Add */
+	private void exitSequence_main_region_Add() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state Multiply */
+	private void exitSequence_main_region_Multiply() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state Divide */
+	private void exitSequence_main_region_Divide() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state Modulo */
+	private void exitSequence_main_region_Modulo() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state Shift */
+	private void exitSequence_main_region_Shift() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state boolean And */
+	private void exitSequence_main_region_boolean_And() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state boolean Or */
+	private void exitSequence_main_region_boolean_Or() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state boolean Xor */
+	private void exitSequence_main_region_boolean_Xor() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state Subtract */
+	private void exitSequence_main_region_Subtract() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_Add :
+				exitSequence_main_region_Add();
+				break;
+
+			case main_region_Multiply :
+				exitSequence_main_region_Multiply();
+				break;
+
+			case main_region_Divide :
+				exitSequence_main_region_Divide();
+				break;
+
+			case main_region_Modulo :
+				exitSequence_main_region_Modulo();
+				break;
+
+			case main_region_Shift :
+				exitSequence_main_region_Shift();
+				break;
+
+			case main_region_boolean_And :
+				exitSequence_main_region_boolean_And();
+				break;
+
+			case main_region_boolean_Or :
+				exitSequence_main_region_boolean_Or();
+				break;
+
+			case main_region_boolean_Xor :
+				exitSequence_main_region_boolean_Xor();
+				break;
+
+			case main_region_Subtract :
+				exitSequence_main_region_Subtract();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state Add. */
+	private void react_main_region_Add() {
+		effect_main_region_Add_tr0();
+	}
+
+	/* The reactions of state Multiply. */
+	private void react_main_region_Multiply() {
+		effect_main_region_Multiply_tr0();
+	}
+
+	/* The reactions of state Divide. */
+	private void react_main_region_Divide() {
+		effect_main_region_Divide_tr0();
+	}
+
+	/* The reactions of state Modulo. */
+	private void react_main_region_Modulo() {
+		effect_main_region_Modulo_tr0();
+	}
+
+	/* The reactions of state Shift. */
+	private void react_main_region_Shift() {
+		effect_main_region_Shift_tr0();
+	}
+
+	/* The reactions of state boolean And. */
+	private void react_main_region_boolean_And() {
+		effect_main_region_boolean_And_tr0();
+	}
+
+	/* The reactions of state boolean Or. */
+	private void react_main_region_boolean_Or() {
+		effect_main_region_boolean_Or_tr0();
+	}
+
+	/* The reactions of state boolean Xor. */
+	private void react_main_region_boolean_Xor() {
+	}
+
+	/* The reactions of state Subtract. */
+	private void react_main_region_Subtract() {
+		effect_main_region_Subtract_tr0();
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_Add_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_Add :
+					react_main_region_Add();
+					break;
+				case main_region_Multiply :
+					react_main_region_Multiply();
+					break;
+				case main_region_Divide :
+					react_main_region_Divide();
+					break;
+				case main_region_Modulo :
+					react_main_region_Modulo();
+					break;
+				case main_region_Shift :
+					react_main_region_Shift();
+					break;
+				case main_region_boolean_And :
+					react_main_region_boolean_And();
+					break;
+				case main_region_boolean_Or :
+					react_main_region_boolean_Or();
+					break;
+				case main_region_boolean_Xor :
+					react_main_region_boolean_Xor();
+					break;
+				case main_region_Subtract :
+					react_main_region_Subtract();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 57 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/assignmentasexpression/IAssignmentAsExpressionStatemachine.java

@@ -0,0 +1,57 @@
+package org.yakindu.scr.assignmentasexpression;
+import org.yakindu.scr.IStatemachine;
+
+public interface IAssignmentAsExpressionStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public long getA();
+		public void setA(long value);
+		public long getB();
+		public void setB(long value);
+		public long getC();
+		public void setC(long value);
+		public long getD();
+		public void setD(long value);
+		public long getE();
+		public void setE(long value);
+		public long getF();
+		public void setF(long value);
+		public long getG();
+		public void setG(long value);
+		public long getH();
+		public void setH(long value);
+		public long getI();
+		public void setI(long value);
+		public long getI1();
+		public void setI1(long value);
+		public long getJ();
+		public void setJ(long value);
+		public long getJ1();
+		public void setJ1(long value);
+		public long getK();
+		public void setK(long value);
+		public long getK1();
+		public void setK1(long value);
+		public long getL();
+		public void setL(long value);
+		public long getM();
+		public void setM(long value);
+		public long getN();
+		public void setN(long value);
+		public long getP();
+		public void setP(long value);
+		public long getR();
+		public void setR(long value);
+		public long getT();
+		public void setT(long value);
+		public long getU();
+		public void setU(long value);
+		public long getV();
+		public void setV(long value);
+		public long getW();
+		public void setW(long value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 380 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/bitexpressions/BitExpressionsStatemachine.java

@@ -0,0 +1,380 @@
+package org.yakindu.scr.bitexpressions;
+
+public class BitExpressionsStatemachine implements IBitExpressionsStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean e1;
+
+		public void raiseE1() {
+			e1 = true;
+		}
+
+		private long myBit1;
+		public long getMyBit1() {
+			return myBit1;
+		}
+
+		public void setMyBit1(long value) {
+			this.myBit1 = value;
+		}
+
+		private long myBit2;
+		public long getMyBit2() {
+			return myBit2;
+		}
+
+		public void setMyBit2(long value) {
+			this.myBit2 = value;
+		}
+
+		private long leftBitshift;
+		public long getLeftBitshift() {
+			return leftBitshift;
+		}
+
+		public void setLeftBitshift(long value) {
+			this.leftBitshift = value;
+		}
+
+		private long rightBitshift;
+		public long getRightBitshift() {
+			return rightBitshift;
+		}
+
+		public void setRightBitshift(long value) {
+			this.rightBitshift = value;
+		}
+
+		private long complementBitshift;
+		public long getComplementBitshift() {
+			return complementBitshift;
+		}
+
+		public void setComplementBitshift(long value) {
+			this.complementBitshift = value;
+		}
+
+		private long bitwiseAnd;
+		public long getBitwiseAnd() {
+			return bitwiseAnd;
+		}
+
+		public void setBitwiseAnd(long value) {
+			this.bitwiseAnd = value;
+		}
+
+		private long bitwiseOr;
+		public long getBitwiseOr() {
+			return bitwiseOr;
+		}
+
+		public void setBitwiseOr(long value) {
+			this.bitwiseOr = value;
+		}
+
+		private long bitwiseXor;
+		public long getBitwiseXor() {
+			return bitwiseXor;
+		}
+
+		public void setBitwiseXor(long value) {
+			this.bitwiseXor = value;
+		}
+
+		public void clearEvents() {
+			e1 = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		main_region_StateA, main_region_StateB, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public BitExpressionsStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.myBit1 = 0;
+
+		sCInterface.myBit2 = 0;
+
+		sCInterface.leftBitshift = 0;
+
+		sCInterface.rightBitshift = 0;
+
+		sCInterface.complementBitshift = 0;
+
+		sCInterface.bitwiseAnd = 0;
+
+		sCInterface.bitwiseOr = 0;
+
+		sCInterface.bitwiseXor = 0;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_StateA :
+				return stateVector[0] == State.main_region_StateA;
+			case main_region_StateB :
+				return stateVector[0] == State.main_region_StateB;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raiseE1() {
+		sCInterface.raiseE1();
+	}
+
+	public long getMyBit1() {
+		return sCInterface.getMyBit1();
+	}
+
+	public void setMyBit1(long value) {
+		sCInterface.setMyBit1(value);
+	}
+	public long getMyBit2() {
+		return sCInterface.getMyBit2();
+	}
+
+	public void setMyBit2(long value) {
+		sCInterface.setMyBit2(value);
+	}
+	public long getLeftBitshift() {
+		return sCInterface.getLeftBitshift();
+	}
+
+	public void setLeftBitshift(long value) {
+		sCInterface.setLeftBitshift(value);
+	}
+	public long getRightBitshift() {
+		return sCInterface.getRightBitshift();
+	}
+
+	public void setRightBitshift(long value) {
+		sCInterface.setRightBitshift(value);
+	}
+	public long getComplementBitshift() {
+		return sCInterface.getComplementBitshift();
+	}
+
+	public void setComplementBitshift(long value) {
+		sCInterface.setComplementBitshift(value);
+	}
+	public long getBitwiseAnd() {
+		return sCInterface.getBitwiseAnd();
+	}
+
+	public void setBitwiseAnd(long value) {
+		sCInterface.setBitwiseAnd(value);
+	}
+	public long getBitwiseOr() {
+		return sCInterface.getBitwiseOr();
+	}
+
+	public void setBitwiseOr(long value) {
+		sCInterface.setBitwiseOr(value);
+	}
+	public long getBitwiseXor() {
+		return sCInterface.getBitwiseXor();
+	}
+
+	public void setBitwiseXor(long value) {
+		sCInterface.setBitwiseXor(value);
+	}
+
+	private boolean check_main_region_StateA_tr0_tr0() {
+		return sCInterface.e1;
+	}
+
+	private void effect_main_region_StateA_tr0() {
+		exitSequence_main_region_StateA();
+
+		enterSequence_main_region_StateB_default();
+	}
+
+	/* Entry action for statechart 'BitExpressions'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'StateA'. */
+	private void entryAction_main_region_StateA() {
+		sCInterface.myBit1 = 5;
+
+		sCInterface.myBit2 = 7;
+	}
+
+	/* Entry action for state 'StateB'. */
+	private void entryAction_main_region_StateB() {
+		sCInterface.leftBitshift = sCInterface.myBit1 << 1;
+
+		sCInterface.rightBitshift = sCInterface.myBit1 >> 1;
+
+		sCInterface.complementBitshift = ~sCInterface.myBit1;
+
+		sCInterface.bitwiseAnd = sCInterface.myBit1 & sCInterface.myBit2;
+
+		sCInterface.bitwiseOr = sCInterface.myBit1 | sCInterface.myBit2;
+
+		sCInterface.bitwiseXor = sCInterface.myBit1 ^ sCInterface.myBit2;
+	}
+
+	/* Exit action for state 'BitExpressions'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state StateA */
+	private void enterSequence_main_region_StateA_default() {
+		entryAction_main_region_StateA();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_StateA;
+	}
+
+	/* 'default' enter sequence for state StateB */
+	private void enterSequence_main_region_StateB_default() {
+		entryAction_main_region_StateB();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_StateB;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state StateA */
+	private void exitSequence_main_region_StateA() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state StateB */
+	private void exitSequence_main_region_StateB() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_StateA :
+				exitSequence_main_region_StateA();
+				break;
+
+			case main_region_StateB :
+				exitSequence_main_region_StateB();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state StateA. */
+	private void react_main_region_StateA() {
+		if (check_main_region_StateA_tr0_tr0()) {
+			effect_main_region_StateA_tr0();
+		}
+	}
+
+	/* The reactions of state StateB. */
+	private void react_main_region_StateB() {
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_StateA_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_StateA :
+					react_main_region_StateA();
+					break;
+				case main_region_StateB :
+					react_main_region_StateB();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 28 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/bitexpressions/IBitExpressionsStatemachine.java

@@ -0,0 +1,28 @@
+package org.yakindu.scr.bitexpressions;
+import org.yakindu.scr.IStatemachine;
+
+public interface IBitExpressionsStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public void raiseE1();
+		public long getMyBit1();
+		public void setMyBit1(long value);
+		public long getMyBit2();
+		public void setMyBit2(long value);
+		public long getLeftBitshift();
+		public void setLeftBitshift(long value);
+		public long getRightBitshift();
+		public void setRightBitshift(long value);
+		public long getComplementBitshift();
+		public void setComplementBitshift(long value);
+		public long getBitwiseAnd();
+		public void setBitwiseAnd(long value);
+		public long getBitwiseOr();
+		public void setBitwiseOr(long value);
+		public long getBitwiseXor();
+		public void setBitwiseXor(long value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 362 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/booleanexpressions/BooleanExpressionsStatemachine.java

@@ -0,0 +1,362 @@
+package org.yakindu.scr.booleanexpressions;
+
+public class BooleanExpressionsStatemachine
+		implements
+			IBooleanExpressionsStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean e1;
+
+		public void raiseE1() {
+			e1 = true;
+		}
+
+		private boolean myBool1;
+		public boolean getMyBool1() {
+			return myBool1;
+		}
+
+		public void setMyBool1(boolean value) {
+			this.myBool1 = value;
+		}
+
+		private boolean myBool2;
+		public boolean getMyBool2() {
+			return myBool2;
+		}
+
+		public void setMyBool2(boolean value) {
+			this.myBool2 = value;
+		}
+
+		private boolean and;
+		public boolean getAnd() {
+			return and;
+		}
+
+		public void setAnd(boolean value) {
+			this.and = value;
+		}
+
+		private boolean or;
+		public boolean getOr() {
+			return or;
+		}
+
+		public void setOr(boolean value) {
+			this.or = value;
+		}
+
+		private boolean not;
+		public boolean getNot() {
+			return not;
+		}
+
+		public void setNot(boolean value) {
+			this.not = value;
+		}
+
+		private boolean equal;
+		public boolean getEqual() {
+			return equal;
+		}
+
+		public void setEqual(boolean value) {
+			this.equal = value;
+		}
+
+		private boolean notequal;
+		public boolean getNotequal() {
+			return notequal;
+		}
+
+		public void setNotequal(boolean value) {
+			this.notequal = value;
+		}
+
+		public void clearEvents() {
+			e1 = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		main_region_StateA, main_region_StateB, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public BooleanExpressionsStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.myBool1 = false;
+
+		sCInterface.myBool2 = false;
+
+		sCInterface.and = false;
+
+		sCInterface.or = false;
+
+		sCInterface.not = false;
+
+		sCInterface.equal = false;
+
+		sCInterface.notequal = false;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_StateA :
+				return stateVector[0] == State.main_region_StateA;
+			case main_region_StateB :
+				return stateVector[0] == State.main_region_StateB;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raiseE1() {
+		sCInterface.raiseE1();
+	}
+
+	public boolean getMyBool1() {
+		return sCInterface.getMyBool1();
+	}
+
+	public void setMyBool1(boolean value) {
+		sCInterface.setMyBool1(value);
+	}
+	public boolean getMyBool2() {
+		return sCInterface.getMyBool2();
+	}
+
+	public void setMyBool2(boolean value) {
+		sCInterface.setMyBool2(value);
+	}
+	public boolean getAnd() {
+		return sCInterface.getAnd();
+	}
+
+	public void setAnd(boolean value) {
+		sCInterface.setAnd(value);
+	}
+	public boolean getOr() {
+		return sCInterface.getOr();
+	}
+
+	public void setOr(boolean value) {
+		sCInterface.setOr(value);
+	}
+	public boolean getNot() {
+		return sCInterface.getNot();
+	}
+
+	public void setNot(boolean value) {
+		sCInterface.setNot(value);
+	}
+	public boolean getEqual() {
+		return sCInterface.getEqual();
+	}
+
+	public void setEqual(boolean value) {
+		sCInterface.setEqual(value);
+	}
+	public boolean getNotequal() {
+		return sCInterface.getNotequal();
+	}
+
+	public void setNotequal(boolean value) {
+		sCInterface.setNotequal(value);
+	}
+
+	private boolean check_main_region_StateA_tr0_tr0() {
+		return sCInterface.e1;
+	}
+
+	private void effect_main_region_StateA_tr0() {
+		exitSequence_main_region_StateA();
+
+		enterSequence_main_region_StateB_default();
+	}
+
+	/* Entry action for statechart 'BooleanExpressions'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'StateA'. */
+	private void entryAction_main_region_StateA() {
+		sCInterface.myBool1 = true;
+
+		sCInterface.myBool2 = false;
+	}
+
+	/* Entry action for state 'StateB'. */
+	private void entryAction_main_region_StateB() {
+		sCInterface.and = sCInterface.myBool1 && sCInterface.myBool2;
+
+		sCInterface.or = sCInterface.myBool1 || sCInterface.myBool2;
+
+		sCInterface.not = !sCInterface.myBool1;
+
+		sCInterface.equal = sCInterface.myBool1 == sCInterface.myBool2;
+
+		sCInterface.notequal = (sCInterface.myBool1 != sCInterface.myBool2);
+	}
+
+	/* Exit action for state 'BooleanExpressions'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state StateA */
+	private void enterSequence_main_region_StateA_default() {
+		entryAction_main_region_StateA();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_StateA;
+	}
+
+	/* 'default' enter sequence for state StateB */
+	private void enterSequence_main_region_StateB_default() {
+		entryAction_main_region_StateB();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_StateB;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state StateA */
+	private void exitSequence_main_region_StateA() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state StateB */
+	private void exitSequence_main_region_StateB() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_StateA :
+				exitSequence_main_region_StateA();
+				break;
+
+			case main_region_StateB :
+				exitSequence_main_region_StateB();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state StateA. */
+	private void react_main_region_StateA() {
+		if (check_main_region_StateA_tr0_tr0()) {
+			effect_main_region_StateA_tr0();
+		}
+	}
+
+	/* The reactions of state StateB. */
+	private void react_main_region_StateB() {
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_StateA_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_StateA :
+					react_main_region_StateA();
+					break;
+				case main_region_StateB :
+					react_main_region_StateB();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 26 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/booleanexpressions/IBooleanExpressionsStatemachine.java

@@ -0,0 +1,26 @@
+package org.yakindu.scr.booleanexpressions;
+import org.yakindu.scr.IStatemachine;
+
+public interface IBooleanExpressionsStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public void raiseE1();
+		public boolean getMyBool1();
+		public void setMyBool1(boolean value);
+		public boolean getMyBool2();
+		public void setMyBool2(boolean value);
+		public boolean getAnd();
+		public void setAnd(boolean value);
+		public boolean getOr();
+		public void setOr(boolean value);
+		public boolean getNot();
+		public void setNot(boolean value);
+		public boolean getEqual();
+		public void setEqual(boolean value);
+		public boolean getNotequal();
+		public void setNotequal(boolean value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 286 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/castexpressions/CastExpressionsStatemachine.java

@@ -0,0 +1,286 @@
+package org.yakindu.scr.castexpressions;
+
+public class CastExpressionsStatemachine
+		implements
+			ICastExpressionsStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private double realValue;
+		public double getRealValue() {
+			return realValue;
+		}
+
+		public void setRealValue(double value) {
+			this.realValue = value;
+		}
+
+		private long intValue;
+		public long getIntValue() {
+			return intValue;
+		}
+
+		public void setIntValue(long value) {
+			this.intValue = value;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		main_region_A, main_region_B, main_region_C, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public CastExpressionsStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.realValue = (((double) 5));
+
+		sCInterface.intValue = (((long) 5.5));
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_A :
+				return stateVector[0] == State.main_region_A;
+			case main_region_B :
+				return stateVector[0] == State.main_region_B;
+			case main_region_C :
+				return stateVector[0] == State.main_region_C;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public double getRealValue() {
+		return sCInterface.getRealValue();
+	}
+
+	public void setRealValue(double value) {
+		sCInterface.setRealValue(value);
+	}
+	public long getIntValue() {
+		return sCInterface.getIntValue();
+	}
+
+	public void setIntValue(long value) {
+		sCInterface.setIntValue(value);
+	}
+
+	private boolean check_main_region_A_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region_B_tr0_tr0() {
+		return (true)
+				&& ((double) (sCInterface.realValue * 0.1)) > ((long) 1.4)
+				&& ((long) (sCInterface.realValue * sCInterface.intValue)) < ((double) 100);
+	}
+
+	private void effect_main_region_A_tr0() {
+		exitSequence_main_region_A();
+
+		enterSequence_main_region_B_default();
+	}
+
+	private void effect_main_region_B_tr0() {
+		exitSequence_main_region_B();
+
+		enterSequence_main_region_C_default();
+	}
+
+	/* Entry action for statechart 'CastExpressions'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'B'. */
+	private void entryAction_main_region_B() {
+		sCInterface.realValue = 3 * ((long) 5.5);
+	}
+
+	/* Entry action for state 'C'. */
+	private void entryAction_main_region_C() {
+		sCInterface.realValue = ((long) (sCInterface.realValue
+				* sCInterface.intValue * 10.1));
+	}
+
+	/* Exit action for state 'CastExpressions'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state A */
+	private void enterSequence_main_region_A_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_A;
+	}
+
+	/* 'default' enter sequence for state B */
+	private void enterSequence_main_region_B_default() {
+		entryAction_main_region_B();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_B;
+	}
+
+	/* 'default' enter sequence for state C */
+	private void enterSequence_main_region_C_default() {
+		entryAction_main_region_C();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_C;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state A */
+	private void exitSequence_main_region_A() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state B */
+	private void exitSequence_main_region_B() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state C */
+	private void exitSequence_main_region_C() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_A :
+				exitSequence_main_region_A();
+				break;
+
+			case main_region_B :
+				exitSequence_main_region_B();
+				break;
+
+			case main_region_C :
+				exitSequence_main_region_C();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state A. */
+	private void react_main_region_A() {
+		effect_main_region_A_tr0();
+	}
+
+	/* The reactions of state B. */
+	private void react_main_region_B() {
+		if (check_main_region_B_tr0_tr0()) {
+			effect_main_region_B_tr0();
+		}
+	}
+
+	/* The reactions of state C. */
+	private void react_main_region_C() {
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_A_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_A :
+					react_main_region_A();
+					break;
+				case main_region_B :
+					react_main_region_B();
+					break;
+				case main_region_C :
+					react_main_region_C();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 15 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/castexpressions/ICastExpressionsStatemachine.java

@@ -0,0 +1,15 @@
+package org.yakindu.scr.castexpressions;
+import org.yakindu.scr.IStatemachine;
+
+public interface ICastExpressionsStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public double getRealValue();
+		public void setRealValue(double value);
+		public long getIntValue();
+		public void setIntValue(long value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 447 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/choice/ChoiceStatemachine.java

@@ -0,0 +1,447 @@
+package org.yakindu.scr.choice;
+
+public class ChoiceStatemachine implements IChoiceStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean e;
+
+		public void raiseE() {
+			e = true;
+		}
+
+		private boolean f;
+
+		public void raiseF() {
+			f = true;
+		}
+
+		private boolean g;
+
+		public void raiseG() {
+			g = true;
+		}
+
+		private boolean h;
+
+		public void raiseH() {
+			h = true;
+		}
+
+		private boolean c;
+		public boolean getC() {
+			return c;
+		}
+
+		public void setC(boolean value) {
+			this.c = value;
+		}
+
+		public void clearEvents() {
+			e = false;
+			f = false;
+			g = false;
+			h = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		main_region_A, main_region_B, main_region_C, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public ChoiceStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.c = false;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_A :
+				return stateVector[0] == State.main_region_A;
+			case main_region_B :
+				return stateVector[0] == State.main_region_B;
+			case main_region_C :
+				return stateVector[0] == State.main_region_C;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raiseE() {
+		sCInterface.raiseE();
+	}
+	public void raiseF() {
+		sCInterface.raiseF();
+	}
+	public void raiseG() {
+		sCInterface.raiseG();
+	}
+	public void raiseH() {
+		sCInterface.raiseH();
+	}
+
+	public boolean getC() {
+		return sCInterface.getC();
+	}
+
+	public void setC(boolean value) {
+		sCInterface.setC(value);
+	}
+
+	private boolean check_main_region_A_tr0_tr0() {
+		return sCInterface.e;
+	}
+
+	private boolean check_main_region_A_tr1_tr1() {
+		return sCInterface.f;
+	}
+
+	private boolean check_main_region_A_tr2_tr2() {
+		return sCInterface.g;
+	}
+
+	private boolean check_main_region_A_tr3_tr3() {
+		return sCInterface.h;
+	}
+
+	private boolean check_main_region_B_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region_C_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region__choice_0_tr1_tr1() {
+		return sCInterface.c;
+	}
+
+	private boolean check_main_region__choice_0_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region__choice_1_tr0_tr0() {
+		return sCInterface.c;
+	}
+
+	private boolean check_main_region__choice_1_tr1_tr1() {
+		return true;
+	}
+
+	private boolean check_main_region__choice_2_tr1_tr1() {
+		return sCInterface.c;
+	}
+
+	private boolean check_main_region__choice_2_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region__choice_3_tr1_tr1() {
+		return sCInterface.c;
+	}
+
+	private boolean check_main_region__choice_3_tr0_tr0() {
+		return true;
+	}
+
+	private void effect_main_region_A_tr0() {
+		exitSequence_main_region_A();
+
+		react_main_region__choice_0();
+	}
+
+	private void effect_main_region_A_tr1() {
+		exitSequence_main_region_A();
+
+		react_main_region__choice_2();
+	}
+
+	private void effect_main_region_A_tr2() {
+		exitSequence_main_region_A();
+
+		react_main_region__choice_1();
+	}
+
+	private void effect_main_region_A_tr3() {
+		exitSequence_main_region_A();
+
+		react_main_region__choice_3();
+	}
+
+	private void effect_main_region_B_tr0() {
+		exitSequence_main_region_B();
+
+		enterSequence_main_region_A_default();
+	}
+
+	private void effect_main_region_C_tr0() {
+		exitSequence_main_region_C();
+
+		enterSequence_main_region_A_default();
+	}
+
+	private void effect_main_region__choice_0_tr1() {
+		enterSequence_main_region_C_default();
+	}
+
+	private void effect_main_region__choice_0_tr0() {
+		enterSequence_main_region_B_default();
+	}
+
+	private void effect_main_region__choice_1_tr0() {
+		enterSequence_main_region_C_default();
+	}
+
+	private void effect_main_region__choice_1_tr1() {
+		enterSequence_main_region_B_default();
+	}
+
+	private void effect_main_region__choice_2_tr1() {
+		enterSequence_main_region_C_default();
+	}
+
+	private void effect_main_region__choice_2_tr0() {
+		enterSequence_main_region_B_default();
+	}
+
+	private void effect_main_region__choice_3_tr1() {
+		enterSequence_main_region_C_default();
+	}
+
+	private void effect_main_region__choice_3_tr0() {
+		enterSequence_main_region_B_default();
+	}
+
+	/* Entry action for statechart 'Choice'. */
+	private void entryAction() {
+	}
+
+	/* Exit action for state 'Choice'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state A */
+	private void enterSequence_main_region_A_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_A;
+	}
+
+	/* 'default' enter sequence for state B */
+	private void enterSequence_main_region_B_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_B;
+	}
+
+	/* 'default' enter sequence for state C */
+	private void enterSequence_main_region_C_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_C;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state A */
+	private void exitSequence_main_region_A() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state B */
+	private void exitSequence_main_region_B() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state C */
+	private void exitSequence_main_region_C() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_A :
+				exitSequence_main_region_A();
+				break;
+
+			case main_region_B :
+				exitSequence_main_region_B();
+				break;
+
+			case main_region_C :
+				exitSequence_main_region_C();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state A. */
+	private void react_main_region_A() {
+		if (check_main_region_A_tr0_tr0()) {
+			effect_main_region_A_tr0();
+		} else {
+			if (check_main_region_A_tr1_tr1()) {
+				effect_main_region_A_tr1();
+			} else {
+				if (check_main_region_A_tr2_tr2()) {
+					effect_main_region_A_tr2();
+				} else {
+					if (check_main_region_A_tr3_tr3()) {
+						effect_main_region_A_tr3();
+					}
+				}
+			}
+		}
+	}
+
+	/* The reactions of state B. */
+	private void react_main_region_B() {
+		effect_main_region_B_tr0();
+	}
+
+	/* The reactions of state C. */
+	private void react_main_region_C() {
+		effect_main_region_C_tr0();
+	}
+
+	/* The reactions of state null. */
+	private void react_main_region__choice_0() {
+		if (check_main_region__choice_0_tr1_tr1()) {
+			effect_main_region__choice_0_tr1();
+		} else {
+			effect_main_region__choice_0_tr0();
+		}
+	}
+
+	/* The reactions of state null. */
+	private void react_main_region__choice_1() {
+		if (check_main_region__choice_1_tr0_tr0()) {
+			effect_main_region__choice_1_tr0();
+		} else {
+			effect_main_region__choice_1_tr1();
+		}
+	}
+
+	/* The reactions of state null. */
+	private void react_main_region__choice_2() {
+		if (check_main_region__choice_2_tr1_tr1()) {
+			effect_main_region__choice_2_tr1();
+		} else {
+			effect_main_region__choice_2_tr0();
+		}
+	}
+
+	/* The reactions of state null. */
+	private void react_main_region__choice_3() {
+		if (check_main_region__choice_3_tr1_tr1()) {
+			effect_main_region__choice_3_tr1();
+		} else {
+			effect_main_region__choice_3_tr0();
+		}
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_A_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_A :
+					react_main_region_A();
+					break;
+				case main_region_B :
+					react_main_region_B();
+					break;
+				case main_region_C :
+					react_main_region_C();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 17 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/choice/IChoiceStatemachine.java

@@ -0,0 +1,17 @@
+package org.yakindu.scr.choice;
+import org.yakindu.scr.IStatemachine;
+
+public interface IChoiceStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public void raiseE();
+		public void raiseF();
+		public void raiseG();
+		public void raiseH();
+		public boolean getC();
+		public void setC(boolean value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 909 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/ckeywords/CKeywordsStatemachine.java

@@ -0,0 +1,909 @@
+package org.yakindu.scr.ckeywords;
+
+public class CKeywordsStatemachine implements ICKeywordsStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean auto;
+
+		public void raiseAuto() {
+			auto = true;
+		}
+
+		private boolean break_ID;
+
+		public void raiseBreak() {
+			break_ID = true;
+		}
+
+		private boolean case_ID;
+		public boolean getCase() {
+			return case_ID;
+		}
+
+		public void setCase(boolean value) {
+			this.case_ID = value;
+		}
+
+		private long do_ID;
+		public long getDo() {
+			return do_ID;
+		}
+
+		public void setDo(long value) {
+			this.do_ID = value;
+		}
+
+		private boolean continue_ID;
+		public boolean getContinue() {
+			return continue_ID;
+		}
+
+		public void setContinue(boolean value) {
+			this.continue_ID = value;
+		}
+
+		private boolean double_ID;
+		public boolean getDouble() {
+			return double_ID;
+		}
+
+		public void setDouble(boolean value) {
+			this.double_ID = value;
+		}
+
+		private boolean enum_ID;
+		public boolean getEnum() {
+			return enum_ID;
+		}
+
+		public void setEnum(boolean value) {
+			this.enum_ID = value;
+		}
+
+		private boolean extern;
+		public boolean getExtern() {
+			return extern;
+		}
+
+		public void setExtern(boolean value) {
+			this.extern = value;
+		}
+
+		private boolean float_ID;
+		public boolean getFloat() {
+			return float_ID;
+		}
+
+		public void setFloat(boolean value) {
+			this.float_ID = value;
+		}
+
+		private boolean for_ID;
+		public boolean getFor() {
+			return for_ID;
+		}
+
+		public void setFor(boolean value) {
+			this.for_ID = value;
+		}
+
+		private boolean goto_ID;
+		public boolean getGoto() {
+			return goto_ID;
+		}
+
+		public void setGoto(boolean value) {
+			this.goto_ID = value;
+		}
+
+		private boolean if_ID;
+		public boolean getIf() {
+			return if_ID;
+		}
+
+		public void setIf(boolean value) {
+			this.if_ID = value;
+		}
+
+		private boolean int_ID;
+		public boolean getInt() {
+			return int_ID;
+		}
+
+		public void setInt(boolean value) {
+			this.int_ID = value;
+		}
+
+		private boolean long_ID;
+		public boolean getLong() {
+			return long_ID;
+		}
+
+		public void setLong(boolean value) {
+			this.long_ID = value;
+		}
+
+		private boolean register;
+		public boolean getRegister() {
+			return register;
+		}
+
+		public void setRegister(boolean value) {
+			this.register = value;
+		}
+
+		private boolean return_ID;
+		public boolean getReturn() {
+			return return_ID;
+		}
+
+		public void setReturn(boolean value) {
+			this.return_ID = value;
+		}
+
+		private boolean short_ID;
+		public boolean getShort() {
+			return short_ID;
+		}
+
+		public void setShort(boolean value) {
+			this.short_ID = value;
+		}
+
+		private boolean signed;
+		public boolean getSigned() {
+			return signed;
+		}
+
+		public void setSigned(boolean value) {
+			this.signed = value;
+		}
+
+		private boolean sizeof;
+		public boolean getSizeof() {
+			return sizeof;
+		}
+
+		public void setSizeof(boolean value) {
+			this.sizeof = value;
+		}
+
+		private boolean static_ID;
+		public boolean getStatic() {
+			return static_ID;
+		}
+
+		public void setStatic(boolean value) {
+			this.static_ID = value;
+		}
+
+		private boolean struct;
+		public boolean getStruct() {
+			return struct;
+		}
+
+		public void setStruct(boolean value) {
+			this.struct = value;
+		}
+
+		private boolean switch_ID;
+		public boolean getSwitch() {
+			return switch_ID;
+		}
+
+		public void setSwitch(boolean value) {
+			this.switch_ID = value;
+		}
+
+		private boolean typedef;
+		public boolean getTypedef() {
+			return typedef;
+		}
+
+		public void setTypedef(boolean value) {
+			this.typedef = value;
+		}
+
+		private boolean union;
+		public boolean getUnion() {
+			return union;
+		}
+
+		public void setUnion(boolean value) {
+			this.union = value;
+		}
+
+		private boolean unsigned;
+		public boolean getUnsigned() {
+			return unsigned;
+		}
+
+		public void setUnsigned(boolean value) {
+			this.unsigned = value;
+		}
+
+		private boolean void_ID;
+		public boolean getVoid() {
+			return void_ID;
+		}
+
+		public void setVoid(boolean value) {
+			this.void_ID = value;
+		}
+
+		private boolean volatile_ID;
+		public boolean getVolatile() {
+			return volatile_ID;
+		}
+
+		public void setVolatile(boolean value) {
+			this.volatile_ID = value;
+		}
+
+		private boolean while_ID;
+		public boolean getWhile() {
+			return while_ID;
+		}
+
+		public void setWhile(boolean value) {
+			this.while_ID = value;
+		}
+
+		public void clearEvents() {
+			auto = false;
+			break_ID = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		auto_char, auto_loop, auto_loop_switch_case, auto_loop_switch_case_enum_asm, $NullState$
+	};
+
+	private State[] historyVector = new State[2];
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public CKeywordsStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		for (int i = 0; i < 2; i++) {
+			historyVector[i] = State.$NullState$;
+		}
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.case_ID = false;
+
+		sCInterface.do_ID = 0;
+
+		sCInterface.continue_ID = false;
+
+		sCInterface.double_ID = false;
+
+		sCInterface.enum_ID = false;
+
+		sCInterface.extern = false;
+
+		sCInterface.float_ID = false;
+
+		sCInterface.for_ID = false;
+
+		sCInterface.goto_ID = false;
+
+		sCInterface.if_ID = false;
+
+		sCInterface.int_ID = false;
+
+		sCInterface.long_ID = false;
+
+		sCInterface.register = false;
+
+		sCInterface.return_ID = false;
+
+		sCInterface.short_ID = false;
+
+		sCInterface.signed = false;
+
+		sCInterface.sizeof = false;
+
+		sCInterface.static_ID = false;
+
+		sCInterface.struct = false;
+
+		sCInterface.switch_ID = false;
+
+		sCInterface.typedef = false;
+
+		sCInterface.union = false;
+
+		sCInterface.unsigned = false;
+
+		sCInterface.void_ID = false;
+
+		sCInterface.volatile_ID = false;
+
+		sCInterface.while_ID = false;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_auto_default();
+	}
+
+	public void exit() {
+		exitSequence_auto();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case auto_char :
+				return stateVector[0] == State.auto_char;
+			case auto_loop :
+				return stateVector[0].ordinal() >= State.auto_loop.ordinal()
+						&& stateVector[0].ordinal() <= State.auto_loop_switch_case_enum_asm
+								.ordinal();
+			case auto_loop_switch_case :
+				return stateVector[0].ordinal() >= State.auto_loop_switch_case
+						.ordinal()
+						&& stateVector[0].ordinal() <= State.auto_loop_switch_case_enum_asm
+								.ordinal();
+			case auto_loop_switch_case_enum_asm :
+				return stateVector[0] == State.auto_loop_switch_case_enum_asm;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raiseAuto() {
+		sCInterface.raiseAuto();
+	}
+	public void raiseBreak() {
+		sCInterface.raiseBreak();
+	}
+
+	public boolean getCase() {
+		return sCInterface.getCase();
+	}
+
+	public void setCase(boolean value) {
+		sCInterface.setCase(value);
+	}
+	public long getDo() {
+		return sCInterface.getDo();
+	}
+
+	public void setDo(long value) {
+		sCInterface.setDo(value);
+	}
+	public boolean getContinue() {
+		return sCInterface.getContinue();
+	}
+
+	public void setContinue(boolean value) {
+		sCInterface.setContinue(value);
+	}
+	public boolean getDouble() {
+		return sCInterface.getDouble();
+	}
+
+	public void setDouble(boolean value) {
+		sCInterface.setDouble(value);
+	}
+	public boolean getEnum() {
+		return sCInterface.getEnum();
+	}
+
+	public void setEnum(boolean value) {
+		sCInterface.setEnum(value);
+	}
+	public boolean getExtern() {
+		return sCInterface.getExtern();
+	}
+
+	public void setExtern(boolean value) {
+		sCInterface.setExtern(value);
+	}
+	public boolean getFloat() {
+		return sCInterface.getFloat();
+	}
+
+	public void setFloat(boolean value) {
+		sCInterface.setFloat(value);
+	}
+	public boolean getFor() {
+		return sCInterface.getFor();
+	}
+
+	public void setFor(boolean value) {
+		sCInterface.setFor(value);
+	}
+	public boolean getGoto() {
+		return sCInterface.getGoto();
+	}
+
+	public void setGoto(boolean value) {
+		sCInterface.setGoto(value);
+	}
+	public boolean getIf() {
+		return sCInterface.getIf();
+	}
+
+	public void setIf(boolean value) {
+		sCInterface.setIf(value);
+	}
+	public boolean getInt() {
+		return sCInterface.getInt();
+	}
+
+	public void setInt(boolean value) {
+		sCInterface.setInt(value);
+	}
+	public boolean getLong() {
+		return sCInterface.getLong();
+	}
+
+	public void setLong(boolean value) {
+		sCInterface.setLong(value);
+	}
+	public boolean getRegister() {
+		return sCInterface.getRegister();
+	}
+
+	public void setRegister(boolean value) {
+		sCInterface.setRegister(value);
+	}
+	public boolean getReturn() {
+		return sCInterface.getReturn();
+	}
+
+	public void setReturn(boolean value) {
+		sCInterface.setReturn(value);
+	}
+	public boolean getShort() {
+		return sCInterface.getShort();
+	}
+
+	public void setShort(boolean value) {
+		sCInterface.setShort(value);
+	}
+	public boolean getSigned() {
+		return sCInterface.getSigned();
+	}
+
+	public void setSigned(boolean value) {
+		sCInterface.setSigned(value);
+	}
+	public boolean getSizeof() {
+		return sCInterface.getSizeof();
+	}
+
+	public void setSizeof(boolean value) {
+		sCInterface.setSizeof(value);
+	}
+	public boolean getStatic() {
+		return sCInterface.getStatic();
+	}
+
+	public void setStatic(boolean value) {
+		sCInterface.setStatic(value);
+	}
+	public boolean getStruct() {
+		return sCInterface.getStruct();
+	}
+
+	public void setStruct(boolean value) {
+		sCInterface.setStruct(value);
+	}
+	public boolean getSwitch() {
+		return sCInterface.getSwitch();
+	}
+
+	public void setSwitch(boolean value) {
+		sCInterface.setSwitch(value);
+	}
+	public boolean getTypedef() {
+		return sCInterface.getTypedef();
+	}
+
+	public void setTypedef(boolean value) {
+		sCInterface.setTypedef(value);
+	}
+	public boolean getUnion() {
+		return sCInterface.getUnion();
+	}
+
+	public void setUnion(boolean value) {
+		sCInterface.setUnion(value);
+	}
+	public boolean getUnsigned() {
+		return sCInterface.getUnsigned();
+	}
+
+	public void setUnsigned(boolean value) {
+		sCInterface.setUnsigned(value);
+	}
+	public boolean getVoid() {
+		return sCInterface.getVoid();
+	}
+
+	public void setVoid(boolean value) {
+		sCInterface.setVoid(value);
+	}
+	public boolean getVolatile() {
+		return sCInterface.getVolatile();
+	}
+
+	public void setVolatile(boolean value) {
+		sCInterface.setVolatile(value);
+	}
+	public boolean getWhile() {
+		return sCInterface.getWhile();
+	}
+
+	public void setWhile(boolean value) {
+		sCInterface.setWhile(value);
+	}
+
+	private boolean check_auto_char_tr0_tr0() {
+		return (sCInterface.auto) && sCInterface.case_ID;
+	}
+
+	private void effect_auto_char_tr0() {
+		exitSequence_auto_char();
+
+		sCInterface.do_ID += 1;
+
+		enterSequence_auto_loop_default();
+	}
+
+	/* Entry action for statechart 'CKeywords'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'char'. */
+	private void entryAction_auto_char() {
+		sCInterface.case_ID = true;
+
+		sCInterface.do_ID = 0;
+
+		sCInterface.continue_ID = true;
+
+		sCInterface.double_ID = true;
+
+		sCInterface.enum_ID = true;
+
+		sCInterface.extern = true;
+
+		sCInterface.float_ID = true;
+
+		sCInterface.for_ID = true;
+
+		sCInterface.goto_ID = true;
+
+		sCInterface.if_ID = true;
+
+		sCInterface.int_ID = true;
+
+		sCInterface.long_ID = true;
+
+		sCInterface.register = true;
+
+		sCInterface.return_ID = true;
+
+		sCInterface.short_ID = true;
+
+		sCInterface.signed = true;
+
+		sCInterface.sizeof = true;
+
+		sCInterface.static_ID = true;
+
+		sCInterface.struct = true;
+
+		sCInterface.switch_ID = true;
+
+		sCInterface.typedef = true;
+
+		sCInterface.union = true;
+
+		sCInterface.unsigned = true;
+
+		sCInterface.void_ID = true;
+
+		sCInterface.volatile_ID = true;
+
+		sCInterface.while_ID = true;
+	}
+
+	/* Entry action for state 'asm'. */
+	private void entryAction_auto_loop_switch_case_enum_asm() {
+		sCInterface.case_ID = false;
+
+		sCInterface.do_ID = 0;
+
+		sCInterface.continue_ID = false;
+
+		sCInterface.double_ID = false;
+
+		sCInterface.enum_ID = false;
+
+		sCInterface.extern = false;
+
+		sCInterface.float_ID = false;
+
+		sCInterface.for_ID = false;
+
+		sCInterface.goto_ID = false;
+
+		sCInterface.if_ID = false;
+
+		sCInterface.int_ID = false;
+
+		sCInterface.long_ID = false;
+
+		sCInterface.register = false;
+
+		sCInterface.return_ID = false;
+
+		sCInterface.short_ID = false;
+
+		sCInterface.signed = false;
+
+		sCInterface.sizeof = false;
+
+		sCInterface.static_ID = false;
+
+		sCInterface.struct = false;
+
+		sCInterface.switch_ID = false;
+
+		sCInterface.typedef = false;
+
+		sCInterface.union = false;
+
+		sCInterface.unsigned = false;
+
+		sCInterface.void_ID = false;
+
+		sCInterface.volatile_ID = false;
+
+		sCInterface.while_ID = false;
+	}
+
+	/* Exit action for state 'CKeywords'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state char */
+	private void enterSequence_auto_char_default() {
+		entryAction_auto_char();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.auto_char;
+	}
+
+	/* 'default' enter sequence for state loop */
+	private void enterSequence_auto_loop_default() {
+		enterSequence_auto_loop_switch_default();
+	}
+
+	/* 'default' enter sequence for state case */
+	private void enterSequence_auto_loop_switch_case_default() {
+		enterSequence_auto_loop_switch_case_enum_default();
+
+		historyVector[0] = stateVector[0];
+	}
+
+	/* 'default' enter sequence for state asm */
+	private void enterSequence_auto_loop_switch_case_enum_asm_default() {
+		entryAction_auto_loop_switch_case_enum_asm();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.auto_loop_switch_case_enum_asm;
+
+		historyVector[1] = stateVector[0];
+	}
+
+	/* 'default' enter sequence for region auto */
+	private void enterSequence_auto_default() {
+		react_auto__entry_Default();
+	}
+
+	/* 'default' enter sequence for region switch */
+	private void enterSequence_auto_loop_switch_default() {
+		react_auto_loop_switch__entry_Default();
+	}
+
+	/* shallow enterSequence with history in child switch */
+	private void shallowEnterSequence_auto_loop_switch() {
+		switch (historyVector[0]) {
+			case auto_loop_switch_case_enum_asm :
+				enterSequence_auto_loop_switch_case_default();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* 'default' enter sequence for region enum */
+	private void enterSequence_auto_loop_switch_case_enum_default() {
+		react_auto_loop_switch_case_enum__entry_Default();
+	}
+
+	/* deep enterSequence with history in child enum */
+	private void deepEnterSequence_auto_loop_switch_case_enum() {
+		switch (historyVector[1]) {
+			case auto_loop_switch_case_enum_asm :
+				enterSequence_auto_loop_switch_case_enum_asm_default();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for state char */
+	private void exitSequence_auto_char() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state asm */
+	private void exitSequence_auto_loop_switch_case_enum_asm() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region auto */
+	private void exitSequence_auto() {
+		switch (stateVector[0]) {
+			case auto_char :
+				exitSequence_auto_char();
+				break;
+
+			case auto_loop_switch_case_enum_asm :
+				exitSequence_auto_loop_switch_case_enum_asm();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region switch */
+	private void exitSequence_auto_loop_switch() {
+		switch (stateVector[0]) {
+			case auto_loop_switch_case_enum_asm :
+				exitSequence_auto_loop_switch_case_enum_asm();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region enum */
+	private void exitSequence_auto_loop_switch_case_enum() {
+		switch (stateVector[0]) {
+			case auto_loop_switch_case_enum_asm :
+				exitSequence_auto_loop_switch_case_enum_asm();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state char. */
+	private void react_auto_char() {
+		if (check_auto_char_tr0_tr0()) {
+			effect_auto_char_tr0();
+		}
+	}
+
+	/* The reactions of state asm. */
+	private void react_auto_loop_switch_case_enum_asm() {
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_auto__entry_Default() {
+		enterSequence_auto_char_default();
+	}
+
+	/* Default react sequence for shallow history entry  */
+	private void react_auto_loop_switch__entry_Default() {
+		/* Enter the region with shallow history */
+		if (historyVector[0] != State.$NullState$) {
+			shallowEnterSequence_auto_loop_switch();
+		} else {
+			enterSequence_auto_loop_switch_case_default();
+		}
+	}
+
+	/* Default react sequence for deep history entry  */
+	private void react_auto_loop_switch_case_enum__entry_Default() {
+		/* Enter the region with deep history */
+		if (historyVector[1] != State.$NullState$) {
+			deepEnterSequence_auto_loop_switch_case_enum();
+		} else {
+			enterSequence_auto_loop_switch_case_enum_asm_default();
+		}
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case auto_char :
+					react_auto_char();
+					break;
+				case auto_loop_switch_case_enum_asm :
+					react_auto_loop_switch_case_enum_asm();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 65 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/ckeywords/ICKeywordsStatemachine.java

@@ -0,0 +1,65 @@
+package org.yakindu.scr.ckeywords;
+import org.yakindu.scr.IStatemachine;
+
+public interface ICKeywordsStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public void raiseAuto();
+		public void raiseBreak();
+		public boolean getCase();
+		public void setCase(boolean value);
+		public long getDo();
+		public void setDo(long value);
+		public boolean getContinue();
+		public void setContinue(boolean value);
+		public boolean getDouble();
+		public void setDouble(boolean value);
+		public boolean getEnum();
+		public void setEnum(boolean value);
+		public boolean getExtern();
+		public void setExtern(boolean value);
+		public boolean getFloat();
+		public void setFloat(boolean value);
+		public boolean getFor();
+		public void setFor(boolean value);
+		public boolean getGoto();
+		public void setGoto(boolean value);
+		public boolean getIf();
+		public void setIf(boolean value);
+		public boolean getInt();
+		public void setInt(boolean value);
+		public boolean getLong();
+		public void setLong(boolean value);
+		public boolean getRegister();
+		public void setRegister(boolean value);
+		public boolean getReturn();
+		public void setReturn(boolean value);
+		public boolean getShort();
+		public void setShort(boolean value);
+		public boolean getSigned();
+		public void setSigned(boolean value);
+		public boolean getSizeof();
+		public void setSizeof(boolean value);
+		public boolean getStatic();
+		public void setStatic(boolean value);
+		public boolean getStruct();
+		public void setStruct(boolean value);
+		public boolean getSwitch();
+		public void setSwitch(boolean value);
+		public boolean getTypedef();
+		public void setTypedef(boolean value);
+		public boolean getUnion();
+		public void setUnion(boolean value);
+		public boolean getUnsigned();
+		public void setUnsigned(boolean value);
+		public boolean getVoid();
+		public void setVoid(boolean value);
+		public boolean getVolatile();
+		public void setVolatile(boolean value);
+		public boolean getWhile();
+		public void setWhile(boolean value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 262 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/conditionalexpressions/ConditionalExpressionsStatemachine.java

@@ -0,0 +1,262 @@
+package org.yakindu.scr.conditionalexpressions;
+
+public class ConditionalExpressionsStatemachine
+		implements
+			IConditionalExpressionsStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean e;
+
+		public void raiseE() {
+			e = true;
+		}
+
+		private long condition;
+		public long getCondition() {
+			return condition;
+		}
+
+		public void setCondition(long value) {
+			this.condition = value;
+		}
+
+		private boolean boolVar;
+		public boolean getBoolVar() {
+			return boolVar;
+		}
+
+		public void setBoolVar(boolean value) {
+			this.boolVar = value;
+		}
+
+		public void clearEvents() {
+			e = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		main_region_A, main_region_B, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public ConditionalExpressionsStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.condition = sCInterface.boolVar ? 3 : 2;
+
+		sCInterface.boolVar = true;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_A :
+				return stateVector[0] == State.main_region_A;
+			case main_region_B :
+				return stateVector[0] == State.main_region_B;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raiseE() {
+		sCInterface.raiseE();
+	}
+
+	public long getCondition() {
+		return sCInterface.getCondition();
+	}
+
+	public void setCondition(long value) {
+		sCInterface.setCondition(value);
+	}
+	public boolean getBoolVar() {
+		return sCInterface.getBoolVar();
+	}
+
+	public void setBoolVar(boolean value) {
+		sCInterface.setBoolVar(value);
+	}
+
+	private boolean check_main_region_A_tr0_tr0() {
+		return (sCInterface.e) && 1 == (sCInterface.boolVar ? 1 : 0);
+	}
+
+	private void effect_main_region_A_tr0() {
+		exitSequence_main_region_A();
+
+		enterSequence_main_region_B_default();
+	}
+
+	/* Entry action for statechart 'ConditionalExpressions'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'A'. */
+	private void entryAction_main_region_A() {
+		sCInterface.condition = sCInterface.boolVar ? 1 : 0;
+	}
+
+	/* Entry action for state 'B'. */
+	private void entryAction_main_region_B() {
+		sCInterface.condition = ((sCInterface.condition == 2) ? 1 : 2);
+	}
+
+	/* Exit action for state 'ConditionalExpressions'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state A */
+	private void enterSequence_main_region_A_default() {
+		entryAction_main_region_A();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_A;
+	}
+
+	/* 'default' enter sequence for state B */
+	private void enterSequence_main_region_B_default() {
+		entryAction_main_region_B();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_B;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state A */
+	private void exitSequence_main_region_A() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state B */
+	private void exitSequence_main_region_B() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_A :
+				exitSequence_main_region_A();
+				break;
+
+			case main_region_B :
+				exitSequence_main_region_B();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state A. */
+	private void react_main_region_A() {
+		if (check_main_region_A_tr0_tr0()) {
+			effect_main_region_A_tr0();
+		}
+	}
+
+	/* The reactions of state B. */
+	private void react_main_region_B() {
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_A_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_A :
+					react_main_region_A();
+					break;
+				case main_region_B :
+					react_main_region_B();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 16 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/conditionalexpressions/IConditionalExpressionsStatemachine.java

@@ -0,0 +1,16 @@
+package org.yakindu.scr.conditionalexpressions;
+import org.yakindu.scr.IStatemachine;
+
+public interface IConditionalExpressionsStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public void raiseE();
+		public long getCondition();
+		public void setCondition(long value);
+		public boolean getBoolVar();
+		public void setBoolVar(boolean value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 350 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/constants/ConstantsStatemachine.java

@@ -0,0 +1,350 @@
+package org.yakindu.scr.constants;
+
+public class ConstantsStatemachine implements IConstantsStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean e;
+
+		public void raiseE() {
+			e = true;
+		}
+
+		private boolean e2;
+
+		private long e2Value;
+
+		public void raiseE2(long value) {
+			e2 = true;
+			e2Value = value;
+		}
+
+		private long getE2Value() {
+			if (!e2)
+				throw new IllegalStateException(
+						"Illegal event value acces. Event E2 is not raised!");
+			return e2Value;
+		}
+
+		public long getX() {
+			return x;
+		}
+
+		public long getY() {
+			return y;
+		}
+
+		private long result;
+		public long getResult() {
+			return result;
+		}
+
+		public void setResult(long value) {
+			this.result = value;
+		}
+
+		public void clearEvents() {
+			e = false;
+			e2 = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+	private final class SCINamedImpl implements SCINamed {
+
+		public String getY() {
+			return y;
+		}
+
+		public long getTwo() {
+			return two;
+		}
+
+	}
+
+	private SCINamedImpl sCINamed;
+
+	public enum State {
+		main_region_A, main_region_B, main_region_C, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public ConstantsStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+		sCINamed = new SCINamedImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.result = 0;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_A :
+				return stateVector[0] == State.main_region_A;
+			case main_region_B :
+				return stateVector[0] == State.main_region_B;
+			case main_region_C :
+				return stateVector[0] == State.main_region_C;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+	public SCINamed getSCINamed() {
+		return sCINamed;
+	}
+
+	public void raiseE() {
+		sCInterface.raiseE();
+	}
+	public void raiseE2(long value) {
+		sCInterface.raiseE2(value);
+	}
+
+	public long getX() {
+		return sCInterface.getX();
+	}
+
+	public long getY() {
+		return sCInterface.getY();
+	}
+
+	public long getResult() {
+		return sCInterface.getResult();
+	}
+
+	public void setResult(long value) {
+		sCInterface.setResult(value);
+	}
+
+	private boolean check_main_region_A_tr0_tr0() {
+		return sCInterface.e;
+	}
+
+	private boolean check_main_region_B_tr0_tr0() {
+		return sCInterface.e;
+	}
+
+	private boolean check_main_region_C_tr0_tr0() {
+		return sCInterface.e2;
+	}
+
+	private void effect_main_region_A_tr0() {
+		exitSequence_main_region_A();
+
+		enterSequence_main_region_B_default();
+	}
+
+	private void effect_main_region_B_tr0() {
+		exitSequence_main_region_B();
+
+		enterSequence_main_region_C_default();
+	}
+
+	private void effect_main_region_C_tr0() {
+		exitSequence_main_region_C();
+
+		sCInterface.result = sCInterface.e2Value * SCInterface.x * SCINamed.two
+				* IConstantsStatemachine.internalConstant;
+
+		enterSequence_main_region_A_default();
+	}
+
+	/* Entry action for statechart 'Constants'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'B'. */
+	private void entryAction_main_region_B() {
+		sCInterface.result = SCINamed.two * SCInterface.x;
+	}
+
+	/* Entry action for state 'C'. */
+	private void entryAction_main_region_C() {
+		sCInterface.result = sCInterface.result
+				* IConstantsStatemachine.internalConstant;
+	}
+
+	/* Exit action for state 'Constants'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state A */
+	private void enterSequence_main_region_A_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_A;
+	}
+
+	/* 'default' enter sequence for state B */
+	private void enterSequence_main_region_B_default() {
+		entryAction_main_region_B();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_B;
+	}
+
+	/* 'default' enter sequence for state C */
+	private void enterSequence_main_region_C_default() {
+		entryAction_main_region_C();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_C;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state A */
+	private void exitSequence_main_region_A() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state B */
+	private void exitSequence_main_region_B() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state C */
+	private void exitSequence_main_region_C() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_A :
+				exitSequence_main_region_A();
+				break;
+
+			case main_region_B :
+				exitSequence_main_region_B();
+				break;
+
+			case main_region_C :
+				exitSequence_main_region_C();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state A. */
+	private void react_main_region_A() {
+		if (check_main_region_A_tr0_tr0()) {
+			effect_main_region_A_tr0();
+		}
+	}
+
+	/* The reactions of state B. */
+	private void react_main_region_B() {
+		if (check_main_region_B_tr0_tr0()) {
+			effect_main_region_B_tr0();
+		}
+	}
+
+	/* The reactions of state C. */
+	private void react_main_region_C() {
+		if (check_main_region_C_tr0_tr0()) {
+			effect_main_region_C_tr0();
+		}
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_A_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_A :
+					react_main_region_A();
+					break;
+				case main_region_B :
+					react_main_region_B();
+					break;
+				case main_region_C :
+					react_main_region_C();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 31 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/constants/IConstantsStatemachine.java

@@ -0,0 +1,31 @@
+package org.yakindu.scr.constants;
+import org.yakindu.scr.IStatemachine;
+
+public interface IConstantsStatemachine extends IStatemachine {
+
+	public static final long internalConstant = 5;
+	public interface SCInterface {
+		public static final long x = 10;
+		public static final long y = SCInterface.x * 2;
+		public void raiseE();
+		public void raiseE2(long value);
+		public long getX();
+		public long getY();
+		public long getResult();
+		public void setResult(long value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+	public interface SCINamed {
+		public static final String y = "Hello World";
+		public static final long two = 2;
+		public String getY();
+		public long getTwo();
+
+	}
+
+	public SCINamed getSCINamed();
+
+}

+ 629 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/declarations/DeclarationsStatemachine.java

@@ -0,0 +1,629 @@
+package org.yakindu.scr.declarations;
+
+public class DeclarationsStatemachine implements IDeclarationsStatemachine {
+	private boolean evInA;
+
+	private boolean evInB;
+
+	private boolean evInC;
+
+	private boolean evInCValue;
+	private boolean evInD;
+
+	private long evInDValue;
+	private boolean evInE;
+
+	private double evInEValue;
+	private boolean evInF;
+
+	private String evInFValue;
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean evA;
+
+		public void raiseEvA() {
+			evA = true;
+		}
+
+		private boolean evB;
+
+		public boolean isRaisedEvB() {
+			return evB;
+		}
+
+		private void raiseEvB() {
+			evB = true;
+		}
+
+		private boolean evC;
+
+		private boolean evCValue;
+
+		public void raiseEvC(boolean value) {
+			evC = true;
+			evCValue = value;
+		}
+
+		private boolean getEvCValue() {
+			if (!evC)
+				throw new IllegalStateException(
+						"Illegal event value acces. Event EvC is not raised!");
+			return evCValue;
+		}
+
+		private boolean evD;
+
+		private long evDValue;
+
+		public boolean isRaisedEvD() {
+			return evD;
+		}
+
+		private void raiseEvD(long value) {
+			evD = true;
+			evDValue = value;
+		}
+
+		public long getEvDValue() {
+			if (!evD)
+				throw new IllegalStateException(
+						"Illegal event value acces. Event EvD is not raised!");
+			return evDValue;
+		}
+
+		private boolean evE;
+
+		private double evEValue;
+
+		public void raiseEvE(double value) {
+			evE = true;
+			evEValue = value;
+		}
+
+		private double getEvEValue() {
+			if (!evE)
+				throw new IllegalStateException(
+						"Illegal event value acces. Event EvE is not raised!");
+			return evEValue;
+		}
+
+		private boolean evF;
+
+		private String evFValue;
+
+		public boolean isRaisedEvF() {
+			return evF;
+		}
+
+		private void raiseEvF(String value) {
+			evF = true;
+			evFValue = value;
+		}
+
+		public String getEvFValue() {
+			if (!evF)
+				throw new IllegalStateException(
+						"Illegal event value acces. Event EvF is not raised!");
+			return evFValue;
+		}
+
+		private boolean varA;
+		public boolean getVarA() {
+			return varA;
+		}
+
+		public void setVarA(boolean value) {
+			this.varA = value;
+		}
+
+		private long varB;
+		public long getVarB() {
+			return varB;
+		}
+
+		public void setVarB(long value) {
+			this.varB = value;
+		}
+
+		private double varC;
+		public double getVarC() {
+			return varC;
+		}
+
+		public void setVarC(double value) {
+			this.varC = value;
+		}
+
+		private String varD;
+		public String getVarD() {
+			return varD;
+		}
+
+		public void setVarD(String value) {
+			this.varD = value;
+		}
+
+		private long varE;
+		public long getVarE() {
+			return varE;
+		}
+
+		public void setVarE(long value) {
+			this.varE = value;
+		}
+
+		public void clearEvents() {
+			evA = false;
+			evC = false;
+			evE = false;
+		}
+
+		public void clearOutEvents() {
+			evB = false;
+			evD = false;
+			evF = false;
+		}
+	}
+
+	private SCInterfaceImpl sCInterface;
+	private final class SCIIfAImpl implements SCIIfA {
+
+		private boolean evA;
+
+		public void raiseEvA() {
+			evA = true;
+		}
+
+		private boolean evB;
+
+		public boolean isRaisedEvB() {
+			return evB;
+		}
+
+		private void raiseEvB() {
+			evB = true;
+		}
+
+		private boolean evC;
+
+		private boolean evCValue;
+
+		public void raiseEvC(boolean value) {
+			evC = true;
+			evCValue = value;
+		}
+
+		private boolean getEvCValue() {
+			if (!evC)
+				throw new IllegalStateException(
+						"Illegal event value acces. Event EvC is not raised!");
+			return evCValue;
+		}
+
+		private boolean evD;
+
+		private long evDValue;
+
+		public boolean isRaisedEvD() {
+			return evD;
+		}
+
+		private void raiseEvD(long value) {
+			evD = true;
+			evDValue = value;
+		}
+
+		public long getEvDValue() {
+			if (!evD)
+				throw new IllegalStateException(
+						"Illegal event value acces. Event EvD is not raised!");
+			return evDValue;
+		}
+
+		private boolean evE;
+
+		private double evEValue;
+
+		public void raiseEvE(double value) {
+			evE = true;
+			evEValue = value;
+		}
+
+		private double getEvEValue() {
+			if (!evE)
+				throw new IllegalStateException(
+						"Illegal event value acces. Event EvE is not raised!");
+			return evEValue;
+		}
+
+		private boolean evF;
+
+		private String evFValue;
+
+		public boolean isRaisedEvF() {
+			return evF;
+		}
+
+		private void raiseEvF(String value) {
+			evF = true;
+			evFValue = value;
+		}
+
+		public String getEvFValue() {
+			if (!evF)
+				throw new IllegalStateException(
+						"Illegal event value acces. Event EvF is not raised!");
+			return evFValue;
+		}
+
+		private boolean varA;
+		public boolean getVarA() {
+			return varA;
+		}
+
+		public void setVarA(boolean value) {
+			this.varA = value;
+		}
+
+		private long varB;
+		public long getVarB() {
+			return varB;
+		}
+
+		public void setVarB(long value) {
+			this.varB = value;
+		}
+
+		private double varC;
+		public double getVarC() {
+			return varC;
+		}
+
+		public void setVarC(double value) {
+			this.varC = value;
+		}
+
+		private String varD;
+		public String getVarD() {
+			return varD;
+		}
+
+		public void setVarD(String value) {
+			this.varD = value;
+		}
+
+		private long varE;
+		public long getVarE() {
+			return varE;
+		}
+
+		public void setVarE(long value) {
+			this.varE = value;
+		}
+
+		public void clearEvents() {
+			evA = false;
+			evC = false;
+			evE = false;
+		}
+
+		public void clearOutEvents() {
+			evB = false;
+			evD = false;
+			evF = false;
+		}
+	}
+
+	private SCIIfAImpl sCIIfA;
+
+	public enum State {
+		main_region_A, $NullState$
+	};
+
+	private boolean varInA;
+	private long varInB;
+	private double varInC;
+	private String varInD;
+	private long varInE;
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public DeclarationsStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+		sCIIfA = new SCIIfAImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.varA = false;
+
+		sCInterface.varB = 1;
+
+		sCInterface.varC = 1.0;
+
+		sCInterface.varD = "myString";
+
+		sCInterface.varE = 16;
+
+		sCIIfA.varA = false;
+
+		sCIIfA.varB = 1;
+
+		sCIIfA.varC = 1.0;
+
+		sCIIfA.varD = "myString";
+
+		sCIIfA.varE = 16;
+
+		varInA = false;
+
+		varInB = 1;
+
+		varInC = 1.0;
+
+		varInD = "myString";
+
+		varInE = 16;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+		sCIIfA.clearEvents();
+		evInA = false;
+		evInB = false;
+		evInC = false;
+		evInD = false;
+		evInE = false;
+		evInF = false;
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+		sCInterface.clearOutEvents();
+		sCIIfA.clearOutEvents();
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_A :
+				return stateVector[0] == State.main_region_A;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+	public SCIIfA getSCIIfA() {
+		return sCIIfA;
+	}
+
+	private void raiseEvInA() {
+		evInA = true;
+	}
+
+	private void raiseEvInB() {
+		evInB = true;
+	}
+
+	private void raiseEvInC(boolean value) {
+		evInCValue = value;
+		evInC = true;
+	}
+
+	private boolean getEvInCValue() {
+		if (!evInC)
+			throw new IllegalStateException(
+					"Illegal event value acces. Event EvInC is not raised!");
+		return evInCValue;
+	}
+	private void raiseEvInD(long value) {
+		evInDValue = value;
+		evInD = true;
+	}
+
+	private long getEvInDValue() {
+		if (!evInD)
+			throw new IllegalStateException(
+					"Illegal event value acces. Event EvInD is not raised!");
+		return evInDValue;
+	}
+	private void raiseEvInE(double value) {
+		evInEValue = value;
+		evInE = true;
+	}
+
+	private double getEvInEValue() {
+		if (!evInE)
+			throw new IllegalStateException(
+					"Illegal event value acces. Event EvInE is not raised!");
+		return evInEValue;
+	}
+	private void raiseEvInF(String value) {
+		evInFValue = value;
+		evInF = true;
+	}
+
+	private String getEvInFValue() {
+		if (!evInF)
+			throw new IllegalStateException(
+					"Illegal event value acces. Event EvInF is not raised!");
+		return evInFValue;
+	}
+
+	public void raiseEvA() {
+		sCInterface.raiseEvA();
+	}
+	public boolean isRaisedEvB() {
+		return sCInterface.isRaisedEvB();
+	}
+	public void raiseEvC(boolean value) {
+		sCInterface.raiseEvC(value);
+	}
+	public boolean isRaisedEvD() {
+		return sCInterface.isRaisedEvD();
+	}
+	public long getEvDValue() {
+		return sCInterface.getEvDValue();
+	}
+	public void raiseEvE(double value) {
+		sCInterface.raiseEvE(value);
+	}
+	public boolean isRaisedEvF() {
+		return sCInterface.isRaisedEvF();
+	}
+	public String getEvFValue() {
+		return sCInterface.getEvFValue();
+	}
+
+	public boolean getVarA() {
+		return sCInterface.getVarA();
+	}
+
+	public void setVarA(boolean value) {
+		sCInterface.setVarA(value);
+	}
+	public long getVarB() {
+		return sCInterface.getVarB();
+	}
+
+	public void setVarB(long value) {
+		sCInterface.setVarB(value);
+	}
+	public double getVarC() {
+		return sCInterface.getVarC();
+	}
+
+	public void setVarC(double value) {
+		sCInterface.setVarC(value);
+	}
+	public String getVarD() {
+		return sCInterface.getVarD();
+	}
+
+	public void setVarD(String value) {
+		sCInterface.setVarD(value);
+	}
+	public long getVarE() {
+		return sCInterface.getVarE();
+	}
+
+	public void setVarE(long value) {
+		sCInterface.setVarE(value);
+	}
+
+	/* Entry action for statechart 'Declarations'. */
+	private void entryAction() {
+	}
+
+	/* Exit action for state 'Declarations'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state A */
+	private void enterSequence_main_region_A_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_A;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state A */
+	private void exitSequence_main_region_A() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_A :
+				exitSequence_main_region_A();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state A. */
+	private void react_main_region_A() {
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_A_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_A :
+					react_main_region_A();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 54 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/declarations/IDeclarationsStatemachine.java

@@ -0,0 +1,54 @@
+package org.yakindu.scr.declarations;
+import org.yakindu.scr.IStatemachine;
+
+public interface IDeclarationsStatemachine extends IStatemachine {
+
+	public interface SCInterface {
+		public void raiseEvA();
+		public boolean isRaisedEvB();
+		public void raiseEvC(boolean value);
+		public boolean isRaisedEvD();
+		public long getEvDValue();
+		public void raiseEvE(double value);
+		public boolean isRaisedEvF();
+		public String getEvFValue();
+		public boolean getVarA();
+		public void setVarA(boolean value);
+		public long getVarB();
+		public void setVarB(long value);
+		public double getVarC();
+		public void setVarC(double value);
+		public String getVarD();
+		public void setVarD(String value);
+		public long getVarE();
+		public void setVarE(long value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+	public interface SCIIfA {
+		public void raiseEvA();
+		public boolean isRaisedEvB();
+		public void raiseEvC(boolean value);
+		public boolean isRaisedEvD();
+		public long getEvDValue();
+		public void raiseEvE(double value);
+		public boolean isRaisedEvF();
+		public String getEvFValue();
+		public boolean getVarA();
+		public void setVarA(boolean value);
+		public long getVarB();
+		public void setVarB(long value);
+		public double getVarC();
+		public void setVarC(double value);
+		public String getVarD();
+		public void setVarD(String value);
+		public long getVarE();
+		public void setVarE(long value);
+
+	}
+
+	public SCIIfA getSCIIfA();
+
+}

+ 662 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/deepentry/DeepEntryStatemachine.java

@@ -0,0 +1,662 @@
+package org.yakindu.scr.deepentry;
+
+public class DeepEntryStatemachine implements IDeepEntryStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean e;
+
+		public void raiseE() {
+			e = true;
+		}
+
+		private boolean f;
+
+		public void raiseF() {
+			f = true;
+		}
+
+		private long x;
+		public long getX() {
+			return x;
+		}
+
+		public void setX(long value) {
+			this.x = value;
+		}
+
+		private long y;
+		public long getY() {
+			return y;
+		}
+
+		public void setY(long value) {
+			this.y = value;
+		}
+
+		private long z;
+		public long getZ() {
+			return z;
+		}
+
+		public void setZ(long value) {
+			this.z = value;
+		}
+
+		public void clearEvents() {
+			e = false;
+			f = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		r_A, r_A_r_B, r2_B, r2_B_r_BA, r2_B_r_BA_r_BAA, r2_B_r_BB, r2_C, r3_D, r3_D_r_DA, r3_D_r_DA_r_DAA, $NullState$
+	};
+
+	private State[] historyVector = new State[4];
+	private final State[] stateVector = new State[3];
+
+	private int nextStateIndex;
+
+	public DeepEntryStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 3; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		for (int i = 0; i < 4; i++) {
+			historyVector[i] = State.$NullState$;
+		}
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.x = 0;
+
+		sCInterface.y = 0;
+
+		sCInterface.z = 0;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_r_default();
+
+		enterSequence_r2_default();
+
+		enterSequence_r3_default();
+	}
+
+	public void exit() {
+		exitSequence_r();
+
+		exitSequence_r2();
+
+		exitSequence_r3();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$
+				|| stateVector[1] != State.$NullState$
+				|| stateVector[2] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case r_A :
+				return stateVector[0].ordinal() >= State.r_A.ordinal()
+						&& stateVector[0].ordinal() <= State.r_A_r_B.ordinal();
+			case r_A_r_B :
+				return stateVector[0] == State.r_A_r_B;
+			case r2_B :
+				return stateVector[1].ordinal() >= State.r2_B.ordinal()
+						&& stateVector[1].ordinal() <= State.r2_B_r_BB
+								.ordinal();
+			case r2_B_r_BA :
+				return stateVector[1].ordinal() >= State.r2_B_r_BA.ordinal()
+						&& stateVector[1].ordinal() <= State.r2_B_r_BA_r_BAA
+								.ordinal();
+			case r2_B_r_BA_r_BAA :
+				return stateVector[1] == State.r2_B_r_BA_r_BAA;
+			case r2_B_r_BB :
+				return stateVector[1] == State.r2_B_r_BB;
+			case r2_C :
+				return stateVector[1] == State.r2_C;
+			case r3_D :
+				return stateVector[2].ordinal() >= State.r3_D.ordinal()
+						&& stateVector[2].ordinal() <= State.r3_D_r_DA_r_DAA
+								.ordinal();
+			case r3_D_r_DA :
+				return stateVector[2].ordinal() >= State.r3_D_r_DA.ordinal()
+						&& stateVector[2].ordinal() <= State.r3_D_r_DA_r_DAA
+								.ordinal();
+			case r3_D_r_DA_r_DAA :
+				return stateVector[2] == State.r3_D_r_DA_r_DAA;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raiseE() {
+		sCInterface.raiseE();
+	}
+	public void raiseF() {
+		sCInterface.raiseF();
+	}
+
+	public long getX() {
+		return sCInterface.getX();
+	}
+
+	public void setX(long value) {
+		sCInterface.setX(value);
+	}
+	public long getY() {
+		return sCInterface.getY();
+	}
+
+	public void setY(long value) {
+		sCInterface.setY(value);
+	}
+	public long getZ() {
+		return sCInterface.getZ();
+	}
+
+	public void setZ(long value) {
+		sCInterface.setZ(value);
+	}
+
+	private boolean check_r2_B_tr0_tr0() {
+		return sCInterface.f;
+	}
+
+	private boolean check_r2_B_r_BA_tr0_tr0() {
+		return sCInterface.e;
+	}
+
+	private boolean check_r2_C_tr0_tr0() {
+		return sCInterface.f;
+	}
+
+	private void effect_r2_B_tr0() {
+		exitSequence_r2_B();
+
+		enterSequence_r2_C_default();
+	}
+
+	private void effect_r2_B_r_BA_tr0() {
+		exitSequence_r2_B_r_BA();
+
+		enterSequence_r2_B_r_BB_default();
+	}
+
+	private void effect_r2_C_tr0() {
+		exitSequence_r2_C();
+
+		enterSequence_r2_B_default();
+	}
+
+	/* Entry action for statechart 'DeepEntry'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'A'. */
+	private void entryAction_r_A() {
+		sCInterface.x += 1;
+	}
+
+	/* Entry action for state 'BA'. */
+	private void entryAction_r2_B_r_BA() {
+		sCInterface.y += 1;
+	}
+
+	/* Entry action for state 'D'. */
+	private void entryAction_r3_D() {
+		sCInterface.z += 1;
+	}
+
+	/* Entry action for state 'DA'. */
+	private void entryAction_r3_D_r_DA() {
+		sCInterface.z += 1;
+	}
+
+	/* Exit action for state 'DeepEntry'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state B */
+	private void enterSequence_r_A_r_B_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.r_A_r_B;
+	}
+
+	/* 'default' enter sequence for state B */
+	private void enterSequence_r2_B_default() {
+		enterSequence_r2_B_r_default();
+	}
+
+	/* 'default' enter sequence for state BA */
+	private void enterSequence_r2_B_r_BA_default() {
+		entryAction_r2_B_r_BA();
+
+		enterSequence_r2_B_r_BA_r_default();
+
+		historyVector[0] = stateVector[1];
+	}
+
+	/* 'default' enter sequence for state BAA */
+	private void enterSequence_r2_B_r_BA_r_BAA_default() {
+		nextStateIndex = 1;
+		stateVector[1] = State.r2_B_r_BA_r_BAA;
+	}
+
+	/* 'default' enter sequence for state BB */
+	private void enterSequence_r2_B_r_BB_default() {
+		nextStateIndex = 1;
+		stateVector[1] = State.r2_B_r_BB;
+
+		historyVector[0] = stateVector[1];
+	}
+
+	/* 'default' enter sequence for state C */
+	private void enterSequence_r2_C_default() {
+		nextStateIndex = 1;
+		stateVector[1] = State.r2_C;
+	}
+
+	/* 'default' enter sequence for state DAA */
+	private void enterSequence_r3_D_r_DA_r_DAA_default() {
+		nextStateIndex = 2;
+		stateVector[2] = State.r3_D_r_DA_r_DAA;
+
+		historyVector[3] = stateVector[2];
+	}
+
+	/* 'default' enter sequence for region r */
+	private void enterSequence_r_default() {
+		react_r__entry_Default();
+	}
+
+	/* 'default' enter sequence for region r2 */
+	private void enterSequence_r2_default() {
+		react_r2__entry_Default();
+	}
+
+	/* 'default' enter sequence for region r */
+	private void enterSequence_r2_B_r_default() {
+		react_r2_B_r__entry_Default();
+	}
+
+	/* shallow enterSequence with history in child r */
+	private void shallowEnterSequence_r2_B_r() {
+		switch (historyVector[0]) {
+			case r2_B_r_BA_r_BAA :
+				enterSequence_r2_B_r_BA_default();
+				break;
+
+			case r2_B_r_BB :
+				enterSequence_r2_B_r_BB_default();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* 'default' enter sequence for region r */
+	private void enterSequence_r2_B_r_BA_r_default() {
+		react_r2_B_r_BA_r__entry_Default();
+	}
+
+	/* 'default' enter sequence for region r3 */
+	private void enterSequence_r3_default() {
+		react_r3__entry_Default();
+	}
+
+	/* deep enterSequence with history in child r3 */
+	private void deepEnterSequence_r3() {
+		switch (historyVector[1]) {
+			case r3_D_r_DA_r_DAA :
+				entryAction_r3_D();
+
+				deepEnterSequence_r3_D_r();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* deep enterSequence with history in child r */
+	private void deepEnterSequence_r3_D_r() {
+		switch (historyVector[2]) {
+			case r3_D_r_DA_r_DAA :
+				entryAction_r3_D_r_DA();
+
+				deepEnterSequence_r3_D_r_DA_r();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* deep enterSequence with history in child r */
+	private void deepEnterSequence_r3_D_r_DA_r() {
+		switch (historyVector[3]) {
+			case r3_D_r_DA_r_DAA :
+				enterSequence_r3_D_r_DA_r_DAA_default();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for state B */
+	private void exitSequence_r_A_r_B() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state B */
+	private void exitSequence_r2_B() {
+		exitSequence_r2_B_r();
+	}
+
+	/* Default exit sequence for state BA */
+	private void exitSequence_r2_B_r_BA() {
+		exitSequence_r2_B_r_BA_r();
+	}
+
+	/* Default exit sequence for state BAA */
+	private void exitSequence_r2_B_r_BA_r_BAA() {
+		nextStateIndex = 1;
+		stateVector[1] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state BB */
+	private void exitSequence_r2_B_r_BB() {
+		nextStateIndex = 1;
+		stateVector[1] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state C */
+	private void exitSequence_r2_C() {
+		nextStateIndex = 1;
+		stateVector[1] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state DAA */
+	private void exitSequence_r3_D_r_DA_r_DAA() {
+		nextStateIndex = 2;
+		stateVector[2] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region r */
+	private void exitSequence_r() {
+		switch (stateVector[0]) {
+			case r_A_r_B :
+				exitSequence_r_A_r_B();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region r */
+	private void exitSequence_r_A_r() {
+		switch (stateVector[0]) {
+			case r_A_r_B :
+				exitSequence_r_A_r_B();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region r2 */
+	private void exitSequence_r2() {
+		switch (stateVector[1]) {
+			case r2_B_r_BA_r_BAA :
+				exitSequence_r2_B_r_BA_r_BAA();
+				break;
+
+			case r2_B_r_BB :
+				exitSequence_r2_B_r_BB();
+				break;
+
+			case r2_C :
+				exitSequence_r2_C();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region r */
+	private void exitSequence_r2_B_r() {
+		switch (stateVector[1]) {
+			case r2_B_r_BA_r_BAA :
+				exitSequence_r2_B_r_BA_r_BAA();
+				break;
+
+			case r2_B_r_BB :
+				exitSequence_r2_B_r_BB();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region r */
+	private void exitSequence_r2_B_r_BA_r() {
+		switch (stateVector[1]) {
+			case r2_B_r_BA_r_BAA :
+				exitSequence_r2_B_r_BA_r_BAA();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region r3 */
+	private void exitSequence_r3() {
+		switch (stateVector[2]) {
+			case r3_D_r_DA_r_DAA :
+				exitSequence_r3_D_r_DA_r_DAA();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region r */
+	private void exitSequence_r3_D_r() {
+		switch (stateVector[2]) {
+			case r3_D_r_DA_r_DAA :
+				exitSequence_r3_D_r_DA_r_DAA();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region r */
+	private void exitSequence_r3_D_r_DA_r() {
+		switch (stateVector[2]) {
+			case r3_D_r_DA_r_DAA :
+				exitSequence_r3_D_r_DA_r_DAA();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state B. */
+	private void react_r_A_r_B() {
+	}
+
+	/* The reactions of state BAA. */
+	private void react_r2_B_r_BA_r_BAA() {
+		if (check_r2_B_tr0_tr0()) {
+			effect_r2_B_tr0();
+		} else {
+			if (check_r2_B_r_BA_tr0_tr0()) {
+				effect_r2_B_r_BA_tr0();
+			} else {
+			}
+		}
+	}
+
+	/* The reactions of state BB. */
+	private void react_r2_B_r_BB() {
+		if (check_r2_B_tr0_tr0()) {
+			effect_r2_B_tr0();
+		} else {
+		}
+	}
+
+	/* The reactions of state C. */
+	private void react_r2_C() {
+		if (check_r2_C_tr0_tr0()) {
+			effect_r2_C_tr0();
+		}
+	}
+
+	/* The reactions of state DAA. */
+	private void react_r3_D_r_DA_r_DAA() {
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_r__entry_Default() {
+		entryAction_r_A();
+
+		enterSequence_r_A_r_B_default();
+	}
+
+	/* Default react sequence for shallow history entry  */
+	private void react_r2_B_r__entry_Default() {
+		/* Enter the region with shallow history */
+		if (historyVector[0] != State.$NullState$) {
+			shallowEnterSequence_r2_B_r();
+		} else {
+			entryAction_r2_B_r_BA();
+
+			enterSequence_r2_B_r_BA_r_BAA_default();
+
+			historyVector[0] = stateVector[1];
+		}
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_r2_B_r_BA_r__entry_Default() {
+		enterSequence_r2_B_r_BA_r_BAA_default();
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_r2__entry_Default() {
+		enterSequence_r2_B_default();
+	}
+
+	/* Default react sequence for deep history entry  */
+	private void react_r3__entry_Default() {
+		/* Enter the region with deep history */
+		if (historyVector[1] != State.$NullState$) {
+			deepEnterSequence_r3();
+		} else {
+			entryAction_r3_D();
+
+			entryAction_r3_D_r_DA();
+
+			enterSequence_r3_D_r_DA_r_DAA_default();
+
+			historyVector[2] = stateVector[2];
+
+			historyVector[1] = stateVector[2];
+		}
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case r_A_r_B :
+					react_r_A_r_B();
+					break;
+				case r2_B_r_BA_r_BAA :
+					react_r2_B_r_BA_r_BAA();
+					break;
+				case r2_B_r_BB :
+					react_r2_B_r_BB();
+					break;
+				case r2_C :
+					react_r2_C();
+					break;
+				case r3_D_r_DA_r_DAA :
+					react_r3_D_r_DA_r_DAA();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 19 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/deepentry/IDeepEntryStatemachine.java

@@ -0,0 +1,19 @@
+package org.yakindu.scr.deepentry;
+import org.yakindu.scr.IStatemachine;
+
+public interface IDeepEntryStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public void raiseE();
+		public void raiseF();
+		public long getX();
+		public void setX(long value);
+		public long getY();
+		public void setY(long value);
+		public long getZ();
+		public void setZ(long value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 738 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/deephistory/DeepHistoryStatemachine.java

@@ -0,0 +1,738 @@
+package org.yakindu.scr.deephistory;
+
+public class DeepHistoryStatemachine implements IDeepHistoryStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean event1;
+
+		public void raiseEvent1() {
+			event1 = true;
+		}
+
+		private boolean event2;
+
+		public void raiseEvent2() {
+			event2 = true;
+		}
+
+		private boolean event3;
+
+		public void raiseEvent3() {
+			event3 = true;
+		}
+
+		private boolean event4;
+
+		public void raiseEvent4() {
+			event4 = true;
+		}
+
+		private boolean event5;
+
+		public void raiseEvent5() {
+			event5 = true;
+		}
+
+		private boolean event6;
+
+		public void raiseEvent6() {
+			event6 = true;
+		}
+
+		private boolean event7;
+
+		public void raiseEvent7() {
+			event7 = true;
+		}
+
+		private boolean event8;
+
+		public void raiseEvent8() {
+			event8 = true;
+		}
+
+		private boolean event9;
+
+		public void raiseEvent9() {
+			event9 = true;
+		}
+
+		public void clearEvents() {
+			event1 = false;
+			event2 = false;
+			event3 = false;
+			event4 = false;
+			event5 = false;
+			event6 = false;
+			event7 = false;
+			event8 = false;
+			event9 = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		mainRegion_State1, mainRegion_State2, mainRegion_State2__region0_a, mainRegion_State2__region0_State4, mainRegion_State2__region0_State4__region0_State6, mainRegion_State2__region0_State4__region0_State7, mainRegion_State2__region0_State4__region0_State7__region0_State8, mainRegion_State2__region0_State4__region0_State7__region0_State9, mainRegion_State2__region0_State5, $NullState$
+	};
+
+	private State[] historyVector = new State[3];
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public DeepHistoryStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		for (int i = 0; i < 3; i++) {
+			historyVector[i] = State.$NullState$;
+		}
+		clearEvents();
+		clearOutEvents();
+
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_mainRegion_default();
+	}
+
+	public void exit() {
+		exitSequence_mainRegion();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case mainRegion_State1 :
+				return stateVector[0] == State.mainRegion_State1;
+			case mainRegion_State2 :
+				return stateVector[0].ordinal() >= State.mainRegion_State2
+						.ordinal()
+						&& stateVector[0].ordinal() <= State.mainRegion_State2__region0_State5
+								.ordinal();
+			case mainRegion_State2__region0_a :
+				return stateVector[0] == State.mainRegion_State2__region0_a;
+			case mainRegion_State2__region0_State4 :
+				return stateVector[0].ordinal() >= State.mainRegion_State2__region0_State4
+						.ordinal()
+						&& stateVector[0].ordinal() <= State.mainRegion_State2__region0_State4__region0_State7__region0_State9
+								.ordinal();
+			case mainRegion_State2__region0_State4__region0_State6 :
+				return stateVector[0] == State.mainRegion_State2__region0_State4__region0_State6;
+			case mainRegion_State2__region0_State4__region0_State7 :
+				return stateVector[0].ordinal() >= State.mainRegion_State2__region0_State4__region0_State7
+						.ordinal()
+						&& stateVector[0].ordinal() <= State.mainRegion_State2__region0_State4__region0_State7__region0_State9
+								.ordinal();
+			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
+				return stateVector[0] == State.mainRegion_State2__region0_State4__region0_State7__region0_State8;
+			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
+				return stateVector[0] == State.mainRegion_State2__region0_State4__region0_State7__region0_State9;
+			case mainRegion_State2__region0_State5 :
+				return stateVector[0] == State.mainRegion_State2__region0_State5;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raiseEvent1() {
+		sCInterface.raiseEvent1();
+	}
+	public void raiseEvent2() {
+		sCInterface.raiseEvent2();
+	}
+	public void raiseEvent3() {
+		sCInterface.raiseEvent3();
+	}
+	public void raiseEvent4() {
+		sCInterface.raiseEvent4();
+	}
+	public void raiseEvent5() {
+		sCInterface.raiseEvent5();
+	}
+	public void raiseEvent6() {
+		sCInterface.raiseEvent6();
+	}
+	public void raiseEvent7() {
+		sCInterface.raiseEvent7();
+	}
+	public void raiseEvent8() {
+		sCInterface.raiseEvent8();
+	}
+	public void raiseEvent9() {
+		sCInterface.raiseEvent9();
+	}
+
+	private boolean check_mainRegion_State1_tr0_tr0() {
+		return sCInterface.event1;
+	}
+
+	private boolean check_mainRegion_State2_tr0_tr0() {
+		return sCInterface.event2;
+	}
+
+	private boolean check_mainRegion_State2__region0_a_tr0_tr0() {
+		return sCInterface.event3;
+	}
+
+	private boolean check_mainRegion_State2__region0_State4_tr0_tr0() {
+		return sCInterface.event4;
+	}
+
+	private boolean check_mainRegion_State2__region0_State4__region0_State6_tr0_tr0() {
+		return sCInterface.event5;
+	}
+
+	private boolean check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0() {
+		return sCInterface.event6;
+	}
+
+	private boolean check_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0_tr0() {
+		return sCInterface.event7;
+	}
+
+	private boolean check_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0_tr0() {
+		return sCInterface.event8;
+	}
+
+	private void effect_mainRegion_State1_tr0() {
+		exitSequence_mainRegion_State1();
+
+		enterSequence_mainRegion_State2_default();
+	}
+
+	private void effect_mainRegion_State2_tr0() {
+		exitSequence_mainRegion_State2();
+
+		enterSequence_mainRegion_State1_default();
+	}
+
+	private void effect_mainRegion_State2__region0_a_tr0() {
+		exitSequence_mainRegion_State2__region0_a();
+
+		enterSequence_mainRegion_State2__region0_State4_default();
+	}
+
+	private void effect_mainRegion_State2__region0_State4_tr0() {
+		exitSequence_mainRegion_State2__region0_State4();
+
+		enterSequence_mainRegion_State2__region0_State5_default();
+	}
+
+	private void effect_mainRegion_State2__region0_State4__region0_State6_tr0() {
+		exitSequence_mainRegion_State2__region0_State4__region0_State6();
+
+		enterSequence_mainRegion_State2__region0_State4__region0_State7_default();
+	}
+
+	private void effect_mainRegion_State2__region0_State4__region0_State7_tr0() {
+		exitSequence_mainRegion_State2__region0_State4__region0_State7();
+
+		enterSequence_mainRegion_State2__region0_State4__region0_State6_default();
+	}
+
+	private void effect_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0() {
+		exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8();
+
+		enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9_default();
+	}
+
+	private void effect_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0() {
+		exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9();
+
+		enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8_default();
+	}
+
+	/* Entry action for statechart 'DeepHistory'. */
+	private void entryAction() {
+	}
+
+	/* Exit action for state 'DeepHistory'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state State1 */
+	private void enterSequence_mainRegion_State1_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.mainRegion_State1;
+	}
+
+	/* 'default' enter sequence for state State2 */
+	private void enterSequence_mainRegion_State2_default() {
+		enterSequence_mainRegion_State2__region0_default();
+	}
+
+	/* 'default' enter sequence for state a */
+	private void enterSequence_mainRegion_State2__region0_a_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.mainRegion_State2__region0_a;
+
+		historyVector[0] = stateVector[0];
+	}
+
+	/* 'default' enter sequence for state State4 */
+	private void enterSequence_mainRegion_State2__region0_State4_default() {
+		enterSequence_mainRegion_State2__region0_State4__region0_default();
+
+		historyVector[0] = stateVector[0];
+	}
+
+	/* 'default' enter sequence for state State6 */
+	private void enterSequence_mainRegion_State2__region0_State4__region0_State6_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.mainRegion_State2__region0_State4__region0_State6;
+
+		historyVector[1] = stateVector[0];
+	}
+
+	/* 'default' enter sequence for state State7 */
+	private void enterSequence_mainRegion_State2__region0_State4__region0_State7_default() {
+		enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_default();
+
+		historyVector[1] = stateVector[0];
+	}
+
+	/* 'default' enter sequence for state State8 */
+	private void enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State8;
+
+		historyVector[2] = stateVector[0];
+	}
+
+	/* 'default' enter sequence for state State9 */
+	private void enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State9;
+
+		historyVector[2] = stateVector[0];
+	}
+
+	/* 'default' enter sequence for state State5 */
+	private void enterSequence_mainRegion_State2__region0_State5_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.mainRegion_State2__region0_State5;
+
+		historyVector[0] = stateVector[0];
+	}
+
+	/* 'default' enter sequence for region mainRegion */
+	private void enterSequence_mainRegion_default() {
+		react_mainRegion__entry_Default();
+	}
+
+	/* 'default' enter sequence for region null */
+	private void enterSequence_mainRegion_State2__region0_default() {
+		react_mainRegion_State2__region0__entry_Default();
+	}
+
+	/* deep enterSequence with history in child null */
+	private void deepEnterSequence_mainRegion_State2__region0() {
+		switch (historyVector[0]) {
+			case mainRegion_State2__region0_a :
+				enterSequence_mainRegion_State2__region0_a_default();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State6 :
+				deepEnterSequence_mainRegion_State2__region0_State4__region0();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
+				deepEnterSequence_mainRegion_State2__region0_State4__region0();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
+				deepEnterSequence_mainRegion_State2__region0_State4__region0();
+				break;
+
+			case mainRegion_State2__region0_State5 :
+				enterSequence_mainRegion_State2__region0_State5_default();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* 'default' enter sequence for region null */
+	private void enterSequence_mainRegion_State2__region0_State4__region0_default() {
+		react_mainRegion_State2__region0_State4__region0__entry_Default();
+	}
+
+	/* deep enterSequence with history in child null */
+	private void deepEnterSequence_mainRegion_State2__region0_State4__region0() {
+		switch (historyVector[1]) {
+			case mainRegion_State2__region0_State4__region0_State6 :
+				enterSequence_mainRegion_State2__region0_State4__region0_State6_default();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
+				deepEnterSequence_mainRegion_State2__region0_State4__region0_State7__region0();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
+				deepEnterSequence_mainRegion_State2__region0_State4__region0_State7__region0();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* 'default' enter sequence for region null */
+	private void enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_default() {
+		react_mainRegion_State2__region0_State4__region0_State7__region0__entry_Default();
+	}
+
+	/* deep enterSequence with history in child null */
+	private void deepEnterSequence_mainRegion_State2__region0_State4__region0_State7__region0() {
+		switch (historyVector[2]) {
+			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
+				enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8_default();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
+				enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9_default();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for state State1 */
+	private void exitSequence_mainRegion_State1() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state State2 */
+	private void exitSequence_mainRegion_State2() {
+		exitSequence_mainRegion_State2__region0();
+	}
+
+	/* Default exit sequence for state a */
+	private void exitSequence_mainRegion_State2__region0_a() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state State4 */
+	private void exitSequence_mainRegion_State2__region0_State4() {
+		exitSequence_mainRegion_State2__region0_State4__region0();
+	}
+
+	/* Default exit sequence for state State6 */
+	private void exitSequence_mainRegion_State2__region0_State4__region0_State6() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state State7 */
+	private void exitSequence_mainRegion_State2__region0_State4__region0_State7() {
+		exitSequence_mainRegion_State2__region0_State4__region0_State7__region0();
+	}
+
+	/* Default exit sequence for state State8 */
+	private void exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state State9 */
+	private void exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state State5 */
+	private void exitSequence_mainRegion_State2__region0_State5() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region mainRegion */
+	private void exitSequence_mainRegion() {
+		switch (stateVector[0]) {
+			case mainRegion_State1 :
+				exitSequence_mainRegion_State1();
+				break;
+
+			case mainRegion_State2__region0_a :
+				exitSequence_mainRegion_State2__region0_a();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State6 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State6();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9();
+				break;
+
+			case mainRegion_State2__region0_State5 :
+				exitSequence_mainRegion_State2__region0_State5();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region null */
+	private void exitSequence_mainRegion_State2__region0() {
+		switch (stateVector[0]) {
+			case mainRegion_State2__region0_a :
+				exitSequence_mainRegion_State2__region0_a();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State6 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State6();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9();
+				break;
+
+			case mainRegion_State2__region0_State5 :
+				exitSequence_mainRegion_State2__region0_State5();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region null */
+	private void exitSequence_mainRegion_State2__region0_State4__region0() {
+		switch (stateVector[0]) {
+			case mainRegion_State2__region0_State4__region0_State6 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State6();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region null */
+	private void exitSequence_mainRegion_State2__region0_State4__region0_State7__region0() {
+		switch (stateVector[0]) {
+			case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8();
+				break;
+
+			case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
+				exitSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state State1. */
+	private void react_mainRegion_State1() {
+		if (check_mainRegion_State1_tr0_tr0()) {
+			effect_mainRegion_State1_tr0();
+		}
+	}
+
+	/* The reactions of state a. */
+	private void react_mainRegion_State2__region0_a() {
+		if (check_mainRegion_State2_tr0_tr0()) {
+			effect_mainRegion_State2_tr0();
+		} else {
+			if (check_mainRegion_State2__region0_a_tr0_tr0()) {
+				effect_mainRegion_State2__region0_a_tr0();
+			}
+		}
+	}
+
+	/* The reactions of state State6. */
+	private void react_mainRegion_State2__region0_State4__region0_State6() {
+		if (check_mainRegion_State2_tr0_tr0()) {
+			effect_mainRegion_State2_tr0();
+		} else {
+			if (check_mainRegion_State2__region0_State4_tr0_tr0()) {
+				effect_mainRegion_State2__region0_State4_tr0();
+			} else {
+				if (check_mainRegion_State2__region0_State4__region0_State6_tr0_tr0()) {
+					effect_mainRegion_State2__region0_State4__region0_State6_tr0();
+				}
+			}
+		}
+	}
+
+	/* The reactions of state State8. */
+	private void react_mainRegion_State2__region0_State4__region0_State7__region0_State8() {
+		if (check_mainRegion_State2_tr0_tr0()) {
+			effect_mainRegion_State2_tr0();
+		} else {
+			if (check_mainRegion_State2__region0_State4_tr0_tr0()) {
+				effect_mainRegion_State2__region0_State4_tr0();
+			} else {
+				if (check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0()) {
+					effect_mainRegion_State2__region0_State4__region0_State7_tr0();
+				} else {
+					if (check_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0_tr0()) {
+						effect_mainRegion_State2__region0_State4__region0_State7__region0_State8_tr0();
+					}
+				}
+			}
+		}
+	}
+
+	/* The reactions of state State9. */
+	private void react_mainRegion_State2__region0_State4__region0_State7__region0_State9() {
+		if (check_mainRegion_State2_tr0_tr0()) {
+			effect_mainRegion_State2_tr0();
+		} else {
+			if (check_mainRegion_State2__region0_State4_tr0_tr0()) {
+				effect_mainRegion_State2__region0_State4_tr0();
+			} else {
+				if (check_mainRegion_State2__region0_State4__region0_State7_tr0_tr0()) {
+					effect_mainRegion_State2__region0_State4__region0_State7_tr0();
+				} else {
+					if (check_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0_tr0()) {
+						effect_mainRegion_State2__region0_State4__region0_State7__region0_State9_tr0();
+					}
+				}
+			}
+		}
+	}
+
+	/* The reactions of state State5. */
+	private void react_mainRegion_State2__region0_State5() {
+		if (check_mainRegion_State2_tr0_tr0()) {
+			effect_mainRegion_State2_tr0();
+		} else {
+		}
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_mainRegion__entry_Default() {
+		enterSequence_mainRegion_State1_default();
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_mainRegion_State2__region0_State4__region0__entry_Default() {
+		enterSequence_mainRegion_State2__region0_State4__region0_State6_default();
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_mainRegion_State2__region0_State4__region0_State7__region0__entry_Default() {
+		enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8_default();
+	}
+
+	/* Default react sequence for deep history entry  */
+	private void react_mainRegion_State2__region0__entry_Default() {
+		/* Enter the region with deep history */
+		if (historyVector[0] != State.$NullState$) {
+			deepEnterSequence_mainRegion_State2__region0();
+		} else {
+			enterSequence_mainRegion_State2__region0_a_default();
+		}
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case mainRegion_State1 :
+					react_mainRegion_State1();
+					break;
+				case mainRegion_State2__region0_a :
+					react_mainRegion_State2__region0_a();
+					break;
+				case mainRegion_State2__region0_State4__region0_State6 :
+					react_mainRegion_State2__region0_State4__region0_State6();
+					break;
+				case mainRegion_State2__region0_State4__region0_State7__region0_State8 :
+					react_mainRegion_State2__region0_State4__region0_State7__region0_State8();
+					break;
+				case mainRegion_State2__region0_State4__region0_State7__region0_State9 :
+					react_mainRegion_State2__region0_State4__region0_State7__region0_State9();
+					break;
+				case mainRegion_State2__region0_State5 :
+					react_mainRegion_State2__region0_State5();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 20 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/deephistory/IDeepHistoryStatemachine.java

@@ -0,0 +1,20 @@
+package org.yakindu.scr.deephistory;
+import org.yakindu.scr.IStatemachine;
+
+public interface IDeepHistoryStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public void raiseEvent1();
+		public void raiseEvent2();
+		public void raiseEvent3();
+		public void raiseEvent4();
+		public void raiseEvent5();
+		public void raiseEvent6();
+		public void raiseEvent7();
+		public void raiseEvent8();
+		public void raiseEvent9();
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 285 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/dynamicchoice/DynamicChoiceStatemachine.java

@@ -0,0 +1,285 @@
+package org.yakindu.scr.dynamicchoice;
+
+public class DynamicChoiceStatemachine implements IDynamicChoiceStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean reset;
+
+		public void raiseReset() {
+			reset = true;
+		}
+
+		private long number;
+		public long getNumber() {
+			return number;
+		}
+
+		public void setNumber(long value) {
+			this.number = value;
+		}
+
+		public void clearEvents() {
+			reset = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		main_region_Start, main_region_A, main_region_B, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public DynamicChoiceStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+		sCInterface.number = 0;
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_Start :
+				return stateVector[0] == State.main_region_Start;
+			case main_region_A :
+				return stateVector[0] == State.main_region_A;
+			case main_region_B :
+				return stateVector[0] == State.main_region_B;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raiseReset() {
+		sCInterface.raiseReset();
+	}
+
+	public long getNumber() {
+		return sCInterface.getNumber();
+	}
+
+	public void setNumber(long value) {
+		sCInterface.setNumber(value);
+	}
+
+	private boolean check_main_region_Start_tr0_tr0() {
+		return true;
+	}
+
+	private boolean check_main_region__choice_0_tr0_tr0() {
+		return sCInterface.number == 2;
+	}
+
+	private boolean check_main_region__choice_0_tr1() {
+		return true;
+	}
+
+	private void effect_main_region_Start_tr0() {
+		exitSequence_main_region_Start();
+
+		sCInterface.number += 1;
+
+		react_main_region__choice_0();
+	}
+
+	private void effect_main_region__choice_0_tr0() {
+		enterSequence_main_region_A_default();
+	}
+
+	private void effect_main_region__choice_0_tr1() {
+		enterSequence_main_region_B_default();
+	}
+
+	/* Entry action for statechart 'DynamicChoice'. */
+	private void entryAction() {
+	}
+
+	/* Entry action for state 'Start'. */
+	private void entryAction_main_region_Start() {
+		sCInterface.number = 1;
+	}
+
+	/* Exit action for state 'DynamicChoice'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state Start */
+	private void enterSequence_main_region_Start_default() {
+		entryAction_main_region_Start();
+
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_Start;
+	}
+
+	/* 'default' enter sequence for state A */
+	private void enterSequence_main_region_A_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_A;
+	}
+
+	/* 'default' enter sequence for state B */
+	private void enterSequence_main_region_B_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_B;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state Start */
+	private void exitSequence_main_region_Start() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state A */
+	private void exitSequence_main_region_A() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state B */
+	private void exitSequence_main_region_B() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_Start :
+				exitSequence_main_region_Start();
+				break;
+
+			case main_region_A :
+				exitSequence_main_region_A();
+				break;
+
+			case main_region_B :
+				exitSequence_main_region_B();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state Start. */
+	private void react_main_region_Start() {
+		effect_main_region_Start_tr0();
+	}
+
+	/* The reactions of state A. */
+	private void react_main_region_A() {
+	}
+
+	/* The reactions of state B. */
+	private void react_main_region_B() {
+	}
+
+	/* The reactions of state null. */
+	private void react_main_region__choice_0() {
+		if (check_main_region__choice_0_tr0_tr0()) {
+			effect_main_region__choice_0_tr0();
+		} else {
+			effect_main_region__choice_0_tr1();
+		}
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_Start_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_Start :
+					react_main_region_Start();
+					break;
+				case main_region_A :
+					react_main_region_A();
+					break;
+				case main_region_B :
+					react_main_region_B();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 14 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/dynamicchoice/IDynamicChoiceStatemachine.java

@@ -0,0 +1,14 @@
+package org.yakindu.scr.dynamicchoice;
+import org.yakindu.scr.IStatemachine;
+
+public interface IDynamicChoiceStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public void raiseReset();
+		public long getNumber();
+		public void setNumber(long value);
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 171 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/emptytransition/EmptyTransitionStatemachine.java

@@ -0,0 +1,171 @@
+package org.yakindu.scr.emptytransition;
+
+public class EmptyTransitionStatemachine implements IEmptyTransitionStatemachine {
+
+	public enum State {
+		main_region_A, main_region_B, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public EmptyTransitionStatemachine() {
+
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_main_region_default();
+	}
+
+	public void exit() {
+		exitSequence_main_region();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	* Always returns 'false' since this state machine can never become final.
+	*
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	* This method resets the incoming events (time events included).
+	*/
+	protected void clearEvents() {
+
+	}
+
+	/**
+	* This method resets the outgoing events.
+	*/
+	protected void clearOutEvents() {
+	}
+
+	/**
+	* Returns true if the given state is currently active otherwise false.
+	*/
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case main_region_A :
+				return stateVector[0] == State.main_region_A;
+			case main_region_B :
+				return stateVector[0] == State.main_region_B;
+			default :
+				return false;
+		}
+	}
+
+	/* Entry action for statechart 'EmptyTransition'. */
+	private void entryAction() {
+	}
+
+	/* Exit action for state 'EmptyTransition'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state A */
+	private void enterSequence_main_region_A_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_A;
+	}
+
+	/* 'default' enter sequence for state B */
+	private void enterSequence_main_region_B_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.main_region_B;
+	}
+
+	/* 'default' enter sequence for region main region */
+	private void enterSequence_main_region_default() {
+		react_main_region__entry_Default();
+	}
+
+	/* Default exit sequence for state A */
+	private void exitSequence_main_region_A() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state B */
+	private void exitSequence_main_region_B() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region main region */
+	private void exitSequence_main_region() {
+		switch (stateVector[0]) {
+			case main_region_A :
+				exitSequence_main_region_A();
+				break;
+
+			case main_region_B :
+				exitSequence_main_region_B();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state A. */
+	private void react_main_region_A() {
+	}
+
+	/* The reactions of state B. */
+	private void react_main_region_B() {
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_main_region__entry_Default() {
+		enterSequence_main_region_A_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case main_region_A :
+					react_main_region_A();
+					break;
+				case main_region_B :
+					react_main_region_B();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 5 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/emptytransition/IEmptyTransitionStatemachine.java

@@ -0,0 +1,5 @@
+package org.yakindu.scr.emptytransition;
+import org.yakindu.scr.IStatemachine;
+
+public interface IEmptyTransitionStatemachine extends IStatemachine {
+}

+ 337 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/enterstate/EnterStateStatemachine.java

@@ -0,0 +1,337 @@
+package org.yakindu.scr.enterstate;
+
+public class EnterStateStatemachine implements IEnterStateStatemachine {
+
+	private final class SCInterfaceImpl implements SCInterface {
+
+		private boolean e;
+
+		public void raiseE() {
+			e = true;
+		}
+
+		private boolean f;
+
+		public void raiseF() {
+			f = true;
+		}
+
+		private boolean g;
+
+		public void raiseG() {
+			g = true;
+		}
+
+		public void clearEvents() {
+			e = false;
+			f = false;
+			g = false;
+		}
+
+	}
+
+	private SCInterfaceImpl sCInterface;
+
+	public enum State {
+		r_A, r_B, r_B_r_E, r_B_r_F, $NullState$
+	};
+
+	private final State[] stateVector = new State[1];
+
+	private int nextStateIndex;
+
+	public EnterStateStatemachine() {
+
+		sCInterface = new SCInterfaceImpl();
+	}
+
+	public void init() {
+		for (int i = 0; i < 1; i++) {
+			stateVector[i] = State.$NullState$;
+		}
+
+		clearEvents();
+		clearOutEvents();
+
+	}
+
+	public void enter() {
+		entryAction();
+
+		enterSequence_r_default();
+	}
+
+	public void exit() {
+		exitSequence_r();
+
+		exitAction();
+	}
+
+	/**
+	 * @see IStatemachine#isActive()
+	 */
+	@Override
+	public boolean isActive() {
+
+		return stateVector[0] != State.$NullState$;
+	}
+
+	/** 
+	 * Always returns 'false' since this state machine can never become final.
+	 *
+	 * @see IStatemachine#isFinal() 
+	 */
+	@Override
+	public boolean isFinal() {
+		return false;
+	}
+
+	/**
+	 * This method resets the incoming events (time events included).
+	 */
+	protected void clearEvents() {
+		sCInterface.clearEvents();
+
+	}
+
+	/**
+	 * This method resets the outgoing events.
+	 */
+	protected void clearOutEvents() {
+	}
+
+	/**
+	 * Returns true if the given state is currently active otherwise false.
+	 */
+	public boolean isStateActive(State state) {
+		switch (state) {
+			case r_A :
+				return stateVector[0] == State.r_A;
+			case r_B :
+				return stateVector[0].ordinal() >= State.r_B.ordinal()
+						&& stateVector[0].ordinal() <= State.r_B_r_F.ordinal();
+			case r_B_r_E :
+				return stateVector[0] == State.r_B_r_E;
+			case r_B_r_F :
+				return stateVector[0] == State.r_B_r_F;
+			default :
+				return false;
+		}
+	}
+
+	public SCInterface getSCInterface() {
+		return sCInterface;
+	}
+
+	public void raiseE() {
+		sCInterface.raiseE();
+	}
+	public void raiseF() {
+		sCInterface.raiseF();
+	}
+	public void raiseG() {
+		sCInterface.raiseG();
+	}
+
+	private boolean check_r_A_tr0_tr0() {
+		return sCInterface.e;
+	}
+
+	private boolean check_r_A_tr1_tr1() {
+		return sCInterface.f;
+	}
+
+	private boolean check_r_A_tr2_tr2() {
+		return sCInterface.g;
+	}
+
+	private void effect_r_A_tr0() {
+		exitSequence_r_A();
+
+		enterSequence_r_B_default();
+	}
+
+	private void effect_r_A_tr1() {
+		exitSequence_r_A();
+
+		enterSequence_r_B_f();
+	}
+
+	private void effect_r_A_tr2() {
+		exitSequence_r_A();
+
+		enterSequence_r_B_g();
+	}
+
+	/* Entry action for statechart 'EnterState'. */
+	private void entryAction() {
+	}
+
+	/* Exit action for state 'EnterState'. */
+	private void exitAction() {
+	}
+
+	/* 'default' enter sequence for state A */
+	private void enterSequence_r_A_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.r_A;
+	}
+
+	/* 'default' enter sequence for state B */
+	private void enterSequence_r_B_default() {
+		enterSequence_r_B_r_default();
+	}
+
+	/* 'f' enter sequence for state B */
+	private void enterSequence_r_B_f() {
+		enterSequence_r_B_r_f();
+	}
+
+	/* 'g' enter sequence for state B */
+	private void enterSequence_r_B_g() {
+		enterSequence_r_B_r_default();
+	}
+
+	/* 'default' enter sequence for state E */
+	private void enterSequence_r_B_r_E_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.r_B_r_E;
+	}
+
+	/* 'default' enter sequence for state F */
+	private void enterSequence_r_B_r_F_default() {
+		nextStateIndex = 0;
+		stateVector[0] = State.r_B_r_F;
+	}
+
+	/* 'default' enter sequence for region r */
+	private void enterSequence_r_default() {
+		react_r__entry_Default();
+	}
+
+	/* 'default' enter sequence for region r */
+	private void enterSequence_r_B_r_default() {
+		react_r_B_r__entry_Default();
+	}
+
+	/* 'f' enter sequence for region r */
+	private void enterSequence_r_B_r_f() {
+		react_r_B_r_f();
+	}
+
+	/* Default exit sequence for state A */
+	private void exitSequence_r_A() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state E */
+	private void exitSequence_r_B_r_E() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for state F */
+	private void exitSequence_r_B_r_F() {
+		nextStateIndex = 0;
+		stateVector[0] = State.$NullState$;
+	}
+
+	/* Default exit sequence for region r */
+	private void exitSequence_r() {
+		switch (stateVector[0]) {
+			case r_A :
+				exitSequence_r_A();
+				break;
+
+			case r_B_r_E :
+				exitSequence_r_B_r_E();
+				break;
+
+			case r_B_r_F :
+				exitSequence_r_B_r_F();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* Default exit sequence for region r */
+	private void exitSequence_r_B_r() {
+		switch (stateVector[0]) {
+			case r_B_r_E :
+				exitSequence_r_B_r_E();
+				break;
+
+			case r_B_r_F :
+				exitSequence_r_B_r_F();
+				break;
+
+			default :
+				break;
+		}
+	}
+
+	/* The reactions of state A. */
+	private void react_r_A() {
+		if (check_r_A_tr0_tr0()) {
+			effect_r_A_tr0();
+		} else {
+			if (check_r_A_tr1_tr1()) {
+				effect_r_A_tr1();
+			} else {
+				if (check_r_A_tr2_tr2()) {
+					effect_r_A_tr2();
+				}
+			}
+		}
+	}
+
+	/* The reactions of state E. */
+	private void react_r_B_r_E() {
+	}
+
+	/* The reactions of state F. */
+	private void react_r_B_r_F() {
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_r__entry_Default() {
+		enterSequence_r_A_default();
+	}
+
+	/* Default react sequence for initial entry  */
+	private void react_r_B_r__entry_Default() {
+		enterSequence_r_B_r_E_default();
+	}
+
+	/* Default react sequence for initial entry f */
+	private void react_r_B_r_f() {
+		enterSequence_r_B_r_F_default();
+	}
+
+	public void runCycle() {
+
+		clearOutEvents();
+
+		for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) {
+
+			switch (stateVector[nextStateIndex]) {
+				case r_A :
+					react_r_A();
+					break;
+				case r_B_r_E :
+					react_r_B_r_E();
+					break;
+				case r_B_r_F :
+					react_r_B_r_F();
+					break;
+				default :
+					// $NullState$
+			}
+		}
+
+		clearEvents();
+	}
+}

+ 14 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/enterstate/IEnterStateStatemachine.java

@@ -0,0 +1,14 @@
+package org.yakindu.scr.enterstate;
+import org.yakindu.scr.IStatemachine;
+
+public interface IEnterStateStatemachine extends IStatemachine {
+	public interface SCInterface {
+		public void raiseE();
+		public void raiseF();
+		public void raiseG();
+
+	}
+
+	public SCInterface getSCInterface();
+
+}

+ 0 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/src-gen/org/yakindu/scr/entrychoice/EntryChoiceStatemachine.java


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels