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 06:11 Go to next message
Low Coupling is currently offline Low Coupling
Messages: 31
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?


interested on Eclipse, DSL and MDA? Visit http://www.lowcoupling.com
Re: Using multi line comments as elements of a DSL [message #1074978 is a reply to message #1074976] Sun, 28 July 2013 06:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6137
Registered: July 2009
Senior Member
Model:
	greetings+=Greeting*;
	
Greeting hidden(WS, SL_COMMENT):
	description=ML_COMMENT?
	'Hello' name=ID '!';
Re: Using multi line comments as elements of a DSL [message #1074981 is a reply to message #1074978] Sun, 28 July 2013 06:30 Go to previous messageGo to next message
Low Coupling is currently offline Low Coupling
Messages: 31
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

interested on Eclipse, DSL and MDA? Visit http://www.lowcoupling.com
Re: Using multi line comments as elements of a DSL [message #1074989 is a reply to message #1074981] Sun, 28 July 2013 06:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6137
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.
Re: Using multi line comments as elements of a DSL [message #1075080 is a reply to message #1074989] Sun, 28 July 2013 13:32 Go to previous message
Low Coupling is currently offline Low Coupling
Messages: 31
Registered: June 2013
Member
it works thank you! I am going to file the bug


interested on Eclipse, DSL and MDA? Visit http://www.lowcoupling.com
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: Mon Jul 28 20:38:28 EDT 2014

Powered by FUDForum. Page generated in 0.02479 seconds