Browse Source

Issue 1770 - sgen variables (#1786)

* Prototype builtin vars in sgen

* Put decl names in interface

* Make Properties persistent

* Add new builtins: Username and Hostname

* Add xtend to pom, organize imports

* Add xtend-gen to sources

* Add documentation for new builtin variables

* Fix h4 id

* Remove xtend-gen files

* removed subfolder

* removed dead code

* explicit dependency to xtend.lib

* removed MaxPermSize=128m, not requried for java 8
Rene Beckmann 7 years ago
parent
commit
1d594529d0
19 changed files with 276 additions and 47 deletions
  1. 28 0
      features/org.yakindu.sct.generator-feature/.project
  2. 0 1
      plugins/org.yakindu.base.expressions/pom.xml
  3. 15 2
      plugins/org.yakindu.sct.doc.user/src/user-guide/generating_code.textile
  4. 21 2
      plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/highlighting/SGenSemanticHighlightingCalculator.java
  5. 2 1
      plugins/org.yakindu.sct.generator.genmodel/META-INF/MANIFEST.MF
  6. 0 1
      plugins/org.yakindu.sct.generator.genmodel/pom.xml
  7. 8 2
      plugins/org.yakindu.sct.generator.genmodel/src/org/yakindu/sct/generator/genmodel/scoping/SGenScopeProvider.java
  8. 71 0
      plugins/org.yakindu.sct.generator.genmodel/src/org/yakindu/sct/generator/genmodel/typesystem/BuiltinDeclarations.xtend
  9. 0 26
      plugins/org.yakindu.sct.model.sexec/pom.xml
  10. 1 0
      plugins/org.yakindu.sct.model.sgen/.classpath
  11. 7 6
      plugins/org.yakindu.sct.model.sgen/META-INF/MANIFEST.MF
  12. 2 1
      plugins/org.yakindu.sct.model.sgen/build.properties
  13. 32 1
      plugins/org.yakindu.sct.model.sgen/pom.xml
  14. 11 2
      plugins/org.yakindu.sct.model.sgen/src/org/yakindu/sct/model/sgen/impl/SGenFactoryImpl.java
  15. 23 0
      plugins/org.yakindu.sct.model.sgen/src/org/yakindu/sct/model/sgen/util/BuiltinDeclarationNames.java
  16. 49 0
      plugins/org.yakindu.sct.model.sgen/src/org/yakindu/sct/model/sgen/util/BuiltinExpressionsInterpreter.xtend
  17. 5 0
      plugins/org.yakindu.sct.model.sgen/xtend-gen/.gitignore
  18. 1 1
      plugins/org.yakindu.sct.model.stext/META-INF/MANIFEST.MF
  19. 0 1
      plugins/org.yakindu.sct.model.stext/pom.xml

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

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.generator-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>1363185131062</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>

+ 0 - 1
plugins/org.yakindu.base.expressions/pom.xml

@@ -125,7 +125,6 @@
 								<jvmArgs>
 									<jvmArg>-Xms100m</jvmArg>
 									<jvmArg>-Xmx700m</jvmArg>
-									<jvmArg>-XX:MaxPermSize=128m</jvmArg>
 									<jvmArg>-Dlog4j.configuration=file:${basedir}/log4j.properties</jvmArg>
 								</jvmArgs>
 							</jvmSettings>

+ 15 - 2
plugins/org.yakindu.sct.doc.user/src/user-guide/generating_code.textile

@@ -287,7 +287,7 @@ bc. feature Debug {
 
 h3(#codegen_using_properties_and_expressions_in_generator_models). Using properties and expressions in generator models
 
-An SGen generator model may assign values to properties and later use these properties in expressions. The following sample generator model uses the *var* keyword to declare the properties _projectName_, _version_, _isBeta_, and _generateTimerServce_ with their respective types and default values. The model then uses these values in *feature* clauses by referring to the properties:
+An SGen generator model may assign values to properties and later use these properties in expressions. The following sample generator model uses the *var* keyword to declare the properties _projectName_, _version_, _isBeta_, and _generateTimerService_ with their respective types and default values. The model then uses these values in *feature* clauses by referring to the properties:
 
 bc.. 
 GeneratorModel for yakindu::java {
@@ -295,7 +295,7 @@ GeneratorModel for yakindu::java {
     var projectName : string = "light_switch"
     var version : string = "1.0"
     var isBeta : boolean = true
-    var generateTimerServce : boolean = true
+    var generateTimerService : boolean = true
 
     statechart myStateAutomaton {
 
@@ -316,6 +316,19 @@ p. The syntax rules for expressions in generator models are the same as for stat
 
 In the properties definition section near the top of a generator model, a value assigned to a property must be given as a _literal_. More complex expressions are not supported there.
 
+h4(#codegen_using_properties_and_expressions_in_generator_models_builtin). Builtin Variables
+
+There are several builtin variables which can be used in expressions in generator models:
+
+* SCTVERSION (String): Returns the current version of YAKINDU Statechart Tools, for example "3.2.0".
+* TIMESTAMP (String): Returns the current date and time as a localized string, for example "11.12.2017 17:08:14".
+* USER (String): Returns the name of the current user that started this instance of YAKINDU Statechart Tools (via @System.getProperty("user.name")@
+* HOSTNAME (String): Returns the host name of the machine on which YAKINDU Statechart Tools runs.
+
+Please be advised that neither USER nor HOSTNAME should be used for any security related tasks. Especially the username can easily be spoofed if anyone would want to. 
+
+h4(#codegen_using_properties_and_expressions_in_generator_models_headless). Overriding variables in a headless build
+
 The values assigned to properties are _default_ values only. That means, you can override them by different values when actually executing a generation model by way of running the "headless code generator":../user-guide/generating_code_headless.html#hdls_headless_code_generation.
 
 For example, the command to call the headless generator might look like this:

+ 21 - 2
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/highlighting/SGenSemanticHighlightingCalculator.java

@@ -14,6 +14,7 @@ import java.util.List;
 
 import org.eclipse.emf.common.util.TreeIterator;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.common.types.TypesPackage;
 import org.eclipse.xtext.nodemodel.INode;
 import org.eclipse.xtext.nodemodel.impl.LeafNode;
 import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
@@ -21,17 +22,21 @@ import org.eclipse.xtext.resource.XtextResource;
 import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration;
 import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightedPositionAcceptor;
 import org.eclipse.xtext.ui.editor.syntaxcoloring.ISemanticHighlightingCalculator;
+import org.yakindu.base.expressions.expressions.ElementReferenceExpression;
+import org.yakindu.base.expressions.expressions.ExpressionsPackage;
+import org.yakindu.base.types.Property;
 import org.yakindu.sct.model.sgen.DeprecatableElement;
 import org.yakindu.sct.model.sgen.GeneratorEntry;
 import org.yakindu.sct.model.sgen.SGenPackage;
 import org.yakindu.sct.model.sgen.impl.FeatureConfigurationImpl;
+import org.yakindu.sct.model.sgen.util.BuiltinDeclarationNames;
 
 /**
  * 
  * @author andreas muelder - Initial contribution and API
  * 
  */
-public class SGenSemanticHighlightingCalculator implements ISemanticHighlightingCalculator {
+public class SGenSemanticHighlightingCalculator implements ISemanticHighlightingCalculator, BuiltinDeclarationNames {
 
 	public void provideHighlightingFor(XtextResource resource, IHighlightedPositionAcceptor acceptor) {
 		if (resource == null || resource.getParseResult() == null)
@@ -62,7 +67,21 @@ public class SGenSemanticHighlightingCalculator implements ISemanticHighlighting
 						}
 					}
 				}
-				allContents.prune();
+				// allContents.prune();
+			} else if (object instanceof ElementReferenceExpression) {
+				List<INode> nodes = NodeModelUtils.findNodesForFeature(object,
+						ExpressionsPackage.Literals.ELEMENT_REFERENCE_EXPRESSION__REFERENCE);
+				for (INode node : nodes) {
+					String name = ((Property) ((ElementReferenceExpression) object).getReference()).getName();
+					switch (name) {
+						case HOSTNAME_VAR :
+						case USER_VAR :
+						case SCT_VERSION_VAR :
+						case TIMESTAMP_VAR :
+							acceptor.addPosition(node.getTotalOffset(), node.getTotalLength(),
+									DefaultHighlightingConfiguration.KEYWORD_ID);
+					}
+				}
 			}
 		}
 	}

+ 2 - 1
plugins/org.yakindu.sct.generator.genmodel/META-INF/MANIFEST.MF

@@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.xtext;visibility:=reexport,
  org.eclipse.core.runtime,
  org.yakindu.sct.generator.core;visibility:=reexport,
  org.yakindu.sct.model.sgen;visibility:=reexport,
- org.yakindu.base.types
+ org.yakindu.base.types,
+ org.yakindu.base.expressions.interpreter
 Import-Package: org.apache.log4j,
  org.apache.commons.logging,
  org.eclipse.xtext.xbase.lib

+ 0 - 1
plugins/org.yakindu.sct.generator.genmodel/pom.xml

@@ -131,7 +131,6 @@
 								<jvmArgs>
 									<jvmArg>-Xms100m</jvmArg>
 									<jvmArg>-Xmx700m</jvmArg>
-									<jvmArg>-XX:MaxPermSize=128m</jvmArg>
 									<jvmArg>-Dlog4j.configuration=file:${basedir}/log4j.properties</jvmArg>
 								</jvmArgs>
 							</jvmSettings>

+ 8 - 2
plugins/org.yakindu.sct.generator.genmodel/src/org/yakindu/sct/generator/genmodel/scoping/SGenScopeProvider.java

@@ -10,6 +10,8 @@
  */
 package org.yakindu.sct.generator.genmodel.scoping;
 
+import java.util.List;
+
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EClass;
@@ -26,6 +28,7 @@ import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;
 import org.eclipse.xtext.scoping.impl.FilteringScope;
 import org.eclipse.xtext.scoping.impl.SimpleScope;
 import org.yakindu.base.expressions.expressions.ExpressionsPackage;
+import org.yakindu.base.types.Property;
 import org.yakindu.base.types.TypesPackage;
 import org.yakindu.base.types.typesystem.ITypeSystem;
 import org.yakindu.sct.generator.core.extensions.GeneratorExtensions;
@@ -33,6 +36,7 @@ import org.yakindu.sct.generator.core.extensions.IGeneratorDescriptor;
 import org.yakindu.sct.generator.core.extensions.ILibraryDescriptor;
 import org.yakindu.sct.generator.core.extensions.LibraryExtensions;
 import org.yakindu.sct.generator.genmodel.resource.FeatureResourceDescription;
+import org.yakindu.sct.generator.genmodel.typesystem.BuiltinDeclarations;
 import org.yakindu.sct.model.sgen.FeatureConfiguration;
 import org.yakindu.sct.model.sgen.GeneratorModel;
 import org.yakindu.sct.model.sgen.PropertyDefinition;
@@ -53,11 +57,12 @@ public class SGenScopeProvider extends AbstractDeclarativeScopeProvider {
 
 	@Inject
 	private XtextResourceSet resourceSet;
-
 	@Inject
 	private Injector injector;
 	@Inject
 	private ITypeSystem typeSystem;
+	@Inject
+	private BuiltinDeclarations buildInDeclarations;
 
 	@Override
 	public IScope getScope(EObject context, EReference reference) {
@@ -82,7 +87,8 @@ public class SGenScopeProvider extends AbstractDeclarativeScopeProvider {
 	protected IScope getElementReferenceScope(EObject context) {
 		GeneratorModel generatorModel = (GeneratorModel) EcoreUtil.getRootContainer(context);
 		EList<PropertyDefinition> properties = generatorModel.getProperties();
-		return Scopes.scopeFor(properties);
+		List<Property> all = buildInDeclarations.getDeclarations();
+		return Scopes.scopeFor(properties, Scopes.scopeFor(all));
 	}
 
 	protected IScope scope_GeneratorEntry_elementRef(final EObject context, final EReference reference) {

+ 71 - 0
plugins/org.yakindu.sct.generator.genmodel/src/org/yakindu/sct/generator/genmodel/typesystem/BuiltinDeclarations.xtend

@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2017 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:
+ * 	rbeckmann - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.generator.genmodel.typesystem
+
+import com.google.inject.Inject
+import org.eclipse.xtend.lib.annotations.Accessors
+import org.yakindu.base.types.Property
+import org.yakindu.base.types.Type
+import org.yakindu.base.types.TypesFactory
+import org.yakindu.base.types.typesystem.AbstractTypeSystem
+import org.yakindu.base.types.typesystem.ITypeSystem
+import org.yakindu.sct.model.sgen.util.BuiltinDeclarationNames
+
+/**
+ * @author rbeckmann
+ * 
+ */
+@Accessors(PUBLIC_GETTER)
+class BuiltinDeclarations implements BuiltinDeclarationNames {
+	protected TypesFactory typesFactory
+	protected ITypeSystem typeSystem
+
+	protected Property sct_version
+	protected Property timestamp
+	protected Property hostname
+	protected Property username
+
+	@Inject
+	new(ITypeSystem typeSystem) {
+		this.typesFactory = TypesFactory.eINSTANCE
+		this.typeSystem = typeSystem
+		
+		val stringtype = typeSystem.getType(ITypeSystem.STRING)
+		
+		sct_version = createProperty(SCT_VERSION_VAR, stringtype)
+		timestamp = createProperty(TIMESTAMP_VAR, stringtype)
+		hostname = createProperty(HOSTNAME_VAR, stringtype)
+		username = createProperty(USER_VAR, stringtype)
+	}
+	
+	def protected Property createProperty(String name, Type type) {
+		typesFactory.createProperty => [prop |
+			(typeSystem as AbstractTypeSystem).resource.contents += prop
+			
+			prop.name = name
+			prop.typeSpecifier = typesFactory.createTypeSpecifier => [
+				it.type = type
+			]
+			prop.const = false
+			prop.readonly = false
+		]
+	}
+
+	def getDeclarations() {
+		#[
+			sct_version,
+			timestamp,
+			hostname,
+			username
+		]
+	}
+
+}

+ 0 - 26
plugins/org.yakindu.sct.model.sexec/pom.xml

@@ -19,32 +19,6 @@
 			</resource>
 		</resources>
 		<plugins>
-			<!-- Copy all Xtext related sources to seperate folder that is registered 
-				as resource folder -->
-			<plugin>
-				<artifactId>maven-resources-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy-resources</id>
-						<phase>initialize</phase>
-						<goals>
-							<goal>copy-resources</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>${project.build.directory}/xtext</outputDirectory>
-							<resources>
-								<resource>
-									<directory>src</directory>
-									<includes>
-										<include>**/*.xtext</include>
-										<include>**/*.mwe2</include>
-									</includes>
-								</resource>
-							</resources>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
 			<plugin>
 				<groupId>org.codehaus.mojo</groupId>
 				<artifactId>build-helper-maven-plugin</artifactId>

+ 1 - 0
plugins/org.yakindu.sct.model.sgen/.classpath

@@ -3,5 +3,6 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="xtend-gen"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

+ 7 - 6
plugins/org.yakindu.sct.model.sgen/META-INF/MANIFEST.MF

@@ -11,11 +11,12 @@ Export-Package: org.yakindu.sct.model.sgen,
  org.yakindu.sct.model.sgen.impl,
  org.yakindu.sct.model.sgen.util
 Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.emf.ecore;visibility:=reexport,
- org.yakindu.sct.model.sgraph;visibility:=reexport,
- org.eclipse.emf.ecore.xmi;visibility:=reexport,
- org.yakindu.base.types;visibility:=reexport,
- com.google.inject;visibility:=reexport,
- org.yakindu.base.expressions;visibility:=reexport,
+ org.eclipse.emf.ecore,
+ org.eclipse.xtend.lib,
+ org.yakindu.sct.model.sgraph,
+ org.eclipse.emf.ecore.xmi,
+ org.yakindu.base.types,
+ com.google.inject,
+ org.yakindu.base.expressions,
  org.yakindu.base.expressions.interpreter
 Bundle-ActivationPolicy: lazy

+ 2 - 1
plugins/org.yakindu.sct.model.sgen/build.properties

@@ -10,5 +10,6 @@ bin.includes = .,\
                plugin.xml,\
                plugin.properties
 jars.compile.order = .
-source.. = src/
+source.. = src/,\
+           xtend-gen/
 output.. = bin/

+ 32 - 1
plugins/org.yakindu.sct.model.sgen/pom.xml

@@ -12,5 +12,36 @@
 	<artifactId>org.yakindu.sct.model.sgen</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>

+ 11 - 2
plugins/org.yakindu.sct.model.sgen/src/org/yakindu/sct/model/sgen/impl/SGenFactoryImpl.java

@@ -17,7 +17,7 @@ import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.impl.EFactoryImpl;
 import org.eclipse.emf.ecore.plugin.EcorePlugin;
 import org.yakindu.base.expressions.ExpressionsRuntimeModule;
-import org.yakindu.sct.model.sgen.*;
+import org.yakindu.base.expressions.interpreter.IExpressionInterpreter;
 import org.yakindu.sct.model.sgen.DeprecatableElement;
 import org.yakindu.sct.model.sgen.FeatureConfiguration;
 import org.yakindu.sct.model.sgen.FeatureParameter;
@@ -28,9 +28,12 @@ import org.yakindu.sct.model.sgen.GeneratorConfiguration;
 import org.yakindu.sct.model.sgen.GeneratorEntry;
 import org.yakindu.sct.model.sgen.GeneratorModel;
 import org.yakindu.sct.model.sgen.ParameterTypes;
+import org.yakindu.sct.model.sgen.PropertyDefinition;
 import org.yakindu.sct.model.sgen.SGenFactory;
 import org.yakindu.sct.model.sgen.SGenPackage;
+import org.yakindu.sct.model.sgen.util.BuiltinExpressionsInterpreter;
 
+import com.google.inject.Binder;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 
@@ -69,7 +72,13 @@ public class SGenFactoryImpl extends EFactoryImpl implements SGenFactory {
 	 * @generated NOT
 	 */
 	public SGenFactoryImpl() {
-		injector = Guice.createInjector(new ExpressionsRuntimeModule());
+		injector = Guice.createInjector(new ExpressionsRuntimeModule() {
+			@Override
+			public void configure(Binder binder) {
+				binder.bind(IExpressionInterpreter.class).to(BuiltinExpressionsInterpreter.class);
+				super.configure(binder);
+			}
+		});
 	}
 
 	/**

+ 23 - 0
plugins/org.yakindu.sct.model.sgen/src/org/yakindu/sct/model/sgen/util/BuiltinDeclarationNames.java

@@ -0,0 +1,23 @@
+/**
+ * Copyright (c) 2017 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:
+ * 	rbeckmann - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.model.sgen.util;
+
+/**
+ * @author rbeckmann
+ *
+ */
+public interface BuiltinDeclarationNames {
+	public static final String SCT_VERSION_VAR = "SCTVERSION";
+	public static final String TIMESTAMP_VAR = "TIMESTAMP";
+	public static final String USER_VAR = "USER";
+	public static final String HOSTNAME_VAR = "HOSTNAME";
+
+}

+ 49 - 0
plugins/org.yakindu.sct.model.sgen/src/org/yakindu/sct/model/sgen/util/BuiltinExpressionsInterpreter.xtend

@@ -0,0 +1,49 @@
+/** 
+ * Copyright (c) 2017 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:
+ * rbeckmann - initial API and implementation
+ */
+package org.yakindu.sct.model.sgen.util
+
+import java.net.InetAddress
+import java.text.DateFormat
+import java.util.Date
+import org.osgi.framework.FrameworkUtil
+import org.yakindu.base.expressions.expressions.ElementReferenceExpression
+import org.yakindu.base.expressions.interpreter.DefaultExpressionInterpreter
+import org.yakindu.base.types.Property
+
+/** 
+ * @author rbeckmann
+ */
+class BuiltinExpressionsInterpreter extends DefaultExpressionInterpreter implements BuiltinDeclarationNames {
+
+	override dispatch Object execute(ElementReferenceExpression expression) {
+		if (expression.reference instanceof Property) {
+			switch ((expression.reference as Property).name) {
+				case SCT_VERSION_VAR: {
+					val v = FrameworkUtil.getBundle(getClass()).version
+					return '''«v.major».«v.minor».«v.micro»'''.toString
+				}
+				case TIMESTAMP_VAR: {
+					return DateFormat.getDateTimeInstance().format(new Date()).toString
+				}
+				case USER_VAR: {
+					return System.getProperty("user.name").toString
+				}
+				case HOSTNAME_VAR: {
+					return InetAddress.localHost.hostName.toString
+				}
+				default:
+					return executeElementReferenceExpression(expression)
+			}
+
+		}
+		executeElementReferenceExpression(expression)
+	}
+
+}

+ 5 - 0
plugins/org.yakindu.sct.model.sgen/xtend-gen/.gitignore

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

+ 1 - 1
plugins/org.yakindu.sct.model.stext/META-INF/MANIFEST.MF

@@ -23,7 +23,7 @@ Require-Bundle: org.eclipse.xtext;visibility:=reexport,
  org.yakindu.sct.model.stext.lib,
  org.eclipse.gmf.runtime.diagram.core
 Import-Package: org.apache.commons.logging,
- org.apache.log4j,
+ org.apache.log4j;visibility:=reexport,
  org.eclipse.xtext.xbase.lib
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Export-Package: org.yakindu.sct.model.stext,

+ 0 - 1
plugins/org.yakindu.sct.model.stext/pom.xml

@@ -124,7 +124,6 @@
 								<jvmArgs>
 									<jvmArg>-Xms100m</jvmArg>
 									<jvmArg>-Xmx700m</jvmArg>
-									<jvmArg>-XX:MaxPermSize=128m</jvmArg>
 									<jvmArg>-Dlog4j.configuration=file:${basedir}/log4j.properties</jvmArg>
 								</jvmArgs>
 							</jvmSettings>