Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.generator')
-rw-r--r--plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GeneratorBaseModule.java3
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend4
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ConfigExtension.java302
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericActorClassGenerator.java127
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericProtocolClassGenerator.java167
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java389
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/PrepareFileSystem.java62
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java291
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java837
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/TypeHelpers.java31
12 files changed, 1038 insertions, 1179 deletions
diff --git a/plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF
index e71a6478c..7b0bd006b 100644
--- a/plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF
@@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.etrice.core.room;bundle-version="0.1.0",
org.eclipse.core.resources;bundle-version="3.7.100",
org.eclipse.xtext.generator;bundle-version="2.1.1",
org.eclipse.xtext;bundle-version="2.1.1",
- org.eclipse.xtext.xtend2.lib;bundle-version="2.1.1",
+ org.eclipse.xtend.lib;bundle-version="2.3.0",
org.eclipse.etrice.core.config;bundle-version="0.2.0"
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.etrice.generator.generic
diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GeneratorBaseModule.java b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GeneratorBaseModule.java
index 1eecf2d2f..5504f864e 100644
--- a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GeneratorBaseModule.java
+++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/base/GeneratorBaseModule.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.etrice.core.genmodel.base.ILogger;
import org.eclipse.etrice.core.genmodel.etricegen.IDiagnostician;
+import org.eclipse.xtext.parser.IEncodingProvider;
import com.google.inject.Binder;
import com.google.inject.Module;
@@ -40,6 +41,8 @@ public class GeneratorBaseModule implements Module {
binder.bind(Diagnostician.class).in(Singleton.class);
binder.bind(IDiagnostician.class).to(Diagnostician.class);
+
+ binder.bind(IEncodingProvider.class).to(IEncodingProvider.Runtime.class);
}
}
diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.xtend b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.xtend
index 94d6f1c0d..3bf8b31cb 100644
--- a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.xtend
+++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.xtend
@@ -94,7 +94,6 @@ class GenericStateMachineGenerator {
var dct = new DetailCodeTranslator(ac, translator)
var async = ac.commType==ActorCommunicationType::ASYNCHRONOUS
var eventDriven = ac.commType==ActorCommunicationType::EVENT_DRIVEN
- var dataDriven = ac.commType==ActorCommunicationType::DATA_DRIVEN
var handleEvents = async || eventDriven
'''
@@ -269,7 +268,6 @@ class GenericStateMachineGenerator {
var async = xpac.actorClass.commType==ActorCommunicationType::ASYNCHRONOUS
var eventDriven = xpac.actorClass.commType==ActorCommunicationType::EVENT_DRIVEN
var dataDriven = xpac.actorClass.commType==ActorCommunicationType::DATA_DRIVEN
- var handleEvents = async || eventDriven
'''
switch («langExt.memberAccess»state) {
«FOR state : xpac.stateMachine.getLeafStateList()»
diff --git a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend
index b418c90bc..feed46412 100644
--- a/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend
+++ b/plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/RoomExtensions.xtend
@@ -225,11 +225,11 @@ class RoomExtensions {
p.name + (if (conj) "Conj" else "") + (if (repl) "Repl" else "") +"Port"
}
- def String getPortClassName(ExternalPort p){
+ def dispatch String getPortClassName(ExternalPort p){
return p.ifport.getPortClassName()
}
- def String getPortClassName(ServiceImplementation svc) {
+ def dispatch String getPortClassName(ServiceImplementation svc) {
return svc.spp.protocol.getPortClassName(false, true)
}
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ConfigExtension.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ConfigExtension.java
index ee1fc5835..e930c7ba2 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ConfigExtension.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ConfigExtension.java
@@ -1,5 +1,6 @@
package org.eclipse.etrice.generator.generic;
+import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.ArrayList;
@@ -30,73 +31,56 @@ import org.eclipse.etrice.core.room.ProtocolClass;
import org.eclipse.etrice.core.room.RefableType;
import org.eclipse.etrice.generator.base.ConfigHelper;
import org.eclipse.etrice.generator.generic.ILanguageExtension;
-import org.eclipse.xtext.xbase.lib.BooleanExtensions;
-import org.eclipse.xtext.xbase.lib.ComparableExtensions;
+import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.ObjectExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.eclipse.xtext.xtend2.lib.StringConcatenation;
-@SuppressWarnings("all")
@Singleton
+@SuppressWarnings("all")
public class ConfigExtension {
@Inject
private ILanguageExtension languageExt;
public String getInitValue(final Attribute a) {
- String _configDefaultValue = this.getConfigDefaultValue(a);
- String value = _configDefaultValue;
- boolean _operator_equals = ObjectExtensions.operator_equals(value, null);
- if (_operator_equals) {
- String _defaultValueLiteral = a.getDefaultValueLiteral();
- value = _defaultValueLiteral;
- }
- return value;
+ String value = this.getConfigDefaultValue(a);
+ boolean _equals = Objects.equal(value, null);
+ if (_equals) {
+ String _defaultValueLiteral = a.getDefaultValueLiteral();
+ value = _defaultValueLiteral;
+ }
+ return value;
}
public String getConfigDefaultValue(final Attribute attr) {
- String _xifexpression = null;
EObject _eContainer = attr.eContainer();
if ((_eContainer instanceof ActorClass)) {
- {
- EObject _eContainer_1 = attr.eContainer();
- ActorClass ac = ((ActorClass) _eContainer_1);
- ActorClassConfig _classConfig = this.getClassConfig(ac);
- EList<AttrClassConfig> _attributes = _classConfig==null?(EList<AttrClassConfig>)null:_classConfig.getAttributes();
- String _configValue = _attributes==null?(String)null:this.getConfigValue(_attributes, attr);
- return _configValue;
- }
+ EObject _eContainer_1 = attr.eContainer();
+ ActorClass ac = ((ActorClass) _eContainer_1);
+ ActorClassConfig _classConfig = this.getClassConfig(ac);
+ EList<AttrClassConfig> _attributes = _classConfig==null?(EList<AttrClassConfig>)null:_classConfig.getAttributes();
+ return _attributes==null?(String)null:this.getConfigValue(_attributes, attr);
} else {
- String _xifexpression_1 = null;
EObject _eContainer_2 = attr.eContainer();
if ((_eContainer_2 instanceof PortClass)) {
- {
- EObject _eContainer_3 = attr.eContainer();
- PortClass pc = ((PortClass) _eContainer_3);
- EObject _eContainer_4 = pc.eContainer();
- ProtocolClass protocol = ((ProtocolClass) _eContainer_4);
- ProtocolClassConfig _protocolConfig = this.getProtocolConfig(((ProtocolClass) protocol));
- ProtocolClassConfig prcConfig = _protocolConfig;
- PortClass _regular = protocol.getRegular();
- boolean _equals = pc.equals(_regular);
- if (_equals) {
- PortClassConfig _regular_1 = prcConfig==null?(PortClassConfig)null:prcConfig.getRegular();
- EList<AttrClassConfig> _attributes_1 = _regular_1==null?(EList<AttrClassConfig>)null:_regular_1.getAttributes();
- String _configValue_1 = _attributes_1==null?(String)null:this.getConfigValue(_attributes_1, attr);
- return _configValue_1;
- } else {
- PortClassConfig _conjugated = prcConfig==null?(PortClassConfig)null:prcConfig.getConjugated();
- EList<AttrClassConfig> _attributes_2 = _conjugated==null?(EList<AttrClassConfig>)null:_conjugated.getAttributes();
- String _configValue_2 = _attributes_2==null?(String)null:this.getConfigValue(_attributes_2, attr);
- return _configValue_2;
- }
+ EObject _eContainer_3 = attr.eContainer();
+ PortClass pc = ((PortClass) _eContainer_3);
+ EObject _eContainer_4 = pc.eContainer();
+ ProtocolClass protocol = ((ProtocolClass) _eContainer_4);
+ ProtocolClassConfig prcConfig = this.getProtocolConfig(((ProtocolClass) protocol));
+ PortClass _regular = protocol.getRegular();
+ boolean _equals = pc.equals(_regular);
+ if (_equals) {
+ PortClassConfig _regular_1 = prcConfig==null?(PortClassConfig)null:prcConfig.getRegular();
+ EList<AttrClassConfig> _attributes_1 = _regular_1==null?(EList<AttrClassConfig>)null:_regular_1.getAttributes();
+ return _attributes_1==null?(String)null:this.getConfigValue(_attributes_1, attr);
+ } else {
+ PortClassConfig _conjugated = prcConfig==null?(PortClassConfig)null:prcConfig.getConjugated();
+ EList<AttrClassConfig> _attributes_2 = _conjugated==null?(EList<AttrClassConfig>)null:_conjugated.getAttributes();
+ return _attributes_2==null?(String)null:this.getConfigValue(_attributes_2, attr);
}
}
- _xifexpression = _xifexpression_1;
}
- return _xifexpression;
+ return null;
}
public String getConfigValue(final List<AttrClassConfig> attrConfigs, final Attribute attr) {
@@ -104,7 +88,7 @@ public class ConfigExtension {
public Boolean apply(final AttrClassConfig attrConfig) {
Attribute _attribute = attrConfig.getAttribute();
boolean _equals = _attribute.equals(attr);
- return ((Boolean)_equals);
+ return Boolean.valueOf(_equals);
}
};
AttrClassConfig _findFirst = IterableExtensions.<AttrClassConfig>findFirst(attrConfigs, _function);
@@ -124,96 +108,92 @@ public class ConfigExtension {
}
public String stringValue(final LiteralArray literalArray, final Attribute attr) {
- String string = "";
- boolean _operator_and = false;
- boolean _isArray = this.isArray(attr);
- if (!_isArray) {
- _operator_and = false;
- } else {
- EList<Literal> _literals = literalArray.getLiterals();
- int _size = _literals.size();
- boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size), ((Integer)1));
- _operator_and = BooleanExtensions.operator_and(_isArray, _operator_greaterThan);
- }
- if (_operator_and) {
- {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("{ ");
- {
- EList<Literal> _literals_1 = literalArray.getLiterals();
- for(final Literal literal : _literals_1) {
- String _stringValue = this.stringValue(literal);
- _builder.append(_stringValue, "");
- _builder.append(", ");
- }
- }
- String _operator_plus = StringExtensions.operator_plus(string, _builder);
- string = _operator_plus;
- int _length = string.length();
- int _operator_minus = IntegerExtensions.operator_minus(((Integer)_length), ((Integer)2));
- String _substring = string.substring(0, _operator_minus);
- StringConcatenation _builder_1 = new StringConcatenation();
- _builder_1.append(" ");
- _builder_1.append("}");
- String _operator_plus_1 = StringExtensions.operator_plus(_substring, _builder_1);
- string = _operator_plus_1;
+ String string = "";
+ boolean _and = false;
+ boolean _isArray = this.isArray(attr);
+ if (!_isArray) {
+ _and = false;
+ } else {
+ EList<Literal> _literals = literalArray.getLiterals();
+ int _size = _literals.size();
+ boolean _greaterThan = (_size > 1);
+ _and = (_isArray && _greaterThan);
+ }
+ if (_and) {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("{ ");
+ {
+ EList<Literal> _literals_1 = literalArray.getLiterals();
+ for(final Literal literal : _literals_1) {
+ String _stringValue = this.stringValue(literal);
+ _builder.append(_stringValue, "");
+ _builder.append(", ");
}
- } else {
- EList<Literal> _literals_2 = literalArray.getLiterals();
- Literal _get = _literals_2.get(0);
- String _stringValue_1 = this.stringValue(_get);
- string = _stringValue_1;
}
- return string;
+ String _plus = (string + _builder.toString());
+ string = _plus;
+ int _length = string.length();
+ int _minus = (_length - 2);
+ String _substring = string.substring(0, _minus);
+ StringConcatenation _builder_1 = new StringConcatenation();
+ _builder_1.append(" ");
+ _builder_1.append("}");
+ String _plus_1 = (_substring + _builder_1.toString());
+ string = _plus_1;
+ } else {
+ EList<Literal> _literals_2 = literalArray.getLiterals();
+ Literal _get = _literals_2.get(0);
+ String _stringValue_1 = this.stringValue(_get);
+ string = _stringValue_1;
+ }
+ return string;
}
private String stringValue(final Literal literal) {
String _switchResult = null;
- final Literal literal_1 = literal;
- boolean matched = false;
- if (!matched) {
- if (literal_1 instanceof BooleanLiteral) {
- final BooleanLiteral literal_2 = (BooleanLiteral) literal_1;
- matched=true;
- boolean _isIsTrue = literal_2.isIsTrue();
- String _string = ((Boolean)_isIsTrue).toString();
+ boolean _matched = false;
+ if (!_matched) {
+ if (literal instanceof BooleanLiteral) {
+ final BooleanLiteral _booleanLiteral = (BooleanLiteral)literal;
+ _matched=true;
+ boolean _isIsTrue = _booleanLiteral.isIsTrue();
+ String _string = Boolean.valueOf(_isIsTrue).toString();
_switchResult = _string;
}
}
- if (!matched) {
- if (literal_1 instanceof IntLiteral) {
- final IntLiteral literal_3 = (IntLiteral) literal_1;
- matched=true;
- int _value = literal_3.getValue();
- String _string_1 = ((Integer)_value).toString();
- _switchResult = _string_1;
+ if (!_matched) {
+ if (literal instanceof IntLiteral) {
+ final IntLiteral _intLiteral = (IntLiteral)literal;
+ _matched=true;
+ int _value = _intLiteral.getValue();
+ String _string = Integer.valueOf(_value).toString();
+ _switchResult = _string;
}
}
- if (!matched) {
- if (literal_1 instanceof RealLiteral) {
- final RealLiteral literal_4 = (RealLiteral) literal_1;
- matched=true;
- double _value_1 = literal_4.getValue();
- String _string_2 = ((Double)_value_1).toString();
- _switchResult = _string_2;
+ if (!_matched) {
+ if (literal instanceof RealLiteral) {
+ final RealLiteral _realLiteral = (RealLiteral)literal;
+ _matched=true;
+ double _value = _realLiteral.getValue();
+ String _string = Double.valueOf(_value).toString();
+ _switchResult = _string;
}
}
- if (!matched) {
- if (literal_1 instanceof StringLiteral) {
- final StringLiteral literal_5 = (StringLiteral) literal_1;
- matched=true;
+ if (!_matched) {
+ if (literal instanceof StringLiteral) {
+ final StringLiteral _stringLiteral = (StringLiteral)literal;
+ _matched=true;
String _xblockexpression = null;
{
- String _value_2 = literal_5.getValue();
- String _string_3 = _value_2.toString();
- String value = _string_3;
+ String _value = _stringLiteral.getValue();
+ String value = _value.toString();
String _xifexpression = null;
int _length = value.length();
- boolean _operator_equals = ObjectExtensions.operator_equals(((Integer)_length), ((Integer)1));
- if (_operator_equals) {
- String _operator_plus = StringExtensions.operator_plus("\'", value);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "\'");
- _xifexpression = _operator_plus_1;
+ boolean _equals = (_length == 1);
+ if (_equals) {
+ String _plus = ("\'" + value);
+ String _plus_1 = (_plus + "\'");
+ _xifexpression = _plus_1;
} else {
String _charArrayExpr = this.languageExt.toCharArrayExpr(value);
_xifexpression = _charArrayExpr;
@@ -233,62 +213,58 @@ public class ConfigExtension {
RefableType _refType = attr.getRefType();
DataType _type = _refType.getType();
if ((_type instanceof PrimitiveType)) {
- {
- RefableType _refType_1 = attr.getRefType();
- DataType _type_1 = _refType_1.getType();
- PrimitiveType primitive = ((PrimitiveType) _type_1);
- LiteralType _type_2 = primitive.getType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_type_2, LiteralType.CHAR);
- isChar = _operator_equals;
- }
+ RefableType _refType_1 = attr.getRefType();
+ DataType _type_1 = _refType_1.getType();
+ PrimitiveType primitive = ((PrimitiveType) _type_1);
+ LiteralType _type_2 = primitive.getType();
+ boolean _equals = Objects.equal(_type_2, LiteralType.CHAR);
+ isChar = _equals;
}
- boolean _operator_and = false;
- boolean _operator_not = BooleanExtensions.operator_not(isChar);
- if (!_operator_not) {
- _operator_and = false;
+ boolean _and = false;
+ boolean _not = (!isChar);
+ if (!_not) {
+ _and = false;
} else {
int _size = attr.getSize();
- boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size), ((Integer)0));
- _operator_and = BooleanExtensions.operator_and(_operator_not, _operator_greaterThan);
+ boolean _greaterThan = (_size > 0);
+ _and = (_not && _greaterThan);
}
- _xblockexpression = (_operator_and);
+ _xblockexpression = (_and);
}
return _xblockexpression;
}
public List<AttrInstanceConfig> getConfigAttributes(final ActorInstance ai) {
- ArrayList<AttrInstanceConfig> _arrayList = new ArrayList<AttrInstanceConfig>();
- ArrayList<AttrInstanceConfig> attrConfigs = _arrayList;
- String _path = ai.getPath();
- ActorInstanceConfig _get = ConfigHelper.instanceMap.get(_path);
- ActorInstanceConfig config = _get;
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(config, null);
- if (_operator_notEquals) {
- EList<AttrInstanceConfig> _attributes = config.getAttributes();
- for (final AttrInstanceConfig attrConfig : _attributes) {
- LiteralArray _value = attrConfig.getValue();
- boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_value, null);
- if (_operator_notEquals_1) {
- attrConfigs.add(attrConfig);
- }
+ ArrayList<AttrInstanceConfig> _arrayList = new ArrayList<AttrInstanceConfig>();
+ ArrayList<AttrInstanceConfig> attrConfigs = _arrayList;
+ String _path = ai.getPath();
+ ActorInstanceConfig config = ConfigHelper.instanceMap.get(_path);
+ boolean _notEquals = (!Objects.equal(config, null));
+ if (_notEquals) {
+ EList<AttrInstanceConfig> _attributes = config.getAttributes();
+ for (final AttrInstanceConfig attrConfig : _attributes) {
+ LiteralArray _value = attrConfig.getValue();
+ boolean _notEquals_1 = (!Objects.equal(_value, null));
+ if (_notEquals_1) {
+ attrConfigs.add(attrConfig);
}
}
- return attrConfigs;
+ }
+ return attrConfigs;
}
public List<PortInstanceConfig> getConfigPorts(final ActorInstance ai) {
- ArrayList<PortInstanceConfig> _arrayList = new ArrayList<PortInstanceConfig>();
- ArrayList<PortInstanceConfig> portConfigs = _arrayList;
- String _path = ai.getPath();
- ActorInstanceConfig _get = ConfigHelper.instanceMap.get(_path);
- ActorInstanceConfig config = _get;
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(config, null);
- if (_operator_notEquals) {
- EList<PortInstanceConfig> _ports = config.getPorts();
- for (final PortInstanceConfig portConfig : _ports) {
- portConfigs.add(portConfig);
- }
+ ArrayList<PortInstanceConfig> _arrayList = new ArrayList<PortInstanceConfig>();
+ ArrayList<PortInstanceConfig> portConfigs = _arrayList;
+ String _path = ai.getPath();
+ ActorInstanceConfig config = ConfigHelper.instanceMap.get(_path);
+ boolean _notEquals = (!Objects.equal(config, null));
+ if (_notEquals) {
+ EList<PortInstanceConfig> _ports = config.getPorts();
+ for (final PortInstanceConfig portConfig : _ports) {
+ portConfigs.add(portConfig);
}
- return portConfigs;
+ }
+ return portConfigs;
}
}
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericActorClassGenerator.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericActorClassGenerator.java
index 85d09c0a9..fb9ff2024 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericActorClassGenerator.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericActorClassGenerator.java
@@ -14,8 +14,6 @@ import org.eclipse.etrice.generator.generic.ILanguageExtension;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.xtext.util.Pair;
import org.eclipse.xtext.util.Tuples;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
@SuppressWarnings("all")
public class GenericActorClassGenerator {
@@ -26,68 +24,67 @@ public class GenericActorClassGenerator {
private RoomExtensions roomExt;
public String genInterfaceItemConstants(final ExpandedActorClass xpac, final ActorClass ac) {
- List<Port> _xifexpression = null;
- boolean _usesInheritance = this.langExt.usesInheritance();
- if (_usesInheritance) {
- List<Port> _endPorts = this.roomExt.getEndPorts(ac);
- _xifexpression = _endPorts;
- } else {
- List<Port> _allEndPorts = this.roomExt.getAllEndPorts(ac);
- _xifexpression = _allEndPorts;
- }
- List<Port> endPorts = _xifexpression;
- List<SAPRef> _xifexpression_1 = null;
- boolean _usesInheritance_1 = this.langExt.usesInheritance();
- if (_usesInheritance_1) {
- EList<SAPRef> _strSAPs = ac.getStrSAPs();
- _xifexpression_1 = _strSAPs;
- } else {
- List<SAPRef> _allSAPs = this.roomExt.getAllSAPs(ac);
- _xifexpression_1 = _allSAPs;
- }
- List<SAPRef> strSAPs = _xifexpression_1;
- List<ServiceImplementation> _xifexpression_2 = null;
- boolean _usesInheritance_2 = this.langExt.usesInheritance();
- if (_usesInheritance_2) {
- EList<ServiceImplementation> _serviceImplementations = ac.getServiceImplementations();
- _xifexpression_2 = _serviceImplementations;
- } else {
- List<ServiceImplementation> _allServiceImplementations = this.roomExt.getAllServiceImplementations(ac);
- _xifexpression_2 = _allServiceImplementations;
- }
- List<ServiceImplementation> svcImpls = _xifexpression_2;
- ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
- ArrayList<Pair<String,String>> list = _arrayList;
- for (final Port ep : endPorts) {
- String _name = ep.getName();
- String _operator_plus = StringExtensions.operator_plus("IFITEM_", _name);
- int _interfaceItemLocalId = xpac.getInterfaceItemLocalId(ep);
- int _operator_plus_1 = IntegerExtensions.operator_plus(((Integer)1), ((Integer)_interfaceItemLocalId));
- String _string = ((Integer)_operator_plus_1).toString();
- Pair<String,String> _pair = Tuples.<String, String>pair(_operator_plus, _string);
- list.add(_pair);
- }
- for (final SAPRef sap : strSAPs) {
- String _name_1 = sap.getName();
- String _operator_plus_2 = StringExtensions.operator_plus("IFITEM_", _name_1);
- int _interfaceItemLocalId_1 = xpac.getInterfaceItemLocalId(sap);
- int _operator_plus_3 = IntegerExtensions.operator_plus(((Integer)1), ((Integer)_interfaceItemLocalId_1));
- String _string_1 = ((Integer)_operator_plus_3).toString();
- Pair<String,String> _pair_1 = Tuples.<String, String>pair(_operator_plus_2, _string_1);
- list.add(_pair_1);
- }
- for (final ServiceImplementation svc : svcImpls) {
- SPPRef _spp = svc.getSpp();
- String _name_2 = _spp.getName();
- String _operator_plus_4 = StringExtensions.operator_plus("IFITEM_", _name_2);
- SPPRef _spp_1 = svc.getSpp();
- int _interfaceItemLocalId_2 = xpac.getInterfaceItemLocalId(_spp_1);
- int _operator_plus_5 = IntegerExtensions.operator_plus(((Integer)1), ((Integer)_interfaceItemLocalId_2));
- String _string_2 = ((Integer)_operator_plus_5).toString();
- Pair<String,String> _pair_2 = Tuples.<String, String>pair(_operator_plus_4, _string_2);
- list.add(_pair_2);
- }
- String _genEnumeration = this.langExt.genEnumeration("interface_items", list);
- return _genEnumeration;
+ List<Port> _xifexpression = null;
+ boolean _usesInheritance = this.langExt.usesInheritance();
+ if (_usesInheritance) {
+ List<Port> _endPorts = this.roomExt.getEndPorts(ac);
+ _xifexpression = _endPorts;
+ } else {
+ List<Port> _allEndPorts = this.roomExt.getAllEndPorts(ac);
+ _xifexpression = _allEndPorts;
+ }
+ List<Port> endPorts = _xifexpression;
+ List<SAPRef> _xifexpression_1 = null;
+ boolean _usesInheritance_1 = this.langExt.usesInheritance();
+ if (_usesInheritance_1) {
+ EList<SAPRef> _strSAPs = ac.getStrSAPs();
+ _xifexpression_1 = _strSAPs;
+ } else {
+ List<SAPRef> _allSAPs = this.roomExt.getAllSAPs(ac);
+ _xifexpression_1 = _allSAPs;
+ }
+ List<SAPRef> strSAPs = _xifexpression_1;
+ List<ServiceImplementation> _xifexpression_2 = null;
+ boolean _usesInheritance_2 = this.langExt.usesInheritance();
+ if (_usesInheritance_2) {
+ EList<ServiceImplementation> _serviceImplementations = ac.getServiceImplementations();
+ _xifexpression_2 = _serviceImplementations;
+ } else {
+ List<ServiceImplementation> _allServiceImplementations = this.roomExt.getAllServiceImplementations(ac);
+ _xifexpression_2 = _allServiceImplementations;
+ }
+ List<ServiceImplementation> svcImpls = _xifexpression_2;
+ ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
+ ArrayList<Pair<String,String>> list = _arrayList;
+ for (final Port ep : endPorts) {
+ String _name = ep.getName();
+ String _plus = ("IFITEM_" + _name);
+ int _interfaceItemLocalId = xpac.getInterfaceItemLocalId(ep);
+ int _plus_1 = (1 + _interfaceItemLocalId);
+ String _string = Integer.valueOf(_plus_1).toString();
+ Pair<String,String> _pair = Tuples.<String, String>pair(_plus, _string);
+ list.add(_pair);
+ }
+ for (final SAPRef sap : strSAPs) {
+ String _name_1 = sap.getName();
+ String _plus_2 = ("IFITEM_" + _name_1);
+ int _interfaceItemLocalId_1 = xpac.getInterfaceItemLocalId(sap);
+ int _plus_3 = (1 + _interfaceItemLocalId_1);
+ String _string_1 = Integer.valueOf(_plus_3).toString();
+ Pair<String,String> _pair_1 = Tuples.<String, String>pair(_plus_2, _string_1);
+ list.add(_pair_1);
+ }
+ for (final ServiceImplementation svc : svcImpls) {
+ SPPRef _spp = svc.getSpp();
+ String _name_2 = _spp.getName();
+ String _plus_4 = ("IFITEM_" + _name_2);
+ SPPRef _spp_1 = svc.getSpp();
+ int _interfaceItemLocalId_2 = xpac.getInterfaceItemLocalId(_spp_1);
+ int _plus_5 = (1 + _interfaceItemLocalId_2);
+ String _string_2 = Integer.valueOf(_plus_5).toString();
+ Pair<String,String> _pair_2 = Tuples.<String, String>pair(_plus_4, _string_2);
+ list.add(_pair_2);
+ }
+ return this.langExt.genEnumeration("interface_items", list);
}
}
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericProtocolClassGenerator.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericProtocolClassGenerator.java
index a5f0de1db..66a2003d5 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericProtocolClassGenerator.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericProtocolClassGenerator.java
@@ -15,8 +15,6 @@ import org.eclipse.etrice.generator.generic.ILanguageExtension;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.xtext.util.Pair;
import org.eclipse.xtext.util.Tuples;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
@SuppressWarnings("all")
public class GenericProtocolClassGenerator {
@@ -27,106 +25,95 @@ public class GenericProtocolClassGenerator {
private RoomExtensions roomExt;
public String genMessageIDs(final ProtocolClass pc) {
- int offset = 0;
- ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
- ArrayList<Pair<String,String>> list = _arrayList;
- String _name = pc.getName();
- String _memberInDeclaration = this.langExt.memberInDeclaration(_name, "MSG_MIN");
- String _string = ((Integer)offset).toString();
- Pair<String,String> _pair = Tuples.<String, String>pair(_memberInDeclaration, _string);
- list.add(_pair);
- List<Message> _allOutgoingMessages = this.roomExt.getAllOutgoingMessages(pc);
- for (final Message msg : _allOutgoingMessages) {
- {
- int _operator_plus = IntegerExtensions.operator_plus(((Integer)offset), ((Integer)1));
- offset = _operator_plus;
- String _name_1 = pc.getName();
- String _name_2 = msg.getName();
- String _operator_plus_1 = StringExtensions.operator_plus("OUT_", _name_2);
- String _memberInDeclaration_1 = this.langExt.memberInDeclaration(_name_1, _operator_plus_1);
- String _string_1 = ((Integer)offset).toString();
- Pair<String,String> _pair_1 = Tuples.<String, String>pair(_memberInDeclaration_1, _string_1);
- list.add(_pair_1);
- }
+ int offset = 0;
+ ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
+ ArrayList<Pair<String,String>> list = _arrayList;
+ String _name = pc.getName();
+ String _memberInDeclaration = this.langExt.memberInDeclaration(_name, "MSG_MIN");
+ String _string = Integer.valueOf(offset).toString();
+ Pair<String,String> _pair = Tuples.<String, String>pair(_memberInDeclaration, _string);
+ list.add(_pair);
+ List<Message> _allOutgoingMessages = this.roomExt.getAllOutgoingMessages(pc);
+ for (final Message msg : _allOutgoingMessages) {
+ {
+ int _plus = (offset + 1);
+ offset = _plus;
+ String _name_1 = pc.getName();
+ String _name_2 = msg.getName();
+ String _plus_1 = ("OUT_" + _name_2);
+ String _memberInDeclaration_1 = this.langExt.memberInDeclaration(_name_1, _plus_1);
+ String _string_1 = Integer.valueOf(offset).toString();
+ Pair<String,String> _pair_1 = Tuples.<String, String>pair(_memberInDeclaration_1, _string_1);
+ list.add(_pair_1);
}
- List<Message> _allIncomingMessages = this.roomExt.getAllIncomingMessages(pc);
- for (final Message msg_1 : _allIncomingMessages) {
- {
- int _operator_plus_2 = IntegerExtensions.operator_plus(((Integer)offset), ((Integer)1));
- offset = _operator_plus_2;
- String _name_3 = pc.getName();
- String _name_4 = msg_1.getName();
- String _operator_plus_3 = StringExtensions.operator_plus("IN_", _name_4);
- String _memberInDeclaration_2 = this.langExt.memberInDeclaration(_name_3, _operator_plus_3);
- String _string_2 = ((Integer)offset).toString();
- Pair<String,String> _pair_2 = Tuples.<String, String>pair(_memberInDeclaration_2, _string_2);
- list.add(_pair_2);
- }
+ }
+ List<Message> _allIncomingMessages = this.roomExt.getAllIncomingMessages(pc);
+ for (final Message msg_1 : _allIncomingMessages) {
+ {
+ int _plus = (offset + 1);
+ offset = _plus;
+ String _name_1 = pc.getName();
+ String _name_2 = msg_1.getName();
+ String _plus_1 = ("IN_" + _name_2);
+ String _memberInDeclaration_1 = this.langExt.memberInDeclaration(_name_1, _plus_1);
+ String _string_1 = Integer.valueOf(offset).toString();
+ Pair<String,String> _pair_1 = Tuples.<String, String>pair(_memberInDeclaration_1, _string_1);
+ list.add(_pair_1);
}
- int _operator_plus_4 = IntegerExtensions.operator_plus(((Integer)offset), ((Integer)1));
- offset = _operator_plus_4;
- String _name_5 = pc.getName();
- String _memberInDeclaration_3 = this.langExt.memberInDeclaration(_name_5, "MSG_MAX");
- String _string_3 = ((Integer)offset).toString();
- Pair<String,String> _pair_3 = Tuples.<String, String>pair(_memberInDeclaration_3, _string_3);
- list.add(_pair_3);
- String _name_6 = pc.getName();
- String _memberInDeclaration_4 = this.langExt.memberInDeclaration(_name_6, "msg_ids");
- String _genEnumeration = this.langExt.genEnumeration(_memberInDeclaration_4, list);
- return _genEnumeration;
+ }
+ int _plus = (offset + 1);
+ offset = _plus;
+ String _name_1 = pc.getName();
+ String _memberInDeclaration_1 = this.langExt.memberInDeclaration(_name_1, "MSG_MAX");
+ String _string_1 = Integer.valueOf(offset).toString();
+ Pair<String,String> _pair_1 = Tuples.<String, String>pair(_memberInDeclaration_1, _string_1);
+ list.add(_pair_1);
+ String _name_2 = pc.getName();
+ String _memberInDeclaration_2 = this.langExt.memberInDeclaration(_name_2, "msg_ids");
+ return this.langExt.genEnumeration(_memberInDeclaration_2, list);
}
public String getMessageID(final MessageFromIf mif) {
Message _message = mif.getMessage();
InterfaceItem _from = mif.getFrom();
- String _messageID = this.getMessageID(_message, _from);
- return _messageID;
+ return this.getMessageID(_message, _from);
}
public String getMessageID(final Message msg, final InterfaceItem item) {
- if ((item instanceof Port)) {
- {
- Port p = ((Port) item);
- String _xifexpression = null;
- boolean _isConjugated = p.isConjugated();
- if (_isConjugated) {
- _xifexpression = "OUT_";
- } else {
- _xifexpression = "IN_";
- }
- String direction = _xifexpression;
- GeneralProtocolClass _protocol = p.getProtocol();
- String _name = _protocol.getName();
- String _name_1 = msg.getName();
- String _operator_plus = StringExtensions.operator_plus(direction, _name_1);
- String _memberInUse = this.langExt.memberInUse(_name, _operator_plus);
- return _memberInUse;
- }
+ if ((item instanceof Port)) {
+ Port p = ((Port) item);
+ String _xifexpression = null;
+ boolean _isConjugated = p.isConjugated();
+ if (_isConjugated) {
+ _xifexpression = "OUT_";
+ } else {
+ _xifexpression = "IN_";
+ }
+ String direction = _xifexpression;
+ GeneralProtocolClass _protocol = p.getProtocol();
+ String _name = _protocol.getName();
+ String _name_1 = msg.getName();
+ String _plus = (direction + _name_1);
+ return this.langExt.memberInUse(_name, _plus);
+ } else {
+ if ((item instanceof SAPRef)) {
+ SAPRef sap = ((SAPRef) item);
+ ProtocolClass _protocol_1 = sap.getProtocol();
+ String _name_2 = _protocol_1.getName();
+ String _name_3 = msg.getName();
+ String _plus_1 = ("OUT_" + _name_3);
+ return this.langExt.memberInUse(_name_2, _plus_1);
} else {
- if ((item instanceof SAPRef)) {
- {
- SAPRef sap = ((SAPRef) item);
- ProtocolClass _protocol_1 = sap.getProtocol();
- String _name_2 = _protocol_1.getName();
- String _name_3 = msg.getName();
- String _operator_plus_1 = StringExtensions.operator_plus("OUT_", _name_3);
- String _memberInUse_1 = this.langExt.memberInUse(_name_2, _operator_plus_1);
- return _memberInUse_1;
- }
- } else {
- if ((item instanceof SPPRef)) {
- {
- SPPRef spp = ((SPPRef) item);
- ProtocolClass _protocol_2 = spp.getProtocol();
- String _name_4 = _protocol_2.getName();
- String _name_5 = msg.getName();
- String _operator_plus_2 = StringExtensions.operator_plus("IN_", _name_5);
- String _memberInUse_2 = this.langExt.memberInUse(_name_4, _operator_plus_2);
- return _memberInUse_2;
- }
- }
+ if ((item instanceof SPPRef)) {
+ SPPRef spp = ((SPPRef) item);
+ ProtocolClass _protocol_2 = spp.getProtocol();
+ String _name_4 = _protocol_2.getName();
+ String _name_5 = msg.getName();
+ String _plus_2 = ("IN_" + _name_5);
+ return this.langExt.memberInUse(_name_4, _plus_2);
}
}
- return "unknown interface item";
+ }
+ return "unknown interface item";
}
}
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java
index 2e212f3a5..4db22d8e6 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java
@@ -1,7 +1,9 @@
package org.eclipse.etrice.generator.generic;
+import com.google.common.base.Objects;
import com.google.inject.Inject;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
@@ -29,15 +31,11 @@ import org.eclipse.etrice.generator.generic.AbstractTransitionChainGenerator;
import org.eclipse.etrice.generator.generic.GenericProtocolClassGenerator;
import org.eclipse.etrice.generator.generic.ILanguageExtension;
import org.eclipse.etrice.generator.generic.RoomExtensions;
+import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.util.Pair;
import org.eclipse.xtext.util.Tuples;
-import org.eclipse.xtext.xbase.lib.BooleanExtensions;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.ObjectExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.eclipse.xtext.xtend2.lib.StringConcatenation;
@SuppressWarnings("all")
public class GenericStateMachineGenerator {
@@ -57,147 +55,136 @@ public class GenericStateMachineGenerator {
protected ITranslationProvider translator;
private String genStateIdConstants(final ExpandedActorClass xpac, final ActorClass ac) {
- int _xifexpression = (int) 0;
- boolean _usesInheritance = this.langExt.usesInheritance();
- if (_usesInheritance) {
- int _numberOfInheritedBaseStates = this.roomExt.getNumberOfInheritedBaseStates(ac);
- _xifexpression = _numberOfInheritedBaseStates;
- } else {
- _xifexpression = 0;
- }
- int _operator_plus = IntegerExtensions.operator_plus(((Integer)2), ((Integer)_xifexpression));
- int offset = _operator_plus;
- List<State> _xifexpression_1 = null;
- boolean _usesInheritance_1 = this.langExt.usesInheritance();
- if (_usesInheritance_1) {
- StateGraph _stateMachine = ac.getStateMachine();
- List<State> _baseStateList = this.roomExt.getBaseStateList(_stateMachine);
- _xifexpression_1 = _baseStateList;
- } else {
- StateGraph _stateMachine_1 = xpac.getStateMachine();
- List<State> _baseStateList_1 = this.roomExt.getBaseStateList(_stateMachine_1);
- _xifexpression_1 = _baseStateList_1;
- }
- List<State> baseStates = _xifexpression_1;
- ArrayList<State> _leafStatesLast = this.roomExt.getLeafStatesLast(baseStates);
- baseStates = _leafStatesLast;
- ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
- ArrayList<Pair<String,String>> list = _arrayList;
- boolean _usesInheritance_2 = this.langExt.usesInheritance();
- boolean _operator_not = BooleanExtensions.operator_not(_usesInheritance_2);
- if (_operator_not) {
- {
- Pair<String,String> _pair = Tuples.<String, String>pair("NO_STATE", "0");
- list.add(_pair);
- Pair<String,String> _pair_1 = Tuples.<String, String>pair("STATE_TOP", "1");
- list.add(_pair_1);
- }
- }
- for (final State state : baseStates) {
- {
- String _stateId = this.roomExt.getStateId(state);
- String _string = ((Integer)offset).toString();
- Pair<String,String> _pair_2 = Tuples.<String, String>pair(_stateId, _string);
- list.add(_pair_2);
- int _operator_plus_1 = IntegerExtensions.operator_plus(((Integer)offset), ((Integer)1));
- offset = _operator_plus_1;
- }
+ int _xifexpression = (int) 0;
+ boolean _usesInheritance = this.langExt.usesInheritance();
+ if (_usesInheritance) {
+ int _numberOfInheritedBaseStates = this.roomExt.getNumberOfInheritedBaseStates(ac);
+ _xifexpression = _numberOfInheritedBaseStates;
+ } else {
+ _xifexpression = 0;
+ }
+ int offset = (2 + _xifexpression);
+ List<State> _xifexpression_1 = null;
+ boolean _usesInheritance_1 = this.langExt.usesInheritance();
+ if (_usesInheritance_1) {
+ StateGraph _stateMachine = ac.getStateMachine();
+ List<State> _baseStateList = this.roomExt.getBaseStateList(_stateMachine);
+ _xifexpression_1 = _baseStateList;
+ } else {
+ StateGraph _stateMachine_1 = xpac.getStateMachine();
+ List<State> _baseStateList_1 = this.roomExt.getBaseStateList(_stateMachine_1);
+ _xifexpression_1 = _baseStateList_1;
+ }
+ List<State> baseStates = _xifexpression_1;
+ ArrayList<State> _leafStatesLast = this.roomExt.getLeafStatesLast(baseStates);
+ baseStates = _leafStatesLast;
+ ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
+ ArrayList<Pair<String,String>> list = _arrayList;
+ boolean _usesInheritance_2 = this.langExt.usesInheritance();
+ boolean _not = (!_usesInheritance_2);
+ if (_not) {
+ Pair<String,String> _pair = Tuples.<String, String>pair("NO_STATE", "0");
+ list.add(_pair);
+ Pair<String,String> _pair_1 = Tuples.<String, String>pair("STATE_TOP", "1");
+ list.add(_pair_1);
+ }
+ for (final State state : baseStates) {
+ {
+ String _stateId = this.roomExt.getStateId(state);
+ String _string = Integer.valueOf(offset).toString();
+ Pair<String,String> _pair_2 = Tuples.<String, String>pair(_stateId, _string);
+ list.add(_pair_2);
+ int _plus = (offset + 1);
+ offset = _plus;
}
- String _genEnumeration = this.langExt.genEnumeration("state_ids", list);
- return _genEnumeration;
+ }
+ return this.langExt.genEnumeration("state_ids", list);
}
private String genTransitionChainConstants(final ExpandedActorClass xpac, final ActorClass ac) {
- EList<TransitionChain> _xifexpression = null;
- boolean _usesInheritance = this.langExt.usesInheritance();
- if (_usesInheritance) {
- EList<TransitionChain> _ownTransitionChains = xpac.getOwnTransitionChains();
- _xifexpression = _ownTransitionChains;
- } else {
- EList<TransitionChain> _transitionChains = xpac.getTransitionChains();
- _xifexpression = _transitionChains;
- }
- EList<TransitionChain> chains = _xifexpression;
- int _xifexpression_1 = (int) 0;
- boolean _usesInheritance_1 = this.langExt.usesInheritance();
- if (_usesInheritance_1) {
- EList<TransitionChain> _transitionChains_1 = xpac.getTransitionChains();
- int _size = _transitionChains_1.size();
- int _size_1 = chains.size();
- int _operator_minus = IntegerExtensions.operator_minus(((Integer)_size), ((Integer)_size_1));
- _xifexpression_1 = _operator_minus;
- } else {
- _xifexpression_1 = 0;
- }
- int offset = _xifexpression_1;
- ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
- ArrayList<Pair<String,String>> list = _arrayList;
- for (final TransitionChain chain : chains) {
- {
- int _operator_plus = IntegerExtensions.operator_plus(((Integer)offset), ((Integer)1));
- offset = _operator_plus;
- String _chainId = this.roomExt.getChainId(chain);
- String _string = ((Integer)offset).toString();
- Pair<String,String> _pair = Tuples.<String, String>pair(_chainId, _string);
- list.add(_pair);
- }
+ EList<TransitionChain> _xifexpression = null;
+ boolean _usesInheritance = this.langExt.usesInheritance();
+ if (_usesInheritance) {
+ EList<TransitionChain> _ownTransitionChains = xpac.getOwnTransitionChains();
+ _xifexpression = _ownTransitionChains;
+ } else {
+ EList<TransitionChain> _transitionChains = xpac.getTransitionChains();
+ _xifexpression = _transitionChains;
+ }
+ EList<TransitionChain> chains = _xifexpression;
+ int _xifexpression_1 = (int) 0;
+ boolean _usesInheritance_1 = this.langExt.usesInheritance();
+ if (_usesInheritance_1) {
+ EList<TransitionChain> _transitionChains_1 = xpac.getTransitionChains();
+ int _size = _transitionChains_1.size();
+ int _size_1 = chains.size();
+ int _minus = (_size - _size_1);
+ _xifexpression_1 = _minus;
+ } else {
+ _xifexpression_1 = 0;
+ }
+ int offset = _xifexpression_1;
+ ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
+ ArrayList<Pair<String,String>> list = _arrayList;
+ for (final TransitionChain chain : chains) {
+ {
+ int _plus = (offset + 1);
+ offset = _plus;
+ String _chainId = this.roomExt.getChainId(chain);
+ String _string = Integer.valueOf(offset).toString();
+ Pair<String,String> _pair = Tuples.<String, String>pair(_chainId, _string);
+ list.add(_pair);
}
- String _genEnumeration = this.langExt.genEnumeration("chain_ids", list);
- return _genEnumeration;
+ }
+ return this.langExt.genEnumeration("chain_ids", list);
}
private String genTriggerConstants(final ExpandedActorClass xpac, final ActorClass ac) {
- EList<MessageFromIf> _xifexpression = null;
- boolean _usesInheritance = this.langExt.usesInheritance();
- if (_usesInheritance) {
- EList<MessageFromIf> _ownTriggers = xpac.getOwnTriggers();
- _xifexpression = _ownTriggers;
- } else {
- EList<MessageFromIf> _triggers = xpac.getTriggers();
- _xifexpression = _triggers;
- }
- EList<MessageFromIf> triggers = _xifexpression;
- ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
- ArrayList<Pair<String,String>> list = _arrayList;
- Pair<String,String> _pair = Tuples.<String, String>pair("POLLING", "0");
- list.add(_pair);
- for (final MessageFromIf mif : triggers) {
- String _triggerCodeName = xpac.getTriggerCodeName(mif);
- InterfaceItem _from = mif.getFrom();
- String _name = _from.getName();
- String _operator_plus = StringExtensions.operator_plus("IFITEM_", _name);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, " + EVT_SHIFT*");
- String _messageID = this.pcGen.getMessageID(mif);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, _messageID);
- Pair<String,String> _pair_1 = Tuples.<String, String>pair(_triggerCodeName, _operator_plus_2);
- list.add(_pair_1);
- }
- String _genEnumeration = this.langExt.genEnumeration("triggers", list);
- return _genEnumeration;
+ EList<MessageFromIf> _xifexpression = null;
+ boolean _usesInheritance = this.langExt.usesInheritance();
+ if (_usesInheritance) {
+ EList<MessageFromIf> _ownTriggers = xpac.getOwnTriggers();
+ _xifexpression = _ownTriggers;
+ } else {
+ EList<MessageFromIf> _triggers = xpac.getTriggers();
+ _xifexpression = _triggers;
+ }
+ EList<MessageFromIf> triggers = _xifexpression;
+ ArrayList<Pair<String,String>> _arrayList = new ArrayList<Pair<String,String>>();
+ ArrayList<Pair<String,String>> list = _arrayList;
+ Pair<String,String> _pair = Tuples.<String, String>pair("POLLING", "0");
+ list.add(_pair);
+ for (final MessageFromIf mif : triggers) {
+ String _triggerCodeName = xpac.getTriggerCodeName(mif);
+ InterfaceItem _from = mif.getFrom();
+ String _name = _from.getName();
+ String _plus = ("IFITEM_" + _name);
+ String _plus_1 = (_plus + " + EVT_SHIFT*");
+ String _messageID = this.pcGen.getMessageID(mif);
+ String _plus_2 = (_plus_1 + _messageID);
+ Pair<String,String> _pair_1 = Tuples.<String, String>pair(_triggerCodeName, _plus_2);
+ list.add(_pair_1);
+ }
+ return this.langExt.genEnumeration("triggers", list);
}
- public StringConcatenation genStateMachine(final ExpandedActorClass xpac, final ActorClass ac) {
- StringConcatenation _xblockexpression = null;
+ public CharSequence genStateMachine(final ExpandedActorClass xpac, final ActorClass ac) {
+ CharSequence _xblockexpression = null;
{
this.translator.setActorClass(ac);
DetailCodeTranslator _detailCodeTranslator = new DetailCodeTranslator(ac, this.translator);
DetailCodeTranslator dct = _detailCodeTranslator;
ActorCommunicationType _commType = ac.getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, ActorCommunicationType.ASYNCHRONOUS);
- boolean async = _operator_equals;
+ boolean async = Objects.equal(_commType, ActorCommunicationType.ASYNCHRONOUS);
ActorCommunicationType _commType_1 = ac.getCommType();
- boolean _operator_equals_1 = ObjectExtensions.operator_equals(_commType_1, ActorCommunicationType.EVENT_DRIVEN);
- boolean eventDriven = _operator_equals_1;
- ActorCommunicationType _commType_2 = ac.getCommType();
- boolean _operator_equals_2 = ObjectExtensions.operator_equals(_commType_2, ActorCommunicationType.DATA_DRIVEN);
- boolean dataDriven = _operator_equals_2;
- boolean _operator_or = false;
+ boolean eventDriven = Objects.equal(_commType_1, ActorCommunicationType.EVENT_DRIVEN);
+ boolean _or = false;
if (async) {
- _operator_or = true;
+ _or = true;
} else {
- _operator_or = BooleanExtensions.operator_or(async, eventDriven);
+ _or = (async || eventDriven);
}
- boolean handleEvents = _operator_or;
+ boolean handleEvents = _or;
StringConcatenation _builder = new StringConcatenation();
_builder.newLine();
_builder.append("/* state IDs */");
@@ -218,7 +205,7 @@ public class GenericStateMachineGenerator {
_builder.append(_genTriggerConstants, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
- StringConcatenation _genExtra = this.genExtra(xpac, ac);
+ CharSequence _genExtra = this.genExtra(xpac, ac);
_builder.append(_genExtra, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -229,16 +216,16 @@ public class GenericStateMachineGenerator {
List<State> _stateList = this.roomExt.getStateList(_stateMachine);
for(final State state : _stateList) {
{
- boolean _operator_or_1 = false;
+ boolean _or_1 = false;
boolean _usesInheritance = this.langExt.usesInheritance();
- boolean _operator_not = BooleanExtensions.operator_not(_usesInheritance);
- if (_operator_not) {
- _operator_or_1 = true;
+ boolean _not = (!_usesInheritance);
+ if (_not) {
+ _or_1 = true;
} else {
boolean _isOwnObject = xpac.isOwnObject(state);
- _operator_or_1 = BooleanExtensions.operator_or(_operator_not, _isOwnObject);
+ _or_1 = (_not || _isOwnObject);
}
- if (_operator_or_1) {
+ if (_or_1) {
{
boolean _hasEntryCode = this.roomExt.hasEntryCode(state);
if (_hasEntryCode) {
@@ -315,27 +302,26 @@ public class GenericStateMachineGenerator {
List<Transition> _transitionList = this.roomExt.getTransitionList(_stateMachine_1);
for(final Transition tr : _transitionList) {
{
- boolean _operator_and = false;
+ boolean _and = false;
boolean _isOwnObject_1 = xpac.isOwnObject(tr);
if (!_isOwnObject_1) {
- _operator_and = false;
+ _and = false;
} else {
boolean _hasActionCode = this.roomExt.hasActionCode(tr);
- _operator_and = BooleanExtensions.operator_and(_isOwnObject_1, _hasActionCode);
+ _and = (_isOwnObject_1 && _hasActionCode);
}
- if (_operator_and) {
+ if (_and) {
TransitionChain _chain = xpac.getChain(tr);
- Transition _transition = _chain.getTransition();
- Transition start = _transition;
+ Transition start = _chain.getTransition();
_builder.newLineIfNotEmpty();
- boolean _operator_and_1 = false;
+ boolean _and_1 = false;
if (!(start instanceof NonInitialTransition)) {
- _operator_and_1 = false;
+ _and_1 = false;
} else {
- boolean _operator_not_1 = BooleanExtensions.operator_not((start instanceof GuardedTransition));
- _operator_and_1 = BooleanExtensions.operator_and((start instanceof NonInitialTransition), _operator_not_1);
+ boolean _not_1 = (!(start instanceof GuardedTransition));
+ _and_1 = ((start instanceof NonInitialTransition) && _not_1);
}
- boolean hasArgs = _operator_and_1;
+ boolean hasArgs = _and_1;
_builder.newLineIfNotEmpty();
String _accessLevelProtected_2 = this.langExt.accessLevelProtected();
_builder.append(_accessLevelProtected_2, "");
@@ -500,8 +486,7 @@ public class GenericStateMachineGenerator {
_builder.append("switch (chain) {");
_builder.newLine();
_builder.append("\t\t");
- EList<TransitionChain> _transitionChains = xpac.getTransitionChains();
- EList<TransitionChain> allchains = _transitionChains;
+ EList<TransitionChain> allchains = xpac.getTransitionChains();
_builder.newLineIfNotEmpty();
{
for(final TransitionChain tc : allchains) {
@@ -633,8 +618,7 @@ public class GenericStateMachineGenerator {
_builder.append("\t");
_builder.append("\t");
StateGraph _subgraph_1 = state_2.getSubgraph();
- Transition _initTransition = this.roomExt.getInitTransition(_subgraph_1);
- Transition sub_initt = _initTransition;
+ Transition sub_initt = this.roomExt.getInitTransition(_subgraph_1);
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t");
_builder.append("\t");
@@ -753,8 +737,7 @@ public class GenericStateMachineGenerator {
_builder.newLineIfNotEmpty();
_builder.append("\t");
StateGraph _stateMachine_4 = xpac.getStateMachine();
- Transition _initTransition_1 = this.roomExt.getInitTransition(_stateMachine_4);
- Transition initt = _initTransition_1;
+ Transition initt = this.roomExt.getInitTransition(_stateMachine_4);
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("int chain = ");
@@ -888,7 +871,7 @@ public class GenericStateMachineGenerator {
_builder.newLine();
_builder.append("\t");
_builder.append("\t");
- StringConcatenation _genStateSwitch = this.genStateSwitch(xpac, dct);
+ CharSequence _genStateSwitch = this.genStateSwitch(xpac, dct);
_builder.append(_genStateSwitch, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -896,7 +879,7 @@ public class GenericStateMachineGenerator {
_builder.newLine();
} else {
_builder.append("\t");
- StringConcatenation _genStateSwitch_1 = this.genStateSwitch(xpac, dct);
+ CharSequence _genStateSwitch_1 = this.genStateSwitch(xpac, dct);
_builder.append(_genStateSwitch_1, " ");
_builder.newLineIfNotEmpty();
}
@@ -954,28 +937,18 @@ public class GenericStateMachineGenerator {
return _xblockexpression;
}
- private StringConcatenation genStateSwitch(final ExpandedActorClass xpac, final DetailCodeTranslator dct) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence genStateSwitch(final ExpandedActorClass xpac, final DetailCodeTranslator dct) {
+ CharSequence _xblockexpression = null;
{
ActorClass _actorClass = xpac.getActorClass();
ActorCommunicationType _commType = _actorClass.getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, ActorCommunicationType.ASYNCHRONOUS);
- boolean async = _operator_equals;
+ boolean async = Objects.equal(_commType, ActorCommunicationType.ASYNCHRONOUS);
ActorClass _actorClass_1 = xpac.getActorClass();
ActorCommunicationType _commType_1 = _actorClass_1.getCommType();
- boolean _operator_equals_1 = ObjectExtensions.operator_equals(_commType_1, ActorCommunicationType.EVENT_DRIVEN);
- boolean eventDriven = _operator_equals_1;
+ boolean eventDriven = Objects.equal(_commType_1, ActorCommunicationType.EVENT_DRIVEN);
ActorClass _actorClass_2 = xpac.getActorClass();
ActorCommunicationType _commType_2 = _actorClass_2.getCommType();
- boolean _operator_equals_2 = ObjectExtensions.operator_equals(_commType_2, ActorCommunicationType.DATA_DRIVEN);
- boolean dataDriven = _operator_equals_2;
- boolean _operator_or = false;
- if (async) {
- _operator_or = true;
- } else {
- _operator_or = BooleanExtensions.operator_or(async, eventDriven);
- }
- boolean handleEvents = _operator_or;
+ boolean dataDriven = Objects.equal(_commType_2, ActorCommunicationType.DATA_DRIVEN);
StringConcatenation _builder = new StringConcatenation();
_builder.append("switch (");
String _memberAccess = this.langExt.memberAccess();
@@ -996,13 +969,12 @@ public class GenericStateMachineGenerator {
if (async) {
_builder.append("\t");
_builder.append("\t");
- EList<ActiveTrigger> _activeTriggers = xpac.getActiveTriggers(state);
- EList<ActiveTrigger> atlist = _activeTriggers;
+ EList<ActiveTrigger> atlist = xpac.getActiveTriggers(state);
_builder.newLineIfNotEmpty();
{
boolean _isEmpty = atlist.isEmpty();
- boolean _operator_not = BooleanExtensions.operator_not(_isEmpty);
- if (_operator_not) {
+ boolean _not = (!_isEmpty);
+ if (_not) {
_builder.append("\t");
_builder.append("\t");
_builder.append("switch(trigger) {");
@@ -1014,7 +986,7 @@ public class GenericStateMachineGenerator {
_builder.append("\t");
_builder.append("\t");
_builder.append("\t");
- StringConcatenation _genDataDrivenTriggers = this.genDataDrivenTriggers(xpac, state, dct);
+ CharSequence _genDataDrivenTriggers = this.genDataDrivenTriggers(xpac, state, dct);
_builder.append(_genDataDrivenTriggers, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -1025,7 +997,7 @@ public class GenericStateMachineGenerator {
_builder.append("\t");
_builder.append("\t");
_builder.append("\t");
- StringConcatenation _genEventDrivenTriggers = this.genEventDrivenTriggers(xpac, state, atlist, dct);
+ CharSequence _genEventDrivenTriggers = this.genEventDrivenTriggers(xpac, state, atlist, dct);
_builder.append(_genEventDrivenTriggers, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -1035,7 +1007,7 @@ public class GenericStateMachineGenerator {
} else {
_builder.append("\t");
_builder.append("\t");
- StringConcatenation _genDataDrivenTriggers_1 = this.genDataDrivenTriggers(xpac, state, dct);
+ CharSequence _genDataDrivenTriggers_1 = this.genDataDrivenTriggers(xpac, state, dct);
_builder.append(_genDataDrivenTriggers_1, " ");
_builder.newLineIfNotEmpty();
}
@@ -1044,20 +1016,19 @@ public class GenericStateMachineGenerator {
if (dataDriven) {
_builder.append("\t");
_builder.append("\t");
- StringConcatenation _genDataDrivenTriggers_2 = this.genDataDrivenTriggers(xpac, state, dct);
+ CharSequence _genDataDrivenTriggers_2 = this.genDataDrivenTriggers(xpac, state, dct);
_builder.append(_genDataDrivenTriggers_2, " ");
_builder.newLineIfNotEmpty();
} else {
if (eventDriven) {
_builder.append("\t");
_builder.append("\t");
- EList<ActiveTrigger> _activeTriggers_1 = xpac.getActiveTriggers(state);
- EList<ActiveTrigger> atlist_1 = _activeTriggers_1;
+ EList<ActiveTrigger> atlist_1 = xpac.getActiveTriggers(state);
_builder.newLineIfNotEmpty();
{
boolean _isEmpty_1 = atlist_1.isEmpty();
- boolean _operator_not_1 = BooleanExtensions.operator_not(_isEmpty_1);
- if (_operator_not_1) {
+ boolean _not_1 = (!_isEmpty_1);
+ if (_not_1) {
_builder.append("\t");
_builder.append("\t");
_builder.append("switch(trigger) {");
@@ -1065,7 +1036,7 @@ public class GenericStateMachineGenerator {
_builder.append("\t");
_builder.append("\t");
_builder.append("\t");
- StringConcatenation _genEventDrivenTriggers_1 = this.genEventDrivenTriggers(xpac, state, atlist_1, dct);
+ CharSequence _genEventDrivenTriggers_1 = this.genEventDrivenTriggers(xpac, state, atlist_1, dct);
_builder.append(_genEventDrivenTriggers_1, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -1091,19 +1062,18 @@ public class GenericStateMachineGenerator {
return _xblockexpression;
}
- private StringConcatenation genDataDrivenTriggers(final ExpandedActorClass xpac, final State state, final DetailCodeTranslator dct) {
+ private CharSequence genDataDrivenTriggers(final ExpandedActorClass xpac, final State state, final DetailCodeTranslator dct) {
StringConcatenation _builder = new StringConcatenation();
- StringConcatenation _genDoCodes = this.genDoCodes(state);
+ CharSequence _genDoCodes = this.genDoCodes(state);
_builder.append(_genDoCodes, "");
_builder.newLineIfNotEmpty();
List<Transition> _outgoingTransitionsHierarchical = this.roomExt.getOutgoingTransitionsHierarchical(xpac, state);
final Function1<Transition,Boolean> _function = new Function1<Transition,Boolean>() {
public Boolean apply(final Transition t) {
- return ((Boolean)(t instanceof GuardedTransition));
+ return Boolean.valueOf((t instanceof GuardedTransition));
}
};
- Iterable<Transition> _filter = IterableExtensions.<Transition>filter(_outgoingTransitionsHierarchical, _function);
- Iterable<Transition> transitions = _filter;
+ Iterable<Transition> transitions = IterableExtensions.<Transition>filter(_outgoingTransitionsHierarchical, _function);
_builder.newLineIfNotEmpty();
{
for(final Transition tr : transitions) {
@@ -1116,8 +1086,7 @@ public class GenericStateMachineGenerator {
_builder.append("{");
_builder.newLine();
_builder.append("\t");
- TransitionChain _chain = xpac.getChain(tr);
- TransitionChain chain = _chain;
+ TransitionChain chain = xpac.getChain(tr);
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("chain = ");
@@ -1151,8 +1120,8 @@ public class GenericStateMachineGenerator {
_builder.newLine();
{
Transition _last = IterableExtensions.<Transition>last(transitions);
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(tr, _last);
- if (_operator_notEquals) {
+ boolean _notEquals = (!Objects.equal(tr, _last));
+ if (_notEquals) {
_builder.append("else ");
_builder.newLine();
}
@@ -1162,7 +1131,7 @@ public class GenericStateMachineGenerator {
return _builder;
}
- private StringConcatenation genEventDrivenTriggers(final ExpandedActorClass xpac, final State state, final List<ActiveTrigger> atlist, final DetailCodeTranslator dct) {
+ private CharSequence genEventDrivenTriggers(final ExpandedActorClass xpac, final State state, final List<ActiveTrigger> atlist, final DetailCodeTranslator dct) {
StringConcatenation _builder = new StringConcatenation();
{
for(final ActiveTrigger at : atlist) {
@@ -1173,8 +1142,7 @@ public class GenericStateMachineGenerator {
_builder.append(":");
_builder.newLineIfNotEmpty();
_builder.append("\t");
- boolean _hasGuard = this.roomExt.hasGuard(xpac, at);
- boolean needData = _hasGuard;
+ boolean needData = this.roomExt.hasGuard(xpac, at);
_builder.newLineIfNotEmpty();
_builder.append("\t");
{
@@ -1188,21 +1156,20 @@ public class GenericStateMachineGenerator {
_builder.newLineIfNotEmpty();
{
EList<TriggeredTransition> _transitions = at.getTransitions();
- boolean hasAnyElements = false;
+ boolean _hasElements = false;
for(final TriggeredTransition tt : _transitions) {
- if (!hasAnyElements) {
- hasAnyElements = true;
+ if (!_hasElements) {
+ _hasElements = true;
} else {
_builder.appendImmediate(" else ", " ");
}
_builder.append("\t");
- TransitionChain _chain = xpac.getChain(tt);
- TransitionChain chain = _chain;
+ TransitionChain chain = xpac.getChain(tt);
_builder.newLineIfNotEmpty();
_builder.append("\t");
Transition _transition = chain.getTransition();
String _trigger_1 = at.getTrigger();
- StringConcatenation _guard = this.guard(_transition, _trigger_1, xpac, dct);
+ CharSequence _guard = this.guard(_transition, _trigger_1, xpac, dct);
_builder.append(_guard, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -1265,23 +1232,22 @@ public class GenericStateMachineGenerator {
return _builder;
}
- public StringConcatenation genExtra(final ExpandedActorClass xpac, final ActorClass ac) {
+ public CharSequence genExtra(final ExpandedActorClass xpac, final ActorClass ac) {
StringConcatenation _builder = new StringConcatenation();
return _builder;
}
- private StringConcatenation _guard(final TriggeredTransition tt, final String trigger, final ExpandedActorClass ac, final DetailCodeTranslator dct) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence _guard(final TriggeredTransition tt, final String trigger, final ExpandedActorClass ac, final DetailCodeTranslator dct) {
+ CharSequence _xblockexpression = null;
{
EList<Trigger> _triggers = tt.getTriggers();
final Function1<Trigger,Boolean> _function = new Function1<Trigger,Boolean>() {
public Boolean apply(final Trigger e) {
boolean _isMatching = ac.isMatching(e, trigger);
- return ((Boolean)_isMatching);
+ return Boolean.valueOf(_isMatching);
}
};
- Trigger _findFirst = IterableExtensions.<Trigger>findFirst(_triggers, _function);
- Trigger tr = _findFirst;
+ Trigger tr = IterableExtensions.<Trigger>findFirst(_triggers, _function);
StringConcatenation _builder = new StringConcatenation();
{
boolean _hasGuard = this.roomExt.hasGuard(tr);
@@ -1300,14 +1266,14 @@ public class GenericStateMachineGenerator {
return _xblockexpression;
}
- private StringConcatenation _guard(final Transition t, final String trigger, final ExpandedActorClass ac, final DetailCodeTranslator dct) {
+ private CharSequence _guard(final Transition t, final String trigger, final ExpandedActorClass ac, final DetailCodeTranslator dct) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/* error */");
_builder.newLine();
return _builder;
}
- private StringConcatenation genDoCodes(final State state) {
+ private CharSequence genDoCodes(final State state) {
StringConcatenation _builder = new StringConcatenation();
{
boolean _hasDoCode = this.roomExt.hasDoCode(state);
@@ -1324,7 +1290,7 @@ public class GenericStateMachineGenerator {
if ((_eContainer_1 instanceof State)) {
EObject _eContainer_2 = state.eContainer();
EObject _eContainer_3 = _eContainer_2.eContainer();
- StringConcatenation _genDoCodes = this.genDoCodes(((State) _eContainer_3));
+ CharSequence _genDoCodes = this.genDoCodes(((State) _eContainer_3));
_builder.append(_genDoCodes, "");
_builder.newLineIfNotEmpty();
}
@@ -1332,11 +1298,14 @@ public class GenericStateMachineGenerator {
return _builder;
}
- private StringConcatenation guard(final Transition tt, final String trigger, final ExpandedActorClass ac, final DetailCodeTranslator dct) {
+ private CharSequence guard(final Transition tt, final String trigger, final ExpandedActorClass ac, final DetailCodeTranslator dct) {
if (tt instanceof TriggeredTransition) {
return _guard((TriggeredTransition)tt, trigger, ac, dct);
- } else {
+ } else if (tt != null) {
return _guard(tt, trigger, ac, dct);
+ } else {
+ throw new IllegalArgumentException("Unhandled parameter types: " +
+ Arrays.<Object>asList(tt, trigger, ac, dct).toString());
}
}
}
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/PrepareFileSystem.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/PrepareFileSystem.java
index 752d71f47..828ac29cc 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/PrepareFileSystem.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/PrepareFileSystem.java
@@ -12,12 +12,11 @@ import org.eclipse.etrice.core.genmodel.base.ILogger;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.room.RoomModel;
import org.eclipse.etrice.generator.generic.RoomExtensions;
+import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.eclipse.xtext.xtend2.lib.StringConcatenation;
-@SuppressWarnings("all")
@Singleton
+@SuppressWarnings("all")
public class PrepareFileSystem {
@Inject
private RoomExtensions roomExt;
@@ -29,49 +28,46 @@ public class PrepareFileSystem {
private ILogger logger;
public void prepare(final Resource resource) {
- HashSet<String> _hashSet = new HashSet<String>();
- Set<String> pathes = _hashSet;
- EList<EObject> _contents = resource.getContents();
- for (final EObject e : _contents) {
- if ((e instanceof Root)) {
- EList<RoomModel> _usedRoomModels = ((Root) e).getUsedRoomModels();
- for (final RoomModel mdl : _usedRoomModels) {
- String _generationTargetPath = this.roomExt.getGenerationTargetPath(mdl);
- pathes.add(_generationTargetPath);
- }
+ HashSet<String> _hashSet = new HashSet<String>();
+ Set<String> pathes = _hashSet;
+ EList<EObject> _contents = resource.getContents();
+ for (final EObject e : _contents) {
+ if ((e instanceof Root)) {
+ EList<RoomModel> _usedRoomModels = ((Root) e).getUsedRoomModels();
+ for (final RoomModel mdl : _usedRoomModels) {
+ String _generationTargetPath = this.roomExt.getGenerationTargetPath(mdl);
+ pathes.add(_generationTargetPath);
}
}
- for (final String path : pathes) {
- {
- String _operator_plus = StringExtensions.operator_plus("clearing ", path);
- this.logger.logInfo(_operator_plus);
- File _file = new File(path);
- File f = _file;
- this.eraseContents(f);
- this.fileAccess.setOutputPath(path);
- StringConcatenation _readmeText = this.readmeText();
- this.fileAccess.generateFile("readme.txt", _readmeText);
- }
+ }
+ for (final String path : pathes) {
+ {
+ String _plus = ("clearing " + path);
+ this.logger.logInfo(_plus);
+ File _file = new File(path);
+ File f = _file;
+ this.eraseContents(f);
+ this.fileAccess.setOutputPath(path);
+ CharSequence _readmeText = this.readmeText();
+ this.fileAccess.generateFile("readme.txt", _readmeText);
}
+ }
}
public void eraseContents(final File f) {
boolean _isDirectory = f.isDirectory();
if (_isDirectory) {
- {
- File[] _listFiles = f.listFiles();
- File[] children = _listFiles;
- for (final File child : children) {
- {
- this.eraseContents(child);
- child.delete();
- }
+ File[] children = f.listFiles();
+ for (final File child : children) {
+ {
+ this.eraseContents(child);
+ child.delete();
}
}
}
}
- public StringConcatenation readmeText() {
+ public CharSequence readmeText() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("This directory is an eTrice code generation target.");
_builder.newLine();
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java
index c9244c22f..9710dc201 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java
@@ -1,5 +1,6 @@
package org.eclipse.etrice.generator.generic;
+import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.List;
@@ -20,16 +21,12 @@ import org.eclipse.etrice.generator.base.ITranslationProvider;
import org.eclipse.etrice.generator.generic.ConfigExtension;
import org.eclipse.etrice.generator.generic.ILanguageExtension;
import org.eclipse.etrice.generator.generic.TypeHelpers;
-import org.eclipse.xtext.xbase.lib.BooleanExtensions;
-import org.eclipse.xtext.xbase.lib.ComparableExtensions;
+import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Conversions;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
-import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.eclipse.xtext.xtend2.lib.StringConcatenation;
-@SuppressWarnings("all")
@Singleton
+@SuppressWarnings("all")
public class ProcedureHelpers {
@Inject
private ILanguageExtension languageExt;
@@ -46,11 +43,11 @@ public class ProcedureHelpers {
@Inject
private ILogger logger;
- public StringConcatenation userCode(final DetailCode dc) {
+ public CharSequence userCode(final DetailCode dc) {
StringConcatenation _builder = new StringConcatenation();
{
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(dc, null);
- if (_operator_notEquals) {
+ boolean _notEquals = (!Objects.equal(dc, null));
+ if (_notEquals) {
_builder.append("/*--------------------- begin user code ---------------------*/");
_builder.newLine();
{
@@ -71,7 +68,7 @@ public class ProcedureHelpers {
/**
* TODO: add ref type
*/
- public StringConcatenation attributes(final List<Attribute> attribs) {
+ public CharSequence attributes(final List<Attribute> attribs) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/*--------------------- attributes ---------------------*/");
_builder.newLine();
@@ -79,8 +76,8 @@ public class ProcedureHelpers {
for(final Attribute attribute : attribs) {
{
int _size = attribute.getSize();
- boolean _operator_equals = ObjectExtensions.operator_equals(((Integer)_size), ((Integer)0));
- if (_operator_equals) {
+ boolean _equals = (_size == 0);
+ if (_equals) {
RefableType _refType = attribute.getRefType();
DataType _type = _refType.getType();
String _typeName = this._typeHelpers.typeName(_type);
@@ -118,82 +115,78 @@ public class ProcedureHelpers {
}
public String arrayInitializer(final Attribute att) {
- String _xifexpression = null;
- String _defaultValueLiteral = att.getDefaultValueLiteral();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_defaultValueLiteral, null);
- if (_operator_notEquals) {
- String _defaultValueLiteral_1 = att.getDefaultValueLiteral();
- _xifexpression = _defaultValueLiteral_1;
- } else {
- RefableType _refType = att.getRefType();
- DataType _type = _refType.getType();
- String _defaultValue = this._typeHelpers.defaultValue(_type);
- _xifexpression = _defaultValue;
- }
- String dflt = _xifexpression;
- boolean _startsWith = dflt.startsWith("{");
- if (_startsWith) {
- {
- String[] _split = dflt.split(",");
- int _size = ((List<String>)Conversions.doWrapArray(_split)).size();
- int _size_1 = att.getSize();
- boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(((Integer)_size), ((Integer)_size_1));
- if (_operator_notEquals_1) {
- String _name = att.getName();
- String _operator_plus = StringExtensions.operator_plus("WARNING: array size determined by initializer differs from attribute size (", _name);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "[");
- int _size_2 = att.getSize();
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, ((Integer)_size_2));
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, "] <-> ");
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, dflt);
- String _operator_plus_5 = StringExtensions.operator_plus(_operator_plus_4, ")");
- this.logger.logInfo(_operator_plus_5);
- }
- return dflt;
- }
+ String _xifexpression = null;
+ String _defaultValueLiteral = att.getDefaultValueLiteral();
+ boolean _notEquals = (!Objects.equal(_defaultValueLiteral, null));
+ if (_notEquals) {
+ String _defaultValueLiteral_1 = att.getDefaultValueLiteral();
+ _xifexpression = _defaultValueLiteral_1;
+ } else {
+ RefableType _refType = att.getRefType();
+ DataType _type = _refType.getType();
+ String _defaultValue = this._typeHelpers.defaultValue(_type);
+ _xifexpression = _defaultValue;
+ }
+ String dflt = _xifexpression;
+ boolean _startsWith = dflt.startsWith("{");
+ if (_startsWith) {
+ String[] _split = dflt.split(",");
+ int _size = ((List<String>)Conversions.doWrapArray(_split)).size();
+ int _size_1 = att.getSize();
+ boolean _notEquals_1 = (_size != _size_1);
+ if (_notEquals_1) {
+ String _name = att.getName();
+ String _plus = ("WARNING: array size determined by initializer differs from attribute size (" + _name);
+ String _plus_1 = (_plus + "[");
+ int _size_2 = att.getSize();
+ String _plus_2 = (_plus_1 + Integer.valueOf(_size_2));
+ String _plus_3 = (_plus_2 + "] <-> ");
+ String _plus_4 = (_plus_3 + dflt);
+ String _plus_5 = (_plus_4 + ")");
+ this.logger.logInfo(_plus_5);
}
- String result = "{";
- int i = 0;
- int _size_3 = att.getSize();
- boolean _operator_lessThan = ComparableExtensions.<Integer>operator_lessThan(((Integer)i), ((Integer)_size_3));
- Boolean _xwhileexpression = _operator_lessThan;
- while (_xwhileexpression) {
- {
- String _operator_plus_6 = StringExtensions.operator_plus(result, dflt);
- result = _operator_plus_6;
- int _operator_plus_7 = IntegerExtensions.operator_plus(((Integer)i), ((Integer)1));
- i = _operator_plus_7;
- int _size_4 = att.getSize();
- boolean _operator_lessThan_1 = ComparableExtensions.<Integer>operator_lessThan(((Integer)i), ((Integer)_size_4));
- if (_operator_lessThan_1) {
- String _operator_plus_8 = StringExtensions.operator_plus(result, ", ");
- result = _operator_plus_8;
- }
+ return dflt;
+ }
+ String result = "{";
+ int i = 0;
+ int _size_3 = att.getSize();
+ boolean _lessThan = (i < _size_3);
+ boolean _while = _lessThan;
+ while (_while) {
+ {
+ String _plus_6 = (result + dflt);
+ result = _plus_6;
+ int _plus_7 = (i + 1);
+ i = _plus_7;
+ int _size_4 = att.getSize();
+ boolean _lessThan_1 = (i < _size_4);
+ if (_lessThan_1) {
+ String _plus_8 = (result + ", ");
+ result = _plus_8;
}
- int _size_5 = att.getSize();
- boolean _operator_lessThan_2 = ComparableExtensions.<Integer>operator_lessThan(((Integer)i), ((Integer)_size_5));
- _xwhileexpression = _operator_lessThan_2;
}
- String _operator_plus_9 = StringExtensions.operator_plus(result, "}");
- return _operator_plus_9;
+ int _size_4 = att.getSize();
+ boolean _lessThan_1 = (i < _size_4);
+ _while = _lessThan_1;
+ }
+ return (result + "}");
}
- public StringConcatenation attributeInitialization(final List<Attribute> attribs, final boolean useClassDefaultsOnly) {
+ public CharSequence attributeInitialization(final List<Attribute> attribs, final boolean useClassDefaultsOnly) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("// initialize attributes");
_builder.newLine();
{
for(final Attribute a : attribs) {
- String _initValue = this._configExtension.getInitValue(a);
- String value = _initValue;
+ String value = this._configExtension.getInitValue(a);
_builder.newLineIfNotEmpty();
{
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(value, null);
- if (_operator_notEquals) {
+ boolean _notEquals = (!Objects.equal(value, null));
+ if (_notEquals) {
{
boolean _isArray = this._configExtension.isArray(a);
- boolean _operator_not = BooleanExtensions.operator_not(_isArray);
- if (_operator_not) {
+ boolean _not = (!_isArray);
+ if (_not) {
String _name = a.getName();
_builder.append(_name, "");
_builder.append(" = ");
@@ -245,28 +238,28 @@ public class ProcedureHelpers {
}
}
} else {
- boolean _operator_or = false;
- boolean _operator_or_1 = false;
+ boolean _or = false;
+ boolean _or_1 = false;
RefableType _refType_2 = a.getRefType();
DataType _type_2 = _refType_2.getType();
if ((_type_2 instanceof ComplexType)) {
- _operator_or_1 = true;
+ _or_1 = true;
} else {
int _size_2 = a.getSize();
- boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size_2), ((Integer)1));
- _operator_or_1 = BooleanExtensions.operator_or((_type_2 instanceof ComplexType), _operator_greaterThan);
+ boolean _greaterThan = (_size_2 > 1);
+ _or_1 = ((_type_2 instanceof ComplexType) || _greaterThan);
}
- if (_operator_or_1) {
- _operator_or = true;
+ if (_or_1) {
+ _or = true;
} else {
- boolean _operator_not_1 = BooleanExtensions.operator_not(useClassDefaultsOnly);
- _operator_or = BooleanExtensions.operator_or(_operator_or_1, _operator_not_1);
+ boolean _not_1 = (!useClassDefaultsOnly);
+ _or = (_or_1 || _not_1);
}
- if (_operator_or) {
+ if (_or) {
{
int _size_3 = a.getSize();
- boolean _operator_equals = ObjectExtensions.operator_equals(((Integer)_size_3), ((Integer)0));
- if (_operator_equals) {
+ boolean _equals = (_size_3 == 0);
+ if (_equals) {
{
RefableType _refType_3 = a.getRefType();
boolean _isRef = _refType_3.isRef();
@@ -304,8 +297,8 @@ public class ProcedureHelpers {
_builder.append("];");
_builder.newLineIfNotEmpty();
{
- boolean _operator_not_2 = BooleanExtensions.operator_not(useClassDefaultsOnly);
- if (_operator_not_2) {
+ boolean _not_2 = (!useClassDefaultsOnly);
+ if (_not_2) {
_builder.append("for (int i=0;i<");
int _size_5 = a.getSize();
_builder.append(_size_5, "");
@@ -344,17 +337,17 @@ public class ProcedureHelpers {
return _builder;
}
- public StringConcatenation attributeSettersGettersDeclaration(final List<Attribute> attribs, final String classname) {
+ public CharSequence attributeSettersGettersDeclaration(final List<Attribute> attribs, final String classname) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("//--------------------- attribute setters and getters");
_builder.newLine();
{
for(final Attribute attribute : attribs) {
- StringConcatenation _setterHeader = this.setterHeader(attribute, classname);
+ CharSequence _setterHeader = this.setterHeader(attribute, classname);
_builder.append(_setterHeader, "");
_builder.append(";");
_builder.newLineIfNotEmpty();
- StringConcatenation _terHeader = this.getterHeader(attribute, classname);
+ CharSequence _terHeader = this.getterHeader(attribute, classname);
_builder.append(_terHeader, "");
_builder.append(";");
_builder.newLineIfNotEmpty();
@@ -363,13 +356,13 @@ public class ProcedureHelpers {
return _builder;
}
- public StringConcatenation attributeSettersGettersImplementation(final List<Attribute> attribs, final String classname) {
+ public CharSequence attributeSettersGettersImplementation(final List<Attribute> attribs, final String classname) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("//--------------------- attribute setters and getters");
_builder.newLine();
{
for(final Attribute attribute : attribs) {
- StringConcatenation _setterHeader = this.setterHeader(attribute, classname);
+ CharSequence _setterHeader = this.setterHeader(attribute, classname);
_builder.append(_setterHeader, "");
_builder.append(" {");
_builder.newLineIfNotEmpty();
@@ -385,7 +378,7 @@ public class ProcedureHelpers {
_builder.newLineIfNotEmpty();
_builder.append("}");
_builder.newLine();
- StringConcatenation _terHeader = this.getterHeader(attribute, classname);
+ CharSequence _terHeader = this.getterHeader(attribute, classname);
_builder.append(_terHeader, "");
_builder.append(" {");
_builder.newLineIfNotEmpty();
@@ -404,7 +397,7 @@ public class ProcedureHelpers {
return _builder;
}
- private StringConcatenation setterHeader(final Attribute attribute, final String classname) {
+ private CharSequence setterHeader(final Attribute attribute, final String classname) {
StringConcatenation _builder = new StringConcatenation();
String _accessLevelPublic = this.languageExt.accessLevelPublic();
_builder.append(_accessLevelPublic, "");
@@ -421,8 +414,8 @@ public class ProcedureHelpers {
_builder.append(_typeName, "");
{
int _size = attribute.getSize();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(((Integer)_size), ((Integer)0));
- if (_operator_notEquals) {
+ boolean _notEquals = (_size != 0);
+ if (_notEquals) {
_builder.append("[]");
}
}
@@ -433,7 +426,7 @@ public class ProcedureHelpers {
return _builder;
}
- private StringConcatenation getterHeader(final Attribute attribute, final String classname) {
+ private CharSequence getterHeader(final Attribute attribute, final String classname) {
StringConcatenation _builder = new StringConcatenation();
String _accessLevelPublic = this.languageExt.accessLevelPublic();
_builder.append(_accessLevelPublic, "");
@@ -443,8 +436,8 @@ public class ProcedureHelpers {
_builder.append(_typeName, "");
{
int _size = attribute.getSize();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(((Integer)_size), ((Integer)0));
- if (_operator_notEquals) {
+ boolean _notEquals = (_size != 0);
+ if (_notEquals) {
_builder.append("[]");
}
}
@@ -459,13 +452,13 @@ public class ProcedureHelpers {
return _builder;
}
- public StringConcatenation argList(final List<Attribute> attributes) {
+ public CharSequence argList(final List<Attribute> attributes) {
StringConcatenation _builder = new StringConcatenation();
{
- boolean hasAnyElements = false;
+ boolean _hasElements = false;
for(final Attribute a : attributes) {
- if (!hasAnyElements) {
- hasAnyElements = true;
+ if (!_hasElements) {
+ _hasElements = true;
} else {
_builder.appendImmediate(", ", "");
}
@@ -475,8 +468,8 @@ public class ProcedureHelpers {
_builder.append(_typeName, "");
{
int _size = a.getSize();
- boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size), ((Integer)1));
- if (_operator_greaterThan) {
+ boolean _greaterThan = (_size > 1);
+ if (_greaterThan) {
_builder.append("[]");
}
}
@@ -488,7 +481,7 @@ public class ProcedureHelpers {
return _builder;
}
- public StringConcatenation getterImplementation(final String typeName, final String name, final String classname) {
+ public CharSequence getterImplementation(final String typeName, final String name, final String classname) {
StringConcatenation _builder = new StringConcatenation();
String _accessLevelPublic = this.languageExt.accessLevelPublic();
_builder.append(_accessLevelPublic, "");
@@ -512,7 +505,7 @@ public class ProcedureHelpers {
return _builder;
}
- public StringConcatenation invokeGetter(final String name, final String classname) {
+ public CharSequence invokeGetter(final String name, final String classname) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("get");
String _firstUpper = StringExtensions.toFirstUpper(name);
@@ -524,7 +517,7 @@ public class ProcedureHelpers {
return _builder;
}
- public StringConcatenation invokeSetter(final String name, final String classname, final String value) {
+ public CharSequence invokeSetter(final String name, final String classname, final String value) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("set");
String _firstUpper = StringExtensions.toFirstUpper(name);
@@ -537,24 +530,24 @@ public class ProcedureHelpers {
return _builder;
}
- public StringConcatenation operationsDeclaration(final List<? extends Operation> operations, final String classname) {
+ public CharSequence operationsDeclaration(final List<? extends Operation> operations, final String classname) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/*--------------------- operations ---------------------*/");
_builder.newLine();
{
for(final Operation operation : operations) {
{
- boolean _operator_and = false;
+ boolean _and = false;
boolean _usesInheritance = this.languageExt.usesInheritance();
if (!_usesInheritance) {
- _operator_and = false;
+ _and = false;
} else {
boolean _isConstructor = RoomHelpers.isConstructor(operation);
- _operator_and = BooleanExtensions.operator_and(_usesInheritance, _isConstructor);
+ _and = (_usesInheritance && _isConstructor);
}
- boolean _operator_not = BooleanExtensions.operator_not(_operator_and);
- if (_operator_not) {
- StringConcatenation _operationSignature = this.operationSignature(operation, classname, true);
+ boolean _not = (!_and);
+ if (_not) {
+ CharSequence _operationSignature = this.operationSignature(operation, classname, true);
_builder.append(_operationSignature, "");
_builder.append(";");
_builder.newLineIfNotEmpty();
@@ -565,24 +558,24 @@ public class ProcedureHelpers {
return _builder;
}
- public StringConcatenation operationsImplementation(final List<? extends Operation> operations, final String classname) {
+ public CharSequence operationsImplementation(final List<? extends Operation> operations, final String classname) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/*--------------------- operations ---------------------*/");
_builder.newLine();
{
for(final Operation operation : operations) {
{
- boolean _operator_and = false;
+ boolean _and = false;
boolean _usesInheritance = this.languageExt.usesInheritance();
if (!_usesInheritance) {
- _operator_and = false;
+ _and = false;
} else {
boolean _isConstructor = RoomHelpers.isConstructor(operation);
- _operator_and = BooleanExtensions.operator_and(_usesInheritance, _isConstructor);
+ _and = (_usesInheritance && _isConstructor);
}
- boolean _operator_not = BooleanExtensions.operator_not(_operator_and);
- if (_operator_not) {
- StringConcatenation _operationSignature = this.operationSignature(operation, classname, false);
+ boolean _not = (!_and);
+ if (_not) {
+ CharSequence _operationSignature = this.operationSignature(operation, classname, false);
_builder.append(_operationSignature, "");
_builder.append(" {");
_builder.newLineIfNotEmpty();
@@ -604,8 +597,8 @@ public class ProcedureHelpers {
return _builder;
}
- public StringConcatenation operationsImplementation(final ActorClass ac) {
- StringConcatenation _xblockexpression = null;
+ public CharSequence operationsImplementation(final ActorClass ac) {
+ CharSequence _xblockexpression = null;
{
this.translator.setActorClass(ac);
DetailCodeTranslator _detailCodeTranslator = new DetailCodeTranslator(ac, this.translator);
@@ -617,18 +610,18 @@ public class ProcedureHelpers {
EList<StandardOperation> _operations = ac.getOperations();
for(final StandardOperation operation : _operations) {
{
- boolean _operator_and = false;
+ boolean _and = false;
boolean _usesInheritance = this.languageExt.usesInheritance();
if (!_usesInheritance) {
- _operator_and = false;
+ _and = false;
} else {
boolean _isConstructor = RoomHelpers.isConstructor(operation);
- _operator_and = BooleanExtensions.operator_and(_usesInheritance, _isConstructor);
+ _and = (_usesInheritance && _isConstructor);
}
- boolean _operator_not = BooleanExtensions.operator_not(_operator_and);
- if (_operator_not) {
+ boolean _not = (!_and);
+ if (_not) {
String _name = ac.getName();
- StringConcatenation _operationSignature = this.operationSignature(operation, _name, false);
+ CharSequence _operationSignature = this.operationSignature(operation, _name, false);
_builder.append(_operationSignature, "");
_builder.append(" {");
_builder.newLineIfNotEmpty();
@@ -648,30 +641,30 @@ public class ProcedureHelpers {
return _xblockexpression;
}
- private StringConcatenation operationSignature(final Operation operation, final String classname, final boolean isDeclaration) {
- StringConcatenation _xifexpression = null;
+ private CharSequence operationSignature(final Operation operation, final String classname, final boolean isDeclaration) {
+ CharSequence _xifexpression = null;
boolean _isConstructor = RoomHelpers.isConstructor(operation);
if (_isConstructor) {
String _constructorName = this.languageExt.constructorName(classname);
String _constructorReturnType = this.languageExt.constructorReturnType();
- StringConcatenation _classOperationSignature = this.classOperationSignature(classname, _constructorName, "", _constructorReturnType, isDeclaration);
+ CharSequence _classOperationSignature = this.classOperationSignature(classname, _constructorName, "", _constructorReturnType, isDeclaration);
_xifexpression = _classOperationSignature;
} else {
- StringConcatenation _xifexpression_1 = null;
+ CharSequence _xifexpression_1 = null;
boolean _isDestructor = RoomHelpers.isDestructor(operation);
if (_isDestructor) {
String _destructorName = this.languageExt.destructorName(classname);
String _destructorReturnType = this.languageExt.destructorReturnType();
- StringConcatenation _classOperationSignature_1 = this.classOperationSignature(classname, _destructorName, "", _destructorReturnType, isDeclaration);
+ CharSequence _classOperationSignature_1 = this.classOperationSignature(classname, _destructorName, "", _destructorReturnType, isDeclaration);
_xifexpression_1 = _classOperationSignature_1;
} else {
String _name = operation.getName();
EList<VarDecl> _arguments = operation.getArguments();
- StringConcatenation _BuildArgumentList = this.BuildArgumentList(_arguments);
+ CharSequence _BuildArgumentList = this.BuildArgumentList(_arguments);
String _string = _BuildArgumentList.toString();
RefableType _returntype = operation.getReturntype();
String _dataTypeToString = this.dataTypeToString(_returntype);
- StringConcatenation _classOperationSignature_2 = this.classOperationSignature(classname, _name, _string, _dataTypeToString, isDeclaration);
+ CharSequence _classOperationSignature_2 = this.classOperationSignature(classname, _name, _string, _dataTypeToString, isDeclaration);
_xifexpression_1 = _classOperationSignature_2;
}
_xifexpression = _xifexpression_1;
@@ -681,8 +674,8 @@ public class ProcedureHelpers {
private String dataTypeToString(final RefableType type) {
String _xifexpression = null;
- boolean _operator_equals = ObjectExtensions.operator_equals(type, null);
- if (_operator_equals) {
+ boolean _equals = Objects.equal(type, null);
+ if (_equals) {
_xifexpression = "void";
} else {
String _xifexpression_1 = null;
@@ -691,8 +684,8 @@ public class ProcedureHelpers {
DataType _type = type.getType();
String _typeName = this._typeHelpers.typeName(_type);
String _pointerLiteral = this.languageExt.pointerLiteral();
- String _operator_plus = StringExtensions.operator_plus(_typeName, _pointerLiteral);
- _xifexpression_1 = _operator_plus;
+ String _plus = (_typeName + _pointerLiteral);
+ _xifexpression_1 = _plus;
} else {
DataType _type_1 = type.getType();
String _typeName_1 = this._typeHelpers.typeName(_type_1);
@@ -706,13 +699,13 @@ public class ProcedureHelpers {
/**
* builds comma separated argument list as string from EList<VarDecl> arguments
*/
- private StringConcatenation BuildArgumentList(final EList<VarDecl> arguments) {
+ private CharSequence BuildArgumentList(final EList<VarDecl> arguments) {
StringConcatenation _builder = new StringConcatenation();
{
- boolean hasAnyElements = false;
+ boolean _hasElements = false;
for(final VarDecl argument : arguments) {
- if (!hasAnyElements) {
- hasAnyElements = true;
+ if (!_hasElements) {
+ _hasElements = true;
} else {
_builder.appendImmediate(", ", "");
}
@@ -736,7 +729,7 @@ public class ProcedureHelpers {
return _builder;
}
- private StringConcatenation classOperationSignature(final String classname, final String operationname, final String argumentList, final String returnType, final boolean isDeclaration) {
+ private CharSequence classOperationSignature(final String classname, final String operationname, final String argumentList, final String returnType, final boolean isDeclaration) {
StringConcatenation _builder = new StringConcatenation();
String _accessLevelPublic = this.languageExt.accessLevelPublic();
_builder.append(_accessLevelPublic, "");
@@ -746,8 +739,8 @@ public class ProcedureHelpers {
_builder.append(_memberInDeclaration, "");
_builder.append("(");
boolean _isEmpty = argumentList.isEmpty();
- boolean _operator_not = BooleanExtensions.operator_not(_isEmpty);
- String _selfPointer = this.languageExt.selfPointer(classname, _operator_not);
+ boolean _not = (!_isEmpty);
+ String _selfPointer = this.languageExt.selfPointer(classname, _not);
_builder.append(_selfPointer, "");
_builder.append(argumentList, "");
_builder.append(")");
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java
index 868b66dce..30d6ddb1f 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java
@@ -1,5 +1,7 @@
package org.eclipse.etrice.generator.generic;
+import com.google.common.base.Objects;
+import com.google.common.collect.Iterables;
import com.google.inject.Singleton;
import java.io.File;
import java.util.ArrayList;
@@ -24,7 +26,6 @@ import org.eclipse.etrice.core.room.ExternalPort;
import org.eclipse.etrice.core.room.GeneralProtocolClass;
import org.eclipse.etrice.core.room.Guard;
import org.eclipse.etrice.core.room.InitialTransition;
-import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.core.room.MessageHandler;
import org.eclipse.etrice.core.room.Port;
@@ -49,43 +50,37 @@ import org.eclipse.etrice.core.room.TriggeredTransition;
import org.eclipse.etrice.core.room.VarDecl;
import org.eclipse.etrice.generator.base.CodegenHelpers;
import org.eclipse.etrice.generator.base.DetailCodeTranslator;
-import org.eclipse.xtext.xbase.lib.BooleanExtensions;
-import org.eclipse.xtext.xbase.lib.CollectionExtensions;
-import org.eclipse.xtext.xbase.lib.ComparableExtensions;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.ObjectExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-@SuppressWarnings("all")
@Singleton
+@SuppressWarnings("all")
public class RoomExtensions {
public <T extends Object> List<T> union(final List<T> l1, final List<T> l2) {
- ArrayList<T> _arrayList = new ArrayList<T>();
- ArrayList<T> ret = _arrayList;
- ret.addAll(l1);
- ret.addAll(l2);
- return ret;
+ ArrayList<T> _arrayList = new ArrayList<T>();
+ ArrayList<T> ret = _arrayList;
+ ret.addAll(l1);
+ ret.addAll(l2);
+ return ret;
}
public <T extends Object> Iterable<T> union(final Iterable<T> l1, final Iterable<T> l2) {
- ArrayList<T> _arrayList = new ArrayList<T>();
- ArrayList<T> ret = _arrayList;
- CollectionExtensions.<T>addAll(ret, l1);
- CollectionExtensions.<T>addAll(ret, l2);
- return ret;
+ ArrayList<T> _arrayList = new ArrayList<T>();
+ ArrayList<T> ret = _arrayList;
+ Iterables.<T>addAll(ret, l1);
+ Iterables.<T>addAll(ret, l2);
+ return ret;
}
public List<Port> punion(final List<Port> in1, final List<ExternalPort> in2) {
- ArrayList<Port> _arrayList = new ArrayList<Port>();
- ArrayList<Port> ret = _arrayList;
- for (final ExternalPort ele : in2) {
- Port _ifport = ele.getIfport();
- ret.add(_ifport);
- }
- ret.addAll(in1);
- return ret;
+ ArrayList<Port> _arrayList = new ArrayList<Port>();
+ ArrayList<Port> ret = _arrayList;
+ for (final ExternalPort ele : in2) {
+ Port _ifport = ele.getIfport();
+ ret.add(_ifport);
+ }
+ ret.addAll(in1);
+ return ret;
}
public String getGenerationPathSegment() {
@@ -97,28 +92,24 @@ public class RoomExtensions {
}
public String getModelPath(final EObject e) {
- Resource _eResource = e.eResource();
- Resource res = _eResource;
- boolean _operator_equals = ObjectExtensions.operator_equals(res, null);
- if (_operator_equals) {
- return "";
- } else {
- URI _uRI = res.getURI();
- String _fileString = _uRI.toFileString();
- return _fileString;
- }
+ Resource res = e.eResource();
+ boolean _equals = Objects.equal(res, null);
+ if (_equals) {
+ return "";
+ } else {
+ URI _uRI = res.getURI();
+ return _uRI.toFileString();
+ }
}
public String getPackage(final RoomClass rc) {
EObject _eContainer = rc.eContainer();
- String _name = ((RoomModel) _eContainer).getName();
- return _name;
+ return ((RoomModel) _eContainer).getName();
}
public String getPathFromPackage(final String packageName) {
String _replaceAll = packageName.replaceAll("\\.", "/");
- String _operator_plus = StringExtensions.operator_plus(_replaceAll, "/");
- return _operator_plus;
+ return (_replaceAll + "/");
}
public String getPath(final RoomClass rc) {
@@ -128,68 +119,61 @@ public class RoomExtensions {
}
public String getProjectPath(final EObject e) {
- Resource _eResource = e.eResource();
- Resource res = _eResource;
- boolean _operator_equals = ObjectExtensions.operator_equals(res, null);
- if (_operator_equals) {
+ Resource res = e.eResource();
+ boolean _equals = Objects.equal(res, null);
+ if (_equals) {
+ return "";
+ } else {
+ File _file = new File("");
+ File tmpf = _file;
+ URI _uRI = res.getURI();
+ String _fileString = _uRI.toFileString();
+ File _file_1 = new File(_fileString);
+ tmpf = _file_1;
+ boolean _isFile = tmpf.isFile();
+ boolean _not = (!_isFile);
+ if (_not) {
return "";
- } else {
+ }
+ boolean isProject = false;
+ boolean _dowhile = false;
+ do {
{
- File _file = new File("");
- File tmpf = _file;
- URI _uRI = res.getURI();
- String _fileString = _uRI.toFileString();
- File _file_1 = new File(_fileString);
- tmpf = _file_1;
- boolean _isFile = tmpf.isFile();
- boolean _operator_not = BooleanExtensions.operator_not(_isFile);
- if (_operator_not) {
- return "";
- }
- boolean isProject = false;
- Boolean _xdowhileexpression;
- do {
- {
- File _parentFile = tmpf.getParentFile();
- tmpf = _parentFile;
- String[] _list = tmpf.list();
- String[] contents = _list;
- for (final String f : contents) {
- boolean _equals = f.equals(".project");
- if (_equals) {
- isProject = true;
- }
- }
+ File _parentFile = tmpf.getParentFile();
+ tmpf = _parentFile;
+ String[] contents = tmpf.list();
+ for (final String f : contents) {
+ boolean _equals_1 = f.equals(".project");
+ if (_equals_1) {
+ isProject = true;
}
- boolean _operator_and = false;
- boolean _operator_not_1 = BooleanExtensions.operator_not(isProject);
- if (!_operator_not_1) {
- _operator_and = false;
- } else {
- File _parentFile_1 = tmpf.getParentFile();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_parentFile_1, null);
- _operator_and = BooleanExtensions.operator_and(_operator_not_1, _operator_notEquals);
- }
- _xdowhileexpression = _operator_and;
- } while(_xdowhileexpression);
- String _absolutePath = tmpf.getAbsolutePath();
- return _absolutePath;
+ }
}
- }
+ boolean _and = false;
+ boolean _not_1 = (!isProject);
+ if (!_not_1) {
+ _and = false;
+ } else {
+ File _parentFile = tmpf.getParentFile();
+ boolean _notEquals = (!Objects.equal(_parentFile, null));
+ _and = (_not_1 && _notEquals);
+ }
+ _dowhile = _and;
+ } while(_dowhile);
+ return tmpf.getAbsolutePath();
+ }
}
public String getGenerationTargetPath(final EObject e) {
String _projectPath = this.getProjectPath(e);
String _generationPathSegment = this.getGenerationPathSegment();
- String _operator_plus = StringExtensions.operator_plus(_projectPath, _generationPathSegment);
- return _operator_plus;
+ return (_projectPath + _generationPathSegment);
}
public String getDocGenerationTargetPath(final EObject e) {
String _projectPath = this.getProjectPath(e);
String _docGenerationPathSegment = this.getDocGenerationPathSegment();
- String _operator_plus = StringExtensions.operator_plus(_projectPath, _docGenerationPathSegment);
- return _operator_plus;
+ return (_projectPath + _docGenerationPathSegment);
}
public List<Port> getEndPorts(final ActorClass ac) {
@@ -202,15 +186,14 @@ public class RoomExtensions {
public List<Port> getAllEndPorts(final ActorClass ac) {
List<Port> _xifexpression = null;
ActorClass _base = ac.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
- List<Port> _endPorts = this.getEndPorts(ac);
- return _endPorts;
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
+ return this.getEndPorts(ac);
} else {
ActorClass _base_1 = ac.getBase();
List<Port> _allEndPorts = this.getAllEndPorts(_base_1);
- List<Port> _endPorts_1 = this.getEndPorts(ac);
- List<Port> _union = this.<Port>union(_allEndPorts, _endPorts_1);
+ List<Port> _endPorts = this.getEndPorts(ac);
+ List<Port> _union = this.<Port>union(_allEndPorts, _endPorts);
_xifexpression = _union;
}
return _xifexpression;
@@ -219,15 +202,14 @@ public class RoomExtensions {
public List<SAPRef> getAllSAPs(final ActorClass ac) {
List<SAPRef> _xifexpression = null;
ActorClass _base = ac.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
- EList<SAPRef> _strSAPs = ac.getStrSAPs();
- return _strSAPs;
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
+ return ac.getStrSAPs();
} else {
ActorClass _base_1 = ac.getBase();
List<SAPRef> _allSAPs = this.getAllSAPs(_base_1);
- EList<SAPRef> _strSAPs_1 = ac.getStrSAPs();
- List<SAPRef> _union = this.<SAPRef>union(_allSAPs, _strSAPs_1);
+ EList<SAPRef> _strSAPs = ac.getStrSAPs();
+ List<SAPRef> _union = this.<SAPRef>union(_allSAPs, _strSAPs);
_xifexpression = _union;
}
return _xifexpression;
@@ -236,15 +218,14 @@ public class RoomExtensions {
public List<ServiceImplementation> getAllServiceImplementations(final ActorClass ac) {
List<ServiceImplementation> _xifexpression = null;
ActorClass _base = ac.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
- EList<ServiceImplementation> _serviceImplementations = ac.getServiceImplementations();
- return _serviceImplementations;
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
+ return ac.getServiceImplementations();
} else {
ActorClass _base_1 = ac.getBase();
List<ServiceImplementation> _allServiceImplementations = this.getAllServiceImplementations(_base_1);
- EList<ServiceImplementation> _serviceImplementations_1 = ac.getServiceImplementations();
- List<ServiceImplementation> _union = this.<ServiceImplementation>union(_allServiceImplementations, _serviceImplementations_1);
+ EList<ServiceImplementation> _serviceImplementations = ac.getServiceImplementations();
+ List<ServiceImplementation> _union = this.<ServiceImplementation>union(_allServiceImplementations, _serviceImplementations);
_xifexpression = _union;
}
return _xifexpression;
@@ -258,15 +239,14 @@ public class RoomExtensions {
public List<Attribute> getAllAttributes(final DataClass dc) {
List<Attribute> _xifexpression = null;
DataClass _base = dc.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
- EList<Attribute> _attributes = dc.getAttributes();
- return _attributes;
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
+ return dc.getAttributes();
} else {
DataClass _base_1 = dc.getBase();
List<Attribute> _allAttributes = this.getAllAttributes(_base_1);
- EList<Attribute> _attributes_1 = dc.getAttributes();
- List<Attribute> _union = this.<Attribute>union(_allAttributes, _attributes_1);
+ EList<Attribute> _attributes = dc.getAttributes();
+ List<Attribute> _union = this.<Attribute>union(_allAttributes, _attributes);
_xifexpression = _union;
}
return _xifexpression;
@@ -275,15 +255,14 @@ public class RoomExtensions {
public List<Attribute> getAllAttributes(final ActorClass ac) {
List<Attribute> _xifexpression = null;
ActorClass _base = ac.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
- EList<Attribute> _attributes = ac.getAttributes();
- return _attributes;
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
+ return ac.getAttributes();
} else {
ActorClass _base_1 = ac.getBase();
List<Attribute> _allAttributes = this.getAllAttributes(_base_1);
- EList<Attribute> _attributes_1 = ac.getAttributes();
- List<Attribute> _union = this.<Attribute>union(_allAttributes, _attributes_1);
+ EList<Attribute> _attributes = ac.getAttributes();
+ List<Attribute> _union = this.<Attribute>union(_allAttributes, _attributes);
_xifexpression = _union;
}
return _xifexpression;
@@ -306,14 +285,12 @@ public class RoomExtensions {
protected String _getPortClassName(final SAPRef sap) {
ProtocolClass _protocol = sap.getProtocol();
- String _portClassName = this.getPortClassName(_protocol, true);
- return _portClassName;
+ return this.getPortClassName(_protocol, true);
}
protected String _getPortClassName(final SPPRef spp) {
ProtocolClass _protocol = spp.getProtocol();
- String _portClassName = this.getPortClassName(_protocol, false, true);
- return _portClassName;
+ return this.getPortClassName(_protocol, false, true);
}
public String getPortClassName(final ProtocolClass p, final boolean conj) {
@@ -329,56 +306,51 @@ public class RoomExtensions {
} else {
_xifexpression = "";
}
- String _operator_plus = StringExtensions.operator_plus(_name, _xifexpression);
+ String _plus = (_name + _xifexpression);
String _xifexpression_1 = null;
if (repl) {
_xifexpression_1 = "Repl";
} else {
_xifexpression_1 = "";
}
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, _xifexpression_1);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "Port");
- return _operator_plus_2;
+ String _plus_1 = (_plus + _xifexpression_1);
+ String _plus_2 = (_plus_1 + "Port");
+ return _plus_2;
}
- public String getPortClassName(final ExternalPort p) {
+ protected String _getPortClassName(final ExternalPort p) {
Port _ifport = p.getIfport();
- String _portClassName = this.getPortClassName(_ifport);
- return _portClassName;
+ return this.getPortClassName(_ifport);
}
- public String getPortClassName(final ServiceImplementation svc) {
+ protected String _getPortClassName(final ServiceImplementation svc) {
SPPRef _spp = svc.getSpp();
ProtocolClass _protocol = _spp.getProtocol();
- String _portClassName = this.getPortClassName(_protocol, false, true);
- return _portClassName;
+ return this.getPortClassName(_protocol, false, true);
}
public List<Message> getAllIncomingMessages(final ProtocolClass pc) {
ProtocolClass _base = pc.getBase();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_base, null);
- if (_operator_notEquals) {
+ boolean _notEquals = (!Objects.equal(_base, null));
+ if (_notEquals) {
ProtocolClass _base_1 = pc.getBase();
List<Message> _allIncomingMessages = this.getAllIncomingMessages(_base_1);
EList<Message> _incomingMessages = pc.getIncomingMessages();
- List<Message> _union = this.<Message>union(_allIncomingMessages, _incomingMessages);
- return _union;
+ return this.<Message>union(_allIncomingMessages, _incomingMessages);
} else {
- EList<Message> _incomingMessages_1 = pc.getIncomingMessages();
- return _incomingMessages_1;
+ return pc.getIncomingMessages();
}
}
public List<Message> getAllOutgoingMessages(final ProtocolClass pc) {
EList<Message> _xifexpression = null;
ProtocolClass _base = pc.getBase();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_base, null);
- if (_operator_notEquals) {
+ boolean _notEquals = (!Objects.equal(_base, null));
+ if (_notEquals) {
ProtocolClass _base_1 = pc.getBase();
List<Message> _allOutgoingMessages = this.getAllOutgoingMessages(_base_1);
EList<Message> _outgoingMessages = pc.getOutgoingMessages();
- List<Message> _union = this.<Message>union(_allOutgoingMessages, _outgoingMessages);
- return _union;
+ return this.<Message>union(_allOutgoingMessages, _outgoingMessages);
} else {
EList<Message> _outgoingMessages_1 = pc.getOutgoingMessages();
_xifexpression = _outgoingMessages_1;
@@ -388,79 +360,72 @@ public class RoomExtensions {
public List<Message> getIncoming(final ProtocolClass pc, final boolean conj) {
if (conj) {
- List<Message> _allOutgoingMessages = this.getAllOutgoingMessages(pc);
- return _allOutgoingMessages;
+ return this.getAllOutgoingMessages(pc);
} else {
- List<Message> _allIncomingMessages = this.getAllIncomingMessages(pc);
- return _allIncomingMessages;
+ return this.getAllIncomingMessages(pc);
}
}
public List<Message> getOutgoing(final ProtocolClass pc, final boolean conj) {
if (conj) {
- List<Message> _allIncomingMessages = this.getAllIncomingMessages(pc);
- return _allIncomingMessages;
+ return this.getAllIncomingMessages(pc);
} else {
- List<Message> _allOutgoingMessages = this.getAllOutgoingMessages(pc);
- return _allOutgoingMessages;
+ return this.getAllOutgoingMessages(pc);
}
}
public PortClass getPortClass(final ProtocolClass pc, final boolean conj) {
if (conj) {
- PortClass _conjugate = pc.getConjugate();
- return _conjugate;
+ return pc.getConjugate();
} else {
- PortClass _regular = pc.getRegular();
- return _regular;
+ return pc.getRegular();
}
}
public boolean handlesSend(final ProtocolClass pc, final boolean conj) {
- PortClass _portClass = this.getPortClass(pc, conj);
- boolean _operator_equals = ObjectExtensions.operator_equals(_portClass, null);
- if (_operator_equals) {
- return false;
- } else {
- PortClass _portClass_1 = this.getPortClass(pc, conj);
- EList<MessageHandler> _msgHandlers = _portClass_1.getMsgHandlers();
- for (final MessageHandler hdlr : _msgHandlers) {
- List<Message> _outgoing = this.getOutgoing(pc, conj);
- Message _msg = hdlr.getMsg();
- boolean _contains = _outgoing.contains(_msg);
- if (_contains) {
- return true;
- }
+ PortClass _portClass = this.getPortClass(pc, conj);
+ boolean _equals = Objects.equal(_portClass, null);
+ if (_equals) {
+ return false;
+ } else {
+ PortClass _portClass_1 = this.getPortClass(pc, conj);
+ EList<MessageHandler> _msgHandlers = _portClass_1.getMsgHandlers();
+ for (final MessageHandler hdlr : _msgHandlers) {
+ List<Message> _outgoing = this.getOutgoing(pc, conj);
+ Message _msg = hdlr.getMsg();
+ boolean _contains = _outgoing.contains(_msg);
+ if (_contains) {
+ return true;
}
}
- return false;
+ }
+ return false;
}
public boolean handlesReceive(final ProtocolClass pc, final boolean conj) {
- PortClass _portClass = this.getPortClass(pc, conj);
- boolean _operator_equals = ObjectExtensions.operator_equals(_portClass, null);
- if (_operator_equals) {
- return false;
- } else {
- PortClass _portClass_1 = this.getPortClass(pc, conj);
- EList<MessageHandler> _msgHandlers = _portClass_1.getMsgHandlers();
- for (final MessageHandler hdlr : _msgHandlers) {
- List<Message> _incoming = this.getIncoming(pc, conj);
- Message _msg = hdlr.getMsg();
- boolean _contains = _incoming.contains(_msg);
- if (_contains) {
- return true;
- }
+ PortClass _portClass = this.getPortClass(pc, conj);
+ boolean _equals = Objects.equal(_portClass, null);
+ if (_equals) {
+ return false;
+ } else {
+ PortClass _portClass_1 = this.getPortClass(pc, conj);
+ EList<MessageHandler> _msgHandlers = _portClass_1.getMsgHandlers();
+ for (final MessageHandler hdlr : _msgHandlers) {
+ List<Message> _incoming = this.getIncoming(pc, conj);
+ Message _msg = hdlr.getMsg();
+ boolean _contains = _incoming.contains(_msg);
+ if (_contains) {
+ return true;
}
}
- return false;
+ }
+ return false;
}
public boolean isConjugated(final InterfaceItemInstance iii) {
if ((iii instanceof PortInstance)) {
Port _port = ((PortInstance) iii).getPort();
- boolean _isConjugated = _port.isConjugated();
- return _isConjugated;
+ return _port.isConjugated();
} else {
if ((iii instanceof SAPInstance)) {
return true;
@@ -476,51 +441,47 @@ public class RoomExtensions {
public List<MessageHandler> getReceiveHandlers(final ProtocolClass pc, final boolean conj) {
PortClass _portClass = this.getPortClass(pc, conj);
- boolean _operator_equals = ObjectExtensions.operator_equals(_portClass, null);
- if (_operator_equals) {
+ boolean _equals = Objects.equal(_portClass, null);
+ if (_equals) {
ArrayList<MessageHandler> _arrayList = new ArrayList<MessageHandler>();
return _arrayList;
} else {
- {
- ArrayList<MessageHandler> _arrayList_1 = new ArrayList<MessageHandler>();
- ArrayList<MessageHandler> res = _arrayList_1;
- PortClass _portClass_1 = this.getPortClass(pc, conj);
- EList<MessageHandler> _msgHandlers = _portClass_1.getMsgHandlers();
- for (final MessageHandler hdlr : _msgHandlers) {
- List<Message> _incoming = this.getIncoming(pc, conj);
- Message _msg = hdlr.getMsg();
- boolean _contains = _incoming.contains(_msg);
- if (_contains) {
- res.add(hdlr);
- }
+ ArrayList<MessageHandler> _arrayList_1 = new ArrayList<MessageHandler>();
+ ArrayList<MessageHandler> res = _arrayList_1;
+ PortClass _portClass_1 = this.getPortClass(pc, conj);
+ EList<MessageHandler> _msgHandlers = _portClass_1.getMsgHandlers();
+ for (final MessageHandler hdlr : _msgHandlers) {
+ List<Message> _incoming = this.getIncoming(pc, conj);
+ Message _msg = hdlr.getMsg();
+ boolean _contains = _incoming.contains(_msg);
+ if (_contains) {
+ res.add(hdlr);
}
- return res;
}
+ return res;
}
}
public List<MessageHandler> getSendHandlers(final ProtocolClass pc, final boolean conj) {
PortClass _portClass = this.getPortClass(pc, conj);
- boolean _operator_equals = ObjectExtensions.operator_equals(_portClass, null);
- if (_operator_equals) {
+ boolean _equals = Objects.equal(_portClass, null);
+ if (_equals) {
ArrayList<MessageHandler> _arrayList = new ArrayList<MessageHandler>();
return _arrayList;
} else {
- {
- ArrayList<MessageHandler> _arrayList_1 = new ArrayList<MessageHandler>();
- ArrayList<MessageHandler> res = _arrayList_1;
- PortClass _portClass_1 = this.getPortClass(pc, conj);
- EList<MessageHandler> _msgHandlers = _portClass_1.getMsgHandlers();
- for (final MessageHandler hdlr : _msgHandlers) {
- List<Message> _outgoing = this.getOutgoing(pc, conj);
- Message _msg = hdlr.getMsg();
- boolean _contains = _outgoing.contains(_msg);
- if (_contains) {
- res.add(hdlr);
- }
+ ArrayList<MessageHandler> _arrayList_1 = new ArrayList<MessageHandler>();
+ ArrayList<MessageHandler> res = _arrayList_1;
+ PortClass _portClass_1 = this.getPortClass(pc, conj);
+ EList<MessageHandler> _msgHandlers = _portClass_1.getMsgHandlers();
+ for (final MessageHandler hdlr : _msgHandlers) {
+ List<Message> _outgoing = this.getOutgoing(pc, conj);
+ Message _msg = hdlr.getMsg();
+ boolean _contains = _outgoing.contains(_msg);
+ if (_contains) {
+ res.add(hdlr);
}
- return res;
}
+ return res;
}
}
@@ -530,135 +491,127 @@ public class RoomExtensions {
final Function1<MessageHandler,Boolean> _function = new Function1<MessageHandler,Boolean>() {
public Boolean apply(final MessageHandler e) {
Message _msg = e.getMsg();
- boolean _operator_equals = ObjectExtensions.operator_equals(_msg, m);
- return ((Boolean)_operator_equals);
+ boolean _equals = Objects.equal(_msg, m);
+ return Boolean.valueOf(_equals);
}
};
- MessageHandler _findFirst = IterableExtensions.<MessageHandler>findFirst(_sendHandlers, _function);
- return _findFirst;
+ return IterableExtensions.<MessageHandler>findFirst(_sendHandlers, _function);
}
public boolean isIncoming(final Message m) {
EObject _eContainer = m.eContainer();
List<Message> _allIncomingMessages = this.getAllIncomingMessages(((ProtocolClass) _eContainer));
- boolean _contains = _allIncomingMessages.contains(m);
- return _contains;
+ return _allIncomingMessages.contains(m);
}
public String getCodeName(final Message m) {
boolean _isIncoming = this.isIncoming(m);
if (_isIncoming) {
String _name = m.getName();
- String _operator_plus = StringExtensions.operator_plus("IN_", _name);
- return _operator_plus;
+ return ("IN_" + _name);
} else {
String _name_1 = m.getName();
- String _operator_plus_1 = StringExtensions.operator_plus("OUT_", _name_1);
- return _operator_plus_1;
+ return ("OUT_" + _name_1);
}
}
public boolean isLeaf(final State s) {
StateGraph _subgraph = s.getSubgraph();
- boolean _operator_equals = ObjectExtensions.operator_equals(_subgraph, null);
- return _operator_equals;
+ boolean _equals = Objects.equal(_subgraph, null);
+ return _equals;
}
public List<State> getLeafStateList(final StateGraph sg) {
- ArrayList<State> _arrayList = new ArrayList<State>();
- ArrayList<State> res = _arrayList;
- EList<State> _states = sg.getStates();
- for (final State s : _states) {
- List<State> _leafStateList = this.getLeafStateList(s);
- res.addAll(_leafStateList);
- }
- return res;
+ ArrayList<State> _arrayList = new ArrayList<State>();
+ ArrayList<State> res = _arrayList;
+ EList<State> _states = sg.getStates();
+ for (final State s : _states) {
+ List<State> _leafStateList = this.getLeafStateList(s);
+ res.addAll(_leafStateList);
+ }
+ return res;
}
public List<State> getLeafStateList(final State s) {
boolean _isLeaf = this.isLeaf(s);
if (_isLeaf) {
- {
- ArrayList<State> _arrayList = new ArrayList<State>();
- ArrayList<State> res = _arrayList;
- res.add(s);
- return res;
- }
+ ArrayList<State> _arrayList = new ArrayList<State>();
+ ArrayList<State> res = _arrayList;
+ res.add(s);
+ return res;
} else {
StateGraph _subgraph = s.getSubgraph();
- List<State> _leafStateList = this.getLeafStateList(_subgraph);
- return _leafStateList;
+ return this.getLeafStateList(_subgraph);
}
}
public List<State> getStateList(final StateGraph sg) {
- ArrayList<State> _arrayList = new ArrayList<State>();
- ArrayList<State> ret = _arrayList;
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(sg, null);
- if (_operator_notEquals) {
- EList<State> _states = sg.getStates();
- for (final State e : _states) {
- {
- ret.add(e);
- StateGraph _subgraph = e.getSubgraph();
- boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_subgraph, null);
- if (_operator_notEquals_1) {
- StateGraph _subgraph_1 = e.getSubgraph();
- List<State> _stateList = this.getStateList(_subgraph_1);
- ret.addAll(_stateList);
- }
+ ArrayList<State> _arrayList = new ArrayList<State>();
+ ArrayList<State> ret = _arrayList;
+ boolean _notEquals = (!Objects.equal(sg, null));
+ if (_notEquals) {
+ EList<State> _states = sg.getStates();
+ for (final State e : _states) {
+ {
+ ret.add(e);
+ StateGraph _subgraph = e.getSubgraph();
+ boolean _notEquals_1 = (!Objects.equal(_subgraph, null));
+ if (_notEquals_1) {
+ StateGraph _subgraph_1 = e.getSubgraph();
+ List<State> _stateList = this.getStateList(_subgraph_1);
+ ret.addAll(_stateList);
}
}
}
- return ret;
+ }
+ return ret;
}
public List<State> getBaseStateList(final StateGraph sg) {
- ArrayList<State> _arrayList = new ArrayList<State>();
- ArrayList<State> ret = _arrayList;
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(sg, null);
- if (_operator_notEquals) {
- List<State> _stateList = this.getStateList(sg);
- for (final State e : _stateList) {
- if ((e instanceof SimpleState)) {
- ret.add(e);
- }
+ ArrayList<State> _arrayList = new ArrayList<State>();
+ ArrayList<State> ret = _arrayList;
+ boolean _notEquals = (!Objects.equal(sg, null));
+ if (_notEquals) {
+ List<State> _stateList = this.getStateList(sg);
+ for (final State e : _stateList) {
+ if ((e instanceof SimpleState)) {
+ ret.add(e);
}
}
- return ret;
+ }
+ return ret;
}
public ArrayList<State> getLeafStatesLast(final List<State> states) {
- ArrayList<State> _arrayList = new ArrayList<State>();
- ArrayList<State> leaf = _arrayList;
- ArrayList<State> _arrayList_1 = new ArrayList<State>();
- ArrayList<State> nonLeaf = _arrayList_1;
- for (final State state : states) {
- boolean _isLeaf = this.isLeaf(state);
- if (_isLeaf) {
- leaf.add(state);
- } else {
- nonLeaf.add(state);
- }
+ ArrayList<State> _arrayList = new ArrayList<State>();
+ ArrayList<State> leaf = _arrayList;
+ ArrayList<State> _arrayList_1 = new ArrayList<State>();
+ ArrayList<State> nonLeaf = _arrayList_1;
+ for (final State state : states) {
+ boolean _isLeaf = this.isLeaf(state);
+ if (_isLeaf) {
+ leaf.add(state);
+ } else {
+ nonLeaf.add(state);
}
- nonLeaf.addAll(leaf);
- return nonLeaf;
+ }
+ nonLeaf.addAll(leaf);
+ return nonLeaf;
}
public List<State> getAllBaseStates(final ActorClass ac) {
List<State> _xifexpression = null;
ActorClass _base = ac.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
StateGraph _stateMachine = ac.getStateMachine();
- List<State> _baseStateList = this.getBaseStateList(_stateMachine);
- return _baseStateList;
+ return this.getBaseStateList(_stateMachine);
} else {
ActorClass _base_1 = ac.getBase();
List<State> _allBaseStates = this.getAllBaseStates(_base_1);
StateGraph _stateMachine_1 = ac.getStateMachine();
- List<State> _baseStateList_1 = this.getBaseStateList(_stateMachine_1);
- List<State> _union = this.<State>union(_allBaseStates, _baseStateList_1);
+ List<State> _baseStateList = this.getBaseStateList(_stateMachine_1);
+ List<State> _union = this.<State>union(_allBaseStates, _baseStateList);
_xifexpression = _union;
}
return _xifexpression;
@@ -667,20 +620,19 @@ public class RoomExtensions {
public List<State> getAllBaseStatesLeavesLast(final ActorClass ac) {
List<State> _xifexpression = null;
ActorClass _base = ac.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
StateGraph _stateMachine = ac.getStateMachine();
List<State> _baseStateList = this.getBaseStateList(_stateMachine);
- ArrayList<State> _leafStatesLast = this.getLeafStatesLast(_baseStateList);
- return _leafStatesLast;
+ return this.getLeafStatesLast(_baseStateList);
} else {
ActorClass _base_1 = ac.getBase();
List<State> _allBaseStates = this.getAllBaseStates(_base_1);
- ArrayList<State> _leafStatesLast_1 = this.getLeafStatesLast(_allBaseStates);
+ ArrayList<State> _leafStatesLast = this.getLeafStatesLast(_allBaseStates);
StateGraph _stateMachine_1 = ac.getStateMachine();
List<State> _baseStateList_1 = this.getBaseStateList(_stateMachine_1);
- ArrayList<State> _leafStatesLast_2 = this.getLeafStatesLast(_baseStateList_1);
- List<State> _union = this.<State>union(_leafStatesLast_1, _leafStatesLast_2);
+ ArrayList<State> _leafStatesLast_1 = this.getLeafStatesLast(_baseStateList_1);
+ List<State> _union = this.<State>union(_leafStatesLast, _leafStatesLast_1);
_xifexpression = _union;
}
return _xifexpression;
@@ -689,71 +641,70 @@ public class RoomExtensions {
public List<State> getAllLeafStates(final ActorClass ac) {
List<State> _xifexpression = null;
ActorClass _base = ac.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
StateGraph _stateMachine = ac.getStateMachine();
- List<State> _leafStateList = this.getLeafStateList(_stateMachine);
- return _leafStateList;
+ return this.getLeafStateList(_stateMachine);
} else {
ActorClass _base_1 = ac.getBase();
List<State> _allLeafStates = this.getAllLeafStates(_base_1);
StateGraph _stateMachine_1 = ac.getStateMachine();
- List<State> _leafStateList_1 = this.getLeafStateList(_stateMachine_1);
- List<State> _union = this.<State>union(_allLeafStates, _leafStateList_1);
+ List<State> _leafStateList = this.getLeafStateList(_stateMachine_1);
+ List<State> _union = this.<State>union(_allLeafStates, _leafStateList);
_xifexpression = _union;
}
return _xifexpression;
}
public boolean overridesStop(final ActorClass ac) {
- boolean _operator_or = false;
+ boolean _or = false;
EList<StandardOperation> _operations = ac.getOperations();
final Function1<StandardOperation,Boolean> _function = new Function1<StandardOperation,Boolean>() {
public Boolean apply(final StandardOperation e) {
- boolean _operator_and = false;
- boolean _operator_and_1 = false;
+ boolean _and = false;
+ boolean _and_1 = false;
String _name = e.getName();
- boolean _operator_equals = ObjectExtensions.operator_equals(_name, "stop");
- if (!_operator_equals) {
- _operator_and_1 = false;
+ boolean _equals = Objects.equal(_name, "stop");
+ if (!_equals) {
+ _and_1 = false;
} else {
EList<VarDecl> _arguments = e.getArguments();
boolean _isEmpty = _arguments.isEmpty();
- _operator_and_1 = BooleanExtensions.operator_and(_operator_equals, _isEmpty);
+ _and_1 = (_equals && _isEmpty);
}
- if (!_operator_and_1) {
- _operator_and = false;
+ if (!_and_1) {
+ _and = false;
} else {
RefableType _returntype = e.getReturntype();
- boolean _operator_equals_1 = ObjectExtensions.operator_equals(_returntype, null);
- _operator_and = BooleanExtensions.operator_and(_operator_and_1, _operator_equals_1);
+ boolean _equals_1 = Objects.equal(_returntype, null);
+ _and = (_and_1 && _equals_1);
}
- return ((Boolean)_operator_and);
+ return Boolean.valueOf(_and);
}
};
boolean _exists = IterableExtensions.<StandardOperation>exists(_operations, _function);
if (_exists) {
- _operator_or = true;
+ _or = true;
} else {
- boolean _operator_and = false;
+ boolean _and = false;
ActorClass _base = ac.getBase();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_base, null);
- if (!_operator_notEquals) {
- _operator_and = false;
+ boolean _notEquals = (!Objects.equal(_base, null));
+ if (!_notEquals) {
+ _and = false;
} else {
ActorClass _base_1 = ac.getBase();
boolean _overridesStop = this.overridesStop(_base_1);
- _operator_and = BooleanExtensions.operator_and(_operator_notEquals, _overridesStop);
+ _and = (_notEquals && _overridesStop);
}
- _operator_or = BooleanExtensions.operator_or(_exists, _operator_and);
+ _or = (_exists || _and);
}
- return _operator_or;
+ return _or;
}
public int getNumberOfInheritedStates(final ActorClass ac) {
ActorClass _base = ac.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
return 0;
} else {
ActorClass _base_1 = ac.getBase();
@@ -762,15 +713,14 @@ public class RoomExtensions {
int _size = _stateList.size();
ActorClass _base_2 = ac.getBase();
int _numberOfInheritedStates = this.getNumberOfInheritedStates(_base_2);
- int _operator_plus = IntegerExtensions.operator_plus(((Integer)_size), ((Integer)_numberOfInheritedStates));
- return _operator_plus;
+ return (_size + _numberOfInheritedStates);
}
}
public int getNumberOfInheritedBaseStates(final ActorClass ac) {
ActorClass _base = ac.getBase();
- boolean _operator_equals = ObjectExtensions.operator_equals(_base, null);
- if (_operator_equals) {
+ boolean _equals = Objects.equal(_base, null);
+ if (_equals) {
return 0;
} else {
ActorClass _base_1 = ac.getBase();
@@ -779,123 +729,119 @@ public class RoomExtensions {
int _size = _baseStateList.size();
ActorClass _base_2 = ac.getBase();
int _numberOfInheritedBaseStates = this.getNumberOfInheritedBaseStates(_base_2);
- int _operator_plus = IntegerExtensions.operator_plus(((Integer)_size), ((Integer)_numberOfInheritedBaseStates));
- return _operator_plus;
+ return (_size + _numberOfInheritedBaseStates);
}
}
public String getStateId(final State s) {
- String _genStateId = CodegenHelpers.getGenStateId(s);
- return _genStateId;
+ return CodegenHelpers.getGenStateId(s);
}
public String getStatePathName(final State s) {
- String _genStatePathName = CodegenHelpers.getGenStatePathName(s);
- return _genStatePathName;
+ return CodegenHelpers.getGenStatePathName(s);
}
public String getChainId(final TransitionChain t) {
- String _genChainId = CodegenHelpers.getGenChainId(t);
- return _genChainId;
+ return CodegenHelpers.getGenChainId(t);
}
public boolean hasGuard(final Trigger tr) {
- boolean _operator_and = false;
- boolean _operator_and_1 = false;
+ boolean _and = false;
+ boolean _and_1 = false;
Guard _guard = tr.getGuard();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_guard, null);
- if (!_operator_notEquals) {
- _operator_and_1 = false;
+ boolean _notEquals = (!Objects.equal(_guard, null));
+ if (!_notEquals) {
+ _and_1 = false;
} else {
Guard _guard_1 = tr.getGuard();
DetailCode _guard_2 = _guard_1.getGuard();
- boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_guard_2, null);
- _operator_and_1 = BooleanExtensions.operator_and(_operator_notEquals, _operator_notEquals_1);
+ boolean _notEquals_1 = (!Objects.equal(_guard_2, null));
+ _and_1 = (_notEquals && _notEquals_1);
}
- if (!_operator_and_1) {
- _operator_and = false;
+ if (!_and_1) {
+ _and = false;
} else {
Guard _guard_3 = tr.getGuard();
DetailCode _guard_4 = _guard_3.getGuard();
EList<String> _commands = _guard_4.getCommands();
int _size = _commands.size();
- boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size), ((Integer)0));
- _operator_and = BooleanExtensions.operator_and(_operator_and_1, _operator_greaterThan);
+ boolean _greaterThan = (_size > 0);
+ _and = (_and_1 && _greaterThan);
}
- return _operator_and;
+ return _and;
}
public boolean hasGuard(final ExpandedActorClass ac, final ActiveTrigger at) {
- boolean hasGuard = false;
- EList<TriggeredTransition> _transitions = at.getTransitions();
- for (final TriggeredTransition t : _transitions) {
- EList<Trigger> _triggers = t.getTriggers();
- final Function1<Trigger,Boolean> _function = new Function1<Trigger,Boolean>() {
- public Boolean apply(final Trigger e) {
- boolean _operator_and = false;
- String _trigger = at.getTrigger();
- boolean _isMatching = ac.isMatching(e, _trigger);
- if (!_isMatching) {
- _operator_and = false;
- } else {
- boolean _hasGuard = RoomExtensions.this.hasGuard(e);
- _operator_and = BooleanExtensions.operator_and(_isMatching, _hasGuard);
- }
- return ((Boolean)_operator_and);
+ boolean hasGuard = false;
+ EList<TriggeredTransition> _transitions = at.getTransitions();
+ for (final TriggeredTransition t : _transitions) {
+ EList<Trigger> _triggers = t.getTriggers();
+ final Function1<Trigger,Boolean> _function = new Function1<Trigger,Boolean>() {
+ public Boolean apply(final Trigger e) {
+ boolean _and = false;
+ String _trigger = at.getTrigger();
+ boolean _isMatching = ac.isMatching(e, _trigger);
+ if (!_isMatching) {
+ _and = false;
+ } else {
+ boolean _hasGuard = RoomExtensions.this.hasGuard(e);
+ _and = (_isMatching && _hasGuard);
}
- };
- boolean _exists = IterableExtensions.<Trigger>exists(_triggers, _function);
- if (_exists) {
- hasGuard = true;
- }
+ return Boolean.valueOf(_and);
+ }
+ };
+ boolean _exists = IterableExtensions.<Trigger>exists(_triggers, _function);
+ if (_exists) {
+ hasGuard = true;
}
- return hasGuard;
+ }
+ return hasGuard;
}
public boolean empty(final DetailCode dc) {
- boolean _operator_or = false;
- boolean _operator_equals = ObjectExtensions.operator_equals(dc, null);
- if (_operator_equals) {
- _operator_or = true;
+ boolean _or = false;
+ boolean _equals = Objects.equal(dc, null);
+ if (_equals) {
+ _or = true;
} else {
EList<String> _commands = dc.getCommands();
boolean _isEmpty = _commands.isEmpty();
- _operator_or = BooleanExtensions.operator_or(_operator_equals, _isEmpty);
+ _or = (_equals || _isEmpty);
}
- return _operator_or;
+ return _or;
}
public boolean hasEntryCode(final State s) {
DetailCode _entryCode = s.getEntryCode();
boolean _empty = this.empty(_entryCode);
- boolean _operator_not = BooleanExtensions.operator_not(_empty);
- return _operator_not;
+ boolean _not = (!_empty);
+ return _not;
}
public boolean hasExitCode(final State s) {
DetailCode _exitCode = s.getExitCode();
boolean _empty = this.empty(_exitCode);
- boolean _operator_not = BooleanExtensions.operator_not(_empty);
- return _operator_not;
+ boolean _not = (!_empty);
+ return _not;
}
public boolean hasDoCode(final State s) {
DetailCode _doCode = s.getDoCode();
boolean _empty = this.empty(_doCode);
- boolean _operator_not = BooleanExtensions.operator_not(_empty);
- return _operator_not;
+ boolean _not = (!_empty);
+ return _not;
}
public String getEntryCode(final ExpandedActorClass ac, final State s, final DetailCodeTranslator dct) {
String _xifexpression = null;
if ((s instanceof RefinedState)) {
String _entryCodeOperationName = CodegenHelpers.getEntryCodeOperationName(s);
- String _operator_plus = StringExtensions.operator_plus("super.", _entryCodeOperationName);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "();\n");
+ String _plus = ("super." + _entryCodeOperationName);
+ String _plus_1 = (_plus + "();\n");
DetailCode _entryCode = s.getEntryCode();
String _code = ac.getCode(_entryCode);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, _code);
- _xifexpression = _operator_plus_2;
+ String _plus_2 = (_plus_1 + _code);
+ _xifexpression = _plus_2;
} else {
DetailCode _entryCode_1 = s.getEntryCode();
String _translateDetailCode = dct.translateDetailCode(_entryCode_1);
@@ -909,11 +855,11 @@ public class RoomExtensions {
if ((s instanceof RefinedState)) {
DetailCode _exitCode = s.getExitCode();
String _code = ac.getCode(_exitCode);
- String _operator_plus = StringExtensions.operator_plus(_code, "super.");
+ String _plus = (_code + "super.");
String _exitCodeOperationName = CodegenHelpers.getExitCodeOperationName(s);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, _exitCodeOperationName);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "();\n");
- _xifexpression = _operator_plus_2;
+ String _plus_1 = (_plus + _exitCodeOperationName);
+ String _plus_2 = (_plus_1 + "();\n");
+ _xifexpression = _plus_2;
} else {
DetailCode _exitCode_1 = s.getExitCode();
String _translateDetailCode = dct.translateDetailCode(_exitCode_1);
@@ -927,11 +873,11 @@ public class RoomExtensions {
if ((s instanceof RefinedState)) {
DetailCode _doCode = s.getDoCode();
String _code = ac.getCode(_doCode);
- String _operator_plus = StringExtensions.operator_plus(_code, "super.");
+ String _plus = (_code + "super.");
String _doCodeOperationName = CodegenHelpers.getDoCodeOperationName(s);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, _doCodeOperationName);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "();\n");
- _xifexpression = _operator_plus_2;
+ String _plus_1 = (_plus + _doCodeOperationName);
+ String _plus_2 = (_plus_1 + "();\n");
+ _xifexpression = _plus_2;
} else {
DetailCode _doCode_1 = s.getDoCode();
String _translateDetailCode = dct.translateDetailCode(_doCode_1);
@@ -941,19 +887,19 @@ public class RoomExtensions {
}
public boolean hasActionCode(final Transition t) {
- boolean _operator_and = false;
+ boolean _and = false;
DetailCode _action = t.getAction();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_action, null);
- if (!_operator_notEquals) {
- _operator_and = false;
+ boolean _notEquals = (!Objects.equal(_action, null));
+ if (!_notEquals) {
+ _and = false;
} else {
DetailCode _action_1 = t.getAction();
EList<String> _commands = _action_1.getCommands();
int _size = _commands.size();
- boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size), ((Integer)0));
- _operator_and = BooleanExtensions.operator_and(_operator_notEquals, _operator_greaterThan);
+ boolean _greaterThan = (_size > 0);
+ _and = (_notEquals && _greaterThan);
}
- return _operator_and;
+ return _and;
}
public String getActionCode(final ExpandedActorClass ac, final Transition t, final DetailCodeTranslator dct) {
@@ -969,23 +915,23 @@ public class RoomExtensions {
}
public Transition getInitTransition(final StateGraph sg) {
- EList<Transition> _transitions = sg.getTransitions();
- for (final Transition tr : _transitions) {
- if ((tr instanceof InitialTransition)) {
- return tr;
- }
+ EList<Transition> _transitions = sg.getTransitions();
+ for (final Transition tr : _transitions) {
+ if ((tr instanceof InitialTransition)) {
+ return tr;
}
- return null;
+ }
+ return null;
}
public boolean hasInitTransition(final StateGraph sg) {
- EList<Transition> _transitions = sg.getTransitions();
- for (final Transition tr : _transitions) {
- if ((tr instanceof InitialTransition)) {
- return true;
- }
+ EList<Transition> _transitions = sg.getTransitions();
+ for (final Transition tr : _transitions) {
+ if ((tr instanceof InitialTransition)) {
+ return true;
}
- return false;
+ }
+ return false;
}
public List<Transition> getTransitionList(final State s) {
@@ -995,53 +941,56 @@ public class RoomExtensions {
return _arrayList;
} else {
StateGraph _subgraph = s.getSubgraph();
- List<Transition> _transitionList = this.getTransitionList(_subgraph);
- return _transitionList;
+ return this.getTransitionList(_subgraph);
}
}
public List<Transition> getTransitionList(final StateGraph sg) {
- EList<Transition> _transitions = sg.getTransitions();
- ArrayList<Transition> _arrayList = new ArrayList<Transition>(_transitions);
- ArrayList<Transition> res = _arrayList;
- EList<State> _states = sg.getStates();
- for (final State s : _states) {
- List<Transition> _transitionList = this.getTransitionList(s);
- res.addAll(_transitionList);
- }
- return res;
+ EList<Transition> _transitions = sg.getTransitions();
+ ArrayList<Transition> _arrayList = new ArrayList<Transition>(_transitions);
+ ArrayList<Transition> res = _arrayList;
+ EList<State> _states = sg.getStates();
+ for (final State s : _states) {
+ List<Transition> _transitionList = this.getTransitionList(s);
+ res.addAll(_transitionList);
+ }
+ return res;
}
public List<Transition> getOutgoingTransitionsHierarchical(final ExpandedActorClass ac, final State s) {
- ArrayList<Transition> _arrayList = new ArrayList<Transition>();
- ArrayList<Transition> result = _arrayList;
- EList<Transition> _outgoingTransitions = ac.getOutgoingTransitions(s);
- result.addAll(_outgoingTransitions);
- EObject _eContainer = s.eContainer();
- StateGraph sg = ((StateGraph) _eContainer);
- EList<TrPoint> _trPoints = sg.getTrPoints();
- for (final TrPoint tp : _trPoints) {
- if ((tp instanceof TransitionPoint)) {
- EList<Transition> _outgoingTransitions_1 = ac.getOutgoingTransitions(tp);
- result.addAll(_outgoingTransitions_1);
- }
+ ArrayList<Transition> _arrayList = new ArrayList<Transition>();
+ ArrayList<Transition> result = _arrayList;
+ EList<Transition> _outgoingTransitions = ac.getOutgoingTransitions(s);
+ result.addAll(_outgoingTransitions);
+ EObject _eContainer = s.eContainer();
+ StateGraph sg = ((StateGraph) _eContainer);
+ EList<TrPoint> _trPoints = sg.getTrPoints();
+ for (final TrPoint tp : _trPoints) {
+ if ((tp instanceof TransitionPoint)) {
+ EList<Transition> _outgoingTransitions_1 = ac.getOutgoingTransitions(tp);
+ result.addAll(_outgoingTransitions_1);
}
- EObject _eContainer_1 = sg.eContainer();
- if ((_eContainer_1 instanceof State)) {
- EObject _eContainer_2 = sg.eContainer();
- List<Transition> _outgoingTransitionsHierarchical = this.getOutgoingTransitionsHierarchical(ac, ((State) _eContainer_2));
- result.addAll(_outgoingTransitionsHierarchical);
- }
- return result;
+ }
+ EObject _eContainer_1 = sg.eContainer();
+ if ((_eContainer_1 instanceof State)) {
+ EObject _eContainer_2 = sg.eContainer();
+ List<Transition> _outgoingTransitionsHierarchical = this.getOutgoingTransitionsHierarchical(ac, ((State) _eContainer_2));
+ result.addAll(_outgoingTransitionsHierarchical);
+ }
+ return result;
}
- public String getPortClassName(final InterfaceItem p) {
+ public String getPortClassName(final EObject p) {
if (p instanceof Port) {
return _getPortClassName((Port)p);
} else if (p instanceof SAPRef) {
return _getPortClassName((SAPRef)p);
} else if (p instanceof SPPRef) {
return _getPortClassName((SPPRef)p);
+ } else if (p instanceof ExternalPort) {
+ return _getPortClassName((ExternalPort)p);
+ } else if (p instanceof ServiceImplementation) {
+ return _getPortClassName((ServiceImplementation)p);
} else {
throw new IllegalArgumentException("Unhandled parameter types: " +
Arrays.<Object>asList(p).toString());
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/TypeHelpers.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/TypeHelpers.java
index 977106d7c..87a7ac65a 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/TypeHelpers.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/TypeHelpers.java
@@ -9,44 +9,37 @@ import org.eclipse.etrice.core.room.PrimitiveType;
import org.eclipse.etrice.core.room.RefableType;
import org.eclipse.etrice.core.room.VarDecl;
import org.eclipse.etrice.generator.generic.AbstractTransitionChainGenerator;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-@SuppressWarnings("all")
@Singleton
+@SuppressWarnings("all")
public class TypeHelpers {
@Inject
private AbstractTransitionChainGenerator chainGenerator;
public String typeName(final DataType type) {
if ((type instanceof PrimitiveType)) {
- String _targetName = ((PrimitiveType) type).getTargetName();
- return _targetName;
+ return ((PrimitiveType) type).getTargetName();
} else {
if ((type instanceof ExternalType)) {
- String _targetName_1 = ((ExternalType) type).getTargetName();
- return _targetName_1;
+ return ((ExternalType) type).getTargetName();
} else {
- String _name = type.getName();
- return _name;
+ return type.getName();
}
}
}
public String defaultValue(final DataType dt) {
if ((dt instanceof PrimitiveType)) {
- String _defaultValueLiteral = ((PrimitiveType) dt).getDefaultValueLiteral();
- return _defaultValueLiteral;
+ return ((PrimitiveType) dt).getDefaultValueLiteral();
} else {
if ((dt instanceof ExternalType)) {
String _targetName = ((ExternalType) dt).getTargetName();
- String _operator_plus = StringExtensions.operator_plus("new ", _targetName);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "()");
- return _operator_plus_1;
+ String _plus = ("new " + _targetName);
+ return (_plus + "()");
} else {
String _name = dt.getName();
- String _operator_plus_2 = StringExtensions.operator_plus("new ", _name);
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, "()");
- return _operator_plus_3;
+ String _plus_1 = ("new " + _name);
+ return (_plus_1 + "()");
}
}
}
@@ -54,12 +47,10 @@ public class TypeHelpers {
public String defaultValue(final VarDecl a) {
RefableType _refType = a.getRefType();
DataType _type = _refType.getType();
- String _defaultValue = this.defaultValue(_type);
- return _defaultValue;
+ return this.defaultValue(_type);
}
public String getTypedDataDefinition(final Message m) {
- String _generateTypedData = this.chainGenerator.generateTypedData(m);
- return _generateTypedData;
+ return this.chainGenerator.generateTypedData(m);
}
}

Back to the top