Skip to content
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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -70,44 +70,43 @@ ParameterStructType returns ParameterStructType:
ParameterIntegerType returns ParameterIntegerType:
{ParameterIntegerType}
'Integer'
('default' default=ParameterInteger)?;
('default:' default=ParameterInteger)?;

ParameterStringType returns ParameterStringType:
{ParameterStringType}
'String'
('default' default=ParameterString)?;
('default:' default=ParameterString)?;

ParameterDoubleType returns ParameterDoubleType:
{ParameterDoubleType}
'Double'
('default' default=ParameterDouble)?;
('default:' default=ParameterDouble)?;

ParameterDateType returns ParameterDateType:
{ParameterDateType}
'Date'
('default' default=ParameterDate)?;
('default:' default=ParameterDate)?;

ParameterBooleanType returns ParameterBooleanType:
{ParameterBooleanType}
'Boolean'
('default' default=ParameterBoolean)?;
('default:' default=ParameterBoolean)?;

ParameterBase64Type returns ParameterBase64Type:
{ParameterBase64Type}
'Base64'
('default' default=ParameterBase64)?;
('default:' default=ParameterBase64)?;

ParameterAnyType returns ParameterAnyType:
{ParameterAnyType}
'Any'
('default' default=ParameterAny)?;
('default:' default=ParameterAny)?;

ParameterArrayType returns ParameterArrayType:
'Array:'
BEGIN
'type' type=ParameterType
('default' default=ParameterList)?
END;
'Array:' type=ParameterType
('default:' default=ParameterList)?
END;

ParameterList returns ParameterSequence:
{ParameterSequence}
Expand Down Expand Up @@ -151,7 +150,6 @@ ParameterDate returns ParameterDate:


ParameterStructMember returns ParameterStructMember:
'ParameterStructMember'
name=EString':'
BEGIN
value=ParameterValue
Expand All @@ -171,7 +169,7 @@ terminal DIGIT: '0'..'9';
terminal BINARY: ('0b'|'0B')('0'|'1')+;

terminal BOOLEAN: 'true'|'false';
terminal DOUBLE returns ecore::EDouble: DIGIT (('.' DECINT*) | (('.' DIGIT*)? ('E'|'e') ('-'|'+')? DIGIT)); // Use terminal to avoid 'e' turning into a keyword
terminal DOUBLE returns ecore::EDouble: (DIGIT | ('-' DIGIT*) ) (('.' DECINT*) | (('.' DIGIT*)? ('E'|'e') ('-'|'+')? DIGIT)); // Use terminal to avoid 'e' turning into a keyword
terminal DECINT: '0' | ('1'..'9' DIGIT*) | ('-''0'..'9' DIGIT*) ;
terminal DAY:'1'..'9' | '1'..'3' '0'..'9';
terminal MONTH:'1'..'9' | '1' '0'..'2';
Expand Down Expand Up @@ -199,8 +197,7 @@ DateTime0 returns type::DateTime:
//MESSAGE PRIMITIVES DEFINITION
///////////////////
MessagePart returns primitives::MessagePart:
Type = AbstractType
Data =(KEYWORD | MESSAGE_ASIGMENT | EString)
Data =(KEYWORD | MESSAGE_ASIGMENT | EString)':' Type = AbstractType
;

terminal MESSAGE_ASIGMENT:
Expand Down Expand Up @@ -290,66 +287,66 @@ duration returns primitives::duration:

boolArray returns primitives::boolArray:
{primitives::boolArray}
'bool[]'
'[bool]'
;

int8Array returns primitives::int8Array:
{primitives::int8Array}
'int8[]'
'[int8]'
;

uint8Array returns primitives::uint8Array:
{primitives::uint8Array}
'uint8[]'
'[uint8]'
;

int16Array returns primitives::int16Array:
{primitives::int16Array}
'int16[]'
'[int16]'
;

uint16Array returns primitives::uint16Array:
{primitives::uint16Array}
'uint16[]'
'[uint16]'
;

int32Array returns primitives::int32Array:
{primitives::int32Array}
'int32[]'
'[int32]'
;

uint32Array returns primitives::uint32Array:
{primitives::uint32Array}
'uint32[]'
'[uint32]'
;

int64Array returns primitives::int64Array:
{primitives::int64Array}
'int64[]'
'[int64]'
;

uint64Array returns primitives::uint64Array:
{primitives::uint64Array}
'uint64[]'
'[uint64]'
;

float32Array returns primitives::float32Array:
{primitives::float32Array}
'float32[]'
'[float32]'
;

float64Array returns primitives::float64Array:
{primitives::float64Array}
'float64[]'
'[float64]'
;

string0Array returns primitives::stringArray:
{primitives::stringArray}
'string[]'
'[string]'
;
byteArray returns primitives::ByteArray:
{primitives::ByteArray}
'byte[]'
'[byte]'
;

Header returns primitives::Header:
Expand All @@ -362,7 +359,7 @@ TopicSpecRef returns TopicSpecRef:
;

ArrayTopicSpecRef returns ArrayTopicSpecRef:
TopicSpec=[TopicSpec|EString]'[]'
'['TopicSpec=[TopicSpec|EString]']'
;

KEYWORD: 'goal' | 'message' | 'result' | 'feedback' | 'name' | 'value' | 'service' | 'type' | 'action' | 'duration' | 'time' ;
Expand All @@ -386,6 +383,9 @@ RosNames returns ecore::EString:
ROS_CONVENTION_A | ID | 'node'
;

PreListElement hidden(SL_COMMENT):
'-';

terminal ROS_CONVENTION_A:
( ('/' ID ) | ( ID '/' ) )* ;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Package_Impl returns Package:
('fromGitRepo:' fromGitRepo=EString)?
('specs:'
BEGIN
spec+=SpecBase*
PreListElement spec+=SpecBase
(PreListElement spec+=SpecBase)*
END
)?
('dependencies:' '[' dependency+=Dependency (',' dependency+=Dependency)* ']' )?
Expand Down Expand Up @@ -72,44 +73,43 @@ Artifact returns Artifact:

Node returns Node:
'node:' name=RosNames
BEGIN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this "BEGIN" removed intentionally? why?
The interfaces should be defined under the node.

(
('publishers:'
BEGIN
publisher+=Publisher*
END
)|
('subscribers:'
BEGIN
subscriber+=Subscriber*
END
)|
('serviceserver:'
BEGIN
serviceserver+=ServiceServer*
END
)|
('serviceclient:'
BEGIN
serviceclient+=ServiceClient*
END
)|
('actionserver:'
BEGIN
actionserver+=ActionServer*
END
)|
('actionclient:'
BEGIN
actionclient+=ActionClient*
END
)|
('parameters:'
BEGIN
parameter+=Parameter*
END
)
)*END
(
('publishers:'
BEGIN
publisher+=Publisher*
END
)|
('subscribers:'
BEGIN
subscriber+=Subscriber*
END
)|
('serviceServers:'
BEGIN
serviceserver+=ServiceServer*
END
)|
('serviceClients:'
BEGIN
serviceclient+=ServiceClient*
END
)|
('actionServers:'
BEGIN
actionserver+=ActionServer*
END
)|
('actionClients:'
BEGIN
actionclient+=ActionClient*
END
)|
('parameters:'
BEGIN
parameter+=Parameter*
END
)
)*
;

///////////////////
Expand Down Expand Up @@ -146,7 +146,7 @@ ActionSpec returns ActionSpec:

MessageDefinition returns MessageDefinition:
{MessageDefinition}
MessagePart+=MessagePart*;
MessagePart+=MessagePart+;

///////////////////
//INTERFACES
Expand Down