Hash comment [message #1731874] |
Tue, 10 May 2016 15:25 |
RamaRao Nandamuri Messages: 120 Registered: April 2016 |
Senior Member |
|
|
Hi Christian,
I have # comment in my dsl.
If it starts with # the remaining line should be in green. But if I using ## at begin it is not behaving like a comment. And also line starts with single # also not working properly. Can you please tell me whats wrong with terminal riule?
[Updated on: Tue, 10 May 2016 16:09] Report message to a moderator
|
|
|
Re: Hash comment [message #1731877 is a reply to message #1731874] |
Tue, 10 May 2016 15:44 |
|
as i am not the only guy answering questions here you do not need to adress me personally.
to your question:
you know xtext is not "line based"
so
and
are the same from a parser point of view?
so is your semantics linebased?
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: Hash comment [message #1731885 is a reply to message #1731877] |
Tue, 10 May 2016 16:03 |
|
p.s.
did you try something like
grammar org.xtext.example.mydsl6.MyDsl with org.eclipse.xtext.common.Terminals
hidden(WS, ML_COMMENT, SL_COMMENT, HASH_COMMENT)
generate myDsl "http://www.xtext.org/example/mydsl6/MyDsl"
Model:
(greetings+=Greeting)*;
Greeting:
name1=ID '##' name2=ID;
terminal HASH_COMMENT : ('#'('\r'? '\n')?) | ('#' !('#'|'\n'|'\r')+ ('\r'? '\n')?) | (('#''#''#') !('\n'|'\r')* ('\r'? '\n')?);
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.02781 seconds