Same rule multiple times [message #1710087] |
Sun, 04 October 2015 02:45  |
Eclipse User |
|
|
|
Hi,
sorry for this beginner questions but I can't wrap my head around it.
I have the following dsl:
/* this is a comment */
/* another comment*/
start
/* comment */
statements
split +
statement
/* comment */
another_statement
end
Comments can occur almost everywhere, before the start, between statements, ...
I started with the grammar:
Program:
'start'
statements+=Statement*
'end';
Statement:
Comment |
Command;
Command:
name=ID;
Comment:
'/*' content=ID '*/';
But this doesn't cover the cases where the comments are before the start or even after the end.
Thanx in advance.
Mihael
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04538 seconds