Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.c')
-rw-r--r--plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend7
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java311
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java86
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/DataClassGen.java66
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/MainGen.java33
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java510
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java20
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java562
-rw-r--r--plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java17
12 files changed, 742 insertions, 876 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF
index 4fc3bfe41..e9a528d86 100644
--- a/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator.c/META-INF/MANIFEST.MF
@@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.etrice.core.room.ui;bundle-version="0.2.0",
org.eclipse.core.runtime;bundle-version="3.6.0",
org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
- org.eclipse.xtext.xtend2.lib;bundle-version="2.1.1",
+ org.eclipse.xtend.lib;bundle-version="2.3.0",
org.eclipse.xtext.generator;bundle-version="2.1.1",
org.eclipse.xtext.util;bundle-version="2.1.1"
Import-Package: org.apache.log4j
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
index 1b856f888..440c12c7d 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
@@ -27,7 +27,6 @@ import org.eclipse.xtext.generator.JavaIoFileSystemAccess
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.generator.generic.ProcedureHelpers
-import org.eclipse.etrice.generator.generic.TypeHelpers
import org.eclipse.etrice.generator.generic.GenericActorClassGenerator
@@ -39,7 +38,6 @@ class ActorClassGen extends GenericActorClassGenerator {
@Inject extension RoomExtensions roomExt
@Inject extension ProcedureHelpers helpers
- @Inject extension TypeHelpers
@Inject extension StateMachineGen stateMachineGen
@Inject ILogger logger
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
index 9e89a0dde..263f80776 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
@@ -15,7 +15,6 @@ package org.eclipse.etrice.generator.c.gen
import com.google.inject.Inject
import com.google.inject.Singleton
-import org.eclipse.etrice.core.room.Message
import org.eclipse.etrice.core.room.ProtocolClass
import org.eclipse.etrice.core.room.CommunicationType
import org.eclipse.etrice.core.room.PrimitiveType
@@ -217,7 +216,6 @@ etInt32 «replPortClassName»_getReplication(const «replPortClassName»* self);
«FOR message : messages»
«var typeName =message.data.refType.type.typeName»
«var refp = if (!(message.data.refType.type instanceof PrimitiveType)) "*" else ""»
- «var refa = if ((message.data.refType.type instanceof PrimitiveType)) "&" else ""»
«var data = ", "+typeName+refp+" data"»
«messageSetterSignature(pc.getPortClassName(true), message.name, data)» {
self->«message.name» = data;
@@ -322,10 +320,6 @@ etInt32 «replPortClassName»_getReplication(const «replPortClassName»* self);
def private messageGetterSignature(String className, String messageName, String type) {
type+" "+className+"_"+messageName+"_get(const "+className+"* const self)"
}
-
- def private messageCall(Message m) {'''
- «m.name»(«IF m.data!=null» «m.data.name»«ENDIF»)
- '''}
// def sendMessage(Message m, boolean conj) {'''
// «var dir = if (conj) "IN" else "OUT"»
@@ -341,7 +335,6 @@ etInt32 «replPortClassName»_getReplication(const «replPortClassName»* self);
def private genReceiveHandlers(ProtocolClass pc, Boolean conj){
var portClassName = pc.getPortClassName(conj)
- var replPortClassName = pc.getPortClassName(conj, true)
'''
/* receiver handlers */
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
index cb15fe9a1..e0ae917de 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.xtend
@@ -337,7 +337,6 @@ class SubSystemClassGen {
var dataPorts = simplePorts.filter(p|p.protocol.commType==CommunicationType::DATA_DRIVEN)
var recvPorts = dataPorts.filter(p|p instanceof PortInstance && !(p as PortInstance).port.conjugated)
- var sendPorts = dataPorts.filter(p|p instanceof PortInstance && (p as PortInstance).port.conjugated)
// compute replicated port offsets
var offsets = new HashMap<InterfaceItemInstance, Integer>()
@@ -380,7 +379,6 @@ class SubSystemClassGen {
'''}
def private String genPortInitializer(Root root, ActorInstance ai, InterfaceItemInstance pi) {
- var recvMsg = if (pi.peers.empty) "NULL" else ai.actorClass.name+"_receiveMessage"
var objId = if (pi.peers.empty) 0 else pi.peers.get(0).objId
var idx = if (pi.peers.empty) 0 else pi.peers.get(0).peers.indexOf(pi)
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java
index dbcb83321..3f26b246b 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java
@@ -1,5 +1,6 @@
package org.eclipse.etrice.generator.c.gen;
+import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.HashSet;
@@ -29,17 +30,13 @@ import org.eclipse.etrice.generator.c.gen.StateMachineGen;
import org.eclipse.etrice.generator.generic.GenericActorClassGenerator;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
-import org.eclipse.etrice.generator.generic.TypeHelpers;
+import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
-import org.eclipse.xtext.xbase.lib.BooleanExtensions;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
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 ActorClassGen extends GenericActorClassGenerator {
@Inject
private JavaIoFileSystemAccess fileAccess;
@@ -54,9 +51,6 @@ public class ActorClassGen extends GenericActorClassGenerator {
private ProcedureHelpers helpers;
@Inject
- private TypeHelpers _typeHelpers;
-
- @Inject
private StateMachineGen stateMachineGen;
@Inject
@@ -70,129 +64,121 @@ public class ActorClassGen extends GenericActorClassGenerator {
String _generationTargetPath = this.roomExt.getGenerationTargetPath(_actorClass);
ActorClass _actorClass_1 = xpac.getActorClass();
String _path = this.roomExt.getPath(_actorClass_1);
- String _operator_plus = StringExtensions.operator_plus(_generationTargetPath, _path);
- String path = _operator_plus;
+ String path = (_generationTargetPath + _path);
ActorClass _actorClass_2 = xpac.getActorClass();
String _cHeaderFileName = this.stdExt.getCHeaderFileName(_actorClass_2);
- String _operator_plus_1 = StringExtensions.operator_plus("generating ActorClass header \'", _cHeaderFileName);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "\' in \'");
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, path);
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, "\'");
- this.logger.logInfo(_operator_plus_4);
+ String _plus = ("generating ActorClass header \'" + _cHeaderFileName);
+ String _plus_1 = (_plus + "\' in \'");
+ String _plus_2 = (_plus_1 + path);
+ String _plus_3 = (_plus_2 + "\'");
+ this.logger.logInfo(_plus_3);
this.fileAccess.setOutputPath(path);
ActorClass _actorClass_3 = xpac.getActorClass();
String _cHeaderFileName_1 = this.stdExt.getCHeaderFileName(_actorClass_3);
ActorClass _actorClass_4 = xpac.getActorClass();
- StringConcatenation _generateHeaderFile = this.generateHeaderFile(root, xpac, _actorClass_4);
+ CharSequence _generateHeaderFile = this.generateHeaderFile(root, xpac, _actorClass_4);
this.fileAccess.generateFile(_cHeaderFileName_1, _generateHeaderFile);
boolean _hasBehaviorAnnotation = this.hasBehaviorAnnotation(xpac, "BehaviorManual");
if (_hasBehaviorAnnotation) {
ActorClass _actorClass_5 = xpac.getActorClass();
String _name = _actorClass_5.getName();
- String _operator_plus_5 = StringExtensions.operator_plus("omitting ActorClass source for \'", _name);
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, "\' since @BehaviorManual is specified");
- this.logger.logInfo(_operator_plus_6);
+ String _plus_4 = ("omitting ActorClass source for \'" + _name);
+ String _plus_5 = (_plus_4 + "\' since @BehaviorManual is specified");
+ this.logger.logInfo(_plus_5);
} else {
- {
- ActorClass _actorClass_6 = xpac.getActorClass();
- String _cSourceFileName = this.stdExt.getCSourceFileName(_actorClass_6);
- String _operator_plus_7 = StringExtensions.operator_plus("generating ActorClass source \'", _cSourceFileName);
- String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_7, "\' in \'");
- String _operator_plus_9 = StringExtensions.operator_plus(_operator_plus_8, path);
- String _operator_plus_10 = StringExtensions.operator_plus(_operator_plus_9, "\'");
- this.logger.logInfo(_operator_plus_10);
- this.fileAccess.setOutputPath(path);
- ActorClass _actorClass_7 = xpac.getActorClass();
- String _cSourceFileName_1 = this.stdExt.getCSourceFileName(_actorClass_7);
- ActorClass _actorClass_8 = xpac.getActorClass();
- StringConcatenation _generateSourceFile = this.generateSourceFile(root, xpac, _actorClass_8);
- this.fileAccess.generateFile(_cSourceFileName_1, _generateSourceFile);
- }
+ ActorClass _actorClass_6 = xpac.getActorClass();
+ String _cSourceFileName = this.stdExt.getCSourceFileName(_actorClass_6);
+ String _plus_6 = ("generating ActorClass source \'" + _cSourceFileName);
+ String _plus_7 = (_plus_6 + "\' in \'");
+ String _plus_8 = (_plus_7 + path);
+ String _plus_9 = (_plus_8 + "\'");
+ this.logger.logInfo(_plus_9);
+ this.fileAccess.setOutputPath(path);
+ ActorClass _actorClass_7 = xpac.getActorClass();
+ String _cSourceFileName_1 = this.stdExt.getCSourceFileName(_actorClass_7);
+ ActorClass _actorClass_8 = xpac.getActorClass();
+ CharSequence _generateSourceFile = this.generateSourceFile(root, xpac, _actorClass_8);
+ this.fileAccess.generateFile(_cSourceFileName_1, _generateSourceFile);
}
}
}
}
private boolean hasBehaviorAnnotation(final ExpandedActorClass xpac, final String annotation) {
- ActorClass _actorClass = xpac.getActorClass();
- EList<Annotation> _behaviorAnnotations = _actorClass.getBehaviorAnnotations();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_behaviorAnnotations, null);
- if (_operator_notEquals) {
- ActorClass _actorClass_1 = xpac.getActorClass();
- EList<Annotation> _behaviorAnnotations_1 = _actorClass_1.getBehaviorAnnotations();
- final Function1<Annotation,Boolean> _function = new Function1<Annotation,Boolean>() {
- public Boolean apply(final Annotation e) {
- String _name = e.getName();
- boolean _operator_equals = ObjectExtensions.operator_equals(_name, annotation);
- return ((Boolean)_operator_equals);
- }
- };
- Annotation _findFirst = IterableExtensions.<Annotation>findFirst(_behaviorAnnotations_1, _function);
- boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_findFirst, null);
- if (_operator_notEquals_1) {
- return true;
- }
+ ActorClass _actorClass = xpac.getActorClass();
+ EList<Annotation> _behaviorAnnotations = _actorClass.getBehaviorAnnotations();
+ boolean _notEquals = (!Objects.equal(_behaviorAnnotations, null));
+ if (_notEquals) {
+ ActorClass _actorClass_1 = xpac.getActorClass();
+ EList<Annotation> _behaviorAnnotations_1 = _actorClass_1.getBehaviorAnnotations();
+ final Function1<Annotation,Boolean> _function = new Function1<Annotation,Boolean>() {
+ public Boolean apply(final Annotation e) {
+ String _name = e.getName();
+ boolean _equals = Objects.equal(_name, annotation);
+ return Boolean.valueOf(_equals);
+ }
+ };
+ Annotation _findFirst = IterableExtensions.<Annotation>findFirst(_behaviorAnnotations_1, _function);
+ boolean _notEquals_1 = (!Objects.equal(_findFirst, null));
+ if (_notEquals_1) {
+ return true;
}
- return false;
+ }
+ return false;
}
- private StringConcatenation generateHeaderFile(final Root root, final ExpandedActorClass xpac, final ActorClass ac) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence generateHeaderFile(final Root root, final ExpandedActorClass xpac, final ActorClass ac) {
+ CharSequence _xblockexpression = null;
{
List<Port> _allEndPorts = this.roomExt.getAllEndPorts(ac);
final Function1<Port,Boolean> _function = new Function1<Port,Boolean>() {
public Boolean apply(final Port p) {
GeneralProtocolClass _protocol = p.getProtocol();
CommunicationType _commType = ((ProtocolClass) _protocol).getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, CommunicationType.EVENT_DRIVEN);
- return ((Boolean)_operator_equals);
+ boolean _equals = Objects.equal(_commType, CommunicationType.EVENT_DRIVEN);
+ return Boolean.valueOf(_equals);
}
};
- Iterable<Port> _filter = IterableExtensions.<Port>filter(_allEndPorts, _function);
- Iterable<Port> eventPorts = _filter;
+ Iterable<Port> eventPorts = IterableExtensions.<Port>filter(_allEndPorts, _function);
List<Port> _allEndPorts_1 = this.roomExt.getAllEndPorts(ac);
final Function1<Port,Boolean> _function_1 = new Function1<Port,Boolean>() {
public Boolean apply(final Port p) {
- boolean _operator_and = false;
+ boolean _and = false;
GeneralProtocolClass _protocol = p.getProtocol();
CommunicationType _commType = ((ProtocolClass) _protocol).getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, CommunicationType.DATA_DRIVEN);
- if (!_operator_equals) {
- _operator_and = false;
+ boolean _equals = Objects.equal(_commType, CommunicationType.DATA_DRIVEN);
+ if (!_equals) {
+ _and = false;
} else {
boolean _isConjugated = p.isConjugated();
- _operator_and = BooleanExtensions.operator_and(_operator_equals, _isConjugated);
+ _and = (_equals && _isConjugated);
}
- return ((Boolean)_operator_and);
+ return Boolean.valueOf(_and);
}
};
- Iterable<Port> _filter_1 = IterableExtensions.<Port>filter(_allEndPorts_1, _function_1);
- Iterable<Port> sendPorts = _filter_1;
+ Iterable<Port> sendPorts = IterableExtensions.<Port>filter(_allEndPorts_1, _function_1);
List<Port> _allEndPorts_2 = this.roomExt.getAllEndPorts(ac);
final Function1<Port,Boolean> _function_2 = new Function1<Port,Boolean>() {
public Boolean apply(final Port p) {
- boolean _operator_and = false;
+ boolean _and = false;
GeneralProtocolClass _protocol = p.getProtocol();
CommunicationType _commType = ((ProtocolClass) _protocol).getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, CommunicationType.DATA_DRIVEN);
- if (!_operator_equals) {
- _operator_and = false;
+ boolean _equals = Objects.equal(_commType, CommunicationType.DATA_DRIVEN);
+ if (!_equals) {
+ _and = false;
} else {
boolean _isConjugated = p.isConjugated();
- boolean _operator_not = BooleanExtensions.operator_not(_isConjugated);
- _operator_and = BooleanExtensions.operator_and(_operator_equals, _operator_not);
+ boolean _not = (!_isConjugated);
+ _and = (_equals && _not);
}
- return ((Boolean)_operator_and);
+ return Boolean.valueOf(_and);
}
};
- Iterable<Port> _filter_2 = IterableExtensions.<Port>filter(_allEndPorts_2, _function_2);
- Iterable<Port> recvPorts = _filter_2;
+ Iterable<Port> recvPorts = IterableExtensions.<Port>filter(_allEndPorts_2, _function_2);
ActorCommunicationType _commType = ac.getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, ActorCommunicationType.DATA_DRIVEN);
- boolean dataDriven = _operator_equals;
+ boolean dataDriven = Objects.equal(_commType, ActorCommunicationType.DATA_DRIVEN);
ActorCommunicationType _commType_1 = ac.getCommType();
- boolean _operator_equals_1 = ObjectExtensions.operator_equals(_commType_1, ActorCommunicationType.ASYNCHRONOUS);
- boolean async = _operator_equals_1;
+ boolean async = Objects.equal(_commType_1, ActorCommunicationType.ASYNCHRONOUS);
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -215,7 +201,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.newLine();
_builder.newLine();
String _name_1 = ac.getName();
- StringConcatenation _generateIncludeGuardBegin = this.stdExt.generateIncludeGuardBegin(_name_1);
+ CharSequence _generateIncludeGuardBegin = this.stdExt.generateIncludeGuardBegin(_name_1);
_builder.append(_generateIncludeGuardBegin, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -246,7 +232,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
_builder.newLine();
DetailCode _userCode1 = ac.getUserCode1();
- StringConcatenation _userCode = this.helpers.userCode(_userCode1);
+ CharSequence _userCode = this.helpers.userCode(_userCode1);
_builder.append(_userCode, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -262,31 +248,31 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append("/* const part of ActorClass (ROM) */");
_builder.newLine();
{
- boolean _operator_and = false;
- boolean _operator_and_1 = false;
- boolean _operator_and_2 = false;
+ boolean _and = false;
+ boolean _and_1 = false;
+ boolean _and_2 = false;
boolean _isEmpty = IterableExtensions.isEmpty(eventPorts);
if (!_isEmpty) {
- _operator_and_2 = false;
+ _and_2 = false;
} else {
boolean _isEmpty_1 = IterableExtensions.isEmpty(recvPorts);
- _operator_and_2 = BooleanExtensions.operator_and(_isEmpty, _isEmpty_1);
+ _and_2 = (_isEmpty && _isEmpty_1);
}
- if (!_operator_and_2) {
- _operator_and_1 = false;
+ if (!_and_2) {
+ _and_1 = false;
} else {
List<SAPRef> _allSAPs = this.roomExt.getAllSAPs(ac);
boolean _isEmpty_2 = _allSAPs.isEmpty();
- _operator_and_1 = BooleanExtensions.operator_and(_operator_and_2, _isEmpty_2);
+ _and_1 = (_and_2 && _isEmpty_2);
}
- if (!_operator_and_1) {
- _operator_and = false;
+ if (!_and_1) {
+ _and = false;
} else {
List<ServiceImplementation> _allServiceImplementations = this.roomExt.getAllServiceImplementations(ac);
boolean _isEmpty_3 = _allServiceImplementations.isEmpty();
- _operator_and = BooleanExtensions.operator_and(_operator_and_1, _isEmpty_3);
+ _and = (_and_1 && _isEmpty_3);
}
- if (_operator_and) {
+ if (_and) {
_builder.append("/* this actor class has no ports and thus no constant data */");
_builder.newLine();
} else {
@@ -302,8 +288,8 @@ public class ActorClassGen extends GenericActorClassGenerator {
for(final Port ep : eventPorts) {
{
int _multiplicity = ep.getMultiplicity();
- boolean _operator_equals_2 = ObjectExtensions.operator_equals(((Integer)_multiplicity), ((Integer)1));
- if (_operator_equals_2) {
+ boolean _equals = (_multiplicity == 1);
+ if (_equals) {
_builder.append("\t");
_builder.append("const ");
String _portClassName = this.roomExt.getPortClassName(ep);
@@ -326,8 +312,8 @@ public class ActorClassGen extends GenericActorClassGenerator {
for(final Port ep_1 : recvPorts) {
{
int _multiplicity_1 = ep_1.getMultiplicity();
- boolean _operator_equals_3 = ObjectExtensions.operator_equals(((Integer)_multiplicity_1), ((Integer)1));
- if (_operator_equals_3) {
+ boolean _equals_1 = (_multiplicity_1 == 1);
+ if (_equals_1) {
_builder.append("\t");
_builder.append("const ");
String _portClassName_1 = this.roomExt.getPortClassName(ep_1);
@@ -369,8 +355,8 @@ public class ActorClassGen extends GenericActorClassGenerator {
for(final Port ep_2 : _allEndPorts_3) {
{
int _multiplicity_2 = ep_2.getMultiplicity();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(((Integer)_multiplicity_2), ((Integer)1));
- if (_operator_notEquals) {
+ boolean _notEquals = (_multiplicity_2 != 1);
+ if (_notEquals) {
_builder.append("\t");
_builder.append("const etReplPort ");
String _name_10 = ep_2.getName();
@@ -409,10 +395,10 @@ public class ActorClassGen extends GenericActorClassGenerator {
{
StateGraph _stateMachine = xpac.getStateMachine();
boolean _isEmpty_4 = RoomHelpers.isEmpty(_stateMachine);
- boolean _operator_not = BooleanExtensions.operator_not(_isEmpty_4);
- if (_operator_not) {
+ boolean _not = (!_isEmpty_4);
+ if (_not) {
_builder.newLine();
- StringConcatenation _genHeaderConstants = this.stateMachineGen.genHeaderConstants(xpac, ac);
+ CharSequence _genHeaderConstants = this.stateMachineGen.genHeaderConstants(xpac, ac);
_builder.append(_genHeaderConstants, "");
_builder.newLineIfNotEmpty();
}
@@ -426,32 +412,32 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
- boolean _operator_and_3 = false;
- boolean _operator_and_4 = false;
- boolean _operator_and_5 = false;
+ boolean _and_3 = false;
+ boolean _and_4 = false;
+ boolean _and_5 = false;
boolean _isEmpty_5 = IterableExtensions.isEmpty(eventPorts);
if (!_isEmpty_5) {
- _operator_and_5 = false;
+ _and_5 = false;
} else {
boolean _isEmpty_6 = IterableExtensions.isEmpty(recvPorts);
- _operator_and_5 = BooleanExtensions.operator_and(_isEmpty_5, _isEmpty_6);
+ _and_5 = (_isEmpty_5 && _isEmpty_6);
}
- if (!_operator_and_5) {
- _operator_and_4 = false;
+ if (!_and_5) {
+ _and_4 = false;
} else {
List<SAPRef> _allSAPs_2 = this.roomExt.getAllSAPs(ac);
boolean _isEmpty_7 = _allSAPs_2.isEmpty();
- _operator_and_4 = BooleanExtensions.operator_and(_operator_and_5, _isEmpty_7);
+ _and_4 = (_and_5 && _isEmpty_7);
}
- if (!_operator_and_4) {
- _operator_and_3 = false;
+ if (!_and_4) {
+ _and_3 = false;
} else {
List<ServiceImplementation> _allServiceImplementations_2 = this.roomExt.getAllServiceImplementations(ac);
boolean _isEmpty_8 = _allServiceImplementations_2.isEmpty();
- _operator_and_3 = BooleanExtensions.operator_and(_operator_and_4, _isEmpty_8);
+ _and_3 = (_and_4 && _isEmpty_8);
}
- boolean _operator_not_1 = BooleanExtensions.operator_not(_operator_and_3);
- if (_operator_not_1) {
+ boolean _not_1 = (!_and_3);
+ if (_not_1) {
_builder.append("\t");
_builder.append("const ");
String _name_14 = ac.getName();
@@ -469,8 +455,8 @@ public class ActorClassGen extends GenericActorClassGenerator {
for(final Port ep_3 : sendPorts) {
{
int _multiplicity_3 = ep_3.getMultiplicity();
- boolean _operator_equals_4 = ObjectExtensions.operator_equals(((Integer)_multiplicity_3), ((Integer)1));
- if (_operator_equals_4) {
+ boolean _equals_2 = (_multiplicity_3 == 1);
+ if (_equals_2) {
_builder.append("\t");
String _portClassName_3 = this.roomExt.getPortClassName(ep_3);
_builder.append(_portClassName_3, " ");
@@ -486,7 +472,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.newLine();
_builder.append("\t");
List<Attribute> _allAttributes = this.roomExt.getAllAttributes(ac);
- StringConcatenation _attributes = this.helpers.attributes(_allAttributes);
+ CharSequence _attributes = this.helpers.attributes(_allAttributes);
_builder.append(_attributes, " ");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -495,14 +481,14 @@ public class ActorClassGen extends GenericActorClassGenerator {
for(final Attribute a : _allAttributes_1) {
{
String _defaultValueLiteral = a.getDefaultValueLiteral();
- boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_defaultValueLiteral, null);
- if (_operator_notEquals_1) {
+ boolean _notEquals_1 = (!Objects.equal(_defaultValueLiteral, null));
+ if (_notEquals_1) {
String _name_16 = ac.getName();
- String _operator_plus = StringExtensions.operator_plus(_name_16, " ");
+ String _plus = (_name_16 + " ");
String _name_17 = a.getName();
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, _name_17);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, ": Attribute initialization not supported in C");
- this.logger.logInfo(_operator_plus_2);
+ String _plus_1 = (_plus + _name_17);
+ String _plus_2 = (_plus_1 + ": Attribute initialization not supported in C");
+ this.logger.logInfo(_plus_2);
_builder.newLineIfNotEmpty();
}
}
@@ -513,13 +499,13 @@ public class ActorClassGen extends GenericActorClassGenerator {
{
StateGraph _stateMachine_1 = xpac.getStateMachine();
boolean _isEmpty_9 = RoomHelpers.isEmpty(_stateMachine_1);
- boolean _operator_not_2 = BooleanExtensions.operator_not(_isEmpty_9);
- if (_operator_not_2) {
+ boolean _not_2 = (!_isEmpty_9);
+ if (_not_2) {
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("\t");
- StringConcatenation _genDataMembers = this.stateMachineGen.genDataMembers(xpac, ac);
+ CharSequence _genDataMembers = this.stateMachineGen.genDataMembers(xpac, ac);
_builder.append(_genDataMembers, " ");
_builder.newLineIfNotEmpty();
}
@@ -543,13 +529,13 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.newLineIfNotEmpty();
_builder.newLine();
{
- boolean _operator_or = false;
+ boolean _or = false;
if (dataDriven) {
- _operator_or = true;
+ _or = true;
} else {
- _operator_or = BooleanExtensions.operator_or(dataDriven, async);
+ _or = (dataDriven || async);
}
- if (_operator_or) {
+ if (_or) {
_builder.append("void ");
String _name_21 = ac.getName();
_builder.append(_name_21, "");
@@ -563,17 +549,17 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.newLine();
EList<StandardOperation> _operations = ac.getOperations();
String _name_23 = ac.getName();
- StringConcatenation _operationsDeclaration = this.helpers.operationsDeclaration(_operations, _name_23);
+ CharSequence _operationsDeclaration = this.helpers.operationsDeclaration(_operations, _name_23);
_builder.append(_operationsDeclaration, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
DetailCode _userCode2 = ac.getUserCode2();
- StringConcatenation _userCode_1 = this.helpers.userCode(_userCode2);
+ CharSequence _userCode_1 = this.helpers.userCode(_userCode2);
_builder.append(_userCode_1, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
String _name_24 = ac.getName();
- StringConcatenation _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_24);
+ CharSequence _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_24);
_builder.append(_generateIncludeGuardEnd, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -582,25 +568,22 @@ public class ActorClassGen extends GenericActorClassGenerator {
return _xblockexpression;
}
- private StringConcatenation generateSourceFile(final Root root, final ExpandedActorClass xpac, final ActorClass ac) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence generateSourceFile(final Root root, final ExpandedActorClass xpac, final ActorClass ac) {
+ CharSequence _xblockexpression = null;
{
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;
+ boolean eventDriven = Objects.equal(_commType_1, ActorCommunicationType.EVENT_DRIVEN);
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 dataDriven = Objects.equal(_commType_2, ActorCommunicationType.DATA_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.append("/**");
_builder.newLine();
@@ -649,7 +632,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
_builder.newLine();
DetailCode _userCode3 = ac.getUserCode3();
- StringConcatenation _userCode = this.helpers.userCode(_userCode3);
+ CharSequence _userCode = this.helpers.userCode(_userCode3);
_builder.append(_userCode, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -662,9 +645,9 @@ public class ActorClassGen extends GenericActorClassGenerator {
{
StateGraph _stateMachine = xpac.getStateMachine();
boolean _isEmpty = RoomHelpers.isEmpty(_stateMachine);
- boolean _operator_not = BooleanExtensions.operator_not(_isEmpty);
- if (_operator_not) {
- StringConcatenation _genStateMachine = this.stateMachineGen.genStateMachine(xpac, ac);
+ boolean _not = (!_isEmpty);
+ if (_not) {
+ CharSequence _genStateMachine = this.stateMachineGen.genStateMachine(xpac, ac);
_builder.append(_genStateMachine, "");
_builder.newLineIfNotEmpty();
}
@@ -687,10 +670,10 @@ public class ActorClassGen extends GenericActorClassGenerator {
{
StateGraph _stateMachine_1 = xpac.getStateMachine();
boolean _isEmpty_1 = RoomHelpers.isEmpty(_stateMachine_1);
- boolean _operator_not_1 = BooleanExtensions.operator_not(_isEmpty_1);
- if (_operator_not_1) {
+ boolean _not_1 = (!_isEmpty_1);
+ if (_not_1) {
_builder.append("\t");
- StringConcatenation _genInitialization = this.stateMachineGen.genInitialization(xpac, ac);
+ CharSequence _genInitialization = this.stateMachineGen.genInitialization(xpac, ac);
_builder.append(_genInitialization, " ");
_builder.newLineIfNotEmpty();
}
@@ -716,8 +699,8 @@ public class ActorClassGen extends GenericActorClassGenerator {
{
StateGraph _stateMachine_2 = xpac.getStateMachine();
boolean _isEmpty_2 = RoomHelpers.isEmpty(_stateMachine_2);
- boolean _operator_not_2 = BooleanExtensions.operator_not(_isEmpty_2);
- if (_operator_not_2) {
+ boolean _not_2 = (!_isEmpty_2);
+ if (_not_2) {
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
@@ -740,13 +723,13 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.newLine();
_builder.newLine();
{
- boolean _operator_or_1 = false;
+ boolean _or_1 = false;
if (dataDriven) {
- _operator_or_1 = true;
+ _or_1 = true;
} else {
- _operator_or_1 = BooleanExtensions.operator_or(dataDriven, async);
+ _or_1 = (dataDriven || async);
}
- if (_operator_or_1) {
+ if (_or_1) {
_builder.append("void ");
String _name_6 = ac.getName();
_builder.append(_name_6, "");
@@ -764,8 +747,8 @@ public class ActorClassGen extends GenericActorClassGenerator {
{
StateGraph _stateMachine_3 = xpac.getStateMachine();
boolean _isEmpty_3 = RoomHelpers.isEmpty(_stateMachine_3);
- boolean _operator_not_3 = BooleanExtensions.operator_not(_isEmpty_3);
- if (_operator_not_3) {
+ boolean _not_3 = (!_isEmpty_3);
+ if (_not_3) {
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
@@ -789,7 +772,7 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
}
_builder.newLine();
- StringConcatenation _operationsImplementation = this.helpers.operationsImplementation(ac);
+ CharSequence _operationsImplementation = this.helpers.operationsImplementation(ac);
_builder.append(_operationsImplementation, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java
index 2e246cb36..54414d85c 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java
@@ -7,19 +7,17 @@ import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.core.room.RoomClass;
import org.eclipse.etrice.generator.generic.AbstractTransitionChainGenerator;
import org.eclipse.etrice.generator.generic.ILanguageExtension;
+import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.util.Pair;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.eclipse.xtext.xtend2.lib.StringConcatenation;
-@SuppressWarnings("all")
@Singleton
+@SuppressWarnings("all")
public class CExtensions implements ILanguageExtension {
@Inject
private AbstractTransitionChainGenerator chainGenerator;
public String getTypedDataDefinition(final Message m) {
- String _generateTypedData = this.chainGenerator.generateTypedData(m);
- return _generateTypedData;
+ return this.chainGenerator.generateTypedData(m);
}
public String accessLevelPrivate() {
@@ -45,8 +43,8 @@ public class CExtensions implements ILanguageExtension {
} else {
_xifexpression = "* self";
}
- String _operator_plus = StringExtensions.operator_plus(classname, _xifexpression);
- return _operator_plus;
+ String _plus = (classname + _xifexpression);
+ return _plus;
}
public String selfPointer(final boolean hasArgs) {
@@ -60,20 +58,18 @@ public class CExtensions implements ILanguageExtension {
}
public String operationScope(final String classname, final boolean isDeclaration) {
- String _operator_plus = StringExtensions.operator_plus(classname, "_");
- return _operator_plus;
+ String _plus = (classname + "_");
+ return _plus;
}
public String memberInDeclaration(final String namespace, final String member) {
- String _operator_plus = StringExtensions.operator_plus(namespace, "_");
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, member);
- return _operator_plus_1;
+ String _plus = (namespace + "_");
+ return (_plus + member);
}
public String memberInUse(final String namespace, final String member) {
- String _operator_plus = StringExtensions.operator_plus(namespace, "_");
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, member);
- return _operator_plus_1;
+ String _plus = (namespace + "_");
+ return (_plus + member);
}
/**
@@ -81,29 +77,25 @@ public class CExtensions implements ILanguageExtension {
*/
public String getCHeaderFileName(final RoomClass rc) {
String _name = rc.getName();
- String _operator_plus = StringExtensions.operator_plus(_name, ".h");
- return _operator_plus;
+ return (_name + ".h");
}
public String getCSourceFileName(final RoomClass rc) {
String _name = rc.getName();
- String _operator_plus = StringExtensions.operator_plus(_name, ".c");
- return _operator_plus;
+ return (_name + ".c");
}
public String getInstSourceFileName(final RoomClass rc) {
String _name = rc.getName();
- String _operator_plus = StringExtensions.operator_plus(_name, "_Inst.h");
- return _operator_plus;
+ return (_name + "_Inst.h");
}
public String getDispSourceFileName(final RoomClass rc) {
String _name = rc.getName();
- String _operator_plus = StringExtensions.operator_plus(_name, "_Disp.h");
- return _operator_plus;
+ return (_name + "_Disp.h");
}
- public StringConcatenation getIncludeGuardString(final String filename) {
+ public CharSequence getIncludeGuardString(final String filename) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("_");
String _upperCase = filename.toUpperCase();
@@ -112,23 +104,23 @@ public class CExtensions implements ILanguageExtension {
return _builder;
}
- public StringConcatenation generateIncludeGuardBegin(final String filename) {
+ public CharSequence generateIncludeGuardBegin(final String filename) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("#ifndef ");
- StringConcatenation _includeGuardString = this.getIncludeGuardString(filename);
+ CharSequence _includeGuardString = this.getIncludeGuardString(filename);
_builder.append(_includeGuardString, "");
_builder.newLineIfNotEmpty();
_builder.append("#define ");
- StringConcatenation _includeGuardString_1 = this.getIncludeGuardString(filename);
+ CharSequence _includeGuardString_1 = this.getIncludeGuardString(filename);
_builder.append(_includeGuardString_1, "");
_builder.newLineIfNotEmpty();
return _builder;
}
- public StringConcatenation generateIncludeGuardEnd(final String filename) {
+ public CharSequence generateIncludeGuardEnd(final String filename) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("#endif /* ");
- StringConcatenation _includeGuardString = this.getIncludeGuardString(filename);
+ CharSequence _includeGuardString = this.getIncludeGuardString(filename);
_builder.append(_includeGuardString, "");
_builder.append(" */");
_builder.newLineIfNotEmpty();
@@ -152,10 +144,10 @@ public class CExtensions implements ILanguageExtension {
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
- boolean hasAnyElements = false;
+ boolean _hasElements = false;
for(final Pair<String,String> entry : entries) {
- if (!hasAnyElements) {
- hasAnyElements = true;
+ if (!_hasElements) {
+ _hasElements = true;
} else {
_builder.appendImmediate(",", " ");
}
@@ -201,19 +193,19 @@ public class CExtensions implements ILanguageExtension {
public String arrayDeclaration(final String type, final int size, final String name, final boolean isRef) {
String _xifexpression = null;
if (isRef) {
- String _operator_plus = StringExtensions.operator_plus(type, "* ");
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, name);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "[");
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, ((Integer)size));
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, "]");
- _xifexpression = _operator_plus_4;
+ String _plus = (type + "* ");
+ String _plus_1 = (_plus + name);
+ String _plus_2 = (_plus_1 + "[");
+ String _plus_3 = (_plus_2 + Integer.valueOf(size));
+ String _plus_4 = (_plus_3 + "]");
+ _xifexpression = _plus_4;
} else {
- String _operator_plus_5 = StringExtensions.operator_plus(type, " ");
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, name);
- String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, "[");
- String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_7, ((Integer)size));
- String _operator_plus_9 = StringExtensions.operator_plus(_operator_plus_8, "]");
- _xifexpression = _operator_plus_9;
+ String _plus_5 = (type + " ");
+ String _plus_6 = (_plus_5 + name);
+ String _plus_7 = (_plus_6 + "[");
+ String _plus_8 = (_plus_7 + Integer.valueOf(size));
+ String _plus_9 = (_plus_8 + "]");
+ _xifexpression = _plus_9;
}
return _xifexpression;
}
@@ -235,8 +227,8 @@ public class CExtensions implements ILanguageExtension {
}
public String toCharArrayExpr(final String s) {
- String _operator_plus = StringExtensions.operator_plus("\"", s);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "\"");
- return _operator_plus_1;
+ String _plus = ("\"" + s);
+ String _plus_1 = (_plus + "\"");
+ return _plus_1;
}
}
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/DataClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/DataClassGen.java
index d1a850a2c..0973c7492 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/DataClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/DataClassGen.java
@@ -1,5 +1,6 @@
package org.eclipse.etrice.generator.c.gen;
+import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.HashSet;
@@ -14,13 +15,11 @@ import org.eclipse.etrice.core.room.StandardOperation;
import org.eclipse.etrice.generator.c.gen.CExtensions;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
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.ObjectExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.eclipse.xtext.xtend2.lib.StringConcatenation;
-@SuppressWarnings("all")
@Singleton
+@SuppressWarnings("all")
public class DataClassGen {
@Inject
private JavaIoFileSystemAccess fileAccess;
@@ -43,33 +42,32 @@ public class DataClassGen {
{
String _generationTargetPath = this.roomExt.getGenerationTargetPath(dc);
String _path = this.roomExt.getPath(dc);
- String _operator_plus = StringExtensions.operator_plus(_generationTargetPath, _path);
- String path = _operator_plus;
+ String path = (_generationTargetPath + _path);
String _cHeaderFileName = this.stdExt.getCHeaderFileName(dc);
- String _operator_plus_1 = StringExtensions.operator_plus("generating DataClass header \'", _cHeaderFileName);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "\' in \'");
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, path);
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, "\'");
- this.logger.logInfo(_operator_plus_4);
+ String _plus = ("generating DataClass header \'" + _cHeaderFileName);
+ String _plus_1 = (_plus + "\' in \'");
+ String _plus_2 = (_plus_1 + path);
+ String _plus_3 = (_plus_2 + "\'");
+ this.logger.logInfo(_plus_3);
this.fileAccess.setOutputPath(path);
String _cHeaderFileName_1 = this.stdExt.getCHeaderFileName(dc);
- StringConcatenation _generateHeaderFile = this.generateHeaderFile(root, dc);
+ CharSequence _generateHeaderFile = this.generateHeaderFile(root, dc);
this.fileAccess.generateFile(_cHeaderFileName_1, _generateHeaderFile);
String _cSourceFileName = this.stdExt.getCSourceFileName(dc);
- String _operator_plus_5 = StringExtensions.operator_plus("generating DataClass source \'", _cSourceFileName);
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, "\' in \'");
- String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, path);
- String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_7, "\'");
- this.logger.logInfo(_operator_plus_8);
+ String _plus_4 = ("generating DataClass source \'" + _cSourceFileName);
+ String _plus_5 = (_plus_4 + "\' in \'");
+ String _plus_6 = (_plus_5 + path);
+ String _plus_7 = (_plus_6 + "\'");
+ this.logger.logInfo(_plus_7);
this.fileAccess.setOutputPath(path);
String _cSourceFileName_1 = this.stdExt.getCSourceFileName(dc);
- StringConcatenation _generateSourceFile = this.generateSourceFile(root, dc);
+ CharSequence _generateSourceFile = this.generateSourceFile(root, dc);
this.fileAccess.generateFile(_cSourceFileName_1, _generateSourceFile);
}
}
}
- public StringConcatenation generateHeaderFile(final Root root, final DataClass dc) {
+ public CharSequence generateHeaderFile(final Root root, final DataClass dc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -92,7 +90,7 @@ public class DataClassGen {
_builder.newLine();
_builder.newLine();
String _name_1 = dc.getName();
- StringConcatenation _generateIncludeGuardBegin = this.stdExt.generateIncludeGuardBegin(_name_1);
+ CharSequence _generateIncludeGuardBegin = this.stdExt.generateIncludeGuardBegin(_name_1);
_builder.append(_generateIncludeGuardBegin, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -111,7 +109,7 @@ public class DataClassGen {
}
_builder.newLine();
DetailCode _userCode1 = dc.getUserCode1();
- StringConcatenation _userCode = this.helpers.userCode(_userCode1);
+ CharSequence _userCode = this.helpers.userCode(_userCode1);
_builder.append(_userCode, "");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
@@ -120,7 +118,7 @@ public class DataClassGen {
_builder.newLine();
_builder.append("\t");
List<Attribute> _allAttributes = this.roomExt.getAllAttributes(dc);
- StringConcatenation _attributes = this.helpers.attributes(_allAttributes);
+ CharSequence _attributes = this.helpers.attributes(_allAttributes);
_builder.append(_attributes, " ");
_builder.newLineIfNotEmpty();
_builder.append("} ");
@@ -134,14 +132,14 @@ public class DataClassGen {
for(final Attribute a : _allAttributes_1) {
{
String _defaultValueLiteral = a.getDefaultValueLiteral();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_defaultValueLiteral, null);
- if (_operator_notEquals) {
+ boolean _notEquals = (!Objects.equal(_defaultValueLiteral, null));
+ if (_notEquals) {
String _name_4 = dc.getName();
- String _operator_plus = StringExtensions.operator_plus(_name_4, " ");
+ String _plus = (_name_4 + " ");
String _name_5 = a.getName();
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, _name_5);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, ": Attribute initialization not supported in C");
- this.logger.logInfo(_operator_plus_2);
+ String _plus_1 = (_plus + _name_5);
+ String _plus_2 = (_plus_1 + ": Attribute initialization not supported in C");
+ this.logger.logInfo(_plus_2);
_builder.newLineIfNotEmpty();
}
}
@@ -151,7 +149,7 @@ public class DataClassGen {
_builder.newLine();
EList<StandardOperation> _operations = dc.getOperations();
String _name_6 = dc.getName();
- StringConcatenation _operationsDeclaration = this.helpers.operationsDeclaration(_operations, _name_6);
+ CharSequence _operationsDeclaration = this.helpers.operationsDeclaration(_operations, _name_6);
_builder.append(_operationsDeclaration, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -170,19 +168,19 @@ public class DataClassGen {
_builder.newLineIfNotEmpty();
_builder.newLine();
DetailCode _userCode2 = dc.getUserCode2();
- StringConcatenation _userCode_1 = this.helpers.userCode(_userCode2);
+ CharSequence _userCode_1 = this.helpers.userCode(_userCode2);
_builder.append(_userCode_1, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
String _name_10 = dc.getName();
- StringConcatenation _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_10);
+ CharSequence _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_10);
_builder.append(_generateIncludeGuardEnd, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
return _builder;
}
- public StringConcatenation generateSourceFile(final Root root, final DataClass dc) {
+ public CharSequence generateSourceFile(final Root root, final DataClass dc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -214,14 +212,14 @@ public class DataClassGen {
_builder.newLine();
_builder.newLine();
DetailCode _userCode3 = dc.getUserCode3();
- StringConcatenation _userCode = this.helpers.userCode(_userCode3);
+ CharSequence _userCode = this.helpers.userCode(_userCode3);
_builder.append(_userCode, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.newLine();
EList<StandardOperation> _operations = dc.getOperations();
String _name_1 = dc.getName();
- StringConcatenation _operationsImplementation = this.helpers.operationsImplementation(_operations, _name_1);
+ CharSequence _operationsImplementation = this.helpers.operationsImplementation(_operations, _name_1);
_builder.append(_operationsImplementation, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/MainGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/MainGen.java
index b1947492b..26daa4b46 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/MainGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/MainGen.java
@@ -14,10 +14,9 @@ import org.eclipse.etrice.generator.c.gen.SubSystemRunnerGen;
import org.eclipse.etrice.generator.generic.PrepareFileSystem;
import org.eclipse.xtext.generator.IFileSystemAccess;
import org.eclipse.xtext.generator.IGenerator;
-import org.eclipse.xtext.xbase.lib.BooleanExtensions;
-@SuppressWarnings("all")
@Singleton
+@SuppressWarnings("all")
public class MainGen implements IGenerator {
@Inject
private DataClassGen dataClassGen;
@@ -38,24 +37,24 @@ public class MainGen implements IGenerator {
private PrepareFileSystem prepFS;
public void doGenerate(final Resource resource, final IFileSystemAccess fsa) {
- this.prepFS.prepare(resource);
- EList<EObject> _contents = resource.getContents();
- for (final EObject e : _contents) {
- if ((e instanceof Root)) {
- this.doGenerate(((Root) e));
- }
+ this.prepFS.prepare(resource);
+ EList<EObject> _contents = resource.getContents();
+ for (final EObject e : _contents) {
+ if ((e instanceof Root)) {
+ this.doGenerate(((Root) e));
}
+ }
}
public void doGenerate(final Root e) {
- this.dataClassGen.doGenerate(e);
- this.protocolClassGen.doGenerate(e);
- this.actorClassGen.doGenerate(e);
- this.subsystemClassGen.doGenerate(e);
- boolean _isLibrary = e.isLibrary();
- boolean _operator_not = BooleanExtensions.operator_not(_isLibrary);
- if (_operator_not) {
- this.subsystemRunnerGen.doGenerate(e);
- }
+ this.dataClassGen.doGenerate(e);
+ this.protocolClassGen.doGenerate(e);
+ this.actorClassGen.doGenerate(e);
+ this.subsystemClassGen.doGenerate(e);
+ boolean _isLibrary = e.isLibrary();
+ boolean _not = (!_isLibrary);
+ if (_not) {
+ this.subsystemRunnerGen.doGenerate(e);
+ }
}
}
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java
index ac6dbaaad..999ef7e28 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java
@@ -1,5 +1,6 @@
package org.eclipse.etrice.generator.c.gen;
+import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.HashSet;
@@ -25,16 +26,13 @@ import org.eclipse.etrice.generator.generic.GenericProtocolClassGenerator;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.generic.TypeHelpers;
+import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
-import org.eclipse.xtext.xbase.lib.BooleanExtensions;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
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 ProtocolClassGen extends GenericProtocolClassGenerator {
@Inject
private JavaIoFileSystemAccess fileAccess;
@@ -60,33 +58,32 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
{
String _generationTargetPath = this.roomExt.getGenerationTargetPath(pc);
String _path = this.roomExt.getPath(pc);
- String _operator_plus = StringExtensions.operator_plus(_generationTargetPath, _path);
- String path = _operator_plus;
+ String path = (_generationTargetPath + _path);
String _cHeaderFileName = this.stdExt.getCHeaderFileName(pc);
- String _operator_plus_1 = StringExtensions.operator_plus("generating ProtocolClass header \'", _cHeaderFileName);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "\' in \'");
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, path);
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, "\'");
- this.logger.logInfo(_operator_plus_4);
+ String _plus = ("generating ProtocolClass header \'" + _cHeaderFileName);
+ String _plus_1 = (_plus + "\' in \'");
+ String _plus_2 = (_plus_1 + path);
+ String _plus_3 = (_plus_2 + "\'");
+ this.logger.logInfo(_plus_3);
this.fileAccess.setOutputPath(path);
String _cHeaderFileName_1 = this.stdExt.getCHeaderFileName(pc);
- StringConcatenation _generateHeaderFile = this.generateHeaderFile(root, pc);
+ CharSequence _generateHeaderFile = this.generateHeaderFile(root, pc);
this.fileAccess.generateFile(_cHeaderFileName_1, _generateHeaderFile);
String _cSourceFileName = this.stdExt.getCSourceFileName(pc);
- String _operator_plus_5 = StringExtensions.operator_plus("generating ProtocolClass source \'", _cSourceFileName);
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, "\' in \'");
- String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, path);
- String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_7, "\'");
- this.logger.logInfo(_operator_plus_8);
+ String _plus_4 = ("generating ProtocolClass source \'" + _cSourceFileName);
+ String _plus_5 = (_plus_4 + "\' in \'");
+ String _plus_6 = (_plus_5 + path);
+ String _plus_7 = (_plus_6 + "\'");
+ this.logger.logInfo(_plus_7);
this.fileAccess.setOutputPath(path);
String _cSourceFileName_1 = this.stdExt.getCSourceFileName(pc);
- StringConcatenation _generateSourceFile = this.generateSourceFile(root, pc);
+ CharSequence _generateSourceFile = this.generateSourceFile(root, pc);
this.fileAccess.generateFile(_cSourceFileName_1, _generateSourceFile);
}
}
}
- private StringConcatenation generateHeaderFile(final Root root, final ProtocolClass pc) {
+ private CharSequence generateHeaderFile(final Root root, final ProtocolClass pc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -109,7 +106,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
_builder.newLine();
String _name_1 = pc.getName();
- StringConcatenation _generateIncludeGuardBegin = this.stdExt.generateIncludeGuardBegin(_name_1);
+ CharSequence _generateIncludeGuardBegin = this.stdExt.generateIncludeGuardBegin(_name_1);
_builder.append(_generateIncludeGuardBegin, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -119,7 +116,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
_builder.newLine();
DetailCode _userCode1 = pc.getUserCode1();
- StringConcatenation _userCode = this.helpers.userCode(_userCode1);
+ CharSequence _userCode = this.helpers.userCode(_userCode1);
_builder.append(_userCode, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -136,8 +133,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
{
CommunicationType _commType = pc.getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, CommunicationType.EVENT_DRIVEN);
- if (_operator_equals) {
+ boolean _equals = Objects.equal(_commType, CommunicationType.EVENT_DRIVEN);
+ if (_equals) {
_builder.newLine();
_builder.append("/* message IDs */");
_builder.newLine();
@@ -147,25 +144,25 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
_builder.append("/*--------------------- port structs and methods */");
_builder.newLine();
- StringConcatenation _portClassHeader = this.portClassHeader(pc, ((Boolean)false));
+ CharSequence _portClassHeader = this.portClassHeader(pc, Boolean.valueOf(false));
_builder.append(_portClassHeader, "");
_builder.newLineIfNotEmpty();
- StringConcatenation _portClassHeader_1 = this.portClassHeader(pc, ((Boolean)true));
+ CharSequence _portClassHeader_1 = this.portClassHeader(pc, Boolean.valueOf(true));
_builder.append(_portClassHeader_1, "");
_builder.newLineIfNotEmpty();
} else {
CommunicationType _commType_1 = pc.getCommType();
- boolean _operator_equals_1 = ObjectExtensions.operator_equals(_commType_1, CommunicationType.DATA_DRIVEN);
- if (_operator_equals_1) {
+ boolean _equals_1 = Objects.equal(_commType_1, CommunicationType.DATA_DRIVEN);
+ if (_equals_1) {
_builder.append("/*--------------------- port structs and methods */");
_builder.newLine();
- StringConcatenation _genDataDrivenPortHeaders = this.genDataDrivenPortHeaders(pc);
+ CharSequence _genDataDrivenPortHeaders = this.genDataDrivenPortHeaders(pc);
_builder.append(_genDataDrivenPortHeaders, "");
_builder.newLineIfNotEmpty();
} else {
CommunicationType _commType_2 = pc.getCommType();
- boolean _operator_equals_2 = ObjectExtensions.operator_equals(_commType_2, CommunicationType.SYNCHRONOUS);
- if (_operator_equals_2) {
+ boolean _equals_2 = Objects.equal(_commType_2, CommunicationType.SYNCHRONOUS);
+ if (_equals_2) {
_builder.append("#error \"synchronoue protocols not implemented yet\"");
_builder.newLine();
}
@@ -185,19 +182,19 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLineIfNotEmpty();
_builder.newLine();
DetailCode _userCode2 = pc.getUserCode2();
- StringConcatenation _userCode_1 = this.helpers.userCode(_userCode2);
+ CharSequence _userCode_1 = this.helpers.userCode(_userCode2);
_builder.append(_userCode_1, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
String _name_4 = pc.getName();
- StringConcatenation _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_4);
+ CharSequence _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_4);
_builder.append(_generateIncludeGuardEnd, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
return _builder;
}
- private StringConcatenation generateSourceFile(final Root root, final ProtocolClass pc) {
+ private CharSequence generateSourceFile(final Root root, final ProtocolClass pc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -228,7 +225,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
_builder.newLine();
DetailCode _userCode3 = pc.getUserCode3();
- StringConcatenation _userCode = this.helpers.userCode(_userCode3);
+ CharSequence _userCode = this.helpers.userCode(_userCode3);
_builder.append(_userCode, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -236,31 +233,31 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
{
CommunicationType _commType = pc.getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, CommunicationType.EVENT_DRIVEN);
- if (_operator_equals) {
- StringConcatenation _portClassSource = this.portClassSource(pc, ((Boolean)false));
+ boolean _equals = Objects.equal(_commType, CommunicationType.EVENT_DRIVEN);
+ if (_equals) {
+ CharSequence _portClassSource = this.portClassSource(pc, Boolean.valueOf(false));
_builder.append(_portClassSource, "");
_builder.newLineIfNotEmpty();
- StringConcatenation _portClassSource_1 = this.portClassSource(pc, ((Boolean)true));
+ CharSequence _portClassSource_1 = this.portClassSource(pc, Boolean.valueOf(true));
_builder.append(_portClassSource_1, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("/*--------------------- debug helpers */");
_builder.newLine();
- StringConcatenation _generateDebugHelpersImplementation = this.generateDebugHelpersImplementation(root, pc);
+ CharSequence _generateDebugHelpersImplementation = this.generateDebugHelpersImplementation(root, pc);
_builder.append(_generateDebugHelpersImplementation, "");
_builder.newLineIfNotEmpty();
} else {
CommunicationType _commType_1 = pc.getCommType();
- boolean _operator_equals_1 = ObjectExtensions.operator_equals(_commType_1, CommunicationType.DATA_DRIVEN);
- if (_operator_equals_1) {
- StringConcatenation _genDataDrivenPortSources = this.genDataDrivenPortSources(pc);
+ boolean _equals_1 = Objects.equal(_commType_1, CommunicationType.DATA_DRIVEN);
+ if (_equals_1) {
+ CharSequence _genDataDrivenPortSources = this.genDataDrivenPortSources(pc);
_builder.append(_genDataDrivenPortSources, "");
_builder.newLineIfNotEmpty();
} else {
CommunicationType _commType_2 = pc.getCommType();
- boolean _operator_equals_2 = ObjectExtensions.operator_equals(_commType_2, CommunicationType.SYNCHRONOUS);
- if (_operator_equals_2) {
+ boolean _equals_2 = Objects.equal(_commType_2, CommunicationType.SYNCHRONOUS);
+ if (_equals_2) {
_builder.append("#error \"synchronoue protocols not implemented yet\"");
_builder.newLine();
}
@@ -270,15 +267,13 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
return _builder;
}
- private StringConcatenation portClassHeader(final ProtocolClass pc, final Boolean conj) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence portClassHeader(final ProtocolClass pc, final Boolean conj) {
+ CharSequence _xblockexpression = null;
{
- String _portClassName = this.roomExt.getPortClassName(pc, conj);
- String portClassName = _portClassName;
- String _portClassName_1 = this.roomExt.getPortClassName(pc, conj, true);
- String replPortClassName = _portClassName_1;
+ String portClassName = this.roomExt.getPortClassName(pc, (conj).booleanValue());
+ String replPortClassName = this.roomExt.getPortClassName(pc, (conj).booleanValue(), true);
List<Message> _xifexpression = null;
- if (conj) {
+ if ((conj).booleanValue()) {
List<Message> _allIncomingMessages = this.roomExt.getAllIncomingMessages(pc);
_xifexpression = _allIncomingMessages;
} else {
@@ -300,15 +295,15 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t\t");
_builder.newLine();
{
- PortClass _portClass = this.roomExt.getPortClass(pc, conj);
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_portClass, null);
- if (_operator_notEquals) {
+ PortClass _portClass = this.roomExt.getPortClass(pc, (conj).booleanValue());
+ boolean _notEquals = (!Objects.equal(_portClass, null));
+ if (_notEquals) {
{
- PortClass _portClass_1 = this.roomExt.getPortClass(pc, conj);
+ PortClass _portClass_1 = this.roomExt.getPortClass(pc, (conj).booleanValue());
EList<Attribute> _attributes = _portClass_1.getAttributes();
boolean _isEmpty = _attributes.isEmpty();
- boolean _operator_not = BooleanExtensions.operator_not(_isEmpty);
- if (_operator_not) {
+ boolean _not = (!_isEmpty);
+ if (_not) {
_builder.append("/* variable part of PortClass (RAM) */");
_builder.newLine();
_builder.append("typedef struct ");
@@ -322,28 +317,28 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("_var {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
- PortClass _portClass_2 = this.roomExt.getPortClass(pc, conj);
+ PortClass _portClass_2 = this.roomExt.getPortClass(pc, (conj).booleanValue());
EList<Attribute> _attributes_1 = _portClass_2.getAttributes();
- StringConcatenation _attributes_2 = this.helpers.attributes(_attributes_1);
+ CharSequence _attributes_2 = this.helpers.attributes(_attributes_1);
_builder.append(_attributes_2, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("};");
_builder.newLine();
{
- PortClass _portClass_3 = this.roomExt.getPortClass(pc, conj);
+ PortClass _portClass_3 = this.roomExt.getPortClass(pc, (conj).booleanValue());
EList<Attribute> _attributes_3 = _portClass_3.getAttributes();
for(final Attribute a : _attributes_3) {
{
String _defaultValueLiteral = a.getDefaultValueLiteral();
- boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(_defaultValueLiteral, null);
- if (_operator_notEquals_1) {
+ boolean _notEquals_1 = (!Objects.equal(_defaultValueLiteral, null));
+ if (_notEquals_1) {
_builder.append("\t\t\t\t");
- String _operator_plus = StringExtensions.operator_plus(portClassName, " ");
+ String _plus = (portClassName + " ");
String _name = a.getName();
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, _name);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, ": Attribute initialization not supported in C");
- this.logger.logInfo(_operator_plus_2);
+ String _plus_1 = (_plus + _name);
+ String _plus_2 = (_plus_1 + ": Attribute initialization not supported in C");
+ this.logger.logInfo(_plus_2);
_builder.newLineIfNotEmpty();
}
}
@@ -359,8 +354,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
for(final Message message : messages) {
_builder.append("\t\t");
VarDecl _data = message.getData();
- boolean _operator_notEquals_2 = ObjectExtensions.operator_notEquals(_data, null);
- boolean hasData = _operator_notEquals_2;
+ boolean hasData = (!Objects.equal(_data, null));
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
String _xifexpression_1 = null;
@@ -377,26 +371,26 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
String _xifexpression_2 = null;
- boolean _operator_and = false;
+ boolean _and = false;
if (!hasData) {
- _operator_and = false;
+ _and = false;
} else {
- boolean _operator_or = false;
+ boolean _or = false;
VarDecl _data_2 = message.getData();
RefableType _refType_1 = _data_2.getRefType();
DataType _type_1 = _refType_1.getType();
- boolean _operator_not_1 = BooleanExtensions.operator_not((_type_1 instanceof PrimitiveType));
- if (_operator_not_1) {
- _operator_or = true;
+ boolean _not_1 = (!(_type_1 instanceof PrimitiveType));
+ if (_not_1) {
+ _or = true;
} else {
VarDecl _data_3 = message.getData();
RefableType _refType_2 = _data_3.getRefType();
boolean _isRef = _refType_2.isRef();
- _operator_or = BooleanExtensions.operator_or(_operator_not_1, _isRef);
+ _or = (_not_1 || _isRef);
}
- _operator_and = BooleanExtensions.operator_and(hasData, _operator_or);
+ _and = (hasData && _or);
}
- if (_operator_and) {
+ if (_and) {
_xifexpression_2 = "*";
} else {
_xifexpression_2 = "";
@@ -406,10 +400,10 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t\t");
String _xifexpression_3 = null;
if (hasData) {
- String _operator_plus_3 = StringExtensions.operator_plus(", ", typeName);
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, refp);
- String _operator_plus_5 = StringExtensions.operator_plus(_operator_plus_4, " data");
- _xifexpression_3 = _operator_plus_5;
+ String _plus_3 = (", " + typeName);
+ String _plus_4 = (_plus_3 + refp);
+ String _plus_5 = (_plus_4 + " data");
+ _xifexpression_3 = _plus_5;
} else {
_xifexpression_3 = "";
}
@@ -429,8 +423,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
String _name_3 = message.getName();
- String _operator_plus_6 = StringExtensions.operator_plus(", int idx", data);
- String _messageSignature_2 = this.messageSignature(replPortClassName, _name_3, "", _operator_plus_6);
+ String _plus_6 = (", int idx" + data);
+ String _messageSignature_2 = this.messageSignature(replPortClassName, _name_3, "", _plus_6);
_builder.append(_messageSignature_2, " ");
_builder.append(";");
_builder.newLineIfNotEmpty();
@@ -439,19 +433,19 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t\t\t");
_builder.newLine();
{
- PortClass _portClass_4 = this.roomExt.getPortClass(pc, conj);
- boolean _operator_notEquals_3 = ObjectExtensions.operator_notEquals(_portClass_4, null);
- if (_operator_notEquals_3) {
+ PortClass _portClass_4 = this.roomExt.getPortClass(pc, (conj).booleanValue());
+ boolean _notEquals_2 = (!Objects.equal(_portClass_4, null));
+ if (_notEquals_2) {
_builder.append("\t\t");
- PortClass _portClass_5 = this.roomExt.getPortClass(pc, conj);
+ PortClass _portClass_5 = this.roomExt.getPortClass(pc, (conj).booleanValue());
EList<PortOperation> _operations = _portClass_5.getOperations();
- StringConcatenation _operationsDeclaration = this.helpers.operationsDeclaration(_operations, portClassName);
+ CharSequence _operationsDeclaration = this.helpers.operationsDeclaration(_operations, portClassName);
_builder.append(_operationsDeclaration, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
- PortClass _portClass_6 = this.roomExt.getPortClass(pc, conj);
+ PortClass _portClass_6 = this.roomExt.getPortClass(pc, (conj).booleanValue());
EList<PortOperation> _operations_1 = _portClass_6.getOperations();
- StringConcatenation _operationsDeclaration_1 = this.helpers.operationsDeclaration(_operations_1, replPortClassName);
+ CharSequence _operationsDeclaration_1 = this.helpers.operationsDeclaration(_operations_1, replPortClassName);
_builder.append(_operationsDeclaration_1, " ");
_builder.newLineIfNotEmpty();
}
@@ -459,10 +453,10 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t\t");
_builder.newLine();
{
- boolean _handlesReceive = this.roomExt.handlesReceive(pc, conj);
+ boolean _handlesReceive = this.roomExt.handlesReceive(pc, (conj).booleanValue());
if (_handlesReceive) {
{
- List<MessageHandler> _receiveHandlers = this.roomExt.getReceiveHandlers(pc, conj);
+ List<MessageHandler> _receiveHandlers = this.roomExt.getReceiveHandlers(pc, (conj).booleanValue());
for(final MessageHandler h : _receiveHandlers) {
_builder.append("void ");
_builder.append(portClassName, "");
@@ -489,19 +483,18 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
return _xblockexpression;
}
- private StringConcatenation genDataDrivenPortHeaders(final ProtocolClass pc) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence genDataDrivenPortHeaders(final ProtocolClass pc) {
+ CharSequence _xblockexpression = null;
{
List<Message> _allIncomingMessages = this.roomExt.getAllIncomingMessages(pc);
final Function1<Message,Boolean> _function = new Function1<Message,Boolean>() {
public Boolean apply(final Message m) {
VarDecl _data = m.getData();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_data, null);
- return ((Boolean)_operator_notEquals);
+ boolean _notEquals = (!Objects.equal(_data, null));
+ return Boolean.valueOf(_notEquals);
}
};
- Iterable<Message> _filter = IterableExtensions.<Message>filter(_allIncomingMessages, _function);
- Iterable<Message> sentMsgs = _filter;
+ Iterable<Message> sentMsgs = IterableExtensions.<Message>filter(_allIncomingMessages, _function);
StringConcatenation _builder = new StringConcatenation();
_builder.append("/* data driven send port (conjugated) */");
_builder.newLine();
@@ -513,8 +506,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
VarDecl _data = msg.getData();
RefableType _refType = _data.getRefType();
DataType _type = _refType.getType();
- String _typeName = this._typeHelpers.typeName(_type);
- String typeName = _typeName;
+ String typeName = this._typeHelpers.typeName(_type);
_builder.newLineIfNotEmpty();
_builder.append("\t");
String _xifexpression = null;
@@ -565,33 +557,32 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
{
for(final Message message : sentMsgs) {
VarDecl _data_2 = message.getData();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_data_2, null);
- boolean hasData = _operator_notEquals;
+ boolean hasData = (!Objects.equal(_data_2, null));
_builder.newLineIfNotEmpty();
String _xifexpression_1 = null;
if (hasData) {
VarDecl _data_3 = message.getData();
RefableType _refType_2 = _data_3.getRefType();
DataType _type_1 = _refType_2.getType();
- String _typeName_1 = this._typeHelpers.typeName(_type_1);
- _xifexpression_1 = _typeName_1;
+ String _typeName = this._typeHelpers.typeName(_type_1);
+ _xifexpression_1 = _typeName;
} else {
_xifexpression_1 = "";
}
String typeName_1 = _xifexpression_1;
_builder.newLineIfNotEmpty();
String _xifexpression_2 = null;
- boolean _operator_and = false;
+ boolean _and = false;
if (!hasData) {
- _operator_and = false;
+ _and = false;
} else {
VarDecl _data_4 = message.getData();
RefableType _refType_3 = _data_4.getRefType();
DataType _type_2 = _refType_3.getType();
- boolean _operator_not = BooleanExtensions.operator_not((_type_2 instanceof PrimitiveType));
- _operator_and = BooleanExtensions.operator_and(hasData, _operator_not);
+ boolean _not = (!(_type_2 instanceof PrimitiveType));
+ _and = (hasData && _not);
}
- if (_operator_and) {
+ if (_and) {
_xifexpression_2 = "*";
} else {
_xifexpression_2 = "";
@@ -600,10 +591,10 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLineIfNotEmpty();
String _xifexpression_3 = null;
if (hasData) {
- String _operator_plus = StringExtensions.operator_plus(", ", typeName_1);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, refp_1);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, " data");
- _xifexpression_3 = _operator_plus_2;
+ String _plus = (", " + typeName_1);
+ String _plus_1 = (_plus + refp_1);
+ String _plus_2 = (_plus_1 + " data");
+ _xifexpression_3 = _plus_2;
} else {
_xifexpression_3 = "";
}
@@ -629,55 +620,41 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
return _xblockexpression;
}
- private StringConcatenation genDataDrivenPortSources(final ProtocolClass pc) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence genDataDrivenPortSources(final ProtocolClass pc) {
+ CharSequence _xblockexpression = null;
{
List<Message> _allIncomingMessages = this.roomExt.getAllIncomingMessages(pc);
final Function1<Message,Boolean> _function = new Function1<Message,Boolean>() {
public Boolean apply(final Message m) {
VarDecl _data = m.getData();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_data, null);
- return ((Boolean)_operator_notEquals);
+ boolean _notEquals = (!Objects.equal(_data, null));
+ return Boolean.valueOf(_notEquals);
}
};
- Iterable<Message> _filter = IterableExtensions.<Message>filter(_allIncomingMessages, _function);
- Iterable<Message> messages = _filter;
+ Iterable<Message> messages = IterableExtensions.<Message>filter(_allIncomingMessages, _function);
StringConcatenation _builder = new StringConcatenation();
{
for(final Message message : messages) {
VarDecl _data = message.getData();
RefableType _refType = _data.getRefType();
DataType _type = _refType.getType();
- String _typeName = this._typeHelpers.typeName(_type);
- String typeName = _typeName;
+ String typeName = this._typeHelpers.typeName(_type);
_builder.newLineIfNotEmpty();
String _xifexpression = null;
VarDecl _data_1 = message.getData();
RefableType _refType_1 = _data_1.getRefType();
DataType _type_1 = _refType_1.getType();
- boolean _operator_not = BooleanExtensions.operator_not((_type_1 instanceof PrimitiveType));
- if (_operator_not) {
+ boolean _not = (!(_type_1 instanceof PrimitiveType));
+ if (_not) {
_xifexpression = "*";
} else {
_xifexpression = "";
}
String refp = _xifexpression;
_builder.newLineIfNotEmpty();
- String _xifexpression_1 = null;
- VarDecl _data_2 = message.getData();
- RefableType _refType_2 = _data_2.getRefType();
- DataType _type_2 = _refType_2.getType();
- if ((_type_2 instanceof PrimitiveType)) {
- _xifexpression_1 = "&";
- } else {
- _xifexpression_1 = "";
- }
- String refa = _xifexpression_1;
- _builder.newLineIfNotEmpty();
- String _operator_plus = StringExtensions.operator_plus(", ", typeName);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, refp);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, " data");
- String data = _operator_plus_2;
+ String _plus = (", " + typeName);
+ String _plus_1 = (_plus + refp);
+ String data = (_plus_1 + " data");
_builder.newLineIfNotEmpty();
String _portClassName = this.roomExt.getPortClassName(pc, true);
String _name = message.getName();
@@ -715,15 +692,13 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
return _xblockexpression;
}
- private StringConcatenation portClassSource(final ProtocolClass pc, final Boolean conj) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence portClassSource(final ProtocolClass pc, final Boolean conj) {
+ CharSequence _xblockexpression = null;
{
- String _portClassName = this.roomExt.getPortClassName(pc, conj);
- String portClassName = _portClassName;
- String _portClassName_1 = this.roomExt.getPortClassName(pc, conj, true);
- String replPortClassName = _portClassName_1;
+ String portClassName = this.roomExt.getPortClassName(pc, (conj).booleanValue());
+ String replPortClassName = this.roomExt.getPortClassName(pc, (conj).booleanValue(), true);
List<Message> _xifexpression = null;
- if (conj) {
+ if ((conj).booleanValue()) {
List<Message> _allIncomingMessages = this.roomExt.getAllIncomingMessages(pc);
_xifexpression = _allIncomingMessages;
} else {
@@ -732,7 +707,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
}
List<Message> messages = _xifexpression;
String _xifexpression_1 = null;
- if (conj) {
+ if ((conj).booleanValue()) {
_xifexpression_1 = "IN_";
} else {
_xifexpression_1 = "OUT_";
@@ -742,8 +717,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
{
for(final Message message : messages) {
VarDecl _data = message.getData();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_data, null);
- boolean hasData = _operator_notEquals;
+ boolean hasData = (!Objects.equal(_data, null));
_builder.newLineIfNotEmpty();
String _xifexpression_2 = null;
if (hasData) {
@@ -758,16 +732,16 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
String typeName = _xifexpression_2;
_builder.newLineIfNotEmpty();
String _xifexpression_3 = null;
- boolean _operator_and = false;
+ boolean _and = false;
if (!hasData) {
- _operator_and = false;
+ _and = false;
} else {
VarDecl _data_2 = message.getData();
RefableType _refType_1 = _data_2.getRefType();
boolean _isRef = _refType_1.isRef();
- _operator_and = BooleanExtensions.operator_and(hasData, _isRef);
+ _and = (hasData && _isRef);
}
- if (_operator_and) {
+ if (_and) {
_xifexpression_3 = "*";
} else {
_xifexpression_3 = "";
@@ -775,26 +749,26 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
String refp = _xifexpression_3;
_builder.newLineIfNotEmpty();
String _xifexpression_4 = null;
- boolean _operator_and_1 = false;
+ boolean _and_1 = false;
if (!hasData) {
- _operator_and_1 = false;
+ _and_1 = false;
} else {
- boolean _operator_or = false;
+ boolean _or = false;
VarDecl _data_3 = message.getData();
RefableType _refType_2 = _data_3.getRefType();
DataType _type_1 = _refType_2.getType();
- boolean _operator_not = BooleanExtensions.operator_not((_type_1 instanceof PrimitiveType));
- if (_operator_not) {
- _operator_or = true;
+ boolean _not = (!(_type_1 instanceof PrimitiveType));
+ if (_not) {
+ _or = true;
} else {
VarDecl _data_4 = message.getData();
RefableType _refType_3 = _data_4.getRefType();
boolean _isRef_1 = _refType_3.isRef();
- _operator_or = BooleanExtensions.operator_or(_operator_not, _isRef_1);
+ _or = (_not || _isRef_1);
}
- _operator_and_1 = BooleanExtensions.operator_and(hasData, _operator_or);
+ _and_1 = (hasData && _or);
}
- if (_operator_and_1) {
+ if (_and_1) {
_xifexpression_4 = "*";
} else {
_xifexpression_4 = "";
@@ -802,27 +776,27 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
String refpd = _xifexpression_4;
_builder.newLineIfNotEmpty();
String _xifexpression_5 = null;
- boolean _operator_and_2 = false;
- boolean _operator_and_3 = false;
+ boolean _and_2 = false;
+ boolean _and_3 = false;
if (!hasData) {
- _operator_and_3 = false;
+ _and_3 = false;
} else {
VarDecl _data_5 = message.getData();
RefableType _refType_4 = _data_5.getRefType();
DataType _type_2 = _refType_4.getType();
- boolean _operator_not_1 = BooleanExtensions.operator_not((_type_2 instanceof PrimitiveType));
- _operator_and_3 = BooleanExtensions.operator_and(hasData, _operator_not_1);
+ boolean _not_1 = (!(_type_2 instanceof PrimitiveType));
+ _and_3 = (hasData && _not_1);
}
- if (!_operator_and_3) {
- _operator_and_2 = false;
+ if (!_and_3) {
+ _and_2 = false;
} else {
VarDecl _data_6 = message.getData();
RefableType _refType_5 = _data_6.getRefType();
boolean _isRef_2 = _refType_5.isRef();
- boolean _operator_not_2 = BooleanExtensions.operator_not(_isRef_2);
- _operator_and_2 = BooleanExtensions.operator_and(_operator_and_3, _operator_not_2);
+ boolean _not_2 = (!_isRef_2);
+ _and_2 = (_and_3 && _not_2);
}
- if (_operator_and_2) {
+ if (_and_2) {
_xifexpression_5 = "";
} else {
_xifexpression_5 = "&";
@@ -831,10 +805,10 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLineIfNotEmpty();
String _xifexpression_6 = null;
if (hasData) {
- String _operator_plus = StringExtensions.operator_plus(", ", typeName);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, refpd);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, " data");
- _xifexpression_6 = _operator_plus_2;
+ String _plus = (", " + typeName);
+ String _plus_1 = (_plus + refpd);
+ String _plus_2 = (_plus_1 + " data");
+ _xifexpression_6 = _plus_2;
} else {
_xifexpression_6 = "";
}
@@ -848,8 +822,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
}
String dataCall = _xifexpression_7;
_builder.newLineIfNotEmpty();
- MessageHandler _sendHandler = this.roomExt.getSendHandler(message, conj);
- MessageHandler hdlr = _sendHandler;
+ MessageHandler hdlr = this.roomExt.getSendHandler(message, (conj).booleanValue());
_builder.newLineIfNotEmpty();
_builder.newLine();
String _name = message.getName();
@@ -858,8 +831,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
- boolean _operator_notEquals_1 = ObjectExtensions.operator_notEquals(hdlr, null);
- if (_operator_notEquals_1) {
+ boolean _notEquals = (!Objects.equal(hdlr, null));
+ if (_notEquals) {
_builder.append("\t");
{
DetailCode _detailCode = hdlr.getDetailCode();
@@ -883,11 +856,11 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t");
String _name_2 = pc.getName();
String _name_3 = message.getName();
- String _operator_plus_3 = StringExtensions.operator_plus(dir, _name_3);
- String _memberInUse = this.stdExt.memberInUse(_name_2, _operator_plus_3);
- String _operator_plus_4 = StringExtensions.operator_plus(typeName, refp);
- String _operator_plus_5 = StringExtensions.operator_plus(refa, "data");
- String _sendMessageCall = this.sendMessageCall(hasData, "self", _memberInUse, _operator_plus_4, _operator_plus_5);
+ String _plus_3 = (dir + _name_3);
+ String _memberInUse = this.stdExt.memberInUse(_name_2, _plus_3);
+ String _plus_4 = (typeName + refp);
+ String _plus_5 = (refa + "data");
+ String _sendMessageCall = this.sendMessageCall(hasData, "self", _memberInUse, _plus_4, _plus_5);
_builder.append(_sendMessageCall, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -904,8 +877,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
- boolean _operator_notEquals_2 = ObjectExtensions.operator_notEquals(hdlr, null);
- if (_operator_notEquals_2) {
+ boolean _notEquals_1 = (!Objects.equal(hdlr, null));
+ if (_notEquals_1) {
_builder.append("\t");
_builder.append("int i;");
_builder.newLine();
@@ -944,11 +917,11 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t");
String _name_7 = pc.getName();
String _name_8 = message.getName();
- String _operator_plus_6 = StringExtensions.operator_plus(dir, _name_8);
- String _memberInUse_1 = this.stdExt.memberInUse(_name_7, _operator_plus_6);
- String _operator_plus_7 = StringExtensions.operator_plus(typeName, refp);
- String _operator_plus_8 = StringExtensions.operator_plus(refa, "data");
- String _sendMessageCall_1 = this.sendMessageCall(hasData, "((etPort*)&((etReplPort*)self)->ports[i])", _memberInUse_1, _operator_plus_7, _operator_plus_8);
+ String _plus_6 = (dir + _name_8);
+ String _memberInUse_1 = this.stdExt.memberInUse(_name_7, _plus_6);
+ String _plus_7 = (typeName + refp);
+ String _plus_8 = (refa + "data");
+ String _sendMessageCall_1 = this.sendMessageCall(hasData, "((etPort*)&((etReplPort*)self)->ports[i])", _memberInUse_1, _plus_7, _plus_8);
_builder.append(_sendMessageCall_1, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -963,14 +936,14 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
_builder.newLine();
String _name_9 = message.getName();
- String _operator_plus_9 = StringExtensions.operator_plus(", int idx", data);
- String _messageSignature_2 = this.messageSignature(replPortClassName, _name_9, "", _operator_plus_9);
+ String _plus_9 = (", int idx" + data);
+ String _messageSignature_2 = this.messageSignature(replPortClassName, _name_9, "", _plus_9);
_builder.append(_messageSignature_2, "");
_builder.append(" {");
_builder.newLineIfNotEmpty();
{
- boolean _operator_notEquals_3 = ObjectExtensions.operator_notEquals(hdlr, null);
- if (_operator_notEquals_3) {
+ boolean _notEquals_2 = (!Objects.equal(hdlr, null));
+ if (_notEquals_2) {
_builder.append("\t");
_builder.append(portClassName, " ");
_builder.append("_");
@@ -996,11 +969,11 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t");
String _name_12 = pc.getName();
String _name_13 = message.getName();
- String _operator_plus_10 = StringExtensions.operator_plus(dir, _name_13);
- String _memberInUse_2 = this.stdExt.memberInUse(_name_12, _operator_plus_10);
- String _operator_plus_11 = StringExtensions.operator_plus(typeName, refp);
- String _operator_plus_12 = StringExtensions.operator_plus(refa, "data");
- String _sendMessageCall_2 = this.sendMessageCall(hasData, "((etPort*)&((etReplPort*)self)->ports[idx])", _memberInUse_2, _operator_plus_11, _operator_plus_12);
+ String _plus_10 = (dir + _name_13);
+ String _memberInUse_2 = this.stdExt.memberInUse(_name_12, _plus_10);
+ String _plus_11 = (typeName + refp);
+ String _plus_12 = (refa + "data");
+ String _sendMessageCall_2 = this.sendMessageCall(hasData, "((etPort*)&((etReplPort*)self)->ports[idx])", _memberInUse_2, _plus_11, _plus_12);
_builder.append(_sendMessageCall_2, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -1017,17 +990,17 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
}
_builder.newLine();
{
- PortClass _portClass = this.roomExt.getPortClass(pc, conj);
- boolean _operator_notEquals_4 = ObjectExtensions.operator_notEquals(_portClass, null);
- if (_operator_notEquals_4) {
- PortClass _portClass_1 = this.roomExt.getPortClass(pc, conj);
+ PortClass _portClass = this.roomExt.getPortClass(pc, (conj).booleanValue());
+ boolean _notEquals_3 = (!Objects.equal(_portClass, null));
+ if (_notEquals_3) {
+ PortClass _portClass_1 = this.roomExt.getPortClass(pc, (conj).booleanValue());
EList<PortOperation> _operations = _portClass_1.getOperations();
- StringConcatenation _operationsImplementation = this.helpers.operationsImplementation(_operations, portClassName);
+ CharSequence _operationsImplementation = this.helpers.operationsImplementation(_operations, portClassName);
_builder.append(_operationsImplementation, "");
_builder.newLineIfNotEmpty();
- PortClass _portClass_2 = this.roomExt.getPortClass(pc, conj);
+ PortClass _portClass_2 = this.roomExt.getPortClass(pc, (conj).booleanValue());
EList<PortOperation> _operations_1 = _portClass_2.getOperations();
- StringConcatenation _operationsImplementation_1 = this.helpers.operationsImplementation(_operations_1, replPortClassName);
+ CharSequence _operationsImplementation_1 = this.helpers.operationsImplementation(_operations_1, replPortClassName);
_builder.append(_operationsImplementation_1, "");
_builder.newLineIfNotEmpty();
}
@@ -1048,9 +1021,9 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
_builder.newLine();
{
- boolean _handlesReceive = this.roomExt.handlesReceive(pc, conj);
+ boolean _handlesReceive = this.roomExt.handlesReceive(pc, (conj).booleanValue());
if (_handlesReceive) {
- StringConcatenation _genReceiveHandlers = this.genReceiveHandlers(pc, conj);
+ CharSequence _genReceiveHandlers = this.genReceiveHandlers(pc, conj);
_builder.append(_genReceiveHandlers, "");
_builder.newLineIfNotEmpty();
}
@@ -1064,93 +1037,70 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
private String sendMessageCall(final boolean hasData, final String self, final String msg, final String typeName, final String data) {
String _xifexpression = null;
if (hasData) {
- String _operator_plus = StringExtensions.operator_plus("etPort_sendMessage(", self);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, ", ");
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, msg);
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, ", sizeof(");
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, typeName);
- String _operator_plus_5 = StringExtensions.operator_plus(_operator_plus_4, "), ");
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, data);
- String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, ");");
- _xifexpression = _operator_plus_7;
+ String _plus = ("etPort_sendMessage(" + self);
+ String _plus_1 = (_plus + ", ");
+ String _plus_2 = (_plus_1 + msg);
+ String _plus_3 = (_plus_2 + ", sizeof(");
+ String _plus_4 = (_plus_3 + typeName);
+ String _plus_5 = (_plus_4 + "), ");
+ String _plus_6 = (_plus_5 + data);
+ String _plus_7 = (_plus_6 + ");");
+ _xifexpression = _plus_7;
} else {
- String _operator_plus_8 = StringExtensions.operator_plus("etPort_sendMessage(", self);
- String _operator_plus_9 = StringExtensions.operator_plus(_operator_plus_8, ", ");
- String _operator_plus_10 = StringExtensions.operator_plus(_operator_plus_9, msg);
- String _operator_plus_11 = StringExtensions.operator_plus(_operator_plus_10, ", 0, NULL);");
- _xifexpression = _operator_plus_11;
+ String _plus_8 = ("etPort_sendMessage(" + self);
+ String _plus_9 = (_plus_8 + ", ");
+ String _plus_10 = (_plus_9 + msg);
+ String _plus_11 = (_plus_10 + ", 0, NULL);");
+ _xifexpression = _plus_11;
}
return _xifexpression;
}
private String messageSignature(final String className, final String messageName, final String methodSuffix, final String data) {
- String _operator_plus = StringExtensions.operator_plus("void ", className);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "_");
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, messageName);
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, methodSuffix);
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, "(const ");
- String _operator_plus_5 = StringExtensions.operator_plus(_operator_plus_4, className);
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, "* self");
- String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, data);
- String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_7, ")");
- return _operator_plus_8;
+ String _plus = ("void " + className);
+ String _plus_1 = (_plus + "_");
+ String _plus_2 = (_plus_1 + messageName);
+ String _plus_3 = (_plus_2 + methodSuffix);
+ String _plus_4 = (_plus_3 + "(const ");
+ String _plus_5 = (_plus_4 + className);
+ String _plus_6 = (_plus_5 + "* self");
+ String _plus_7 = (_plus_6 + data);
+ String _plus_8 = (_plus_7 + ")");
+ return _plus_8;
}
private String messageSetterSignature(final String className, final String messageName, final String data) {
- String _operator_plus = StringExtensions.operator_plus("void ", className);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "_");
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, messageName);
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, "_set(");
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, className);
- String _operator_plus_5 = StringExtensions.operator_plus(_operator_plus_4, "* self");
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, data);
- String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, ")");
- return _operator_plus_7;
+ String _plus = ("void " + className);
+ String _plus_1 = (_plus + "_");
+ String _plus_2 = (_plus_1 + messageName);
+ String _plus_3 = (_plus_2 + "_set(");
+ String _plus_4 = (_plus_3 + className);
+ String _plus_5 = (_plus_4 + "* self");
+ String _plus_6 = (_plus_5 + data);
+ String _plus_7 = (_plus_6 + ")");
+ return _plus_7;
}
private String messageGetterSignature(final String className, final String messageName, final String type) {
- String _operator_plus = StringExtensions.operator_plus(type, " ");
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, className);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "_");
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, messageName);
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, "_get(const ");
- String _operator_plus_5 = StringExtensions.operator_plus(_operator_plus_4, className);
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, "* const self)");
- return _operator_plus_6;
- }
-
- private StringConcatenation messageCall(final Message m) {
- StringConcatenation _builder = new StringConcatenation();
- String _name = m.getName();
- _builder.append(_name, "");
- _builder.append("(");
- {
- VarDecl _data = m.getData();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_data, null);
- if (_operator_notEquals) {
- _builder.append(" ");
- VarDecl _data_1 = m.getData();
- String _name_1 = _data_1.getName();
- _builder.append(_name_1, "");
- }
- }
- _builder.append(")");
- _builder.newLineIfNotEmpty();
- return _builder;
+ String _plus = (type + " ");
+ String _plus_1 = (_plus + className);
+ String _plus_2 = (_plus_1 + "_");
+ String _plus_3 = (_plus_2 + messageName);
+ String _plus_4 = (_plus_3 + "_get(const ");
+ String _plus_5 = (_plus_4 + className);
+ String _plus_6 = (_plus_5 + "* const self)");
+ return _plus_6;
}
- private StringConcatenation genReceiveHandlers(final ProtocolClass pc, final Boolean conj) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence genReceiveHandlers(final ProtocolClass pc, final Boolean conj) {
+ CharSequence _xblockexpression = null;
{
- String _portClassName = this.roomExt.getPortClassName(pc, conj);
- String portClassName = _portClassName;
- String _portClassName_1 = this.roomExt.getPortClassName(pc, conj, true);
- String replPortClassName = _portClassName_1;
+ String portClassName = this.roomExt.getPortClassName(pc, (conj).booleanValue());
StringConcatenation _builder = new StringConcatenation();
_builder.append("/* receiver handlers */");
_builder.newLine();
{
- List<MessageHandler> _receiveHandlers = this.roomExt.getReceiveHandlers(pc, conj);
+ List<MessageHandler> _receiveHandlers = this.roomExt.getReceiveHandlers(pc, (conj).booleanValue());
for(final MessageHandler h : _receiveHandlers) {
_builder.append("void ");
_builder.append(portClassName, "");
@@ -1164,7 +1114,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLineIfNotEmpty();
_builder.append("\t");
DetailCode _detailCode = h.getDetailCode();
- StringConcatenation _userCode = this.helpers.userCode(_detailCode);
+ CharSequence _userCode = this.helpers.userCode(_detailCode);
_builder.append(_userCode, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t");
@@ -1182,7 +1132,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
return _xblockexpression;
}
- private StringConcatenation generateDebugHelpersImplementation(final Root root, final ProtocolClass pc) {
+ private CharSequence generateDebugHelpersImplementation(final Root root, final ProtocolClass pc) {
StringConcatenation _builder = new StringConcatenation();
_builder.newLine();
_builder.append("/* message names as strings for debugging (generate MSC) */");
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java
index 133e2ad8f..751c964b6 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java
@@ -8,25 +8,23 @@ import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.State;
import org.eclipse.etrice.generator.generic.GenericStateMachineGenerator;
import org.eclipse.etrice.generator.generic.RoomExtensions;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
-import org.eclipse.xtext.xtend2.lib.StringConcatenation;
+import org.eclipse.xtend2.lib.StringConcatenation;
-@SuppressWarnings("all")
@Singleton
+@SuppressWarnings("all")
public class StateMachineGen extends GenericStateMachineGenerator {
@Inject
private RoomExtensions _roomExtensions;
- public StringConcatenation genHeaderConstants(final ExpandedActorClass xpac, final ActorClass ac) {
- StringConcatenation _xblockexpression = null;
+ public CharSequence genHeaderConstants(final ExpandedActorClass xpac, final ActorClass ac) {
+ CharSequence _xblockexpression = null;
{
List<State> _allBaseStates = this._roomExtensions.getAllBaseStates(ac);
int _size = _allBaseStates.size();
List<State> _allLeafStates = this._roomExtensions.getAllLeafStates(ac);
int _size_1 = _allLeafStates.size();
- int _operator_minus = IntegerExtensions.operator_minus(((Integer)_size), ((Integer)_size_1));
- int _operator_plus = IntegerExtensions.operator_plus(((Integer)_operator_minus), ((Integer)2));
- int historySize = _operator_plus;
+ int _minus = (_size - _size_1);
+ int historySize = (_minus + 2);
StringConcatenation _builder = new StringConcatenation();
_builder.append("/* constant for state machine data */");
_builder.newLine();
@@ -42,7 +40,7 @@ public class StateMachineGen extends GenericStateMachineGenerator {
return _xblockexpression;
}
- public StringConcatenation genDataMembers(final ExpandedActorClass xpac, final ActorClass ac) {
+ public CharSequence genDataMembers(final ExpandedActorClass xpac, final ActorClass ac) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/* state machine variables */");
_builder.newLine();
@@ -57,7 +55,7 @@ public class StateMachineGen extends GenericStateMachineGenerator {
return _builder;
}
- public StringConcatenation genInitialization(final ExpandedActorClass xpac, final ActorClass ac) {
+ public CharSequence genInitialization(final ExpandedActorClass xpac, final ActorClass ac) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("self->state = STATE_TOP;");
_builder.newLine();
@@ -83,7 +81,7 @@ public class StateMachineGen extends 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();
_builder.newLine();
String _accessLevelPrivate = this.langExt.accessLevelPrivate();
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
index 6ba2c9d02..e4737ab0c 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java
@@ -1,5 +1,7 @@
package org.eclipse.etrice.generator.c.gen;
+import com.google.common.base.Objects;
+import com.google.common.collect.Iterables;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.ArrayList;
@@ -34,20 +36,14 @@ import org.eclipse.etrice.generator.c.gen.CExtensions;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.generic.TypeHelpers;
+import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
-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.ListExtensions;
-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 SubSystemClassGen {
@Inject
private JavaIoFileSystemAccess fileAccess;
@@ -75,61 +71,59 @@ public class SubSystemClassGen {
String _generationTargetPath = this.roomExt.getGenerationTargetPath(_subSystemClass);
SubSystemClass _subSystemClass_1 = ssi.getSubSystemClass();
String _path = this.roomExt.getPath(_subSystemClass_1);
- String _operator_plus = StringExtensions.operator_plus(_generationTargetPath, _path);
- String path = _operator_plus;
+ String path = (_generationTargetPath + _path);
SubSystemClass _subSystemClass_2 = ssi.getSubSystemClass();
- String _cHeaderFileName = this.stdExt.getCHeaderFileName(_subSystemClass_2);
- String file = _cHeaderFileName;
- String _operator_plus_1 = StringExtensions.operator_plus("generating SubSystemClass declaration: \'", file);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "\' in \'");
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, path);
- String _operator_plus_4 = StringExtensions.operator_plus(_operator_plus_3, "\'");
- this.logger.logInfo(_operator_plus_4);
+ String file = this.stdExt.getCHeaderFileName(_subSystemClass_2);
+ String _plus = ("generating SubSystemClass declaration: \'" + file);
+ String _plus_1 = (_plus + "\' in \'");
+ String _plus_2 = (_plus_1 + path);
+ String _plus_3 = (_plus_2 + "\'");
+ this.logger.logInfo(_plus_3);
this.fileAccess.setOutputPath(path);
SubSystemClass _subSystemClass_3 = ssi.getSubSystemClass();
- StringConcatenation _generateHeaderFile = this.generateHeaderFile(root, ssi, _subSystemClass_3);
+ CharSequence _generateHeaderFile = this.generateHeaderFile(root, ssi, _subSystemClass_3);
this.fileAccess.generateFile(file, _generateHeaderFile);
SubSystemClass _subSystemClass_4 = ssi.getSubSystemClass();
String _cSourceFileName = this.stdExt.getCSourceFileName(_subSystemClass_4);
file = _cSourceFileName;
- String _operator_plus_5 = StringExtensions.operator_plus("generating SubSystemClass implementation: \'", file);
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, "\' in \'");
- String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, path);
- String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_7, "\'");
- this.logger.logInfo(_operator_plus_8);
+ String _plus_4 = ("generating SubSystemClass implementation: \'" + file);
+ String _plus_5 = (_plus_4 + "\' in \'");
+ String _plus_6 = (_plus_5 + path);
+ String _plus_7 = (_plus_6 + "\'");
+ this.logger.logInfo(_plus_7);
this.fileAccess.setOutputPath(path);
SubSystemClass _subSystemClass_5 = ssi.getSubSystemClass();
- StringConcatenation _generateSourceFile = this.generateSourceFile(root, ssi, _subSystemClass_5);
+ CharSequence _generateSourceFile = this.generateSourceFile(root, ssi, _subSystemClass_5);
this.fileAccess.generateFile(file, _generateSourceFile);
SubSystemClass _subSystemClass_6 = ssi.getSubSystemClass();
String _instSourceFileName = this.stdExt.getInstSourceFileName(_subSystemClass_6);
file = _instSourceFileName;
- String _operator_plus_9 = StringExtensions.operator_plus("generating SubSystemClass instance file: \'", file);
- String _operator_plus_10 = StringExtensions.operator_plus(_operator_plus_9, "\' in \'");
- String _operator_plus_11 = StringExtensions.operator_plus(_operator_plus_10, path);
- String _operator_plus_12 = StringExtensions.operator_plus(_operator_plus_11, "\'");
- this.logger.logInfo(_operator_plus_12);
+ String _plus_8 = ("generating SubSystemClass instance file: \'" + file);
+ String _plus_9 = (_plus_8 + "\' in \'");
+ String _plus_10 = (_plus_9 + path);
+ String _plus_11 = (_plus_10 + "\'");
+ this.logger.logInfo(_plus_11);
this.fileAccess.setOutputPath(path);
SubSystemClass _subSystemClass_7 = ssi.getSubSystemClass();
- StringConcatenation _generateInstanceFile = this.generateInstanceFile(root, ssi, _subSystemClass_7);
+ CharSequence _generateInstanceFile = this.generateInstanceFile(root, ssi, _subSystemClass_7);
this.fileAccess.generateFile(file, _generateInstanceFile);
SubSystemClass _subSystemClass_8 = ssi.getSubSystemClass();
String _dispSourceFileName = this.stdExt.getDispSourceFileName(_subSystemClass_8);
file = _dispSourceFileName;
- String _operator_plus_13 = StringExtensions.operator_plus("generating SubSystemClass dispatcher file: \'", file);
- String _operator_plus_14 = StringExtensions.operator_plus(_operator_plus_13, "\' in \'");
- String _operator_plus_15 = StringExtensions.operator_plus(_operator_plus_14, path);
- String _operator_plus_16 = StringExtensions.operator_plus(_operator_plus_15, "\'");
- this.logger.logInfo(_operator_plus_16);
+ String _plus_12 = ("generating SubSystemClass dispatcher file: \'" + file);
+ String _plus_13 = (_plus_12 + "\' in \'");
+ String _plus_14 = (_plus_13 + path);
+ String _plus_15 = (_plus_14 + "\'");
+ this.logger.logInfo(_plus_15);
this.fileAccess.setOutputPath(path);
SubSystemClass _subSystemClass_9 = ssi.getSubSystemClass();
- StringConcatenation _generateDispatcherFile = this.generateDispatcherFile(root, ssi, _subSystemClass_9);
+ CharSequence _generateDispatcherFile = this.generateDispatcherFile(root, ssi, _subSystemClass_9);
this.fileAccess.generateFile(file, _generateDispatcherFile);
}
}
}
- private StringConcatenation generateHeaderFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
+ private CharSequence generateHeaderFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -152,12 +146,12 @@ public class SubSystemClassGen {
_builder.newLine();
_builder.newLine();
String _name_1 = ssc.getName();
- StringConcatenation _generateIncludeGuardBegin = this.stdExt.generateIncludeGuardBegin(_name_1);
+ CharSequence _generateIncludeGuardBegin = this.stdExt.generateIncludeGuardBegin(_name_1);
_builder.append(_generateIncludeGuardBegin, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
DetailCode _userCode1 = ssc.getUserCode1();
- StringConcatenation _userCode = this.helpers.userCode(_userCode1);
+ CharSequence _userCode = this.helpers.userCode(_userCode1);
_builder.append(_userCode, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -206,12 +200,12 @@ public class SubSystemClassGen {
_builder.newLineIfNotEmpty();
_builder.newLine();
DetailCode _userCode2 = ssc.getUserCode2();
- StringConcatenation _userCode_1 = this.helpers.userCode(_userCode2);
+ CharSequence _userCode_1 = this.helpers.userCode(_userCode2);
_builder.append(_userCode_1, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
String _name_8 = ssc.getName();
- StringConcatenation _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_8);
+ CharSequence _generateIncludeGuardEnd = this.stdExt.generateIncludeGuardEnd(_name_8);
_builder.append(_generateIncludeGuardEnd, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -219,7 +213,7 @@ public class SubSystemClassGen {
return _builder;
}
- private StringConcatenation generateSourceFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
+ private CharSequence generateSourceFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -271,7 +265,7 @@ public class SubSystemClassGen {
_builder.newLine();
_builder.newLine();
DetailCode _userCode3 = ssc.getUserCode3();
- StringConcatenation _userCode = this.helpers.userCode(_userCode3);
+ CharSequence _userCode = this.helpers.userCode(_userCode3);
_builder.append(_userCode, "");
_builder.newLineIfNotEmpty();
_builder.newLine();
@@ -416,7 +410,7 @@ public class SubSystemClassGen {
_builder.append("etMessageService_execute(&msgService_Thread1);");
_builder.newLine();
_builder.append("\t\t\t\t");
- StringConcatenation _generateDatadrivenExecutes = this.generateDatadrivenExecutes(root, ssi);
+ CharSequence _generateDatadrivenExecutes = this.generateDatadrivenExecutes(root, ssi);
_builder.append(_generateDatadrivenExecutes, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t");
@@ -444,7 +438,7 @@ public class SubSystemClassGen {
_builder.append("etMessageService_execute(&msgService_Thread1);");
_builder.newLine();
_builder.append("\t\t\t\t");
- StringConcatenation _generateDatadrivenExecutes_1 = this.generateDatadrivenExecutes(root, ssi);
+ CharSequence _generateDatadrivenExecutes_1 = this.generateDatadrivenExecutes(root, ssi);
_builder.append(_generateDatadrivenExecutes_1, " ");
_builder.newLineIfNotEmpty();
_builder.append("\t\t\t\t");
@@ -512,7 +506,7 @@ public class SubSystemClassGen {
_builder.newLineIfNotEmpty();
{
EList<ActorInstance> _allContainedInstances = ssi.getAllContainedInstances();
- Iterable<ActorInstance> _reverseView = ListExtensions.<ActorInstance>reverseView(_allContainedInstances);
+ List<ActorInstance> _reverseView = ListExtensions.<ActorInstance>reverseView(_allContainedInstances);
for(final ActorInstance ai : _reverseView) {
{
ActorClass _actorClass = ai.getActorClass();
@@ -520,13 +514,13 @@ public class SubSystemClassGen {
final Function1<StandardOperation,Boolean> _function = new Function1<StandardOperation,Boolean>() {
public Boolean apply(final StandardOperation op) {
boolean _isDestructor = op.isDestructor();
- return ((Boolean)_isDestructor);
+ return Boolean.valueOf(_isDestructor);
}
};
Iterable<StandardOperation> _filter = IterableExtensions.<StandardOperation>filter(_operations, _function);
boolean _isEmpty = IterableExtensions.isEmpty(_filter);
- boolean _operator_not = BooleanExtensions.operator_not(_isEmpty);
- if (_operator_not) {
+ boolean _not = (!_isEmpty);
+ if (_not) {
_builder.append("\t");
ActorClass _actorClass_1 = ai.getActorClass();
String _name_22 = _actorClass_1.getName();
@@ -593,13 +587,13 @@ public class SubSystemClassGen {
final Function1<StandardOperation,Boolean> _function_1 = new Function1<StandardOperation,Boolean>() {
public Boolean apply(final StandardOperation op) {
boolean _isConstructor = RoomHelpers.isConstructor(op);
- return ((Boolean)_isConstructor);
+ return Boolean.valueOf(_isConstructor);
}
};
Iterable<StandardOperation> _filter_1 = IterableExtensions.<StandardOperation>filter(_operations_1, _function_1);
boolean _isEmpty_1 = IterableExtensions.isEmpty(_filter_1);
- boolean _operator_not_1 = BooleanExtensions.operator_not(_isEmpty_1);
- if (_operator_not_1) {
+ boolean _not_1 = (!_isEmpty_1);
+ if (_not_1) {
_builder.append("\t");
ActorClass _actorClass_3 = ai_1.getActorClass();
String _name_28 = _actorClass_3.getName();
@@ -655,7 +649,7 @@ public class SubSystemClassGen {
return _builder;
}
- private StringConcatenation generateInstanceFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
+ private CharSequence generateInstanceFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -763,16 +757,16 @@ public class SubSystemClassGen {
ProtocolClass _protocol = pi.getProtocol();
boolean _isConjugated = this.roomExt.isConjugated(pi);
PortClass _portClass = this.roomExt.getPortClass(_protocol, _isConjugated);
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_portClass, null);
- if (_operator_notEquals) {
+ boolean _notEquals = (!Objects.equal(_portClass, null));
+ if (_notEquals) {
{
ProtocolClass _protocol_1 = pi.getProtocol();
boolean _isConjugated_1 = this.roomExt.isConjugated(pi);
PortClass _portClass_1 = this.roomExt.getPortClass(_protocol_1, _isConjugated_1);
EList<Attribute> _attributes = _portClass_1.getAttributes();
boolean _isEmpty_1 = _attributes.isEmpty();
- boolean _operator_not = BooleanExtensions.operator_not(_isEmpty_1);
- if (_operator_not) {
+ boolean _not = (!_isEmpty_1);
+ if (_not) {
{
boolean _isReplicated = pi.isReplicated();
if (_isReplicated) {
@@ -805,7 +799,7 @@ public class SubSystemClassGen {
String _pathName_2 = this.roomExt.getPathName(_path_2);
_builder.append(_pathName_2, "");
_builder.append("_var={");
- StringConcatenation _genPortAttributeInitializer = this.genPortAttributeInitializer(pi);
+ CharSequence _genPortAttributeInitializer = this.genPortAttributeInitializer(pi);
_builder.append(_genPortAttributeInitializer, "");
_builder.append("};");
_builder.newLineIfNotEmpty();
@@ -839,7 +833,7 @@ public class SubSystemClassGen {
_builder.append("/* no ports/saps/services - nothing to initialize statically */");
_builder.newLine();
} else {
- StringConcatenation _genActorInstanceInitializer = this.genActorInstanceInitializer(root, ai_2);
+ CharSequence _genActorInstanceInitializer = this.genActorInstanceInitializer(root, ai_2);
_builder.append(_genActorInstanceInitializer, "");
_builder.newLineIfNotEmpty();
}
@@ -851,52 +845,52 @@ public class SubSystemClassGen {
}
private String genReplPortAttributeInitializer(final InterfaceItemInstance pi) {
- int i = 0;
- String retval = "";
- EList<InterfaceItemInstance> _peers = pi.getPeers();
- int _size = _peers.size();
- i = _size;
- boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)i), ((Integer)0));
- Boolean _xwhileexpression = _operator_greaterThan;
- while (_xwhileexpression) {
- {
- String _operator_plus = StringExtensions.operator_plus(retval, "\r\n\t\t\t{");
- StringConcatenation _genPortAttributeInitializer = this.genPortAttributeInitializer(pi);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, _genPortAttributeInitializer);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, "}");
- retval = _operator_plus_2;
- int _operator_minus = IntegerExtensions.operator_minus(((Integer)i), ((Integer)1));
- i = _operator_minus;
- boolean _operator_greaterThan_1 = ComparableExtensions.<Integer>operator_greaterThan(((Integer)i), ((Integer)0));
- if (_operator_greaterThan_1) {
- String _operator_plus_3 = StringExtensions.operator_plus(retval, ",");
- retval = _operator_plus_3;
- }
+ int i = 0;
+ String retval = "";
+ EList<InterfaceItemInstance> _peers = pi.getPeers();
+ int _size = _peers.size();
+ i = _size;
+ boolean _greaterThan = (i > 0);
+ boolean _while = _greaterThan;
+ while (_while) {
+ {
+ String _plus = (retval + "\r\n\t\t\t{");
+ CharSequence _genPortAttributeInitializer = this.genPortAttributeInitializer(pi);
+ String _plus_1 = (_plus + _genPortAttributeInitializer);
+ String _plus_2 = (_plus_1 + "}");
+ retval = _plus_2;
+ int _minus = (i - 1);
+ i = _minus;
+ boolean _greaterThan_1 = (i > 0);
+ if (_greaterThan_1) {
+ String _plus_3 = (retval + ",");
+ retval = _plus_3;
}
- boolean _operator_greaterThan_2 = ComparableExtensions.<Integer>operator_greaterThan(((Integer)i), ((Integer)0));
- _xwhileexpression = _operator_greaterThan_2;
}
- return retval;
+ boolean _greaterThan_1 = (i > 0);
+ _while = _greaterThan_1;
+ }
+ return retval;
}
- private StringConcatenation genPortAttributeInitializer(final InterfaceItemInstance pi) {
+ private CharSequence genPortAttributeInitializer(final InterfaceItemInstance pi) {
StringConcatenation _builder = new StringConcatenation();
{
ProtocolClass _protocol = pi.getProtocol();
boolean _isConjugated = this.roomExt.isConjugated(pi);
PortClass _portClass = this.roomExt.getPortClass(_protocol, _isConjugated);
EList<Attribute> _attributes = _portClass.getAttributes();
- boolean hasAnyElements = false;
+ boolean _hasElements = false;
for(final Attribute attr : _attributes) {
- if (!hasAnyElements) {
- hasAnyElements = true;
+ if (!_hasElements) {
+ _hasElements = true;
} else {
_builder.appendImmediate(",", "");
}
{
String _defaultValueLiteral = attr.getDefaultValueLiteral();
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_defaultValueLiteral, null);
- if (_operator_notEquals) {
+ boolean _notEquals = (!Objects.equal(_defaultValueLiteral, null));
+ if (_notEquals) {
String _defaultValueLiteral_1 = attr.getDefaultValueLiteral();
_builder.append(_defaultValueLiteral_1, "");
} else {
@@ -911,113 +905,93 @@ public class SubSystemClassGen {
return _builder;
}
- private StringConcatenation genActorInstanceInitializer(final Root root, final ActorInstance ai) {
- StringConcatenation _xblockexpression = null;
+ private CharSequence genActorInstanceInitializer(final Root root, final ActorInstance ai) {
+ CharSequence _xblockexpression = null;
{
String _path = ai.getPath();
- String _pathName = this.roomExt.getPathName(_path);
- String instName = _pathName;
+ String instName = this.roomExt.getPathName(_path);
ArrayList<InterfaceItemInstance> _arrayList = new ArrayList<InterfaceItemInstance>();
ArrayList<InterfaceItemInstance> replPorts = _arrayList;
EList<InterfaceItemInstance> _orderedIfItemInstances = ai.getOrderedIfItemInstances();
final Function1<InterfaceItemInstance,Boolean> _function = new Function1<InterfaceItemInstance,Boolean>() {
public Boolean apply(final InterfaceItemInstance e) {
boolean _isReplicated = e.isReplicated();
- return ((Boolean)_isReplicated);
+ return Boolean.valueOf(_isReplicated);
}
};
Iterable<InterfaceItemInstance> _filter = IterableExtensions.<InterfaceItemInstance>filter(_orderedIfItemInstances, _function);
- CollectionExtensions.<InterfaceItemInstance>addAll(replPorts, _filter);
+ Iterables.<InterfaceItemInstance>addAll(replPorts, _filter);
final Function1<InterfaceItemInstance,Boolean> _function_1 = new Function1<InterfaceItemInstance,Boolean>() {
public Boolean apply(final InterfaceItemInstance e) {
EList<InterfaceItemInstance> _peers = e.getPeers();
boolean _isEmpty = _peers.isEmpty();
- boolean _operator_not = BooleanExtensions.operator_not(_isEmpty);
- return ((Boolean)_operator_not);
+ boolean _not = (!_isEmpty);
+ return Boolean.valueOf(_not);
}
};
InterfaceItemInstance _findFirst = IterableExtensions.<InterfaceItemInstance>findFirst(replPorts, _function_1);
- boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_findFirst, null);
- boolean haveReplSubPorts = _operator_notEquals;
+ boolean haveReplSubPorts = (!Objects.equal(_findFirst, null));
EList<InterfaceItemInstance> _orderedIfItemInstances_1 = ai.getOrderedIfItemInstances();
final Function1<InterfaceItemInstance,Boolean> _function_2 = new Function1<InterfaceItemInstance,Boolean>() {
public Boolean apply(final InterfaceItemInstance e) {
boolean _isSimple = e.isSimple();
- return ((Boolean)_isSimple);
+ return Boolean.valueOf(_isSimple);
}
};
- Iterable<InterfaceItemInstance> _filter_1 = IterableExtensions.<InterfaceItemInstance>filter(_orderedIfItemInstances_1, _function_2);
- Iterable<InterfaceItemInstance> simplePorts = _filter_1;
+ Iterable<InterfaceItemInstance> simplePorts = IterableExtensions.<InterfaceItemInstance>filter(_orderedIfItemInstances_1, _function_2);
ArrayList<InterfaceItemInstance> _arrayList_1 = new ArrayList<InterfaceItemInstance>();
ArrayList<InterfaceItemInstance> eventPorts = _arrayList_1;
final Function1<InterfaceItemInstance,Boolean> _function_3 = new Function1<InterfaceItemInstance,Boolean>() {
public Boolean apply(final InterfaceItemInstance p) {
ProtocolClass _protocol = p.getProtocol();
CommunicationType _commType = _protocol.getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, CommunicationType.EVENT_DRIVEN);
- return ((Boolean)_operator_equals);
+ boolean _equals = Objects.equal(_commType, CommunicationType.EVENT_DRIVEN);
+ return Boolean.valueOf(_equals);
}
};
- Iterable<InterfaceItemInstance> _filter_2 = IterableExtensions.<InterfaceItemInstance>filter(simplePorts, _function_3);
- Iterable<InterfaceItemInstance> _union = this.roomExt.<InterfaceItemInstance>union(_filter_2, replPorts);
- CollectionExtensions.<InterfaceItemInstance>addAll(eventPorts, _union);
+ Iterable<InterfaceItemInstance> _filter_1 = IterableExtensions.<InterfaceItemInstance>filter(simplePorts, _function_3);
+ Iterable<InterfaceItemInstance> _union = this.roomExt.<InterfaceItemInstance>union(_filter_1, replPorts);
+ Iterables.<InterfaceItemInstance>addAll(eventPorts, _union);
final Function1<InterfaceItemInstance,Boolean> _function_4 = new Function1<InterfaceItemInstance,Boolean>() {
public Boolean apply(final InterfaceItemInstance p) {
ProtocolClass _protocol = p.getProtocol();
CommunicationType _commType = _protocol.getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, CommunicationType.DATA_DRIVEN);
- return ((Boolean)_operator_equals);
+ boolean _equals = Objects.equal(_commType, CommunicationType.DATA_DRIVEN);
+ return Boolean.valueOf(_equals);
}
};
- Iterable<InterfaceItemInstance> _filter_3 = IterableExtensions.<InterfaceItemInstance>filter(simplePorts, _function_4);
- Iterable<InterfaceItemInstance> dataPorts = _filter_3;
+ Iterable<InterfaceItemInstance> dataPorts = IterableExtensions.<InterfaceItemInstance>filter(simplePorts, _function_4);
final Function1<InterfaceItemInstance,Boolean> _function_5 = new Function1<InterfaceItemInstance,Boolean>() {
public Boolean apply(final InterfaceItemInstance p) {
- boolean _operator_and = false;
- if (!(p instanceof PortInstance)) {
- _operator_and = false;
- } else {
- Port _port = ((PortInstance) p).getPort();
- boolean _isConjugated = _port.isConjugated();
- boolean _operator_not = BooleanExtensions.operator_not(_isConjugated);
- _operator_and = BooleanExtensions.operator_and((p instanceof PortInstance), _operator_not);
- }
- return ((Boolean)_operator_and);
- }
- };
- Iterable<InterfaceItemInstance> _filter_4 = IterableExtensions.<InterfaceItemInstance>filter(dataPorts, _function_5);
- Iterable<InterfaceItemInstance> recvPorts = _filter_4;
- final Function1<InterfaceItemInstance,Boolean> _function_6 = new Function1<InterfaceItemInstance,Boolean>() {
- public Boolean apply(final InterfaceItemInstance p) {
- boolean _operator_and = false;
+ boolean _and = false;
if (!(p instanceof PortInstance)) {
- _operator_and = false;
+ _and = false;
} else {
Port _port = ((PortInstance) p).getPort();
boolean _isConjugated = _port.isConjugated();
- _operator_and = BooleanExtensions.operator_and((p instanceof PortInstance), _isConjugated);
+ boolean _not = (!_isConjugated);
+ _and = ((p instanceof PortInstance) && _not);
}
- return ((Boolean)_operator_and);
+ return Boolean.valueOf(_and);
}
};
- Iterable<InterfaceItemInstance> _filter_5 = IterableExtensions.<InterfaceItemInstance>filter(dataPorts, _function_6);
- Iterable<InterfaceItemInstance> sendPorts = _filter_5;
+ Iterable<InterfaceItemInstance> recvPorts = IterableExtensions.<InterfaceItemInstance>filter(dataPorts, _function_5);
HashMap<InterfaceItemInstance,Integer> _hashMap = new HashMap<InterfaceItemInstance,Integer>();
HashMap<InterfaceItemInstance,Integer> offsets = _hashMap;
int offset = 0;
for (final InterfaceItemInstance p : replPorts) {
{
- offsets.put(p, ((Integer)offset));
+ offsets.put(p, Integer.valueOf(offset));
EList<InterfaceItemInstance> _peers = p.getPeers();
int _size = _peers.size();
- int _operator_plus = IntegerExtensions.operator_plus(((Integer)offset), ((Integer)_size));
- offset = _operator_plus;
+ int _plus = (offset + _size);
+ offset = _plus;
}
}
String _xifexpression = null;
if (haveReplSubPorts) {
- String _operator_plus_1 = StringExtensions.operator_plus(instName, "_repl_sub_ports");
- _xifexpression = _operator_plus_1;
+ String _plus = (instName + "_repl_sub_ports");
+ _xifexpression = _plus;
} else {
_xifexpression = "NULL";
}
@@ -1035,10 +1009,10 @@ public class SubSystemClassGen {
_builder.append("/* Replicated Sub Ports: {varData, msgService, peerAddress, localId, index} */");
_builder.newLine();
{
- boolean hasAnyElements = false;
+ boolean _hasElements = false;
for(final InterfaceItemInstance pi : replPorts) {
- if (!hasAnyElements) {
- hasAnyElements = true;
+ if (!_hasElements) {
+ _hasElements = true;
} else {
_builder.appendImmediate(",", " ");
}
@@ -1053,16 +1027,16 @@ public class SubSystemClassGen {
}
}
{
- boolean _operator_and = false;
+ boolean _and = false;
boolean _isEmpty = eventPorts.isEmpty();
if (!_isEmpty) {
- _operator_and = false;
+ _and = false;
} else {
boolean _isEmpty_1 = IterableExtensions.isEmpty(recvPorts);
- _operator_and = BooleanExtensions.operator_and(_isEmpty, _isEmpty_1);
+ _and = (_isEmpty && _isEmpty_1);
}
- boolean _operator_not = BooleanExtensions.operator_not(_operator_and);
- if (_operator_not) {
+ boolean _not = (!_and);
+ if (_not) {
_builder.append("static const ");
ActorClass _actorClass = ai.getActorClass();
String _name = _actorClass.getName();
@@ -1075,10 +1049,10 @@ public class SubSystemClassGen {
_builder.append("/* Ports: {varData, msgService, peerAddress, localId} */");
_builder.newLine();
{
- boolean hasAnyElements_1 = false;
+ boolean _hasElements_1 = false;
for(final InterfaceItemInstance pi_1 : eventPorts) {
- if (!hasAnyElements_1) {
- hasAnyElements_1 = true;
+ if (!_hasElements_1) {
+ _hasElements_1 = true;
} else {
_builder.appendImmediate(",", " ");
}
@@ -1092,9 +1066,9 @@ public class SubSystemClassGen {
} else {
_builder.append("\t");
_builder.append("{");
- EList<InterfaceItemInstance> _peers_1 = pi_1.getPeers();
- int _size_1 = _peers_1.size();
- _builder.append(_size_1, " ");
+ EList<InterfaceItemInstance> _peers = pi_1.getPeers();
+ int _size = _peers.size();
+ _builder.append(_size, " ");
_builder.append(", ");
_builder.append(replSubPortsArray, " ");
_builder.append("+");
@@ -1108,17 +1082,17 @@ public class SubSystemClassGen {
}
_builder.append("\t");
{
- boolean _operator_and_1 = false;
+ boolean _and_1 = false;
boolean _isEmpty_2 = eventPorts.isEmpty();
- boolean _operator_not_1 = BooleanExtensions.operator_not(_isEmpty_2);
- if (!_operator_not_1) {
- _operator_and_1 = false;
+ boolean _not_1 = (!_isEmpty_2);
+ if (!_not_1) {
+ _and_1 = false;
} else {
boolean _isEmpty_3 = IterableExtensions.isEmpty(recvPorts);
- boolean _operator_not_2 = BooleanExtensions.operator_not(_isEmpty_3);
- _operator_and_1 = BooleanExtensions.operator_and(_operator_not_1, _operator_not_2);
+ boolean _not_2 = (!_isEmpty_3);
+ _and_1 = (_not_1 && _not_2);
}
- if (_operator_and_1) {
+ if (_and_1) {
_builder.append(",");
}
}
@@ -1129,10 +1103,10 @@ public class SubSystemClassGen {
_builder.append("/* data receive ports */");
_builder.newLine();
{
- boolean hasAnyElements_2 = false;
+ boolean _hasElements_2 = false;
for(final InterfaceItemInstance pi_2 : recvPorts) {
- if (!hasAnyElements_2) {
- hasAnyElements_2 = true;
+ if (!_hasElements_2) {
+ _hasElements_2 = true;
} else {
_builder.appendImmediate(",", " ");
}
@@ -1164,86 +1138,73 @@ public class SubSystemClassGen {
private String genPortInitializer(final Root root, final ActorInstance ai, final InterfaceItemInstance pi) {
String _xblockexpression = null;
{
- String _xifexpression = null;
+ int _xifexpression = (int) 0;
EList<InterfaceItemInstance> _peers = pi.getPeers();
boolean _isEmpty = _peers.isEmpty();
if (_isEmpty) {
- _xifexpression = "NULL";
+ _xifexpression = 0;
} else {
- ActorClass _actorClass = ai.getActorClass();
- String _name = _actorClass.getName();
- String _operator_plus = StringExtensions.operator_plus(_name, "_receiveMessage");
- _xifexpression = _operator_plus;
+ EList<InterfaceItemInstance> _peers_1 = pi.getPeers();
+ InterfaceItemInstance _get = _peers_1.get(0);
+ int _objId = _get.getObjId();
+ _xifexpression = _objId;
}
- String recvMsg = _xifexpression;
+ int objId = _xifexpression;
int _xifexpression_1 = (int) 0;
- EList<InterfaceItemInstance> _peers_1 = pi.getPeers();
- boolean _isEmpty_1 = _peers_1.isEmpty();
+ EList<InterfaceItemInstance> _peers_2 = pi.getPeers();
+ boolean _isEmpty_1 = _peers_2.isEmpty();
if (_isEmpty_1) {
_xifexpression_1 = 0;
} else {
- EList<InterfaceItemInstance> _peers_2 = pi.getPeers();
- InterfaceItemInstance _get = _peers_2.get(0);
- int _objId = _get.getObjId();
- _xifexpression_1 = _objId;
- }
- int objId = _xifexpression_1;
- int _xifexpression_2 = (int) 0;
- EList<InterfaceItemInstance> _peers_3 = pi.getPeers();
- boolean _isEmpty_2 = _peers_3.isEmpty();
- if (_isEmpty_2) {
- _xifexpression_2 = 0;
- } else {
- EList<InterfaceItemInstance> _peers_4 = pi.getPeers();
- InterfaceItemInstance _get_1 = _peers_4.get(0);
- EList<InterfaceItemInstance> _peers_5 = _get_1.getPeers();
- int _indexOf = _peers_5.indexOf(pi);
- _xifexpression_2 = _indexOf;
+ EList<InterfaceItemInstance> _peers_3 = pi.getPeers();
+ InterfaceItemInstance _get_1 = _peers_3.get(0);
+ EList<InterfaceItemInstance> _peers_4 = _get_1.getPeers();
+ int _indexOf = _peers_4.indexOf(pi);
+ _xifexpression_1 = _indexOf;
}
- int idx = _xifexpression_2;
+ int idx = _xifexpression_1;
String _interfaceItemInstanceData = this.getInterfaceItemInstanceData(pi);
- String _operator_plus_1 = StringExtensions.operator_plus("{", _interfaceItemInstanceData);
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, ",");
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, "&msgService_Thread1, ");
- int _operator_plus_4 = IntegerExtensions.operator_plus(((Integer)objId), ((Integer)idx));
- String _operator_plus_5 = StringExtensions.operator_plus(_operator_plus_3, ((Integer)_operator_plus_4));
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, ", ");
+ String _plus = ("{" + _interfaceItemInstanceData);
+ String _plus_1 = (_plus + ",");
+ String _plus_2 = (_plus_1 + "&msgService_Thread1, ");
+ int _plus_3 = (objId + idx);
+ String _plus_4 = (_plus_2 + Integer.valueOf(_plus_3));
+ String _plus_5 = (_plus_4 + ", ");
ExpandedActorClass _expandedActorClass = root.getExpandedActorClass(ai);
InterfaceItem _interfaceItem = pi.getInterfaceItem();
int _interfaceItemLocalId = _expandedActorClass.getInterfaceItemLocalId(_interfaceItem);
- int _operator_plus_7 = IntegerExtensions.operator_plus(((Integer)_interfaceItemLocalId), ((Integer)1));
- String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_6, ((Integer)_operator_plus_7));
- String _operator_plus_9 = StringExtensions.operator_plus(_operator_plus_8, "} /* Port ");
- String _name_1 = pi.getName();
- String _operator_plus_10 = StringExtensions.operator_plus(_operator_plus_9, _name_1);
- String _operator_plus_11 = StringExtensions.operator_plus(_operator_plus_10, " */");
- _xblockexpression = (_operator_plus_11);
+ int _plus_6 = (_interfaceItemLocalId + 1);
+ String _plus_7 = (_plus_5 + Integer.valueOf(_plus_6));
+ String _plus_8 = (_plus_7 + "} /* Port ");
+ String _name = pi.getName();
+ String _plus_9 = (_plus_8 + _name);
+ String _plus_10 = (_plus_9 + " */");
+ _xblockexpression = (_plus_10);
}
return _xblockexpression;
}
private String getInterfaceItemInstanceData(final InterfaceItemInstance pi) {
- ProtocolClass _protocol = pi.getProtocol();
- boolean _isConjugated = this.roomExt.isConjugated(pi);
- PortClass _portClass = this.roomExt.getPortClass(_protocol, _isConjugated);
- boolean _operator_equals = ObjectExtensions.operator_equals(_portClass, null);
- if (_operator_equals) {
- return "0";
- }
- ProtocolClass _protocol_1 = pi.getProtocol();
- boolean _isConjugated_1 = this.roomExt.isConjugated(pi);
- PortClass _portClass_1 = this.roomExt.getPortClass(_protocol_1, _isConjugated_1);
- EList<Attribute> _attributes = _portClass_1.getAttributes();
- boolean _isEmpty = _attributes.isEmpty();
- if (_isEmpty) {
- return "0";
- } else {
- String _path = pi.getPath();
- String _pathName = this.roomExt.getPathName(_path);
- String _operator_plus = StringExtensions.operator_plus("&", _pathName);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, "_var");
- return _operator_plus_1;
- }
+ ProtocolClass _protocol = pi.getProtocol();
+ boolean _isConjugated = this.roomExt.isConjugated(pi);
+ PortClass _portClass = this.roomExt.getPortClass(_protocol, _isConjugated);
+ boolean _equals = Objects.equal(_portClass, null);
+ if (_equals) {
+ return "0";
+ }
+ ProtocolClass _protocol_1 = pi.getProtocol();
+ boolean _isConjugated_1 = this.roomExt.isConjugated(pi);
+ PortClass _portClass_1 = this.roomExt.getPortClass(_protocol_1, _isConjugated_1);
+ EList<Attribute> _attributes = _portClass_1.getAttributes();
+ boolean _isEmpty = _attributes.isEmpty();
+ if (_isEmpty) {
+ return "0";
+ } else {
+ String _path = pi.getPath();
+ String _pathName = this.roomExt.getPathName(_path);
+ String _plus = ("&" + _pathName);
+ return (_plus + "_var");
+ }
}
private String genRecvPortInitializer(final Root root, final ActorInstance ai, final InterfaceItemInstance pi) {
@@ -1255,86 +1216,83 @@ public class SubSystemClassGen {
return "{NULL}";
}
EList<InterfaceItemInstance> _peers_1 = pi.getPeers();
- InterfaceItemInstance _get = _peers_1.get(0);
- InterfaceItemInstance peer = _get;
+ InterfaceItemInstance peer = _peers_1.get(0);
EList<InterfaceItemInstance> _peers_2 = pi.getPeers();
- InterfaceItemInstance _get_1 = _peers_2.get(0);
- EObject _eContainer = _get_1.eContainer();
+ InterfaceItemInstance _get = _peers_2.get(0);
+ EObject _eContainer = _get.eContainer();
ActorInstance peerInst = ((ActorInstance) _eContainer);
String _path = peerInst.getPath();
- String _pathName = this.roomExt.getPathName(_path);
- String instName = _pathName;
- String _operator_plus = StringExtensions.operator_plus("{&", instName);
- String _operator_plus_1 = StringExtensions.operator_plus(_operator_plus, ".");
+ String instName = this.roomExt.getPathName(_path);
+ String _plus = ("{&" + instName);
+ String _plus_1 = (_plus + ".");
String _name = peer.getName();
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, _name);
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, "}");
- _xblockexpression = (_operator_plus_3);
+ String _plus_2 = (_plus_1 + _name);
+ String _plus_3 = (_plus_2 + "}");
+ _xblockexpression = (_plus_3);
}
return _xblockexpression;
}
private String genReplSubPortInitializers(final Root root, final ActorInstance ai, final InterfaceItemInstance pi) {
- String result = "";
- EList<InterfaceItemInstance> _peers = pi.getPeers();
- for (final InterfaceItemInstance p : _peers) {
- {
- EList<InterfaceItemInstance> _peers_1 = pi.getPeers();
- int _indexOf = _peers_1.indexOf(p);
- int idx = _indexOf;
- String _xifexpression = null;
- EList<InterfaceItemInstance> _peers_2 = pi.getPeers();
- int _size = _peers_2.size();
- int _operator_minus = IntegerExtensions.operator_minus(((Integer)_size), ((Integer)1));
- boolean _operator_lessThan = ComparableExtensions.<Integer>operator_lessThan(((Integer)idx), ((Integer)_operator_minus));
- if (_operator_lessThan) {
- _xifexpression = ",";
- } else {
- _xifexpression = "";
- }
- String comma = _xifexpression;
- String _interfaceItemInstanceData = this.getInterfaceItemInstanceData(pi);
- String iiiD = _interfaceItemInstanceData;
- String _xifexpression_1 = null;
- boolean _equals = iiiD.equals("0");
- if (_equals) {
- String _operator_plus = StringExtensions.operator_plus(iiiD, ",");
- _xifexpression_1 = _operator_plus;
- } else {
- String _operator_plus_1 = StringExtensions.operator_plus(iiiD, "[");
- String _operator_plus_2 = StringExtensions.operator_plus(_operator_plus_1, ((Integer)idx));
- String _operator_plus_3 = StringExtensions.operator_plus(_operator_plus_2, "],");
- _xifexpression_1 = _operator_plus_3;
- }
- iiiD = _xifexpression_1;
- String _operator_plus_4 = StringExtensions.operator_plus(result, "{");
- String _operator_plus_5 = StringExtensions.operator_plus(_operator_plus_4, iiiD);
- String _operator_plus_6 = StringExtensions.operator_plus(_operator_plus_5, "&msgService_Thread1, ");
- int _objId = p.getObjId();
- String _operator_plus_7 = StringExtensions.operator_plus(_operator_plus_6, ((Integer)_objId));
- String _operator_plus_8 = StringExtensions.operator_plus(_operator_plus_7, ", ");
- ExpandedActorClass _expandedActorClass = root.getExpandedActorClass(ai);
- InterfaceItem _interfaceItem = pi.getInterfaceItem();
- int _interfaceItemLocalId = _expandedActorClass.getInterfaceItemLocalId(_interfaceItem);
- int _operator_plus_9 = IntegerExtensions.operator_plus(((Integer)_interfaceItemLocalId), ((Integer)1));
- String _operator_plus_10 = StringExtensions.operator_plus(_operator_plus_8, ((Integer)_operator_plus_9));
- String _operator_plus_11 = StringExtensions.operator_plus(_operator_plus_10, ", ");
- String _operator_plus_12 = StringExtensions.operator_plus(_operator_plus_11, ((Integer)idx));
- String _operator_plus_13 = StringExtensions.operator_plus(_operator_plus_12, "}");
- String _operator_plus_14 = StringExtensions.operator_plus(_operator_plus_13, comma);
- String _operator_plus_15 = StringExtensions.operator_plus(_operator_plus_14, " /* Repl Sub Port ");
- String _name = pi.getName();
- String _operator_plus_16 = StringExtensions.operator_plus(_operator_plus_15, _name);
- String _operator_plus_17 = StringExtensions.operator_plus(_operator_plus_16, " idx +");
- String _operator_plus_18 = StringExtensions.operator_plus(_operator_plus_17, ((Integer)idx));
- String _operator_plus_19 = StringExtensions.operator_plus(_operator_plus_18, "*/\n");
- result = _operator_plus_19;
+ String result = "";
+ EList<InterfaceItemInstance> _peers = pi.getPeers();
+ for (final InterfaceItemInstance p : _peers) {
+ {
+ EList<InterfaceItemInstance> _peers_1 = pi.getPeers();
+ int idx = _peers_1.indexOf(p);
+ String _xifexpression = null;
+ EList<InterfaceItemInstance> _peers_2 = pi.getPeers();
+ int _size = _peers_2.size();
+ int _minus = (_size - 1);
+ boolean _lessThan = (idx < _minus);
+ if (_lessThan) {
+ _xifexpression = ",";
+ } else {
+ _xifexpression = "";
+ }
+ String comma = _xifexpression;
+ String iiiD = this.getInterfaceItemInstanceData(pi);
+ String _xifexpression_1 = null;
+ boolean _equals = iiiD.equals("0");
+ if (_equals) {
+ String _plus = (iiiD + ",");
+ _xifexpression_1 = _plus;
+ } else {
+ String _plus_1 = (iiiD + "[");
+ String _plus_2 = (_plus_1 + Integer.valueOf(idx));
+ String _plus_3 = (_plus_2 + "],");
+ _xifexpression_1 = _plus_3;
}
+ iiiD = _xifexpression_1;
+ String _plus_4 = (result +
+ "{");
+ String _plus_5 = (_plus_4 + iiiD);
+ String _plus_6 = (_plus_5 + "&msgService_Thread1, ");
+ int _objId = p.getObjId();
+ String _plus_7 = (_plus_6 + Integer.valueOf(_objId));
+ String _plus_8 = (_plus_7 + ", ");
+ ExpandedActorClass _expandedActorClass = root.getExpandedActorClass(ai);
+ InterfaceItem _interfaceItem = pi.getInterfaceItem();
+ int _interfaceItemLocalId = _expandedActorClass.getInterfaceItemLocalId(_interfaceItem);
+ int _plus_9 = (_interfaceItemLocalId + 1);
+ String _plus_10 = (_plus_8 + Integer.valueOf(_plus_9));
+ String _plus_11 = (_plus_10 + ", ");
+ String _plus_12 = (_plus_11 + Integer.valueOf(idx));
+ String _plus_13 = (_plus_12 + "}");
+ String _plus_14 = (_plus_13 + comma);
+ String _plus_15 = (_plus_14 + " /* Repl Sub Port ");
+ String _name = pi.getName();
+ String _plus_16 = (_plus_15 + _name);
+ String _plus_17 = (_plus_16 + " idx +");
+ String _plus_18 = (_plus_17 + Integer.valueOf(idx));
+ String _plus_19 = (_plus_18 + "*/\n");
+ result = _plus_19;
}
- return result;
+ }
+ return result;
}
- private StringConcatenation generateDispatcherFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
+ private CharSequence generateDispatcherFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();
@@ -1388,8 +1346,8 @@ public class SubSystemClassGen {
public Boolean apply(final InterfaceItemInstance p) {
ProtocolClass _protocol = p.getProtocol();
CommunicationType _commType = _protocol.getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, CommunicationType.EVENT_DRIVEN);
- return ((Boolean)_operator_equals);
+ boolean _equals = Objects.equal(_commType, CommunicationType.EVENT_DRIVEN);
+ return Boolean.valueOf(_equals);
}
};
Iterable<InterfaceItemInstance> _filter = IterableExtensions.<InterfaceItemInstance>filter(_orderedIfItemInstances, _function);
@@ -1405,8 +1363,8 @@ public class SubSystemClassGen {
int _objId = pi.getObjId();
EList<InterfaceItemInstance> _peers_1 = pi.getPeers();
int _indexOf = _peers_1.indexOf(peer);
- int _operator_plus = IntegerExtensions.operator_plus(((Integer)_objId), ((Integer)_indexOf));
- _builder.append(_operator_plus, " ");
+ int _plus = (_objId + _indexOf);
+ _builder.append(_plus, " ");
_builder.append(":");
_builder.newLineIfNotEmpty();
{
@@ -1669,25 +1627,25 @@ public class SubSystemClassGen {
return _builder;
}
- private StringConcatenation generateDatadrivenExecutes(final Root root, final SubSystemInstance ssi) {
+ private CharSequence generateDatadrivenExecutes(final Root root, final SubSystemInstance ssi) {
StringConcatenation _builder = new StringConcatenation();
{
EList<ActorInstance> _allContainedInstances = ssi.getAllContainedInstances();
for(final ActorInstance ai : _allContainedInstances) {
{
- boolean _operator_or = false;
+ boolean _or = false;
ActorClass _actorClass = ai.getActorClass();
ActorCommunicationType _commType = _actorClass.getCommType();
- boolean _operator_equals = ObjectExtensions.operator_equals(_commType, ActorCommunicationType.ASYNCHRONOUS);
- if (_operator_equals) {
- _operator_or = true;
+ boolean _equals = Objects.equal(_commType, ActorCommunicationType.ASYNCHRONOUS);
+ if (_equals) {
+ _or = true;
} else {
ActorClass _actorClass_1 = ai.getActorClass();
ActorCommunicationType _commType_1 = _actorClass_1.getCommType();
- boolean _operator_equals_1 = ObjectExtensions.operator_equals(_commType_1, ActorCommunicationType.DATA_DRIVEN);
- _operator_or = BooleanExtensions.operator_or(_operator_equals, _operator_equals_1);
+ boolean _equals_1 = Objects.equal(_commType_1, ActorCommunicationType.DATA_DRIVEN);
+ _or = (_equals || _equals_1);
}
- if (_operator_or) {
+ if (_or) {
ActorClass _actorClass_2 = ai.getActorClass();
String _name = _actorClass_2.getName();
_builder.append(_name, "");
diff --git a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java
index c2116359d..a1a5d02f7 100644
--- a/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java
+++ b/plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemRunnerGen.java
@@ -7,12 +7,11 @@ import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance;
import org.eclipse.etrice.core.room.SubSystemClass;
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 SubSystemRunnerGen {
@Inject
private JavaIoFileSystemAccess fileAccess;
@@ -28,18 +27,18 @@ public class SubSystemRunnerGen {
String _generationTargetPath = this.roomExt.getGenerationTargetPath(_subSystemClass);
SubSystemClass _subSystemClass_1 = sc.getSubSystemClass();
String _path = this.roomExt.getPath(_subSystemClass_1);
- String _operator_plus = StringExtensions.operator_plus(_generationTargetPath, _path);
- this.fileAccess.setOutputPath(_operator_plus);
+ String _plus = (_generationTargetPath + _path);
+ this.fileAccess.setOutputPath(_plus);
String _name = sc.getName();
- String _operator_plus_1 = StringExtensions.operator_plus(_name, "_Runner.c");
+ String _plus_1 = (_name + "_Runner.c");
SubSystemClass _subSystemClass_2 = sc.getSubSystemClass();
- StringConcatenation _generateSourceFile = this.generateSourceFile(root, sc, _subSystemClass_2);
- this.fileAccess.generateFile(_operator_plus_1, _generateSourceFile);
+ CharSequence _generateSourceFile = this.generateSourceFile(root, sc, _subSystemClass_2);
+ this.fileAccess.generateFile(_plus_1, _generateSourceFile);
}
}
}
- public StringConcatenation generateSourceFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
+ public CharSequence generateSourceFile(final Root root, final SubSystemInstance ssi, final SubSystemClass ssc) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/**");
_builder.newLine();

Back to the top