What is wrong with my simple grammar ? [message #1064902] |
Fri, 21 June 2013 10:59  |
Eclipse User |
|
|
|
Hi,
I'm trying to define a grammar able to support writing the following text:
--NECST HEADER Scripts
#NESCT START
#NECST MIDDLE [free_text1][free_text2]
--NECST ONE Script
--NECST TWO Script
#NECST EXIT
For that, I have define the following grammar:
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals hidden (NECST_PARAM)
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:{Model}
'--NECST HEADER Scripts'
(commentNecst+=CommandNecst*)?
scripts+=Script+;
CommandNecst:
'#NECST' command=ENUM_COMMANDNECST param+=NECST_PARAM*;
enum ENUM_COMMANDNECST : START|MIDDLE|EXIT;
Script:
'--NECST' script=ENUM_SCRIPT 'Script'
;
enum ENUM_SCRIPT : ONE|TWO|THREE;
terminal NECST_PARAM : '[' -> ']';
But, I am not able to type anything after the first line.
What is wrong ?
Thanks
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07064 seconds