Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » how to escape #comments in freecode
how to escape #comments in freecode [message #1744785] Fri, 30 September 2016 08:43 Go to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
For an existing language, I want to allow to put text snippets in my DSL. So I added:

('LPMX=' lpmxText=ML_FREECODE)?
with:
terminal ML_FREECODE : '«' -> '»' ;

In my DSL, I have:

LPMX=«#ifundefined abc
#define abc = 123at
#endif
; just an example
»

but in the generator, all lines with a "#" are not included in the AST.

Others like:
LPMX=«abacap(12)
test12
abc»

are delivered as expected. What do I have to do to get all the text in the generator ?

TIA, Uli
Re: how to escape #comments in freecode [message #1744790 is a reply to message #1744785] Fri, 30 September 2016 09:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13885
Registered: July 2009
Senior Member
There must be something else in you grammar / value converter / generator causing this. Did you debugwhat is in your ast

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: how to escape #comments in freecode [message #1744803 is a reply to message #1744790] Fri, 30 September 2016 10:09 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
Hi Christian,
thanks for your fast reply.

my project is based on the greeting example
and beside the grammar and the generator, I have not touched the code.
And I didn't have coded something with a if "#" ...

I will give it a try with a minimal reproducable example, perhaps this will give us some clue.

[Updated on: Fri, 30 September 2016 10:09]

Report message to a moderator

Re: how to escape #comments in freecode [message #1744809 is a reply to message #1744803] Fri, 30 September 2016 10:47 Go to previous message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
It's a kind of magic:
I HAVEN'T DONE NOTHING, but it works now.
Thanks Dietrich for your input,Uli

P.S. I know, they always say this
Previous Topic:Quickfix in Problemsview
Next Topic:Xtext code generation using other JVM languages, e.g. Scala
Goto Forum:
  


Current Time: Sat Apr 17 23:57:27 GMT 2021

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

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

Back to the top