Commit 199d5bcb authored by René Schöne's avatar René Schöne
Browse files

Rename read/write to receive/send

parent f86f4292
Pipeline #7534 passed with stages
in 4 minutes and 32 seconds
......@@ -7,32 +7,32 @@ aspect Errors {
[new TreeSet<ErrorMessage>()]
root RagConnect;
ReadFromMqttDefinition contributes error("Read definition already defined for " + getToken().getName())
ReceiveFromMqttDefinition contributes error("Receive definition already defined for " + getToken().getName())
when isAlreadyDefined()
to RagConnect.errors();
ReadFromMqttDefinition contributes error("Reading target token must not be an NTA token!")
ReceiveFromMqttDefinition contributes error("Receiving target token must not be an NTA token!")
when getToken().getNTA()
to RagConnect.errors();
// if first mapping is null, then suitableDefaultMapping() == null
ReadFromMqttDefinition contributes error("No suitable default mapping found for type " +
ReceiveFromMqttDefinition contributes error("No suitable default mapping found for type " +
((getMappingList().isEmpty())
? getToken().getJavaTypeUse().prettyPrint()
: getMappingList().get(0).getFromType().prettyPrint()))
when effectiveMappings().get(0) == null
to RagConnect.errors();
ReadFromMqttDefinition contributes error("to-type of last mapping must be type of the Token!")
ReceiveFromMqttDefinition contributes error("to-type of last mapping must be type of the Token!")
when getToken().getJavaTypeUse().prettyPrint().equals(
effectiveMappings().get(effectiveMappings().size() - 1))
to RagConnect.errors();
WriteToMqttDefinition contributes error("Writing target token must be an NTA token!")
SendToMqttDefinition contributes error("Sending target token must be an NTA token!")
when !getToken().getNTA()
to RagConnect.errors();
WriteToMqttDefinition contributes error("Write definition already defined for " + getToken().getName())
SendToMqttDefinition contributes error("Send definition already defined for " + getToken().getName())
when isAlreadyDefined()
to RagConnect.errors();
......@@ -44,7 +44,7 @@ aspect Errors {
when isAlreadyDefinedAsList()
to RagConnect.errors();
DependencyDefinition contributes error("There must be a write update definition targeting " + getSource().parentTypeypeAndName() + " for dependency definition " + getID())
DependencyDefinition contributes error("There must be a send update definition targeting " + getSource().parentTypeypeAndName() + " for dependency definition " + getID())
when targetEndpointDefinition() == null
to RagConnect.errors();
}
......
//TypeComponentMustache ;
//rel TypeComponentMustache.TypeComponent -> TypeComponent ;
MRagConnect ::= ReadDefinition:MReadDefinition* WriteDefinition:MWriteDefinition* MappingDefinition:MMappingDefinition* DependencyDefinition:MDependencyDefinition* RootTypeComponent:MTypeComponent* TokenComponent:MTokenComponent*;
MRagConnect ::= ReceiveDefinition:MReceiveDefinition* SendDefinition:MSendDefinition* MappingDefinition:MMappingDefinition* DependencyDefinition:MDependencyDefinition* RootTypeComponent:MTypeComponent* TokenComponent:MTokenComponent*;
abstract MEndpointDefinition ::= InnerMappingDefinition:MInnerMappingDefinition*;
MReadDefinition : MEndpointDefinition;
MWriteDefinition : MEndpointDefinition;
MReceiveDefinition : MEndpointDefinition;
MSendDefinition : MEndpointDefinition;
MMappingDefinition;
MInnerMappingDefinition;
MDependencyDefinition;
......@@ -13,8 +13,8 @@ MTokenComponent;
rel MRagConnect.RagConnect -> RagConnect;
rel MInnerMappingDefinition.MappingDefinition -> MappingDefinition;
rel MReadDefinition.ReadFromMqttDefinition -> ReadFromMqttDefinition;
rel MWriteDefinition.WriteToMqttDefinition -> WriteToMqttDefinition;
rel MReceiveDefinition.ReceiveFromMqttDefinition -> ReceiveFromMqttDefinition;
rel MSendDefinition.SendToMqttDefinition -> SendToMqttDefinition;
rel MMappingDefinition.MappingDefinition -> MappingDefinition;
rel MDependencyDefinition.DependencyDefinition -> DependencyDefinition;
rel MTypeComponent.TypeComponent -> TypeComponent;
......
......@@ -24,25 +24,25 @@ aspect Navigation {
syn TokenEndpointDefinition EndpointDefinition.asTokenEndpointDefinition() = null;
eq TokenEndpointDefinition.asTokenEndpointDefinition() = this;
// --- isWriteToMqttDefinition ---
syn boolean EndpointDefinition.isWriteToMqttDefinition() = false;
eq WriteToMqttDefinition.isWriteToMqttDefinition() = true;
// --- isSendToMqttDefinition ---
syn boolean EndpointDefinition.isSendToMqttDefinition() = false;
eq SendToMqttDefinition.isSendToMqttDefinition() = true;
// --- asWriteToMqttDefinition ---
syn WriteToMqttDefinition EndpointDefinition.asWriteToMqttDefinition() = null;
eq WriteToMqttDefinition.asWriteToMqttDefinition() = this;
// --- asSendToMqttDefinition ---
syn SendToMqttDefinition EndpointDefinition.asSendToMqttDefinition() = null;
eq SendToMqttDefinition.asSendToMqttDefinition() = this;
// --- asReadFromMqttDefinition ---
syn ReadFromMqttDefinition EndpointDefinition.asReadFromMqttDefinition() = null;
eq ReadFromMqttDefinition.asReadFromMqttDefinition() = this;
// --- asReceiveFromMqttDefinition ---
syn ReceiveFromMqttDefinition EndpointDefinition.asReceiveFromMqttDefinition() = null;
eq ReceiveFromMqttDefinition.asReceiveFromMqttDefinition() = this;
// --- targetEndpointDefinition ---
syn WriteToMqttDefinition DependencyDefinition.targetEndpointDefinition() {
syn SendToMqttDefinition DependencyDefinition.targetEndpointDefinition() {
// resolve definition in here, as we do not need resolveMethod in any other place (yet)
for (EndpointDefinition endpointDefinition : ragconnect().getEndpointDefinitionList()) {
if (endpointDefinition.isWriteToMqttDefinition() &&
endpointDefinition.asWriteToMqttDefinition().getToken().equals(this.getTarget())) {
return endpointDefinition.asWriteToMqttDefinition();
if (endpointDefinition.isSendToMqttDefinition() &&
endpointDefinition.asSendToMqttDefinition().getToken().equals(this.getTarget())) {
return endpointDefinition.asSendToMqttDefinition();
}
}
return null;
......
......@@ -7,8 +7,8 @@ rel EndpointDefinition.Mapping* -> MappingDefinition;
abstract TokenEndpointDefinition : EndpointDefinition;
rel TokenEndpointDefinition.Token -> TokenComponent;
ReadFromMqttDefinition : TokenEndpointDefinition;
WriteToMqttDefinition : TokenEndpointDefinition;
ReceiveFromMqttDefinition : TokenEndpointDefinition;
SendToMqttDefinition : TokenEndpointDefinition;
DependencyDefinition ::= <ID>;
rel DependencyDefinition.Source <-> TokenComponent.DependencySourceDefinition*;
......
......@@ -79,23 +79,23 @@ aspect AttributesForMustache {
syn String MInnerMappingDefinition.methodName() = getMappingDefinition().methodName();
inh String MInnerMappingDefinition.inputVarName();
// --- MReadDefinition ---
eq MReadDefinition.preemptiveExpectedValue() = "get" + tokenName() + "()";
eq MReadDefinition.preemptiveReturn() = "return;";
eq MReadDefinition.endpointDef() = getReadFromMqttDefinition();
eq MReadDefinition.firstInputVarName() = "message";
// --- MReceiveDefinition ---
eq MReceiveDefinition.preemptiveExpectedValue() = "get" + tokenName() + "()";
eq MReceiveDefinition.preemptiveReturn() = "return;";
eq MReceiveDefinition.endpointDef() = getReceiveFromMqttDefinition();
eq MReceiveDefinition.firstInputVarName() = "message";
// --- MWriteDefinition ---
eq MWriteDefinition.preemptiveExpectedValue() = lastValue();
eq MWriteDefinition.preemptiveReturn() = "return false;";
eq MWriteDefinition.endpointDef() = getWriteToMqttDefinition();
eq MWriteDefinition.firstInputVarName() = "get" + tokenName() + "()";
// --- MSendDefinition ---
eq MSendDefinition.preemptiveExpectedValue() = lastValue();
eq MSendDefinition.preemptiveReturn() = "return false;";
eq MSendDefinition.endpointDef() = getSendToMqttDefinition();
eq MSendDefinition.firstInputVarName() = "get" + tokenName() + "()";
syn String MWriteDefinition.writeTopic() = getWriteToMqttDefinition().writeTopic();
syn String MWriteDefinition.lastValue() = getWriteToMqttDefinition().lastValue();
syn String MWriteDefinition.updateMethod() = getWriteToMqttDefinition().updateMethod();
syn String MWriteDefinition.writeMethod() = getWriteToMqttDefinition().writeMethod();
syn String MWriteDefinition.tokenResetMethod() = getWriteToMqttDefinition().tokenResetMethod();
syn String MSendDefinition.sendTopic() = getSendToMqttDefinition().sendTopic();
syn String MSendDefinition.lastValue() = getSendToMqttDefinition().lastValue();
syn String MSendDefinition.updateMethod() = getSendToMqttDefinition().updateMethod();
syn String MSendDefinition.writeMethod() = getSendToMqttDefinition().writeMethod();
syn String MSendDefinition.tokenResetMethod() = getSendToMqttDefinition().tokenResetMethod();
// --- MMappingDefinition ---
syn String MMappingDefinition.toType() = getMappingDefinition().getToType().prettyPrint();
......@@ -130,10 +130,10 @@ aspect AttributesForMustache {
MRagConnect result = new MRagConnect();
result.setRagConnect(this);
for (EndpointDefinition def : getEndpointDefinitionList()) {
if (def.isWriteToMqttDefinition()) {
result.addWriteDefinition(def.asWriteToMqttDefinition().toMustache());
if (def.isSendToMqttDefinition()) {
result.addSendDefinition(def.asSendToMqttDefinition().toMustache());
} else {
result.addReadDefinition(def.asReadFromMqttDefinition().toMustache());
result.addReceiveDefinition(def.asReceiveFromMqttDefinition().toMustache());
}
}
for (MappingDefinition def : allMappingDefinitions()) {
......@@ -163,15 +163,15 @@ aspect AttributesForMustache {
addInnerMappingDefinition(inner);
}
}
syn lazy MReadDefinition ReadFromMqttDefinition.toMustache() {
MReadDefinition result = new MReadDefinition();
result.setReadFromMqttDefinition(this);
syn lazy MReceiveDefinition ReceiveFromMqttDefinition.toMustache() {
MReceiveDefinition result = new MReceiveDefinition();
result.setReceiveFromMqttDefinition(this);
result.addInnerMappings();
return result;
}
syn lazy MWriteDefinition WriteToMqttDefinition.toMustache() {
MWriteDefinition result = new MWriteDefinition();
result.setWriteToMqttDefinition(this);
syn lazy MSendDefinition SendToMqttDefinition.toMustache() {
MSendDefinition result = new MSendDefinition();
result.setSendToMqttDefinition(this);
result.addInnerMappings();
return result;
}
......@@ -206,11 +206,11 @@ aspect AspectGeneration {
syn String TokenComponent.externalName() = getName();
syn String TokenEndpointDefinition.connectMethod() = "connect" + getToken().getName();
syn String WriteToMqttDefinition.writeTopic() = "_topic_" + getToken().getName();
syn String WriteToMqttDefinition.lastValue() = "_lastValue" + getToken().getName();
syn String WriteToMqttDefinition.updateMethod() = "_update_" + getToken().getName();
syn String WriteToMqttDefinition.writeMethod() = "_writeLastValue_" + getToken().getName();
syn String WriteToMqttDefinition.tokenResetMethod() = "get" + getToken().getName() + "_reset";
syn String SendToMqttDefinition.sendTopic() = "_topic_" + getToken().getName();
syn String SendToMqttDefinition.lastValue() = "_lastValue" + getToken().getName();
syn String SendToMqttDefinition.updateMethod() = "_update_" + getToken().getName();
syn String SendToMqttDefinition.writeMethod() = "_writeLastValue_" + getToken().getName();
syn String SendToMqttDefinition.tokenResetMethod() = "get" + getToken().getName() + "_reset";
syn String MappingDefinition.methodName() = "_apply_" + getID();
syn String DependencyDefinition.dependencyMethod() = "add" +
Character.toUpperCase(getID().charAt(0)) +
......
......@@ -106,7 +106,7 @@ aspect DefaultMappings {
aspect Mappings {
// --- effectiveMappings ---
syn java.util.List<MappingDefinition> EndpointDefinition.effectiveMappings();
eq ReadFromMqttDefinition.effectiveMappings() {
eq ReceiveFromMqttDefinition.effectiveMappings() {
// if there is a first mapping, check if its input type is byte[].
// or if no mappings are specified.
// then prepend the suitable default mapping
......@@ -120,7 +120,7 @@ aspect Mappings {
}
return result;
}
eq WriteToMqttDefinition.effectiveMappings() {
eq SendToMqttDefinition.effectiveMappings() {
// if there is a mapping, check if the output type of the last mapping is byte[].
// or if no mappings are specified.
// then append the suitable default mapping
......@@ -160,7 +160,7 @@ aspect Mappings {
// --- suitableDefaultMapping ---
syn DefaultMappingDefinition EndpointDefinition.suitableDefaultMapping();
eq ReadFromMqttDefinition.suitableDefaultMapping() {
eq ReceiveFromMqttDefinition.suitableDefaultMapping() {
String typeName = getMappingList().isEmpty() ?
getToken().getJavaTypeUse().getName() :
getMappingList().get(0).getFromType().prettyPrint();
......@@ -181,7 +181,7 @@ aspect Mappings {
default: return null;
}
}
eq WriteToMqttDefinition.suitableDefaultMapping() {
eq SendToMqttDefinition.suitableDefaultMapping() {
String typeName = getMappingList().isEmpty() ?
getToken().getJavaTypeUse().getName() :
getMappingList().get(getMappingList().size() - 1).getFromType().prettyPrint();
......
......@@ -13,30 +13,30 @@ RagConnect ragconnect
:} ;
EndpointDefinition endpoint_definition
= READ ID.type_name DOT ID.token_name SCOL
= RECEIVE ID.type_name DOT ID.token_name SCOL
{:
ReadFromMqttDefinition result = new ReadFromMqttDefinition();
ReceiveFromMqttDefinition result = new ReceiveFromMqttDefinition();
result.setToken(TokenComponent.createRef(type_name + "." + token_name));
return result;
:}
| READ ID.type_name DOT ID.token_name USING string_list.mapping_defs SCOL
| RECEIVE ID.type_name DOT ID.token_name USING string_list.mapping_defs SCOL
{:
ReadFromMqttDefinition result = new ReadFromMqttDefinition();
ReceiveFromMqttDefinition result = new ReceiveFromMqttDefinition();
result.setToken(TokenComponent.createRef(type_name + "." + token_name));
for (String mapping_def : makeMappingDefs(mapping_defs)) {
result.addMapping(MappingDefinition.createRef(mapping_def));
}
return result;
:}
| WRITE ID.type_name DOT ID.token_name SCOL
| SEND ID.type_name DOT ID.token_name SCOL
{:
WriteToMqttDefinition result = new WriteToMqttDefinition();
SendToMqttDefinition result = new SendToMqttDefinition();
result.setToken(TokenComponent.createRef(type_name + "." + token_name));
return result;
:}
| WRITE ID.type_name DOT ID.token_name USING string_list.mapping_defs SCOL
| SEND ID.type_name DOT ID.token_name USING string_list.mapping_defs SCOL
{:
WriteToMqttDefinition result = new WriteToMqttDefinition();
SendToMqttDefinition result = new SendToMqttDefinition();
result.setToken(TokenComponent.createRef(type_name + "." + token_name));
for (String mapping_def : makeMappingDefs(mapping_defs)) {
result.addMapping(MappingDefinition.createRef(mapping_def));
......
"read" { yybegin(DECLARATION); return sym(Terminals.READ); }
"write" { yybegin(DECLARATION); return sym(Terminals.WRITE); }
"receive" { yybegin(DECLARATION); return sym(Terminals.RECEIVE); }
"send" { yybegin(DECLARATION); return sym(Terminals.SEND); }
"using" { return sym(Terminals.USING); }
"canDependOn" { return sym(Terminals.CAN_DEPEND_ON); }
"maps" { return sym(Terminals.MAPS); }
......
......@@ -77,9 +77,9 @@ public class Compiler extends AbstractCompiler {
}
for (GrammarFile grammarFile : ragConnect.getProgram().getGrammarFileList()) {
Path outputFile = getConfiguration().outputDir().toPath().resolve(grammarFile.getFileName());
writeToFile(outputFile, grammarFile.generateAbstractGrammar());
sendToFile(outputFile, grammarFile.generateAbstractGrammar());
}
writeToFile(getConfiguration().outputDir().toPath().resolve("RagConnect.jadd"), ragConnect.generateAspect(optionRootNode.value()));
sendToFile(getConfiguration().outputDir().toPath().resolve("RagConnect.jadd"), ragConnect.generateAspect(optionRootNode.value()));
return 0;
}
......@@ -118,7 +118,7 @@ public class Compiler extends AbstractCompiler {
System.out.println(message);
}
private void writeToFile(Path path, String str) throws CompilerException {
private void sendToFile(Path path, String str) throws CompilerException {
try (BufferedWriter writer = Files.newBufferedWriter(path)) {
writer.append(str);
} catch (Exception e) {
......
......@@ -123,11 +123,11 @@ public class SimpleMain {
" ;");
model.addMappingDefinition(mappingDefinition);
ReadFromMqttDefinition readFromMqttDefinition = new ReadFromMqttDefinition();
readFromMqttDefinition.setAlwaysApply(false);
readFromMqttDefinition.setToken(TokenComponent.createRef("Link.CurrentPosition"));
readFromMqttDefinition.addMapping(mappingDefinition);
model.addEndpointDefinition(readFromMqttDefinition);
ReceiveFromMqttDefinition receiveFromMqttDefinition = new ReceiveFromMqttDefinition();
receiveFromMqttDefinition.setAlwaysApply(false);
receiveFromMqttDefinition.setToken(TokenComponent.createRef("Link.CurrentPosition"));
receiveFromMqttDefinition.addMapping(mappingDefinition);
model.addEndpointDefinition(receiveFromMqttDefinition);
model.treeResolveAll();
for (ErrorMessage error : model.errors()) {
......
{{> mqtt}}
aspect ROS2RAG {
{{#ReadDefinitions}}
{{> readDefinition}}
{{/ReadDefinitions}}
{{#ReceiveDefinitions}}
{{> receiveDefinition}}
{{/ReceiveDefinitions}}
{{#WriteDefinitions}}
{{> writeDefinition}}
{{/WriteDefinitions}}
{{#SendDefinitions}}
{{> sendDefinition}}
{{/SendDefinitions}}
{{#MappingDefinitions}}
{{> mappingDefinition}}
......
......@@ -2,7 +2,7 @@
{{mqttHandlerAttribute}}().newConnection(topic, message -> {
{{> mappingApplication}}
{{#loggingEnabledForReads}}
System.out.println("[Read] " + topic + " -> {{tokenName}} = " + {{lastResult}});{{!lastResult has to be a new attribute}}
System.out.println("[Receive] " + topic + " -> {{tokenName}} = " + {{lastResult}});{{!lastResult has to be a new attribute}}
{{/loggingEnabledForReads}}
set{{tokenName}}({{lastResult}});
});
......
private String {{parentTypeName}}.{{writeTopic}} = null;
private String {{parentTypeName}}.{{sendTopic}} = null;
private byte[] {{parentTypeName}}.{{lastValue}} = null;
public void {{parentTypeName}}.{{connectMethod}}(String topic, boolean writeCurrentValue) {
{{writeTopic}} = topic;
{{sendTopic}} = topic;
{{updateMethod}}();
if (writeCurrentValue) {
{{writeMethod}}();
......@@ -18,7 +18,7 @@
protected void {{parentTypeName}}.{{writeMethod}}() {
{{#loggingEnabledForWrites}}
System.out.println("[Write] {{tokenName}} = " + get{{tokenName}}() + " -> " + {{writeTopic}});
System.out.println("[Send] {{tokenName}} = " + get{{tokenName}}() + " -> " + {{sendTopic}});
{{/loggingEnabledForWrites}}
{{mqttHandlerAttribute}}().publish({{writeTopic}}, {{lastValue}});
{{mqttHandlerAttribute}}().publish({{sendTopic}}, {{lastValue}});
}
// --- update definitions ---
read NativeTypes.IntValue;
read NativeTypes.ShortValue;
read NativeTypes.LongValue;
read NativeTypes.FloatValue;
read NativeTypes.DoubleValue;
read NativeTypes.CharValue;
read NativeTypes.StringValue;
receive NativeTypes.IntValue;
receive NativeTypes.ShortValue;
receive NativeTypes.LongValue;
receive NativeTypes.FloatValue;
receive NativeTypes.DoubleValue;
receive NativeTypes.CharValue;
receive NativeTypes.StringValue;
read BoxedTypes.IntValue;
read BoxedTypes.ShortValue;
read BoxedTypes.LongValue;
read BoxedTypes.FloatValue;
read BoxedTypes.DoubleValue;
read BoxedTypes.CharValue;
receive BoxedTypes.IntValue;
receive BoxedTypes.ShortValue;
receive BoxedTypes.LongValue;
receive BoxedTypes.FloatValue;
receive BoxedTypes.DoubleValue;
receive BoxedTypes.CharValue;
// --- update definitions ---
// native types, synthesized
write NativeTypesSyn.IntValue;
write NativeTypesSyn.ShortValue;
write NativeTypesSyn.LongValue;
write NativeTypesSyn.FloatValue;
write NativeTypesSyn.DoubleValue;
write NativeTypesSyn.CharValue;
write NativeTypesSyn.StringValue;
send NativeTypesSyn.IntValue;
send NativeTypesSyn.ShortValue;
send NativeTypesSyn.LongValue;
send NativeTypesSyn.FloatValue;
send NativeTypesSyn.DoubleValue;
send NativeTypesSyn.CharValue;
send NativeTypesSyn.StringValue;
// boxed types, synthesized
write BoxedTypesSyn.IntValue;
write BoxedTypesSyn.ShortValue;
write BoxedTypesSyn.LongValue;
write BoxedTypesSyn.FloatValue;
write BoxedTypesSyn.DoubleValue;
write BoxedTypesSyn.CharValue;
send BoxedTypesSyn.IntValue;
send BoxedTypesSyn.ShortValue;
send BoxedTypesSyn.LongValue;
send BoxedTypesSyn.FloatValue;
send BoxedTypesSyn.DoubleValue;
send BoxedTypesSyn.CharValue;
// --- dependency definitions ---
NativeTypesSyn.IntValue canDependOn NativeTypesSyn.DriverSyn as nativeIntDependency;
......@@ -34,18 +34,18 @@ BoxedTypesSyn.CharValue canDependOn BoxedTypesSyn.DriverSyn as boxedCharDependen
// --- inherited attributes not supported ---
//// native types, inherited
//write NativeTypesInh.IntValue;
//write NativeTypesInh.ShortValue;
//write NativeTypesInh.LongValue;
//write NativeTypesInh.FloatValue;
//write NativeTypesInh.DoubleValue;
//write NativeTypesInh.CharValue;
//write NativeTypesInh.StringValue;
//send NativeTypesInh.IntValue;
//send NativeTypesInh.ShortValue;
//send NativeTypesInh.LongValue;
//send NativeTypesInh.FloatValue;
//send NativeTypesInh.DoubleValue;
//send NativeTypesInh.CharValue;
//send NativeTypesInh.StringValue;
//
//// boxed types, inherited
//write BoxedTypesInh.IntValue;
//write BoxedTypesInh.ShortValue;
//write BoxedTypesInh.LongValue;
//write BoxedTypesInh.FloatValue;
//write BoxedTypesInh.DoubleValue;
//write BoxedTypesInh.CharValue;
//send BoxedTypesInh.IntValue;
//send BoxedTypesInh.ShortValue;
//send BoxedTypesInh.LongValue;
//send BoxedTypesInh.FloatValue;
//send BoxedTypesInh.DoubleValue;
//send BoxedTypesInh.CharValue;
// --- update read definitions ---
// Error: there must not be two read definitions for the same token
read B.DoubledValue ;
read B.DoubledValue using IntToInt ;
// --- update receive definitions ---
// Error: there must not be two receive definitions for the same token
receive B.DoubledValue ;
receive B.DoubledValue using IntToInt ;
// NOT HANDLED \\ Error: the token must be resolvable within the parent type
// NOT HANDLED \\ read B.NonExisting ;
// NOT HANDLED \\ receive B.NonExisting ;
// Error: the Token must not be a TokenNTA (i.e., check for !Token.getNTA())
read B.ErrorNTA ;
receive B.ErrorNTA ;
// Error: from-type of first mapping must be byte[] or a supported primitive type
read B.ErrorTypeOfFirstMapping using ListToList ;
receive B.ErrorTypeOfFirstMapping using ListToList ;
// Error: to-type of last mapping must be type of the Token
read B.ErrorTypeOfLastMapping using StringToList ;
receive B.ErrorTypeOfLastMapping using StringToList ;
// Error: types of mappings must match (modulo inheritance)
read B.ErrorTypeMismatch using StringToList, IntToInt ;
receive B.ErrorTypeMismatch using StringToList, IntToInt ;
// --- update write definitions ---
// --- update send definitions ---
// NOT HANDLED \\ Error: the token must be resolvable within the parent type
// NOT HANDLED \\ read C.NonExisting ;
// NOT HANDLED \\ receive C.NonExisting ;
// Error: Token must be a TokenNTA (i.e., check for Token.getNTA())
write C.ErrorNotNTA ;
send C.ErrorNotNTA ;
// Error: from-type of first mapping must be type of Token
write C.ErrorTypeOfFirstMapping using IntToInt ;
send C.ErrorTypeOfFirstMapping using IntToInt ;
// Error: to-type of last mapping must be byte[] or a supported primitive type
write C.ErrorTypeOfLastMapping1 using StringToList ;
write C.ErrorTypeOfLastMapping2 ;
send C.ErrorTypeOfLastMapping1 using StringToList ;
send C.ErrorTypeOfLastMapping2 ;
// Error: types of mappings must match (modulo inheritance)
write C.ErrorTypeMismatch using StringToList, IntToInt ;
send C.ErrorTypeMismatch using StringToList, IntToInt ;
// Error: no more than one write mapping for each TokenComponent
write C.DoubledValue ;
write C.DoubledValue using IntToInt ;
// Error: no more than one send mapping for each TokenComponent
send C.DoubledValue ;
send C.DoubledValue using IntToInt ;
// --- dependency definitions ---
// NOT HANDLED \\ Error: Both, source and target must be resolvable within the parent type
// NOT HANDLED \\ D.SourceNonExistingTarget canDependOn D.NonExisting as NonExistingTarget ;
// NOT HANDLED \\ D.NonExisting canDependOn D.TargetNonExistingSource as NonExistingSource ;
// Error: There must be a write update definition for the target token
// Error: There must be a send update definition for the target token
D.SourceNoWriteDef canDependOn D.TargetNoWriteDef as NoWriteDef ;
// Error: The name of a dependency definition must not be equal to a list-node on the source
D.SourceSameAsListNode canDependOn D.TargetSameAsListNode as MyList ;
write D.TargetSameAsListNode;
send D.TargetSameAsListNode;
// Error: There must not be two dependency definitions with the same name
D.SourceDoubledValue canDependOn D.TargetDoubledValue as DoubledValue ;
D.SourceDoubledValue canDependOn D.TargetDoubledValue as DoubledValue ;
write D.TargetDoubledValue;
send D.TargetDoubledValue;
// --- mapping definitions ---
ListToList maps java.util.List<String> list to java.util.List<String> {:
......
/* Version 2020-07-15 */
// --- update definitions ---
read Link.CurrentPosition using ParseRobotState, RobotStateToIntPosition ;
write RobotArm.AppropriateSpeed using CreateSpeedMessage, SerializeRobotConfig ;
receive Link.CurrentPosition using ParseRobotState, RobotStateToIntPosition ;
send RobotArm.AppropriateSpeed using CreateSpeedMessage, SerializeRobotConfig ;
// --- dependency definitions ---
RobotArm.AppropriateSpeed canDependOn Link.CurrentPosition as dependency1 ;
......
// --- update definitions ---
// OnSameNonterminal
read OnSameNonterminal.Input;
write OnSameNonterminal.OutInteger;
write OnSameNonterminal.OutString;
receive OnSameNonterminal.Input;
send OnSameNonterminal.OutInteger;
send OnSameNonterminal.OutString;
// OnDifferentNonterminal
read OnDifferentNonterminal.Input;
write TheOther.OutInteger;
write TheOther.OutString;
receive OnDifferentNonterminal.Input;
send TheOther.OutInteger;
send TheOther.OutString;
// --- dependency definitions ---
// OnSameNonterminal
......
// --- update definitions ---
// OnSameNonterminal
read OnSameNonterminal.Input1;