-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix xtext grammar and reference node in process #194
base: main
Are you sure you want to change the base?
Changes from 1 commit
92738ab
ae1b0b4
3aa5e54
7092192
ac0d82d
796b934
3437f51
d1ce353
97cafc6
8e6e85b
3436be7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,29 +6,32 @@ import "http://www.eclipse.org/emf/2002/Ecore" as ecore | |
import "http://www.ipa.fraunhofer.de/ros" as ros | ||
import "http://www.ipa.fraunhofer.de/primitives" as primitives | ||
|
||
System returns System: | ||
RosSystem | ||
; | ||
|
||
RosSystem returns System: | ||
Name=EString':' | ||
name=EString':' | ||
BEGIN | ||
( | ||
('processes:' | ||
BEGIN | ||
Processes+=Process* | ||
processes+=Process* | ||
END | ||
) | | ||
('nodes:' | ||
BEGIN | ||
Components+=RosNode* | ||
components+=RosNode* | ||
END | ||
) | | ||
('parameters:' | ||
BEGIN | ||
Parameter+=Parameter* | ||
parameter+=RosParameter* | ||
END | ||
) | | ||
('connections:' | ||
BEGIN | ||
Connections+=RosConnection* | ||
connections+=RosConnection* | ||
END | ||
) | ||
)* | ||
|
@@ -37,20 +40,23 @@ RosSystem returns System: | |
|
||
Process returns Process: | ||
{Process} | ||
Name=EString':' | ||
BEGIN | ||
('nodes:' '[' | ||
Nodes+=[RosNode|EString] | ||
']')? | ||
('threads:'Threads=INT) | ||
END | ||
name=EString':' | ||
BEGIN | ||
('nodes:' '['nodes+=ComponentRef (',' nodes+=ComponentRef)+']')? | ||
('threads:'threads=Integer0) | ||
END | ||
; | ||
|
||
ComponentRef returns ComponentRef: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed if the metamodel is correctly defined, see: d1ce353#r113516155 |
||
{ComponentRef} | ||
componentRef = [RosNode| EString] | ||
; | ||
|
||
RosNode returns RosNode: | ||
{RosNode} | ||
Name=EString':' | ||
name=EString':' | ||
BEGIN | ||
'from:'From=[ros::Node|EString] | ||
'from:'from=[ros::Node|EString] | ||
('interfaces:' | ||
BEGIN | ||
rosinterfaces+=RosInterface* | ||
|
@@ -63,9 +69,9 @@ RosNode returns RosNode: | |
; | ||
|
||
RosInterface returns RosInterface: | ||
Name=EString':' | ||
name=EString':' | ||
BEGIN | ||
Reference=InterfaceReference | ||
reference=InterfaceReference | ||
END | ||
; | ||
|
||
|
@@ -77,40 +83,39 @@ InterfaceReference_Impl returns InterfaceReference: | |
; | ||
|
||
RosPublisherReference returns RosPublisherReference: | ||
'fromPub:'From=[ros::Publisher|EString] | ||
'fromPub:'from=[ros::Publisher|EString] | ||
; | ||
|
||
RosSubscriberReference returns RosSubscriberReference: | ||
'fromSub:'From=[ros::Subscriber|EString] | ||
'fromSub:'from=[ros::Subscriber|EString] | ||
; | ||
|
||
RosServiceServerReference returns RosServiceServerReference: | ||
'fromSS:'From=[ros::ServiceServer|EString] | ||
'fromSS:'from=[ros::ServiceServer|EString] | ||
; | ||
|
||
RosServerClientReference returns RosServerClientReference: | ||
'fromSC:'From=[ros::ServiceClient|EString] | ||
'fromSC:'from=[ros::ServiceClient|EString] | ||
; | ||
|
||
RosActionServerReference returns RosActionServerReference: | ||
'fromAS:'From=[ros::ActionServer|EString] | ||
'fromAS:'from=[ros::ActionServer|EString] | ||
; | ||
|
||
RosActionClientReference returns RosActionClientReference: | ||
'fromAC:'From=[ros::ActionClient|EString] | ||
'fromAC:'from=[ros::ActionClient|EString] | ||
; | ||
|
||
RosParameter returns RosParameter: | ||
Name=EString':' | ||
PreListElement name=EString':' from=[ros::Parameter|EString] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PreListElement was defined in another commit, I will remove it from here. This commit is about uncapitalize the definition of the attributes |
||
BEGIN | ||
'from:'From=[ros::Parameter|EString] | ||
'value:'value=ParameterValue | ||
END | ||
; | ||
|
||
|
||
RosConnection returns RosConnection: | ||
'-['from=[RosInterface|EString]','to=[RosInterface|EString]']' | ||
PreListElement '['from=[RosInterface|EString]','to=[RosInterface|EString]']' | ||
; | ||
|
||
/////////////////// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be simplified to:
nodes+=[RosNode| EString]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grammar is wrong, this implementation doesn't allow a process with a single node. It should be:
('nodes:' '['nodes+=ComponentRef (',' nodes+=ComponentRef)*']')?