Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Hash comment(Hash comment)
Hash comment [message #1731874] Tue, 10 May 2016 15:25 Go to next message
RamaRao Nandamuri is currently offline RamaRao NandamuriFriend
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 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13219
Registered: July 2009
Senior Member
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

firstpart ## secondpart


and

firstpart 
## secondpart


are the same from a parser point of view?

so is your semantics linebased?


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
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 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13219
Registered: July 2009
Senior Member
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')?);




Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Intellij , xbase cyclic dependencies
Next Topic:Seven languages in the website documentation
Goto Forum:
  


Current Time: Thu Nov 21 19:29:53 GMT 2019

Powered by FUDForum. Page generated in 0.02283 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top