Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using multi line comments as elements of a DSL
Using multi line comments as elements of a DSL [message #1074976] Sun, 28 July 2013 10:11 Go to next message
Low Coupling is currently offline Low CouplingFriend
Messages: 30
Registered: June 2013
Member
I'd like a MLComment just before the definition of non terminal to be saved in a description property of the nonterminal element.
How could I do that?
Re: Using multi line comments as elements of a DSL [message #1074978 is a reply to message #1074976] Sun, 28 July 2013 10:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Model:
	greetings+=Greeting*;
	
Greeting hidden(WS, SL_COMMENT):
	description=ML_COMMENT?
	'Hello' name=ID '!';


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Using multi line comments as elements of a DSL [message #1074981 is a reply to message #1074978] Sun, 28 July 2013 10:30 Go to previous messageGo to next message
Low Coupling is currently offline Low CouplingFriend
Messages: 30
Registered: June 2013
Member
I was trying to do the same thing but the result I get is that the description property is present but empty
Re: Using multi line comments as elements of a DSL [message #1074989 is a reply to message #1074981] Sun, 28 July 2013 10:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
hmmmm, strange i thought that would work.
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals  hidden(WS, SL_COMMENT)

generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"

Model:
	greetings+=Greeting*;
	
Greeting:
	description=ML_COMMENT?
	'Hello' name=ID '!';


works but imho the other should too. can you file a bug.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Using multi line comments as elements of a DSL [message #1075080 is a reply to message #1074989] Sun, 28 July 2013 17:32 Go to previous message
Low Coupling is currently offline Low CouplingFriend
Messages: 30
Registered: June 2013
Member
it works thank you! I am going to file the bug
Previous Topic:validation order
Next Topic:Xtext 2.4.2: (1) When does validation start and (2) how to get resource of the imported tree
Goto Forum:
  


Current Time: Fri Mar 29 13:11:55 GMT 2024

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

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

Back to the top