Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Supporting macros/includes in Xtext ?!
Supporting macros/includes in Xtext ?! [message #740437] Tue, 18 October 2011 14:06 Go to next message
Mahmoud Moneeb is currently offline Mahmoud MoneebFriend
Messages: 15
Registered: October 2011
Junior Member
Hi,

I want to ask if Xtext is capable of supporting "includes/macros" as in C like languages ?!

If no, Can I implement my own text preprocessor and pass the final code after text replacement as a stream to Xtext ?!


I want to know if you are planning to support "includes/macros" in future releases or not ?!

I think it's too important to support this features so Xtext can cover more languages' grammar

Best regards,
Re: Supporting macros/includes in Xtext ?! [message #740741 is a reply to message #740437] Tue, 18 October 2011 21:04 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Mahmoud,

no, we don't support pre-processed languages and don't have concrete
plans to do that in the future. You could try to implement something on
your own, though that will be quite complicated (which is caused by the
nature of macros and pre-processors).

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

On 18.10.11 16:06, Mahmoud Moneeb wrote:
> Hi,
>
> I want to ask if Xtext is capable of supporting "includes/macros" as in
> C like languages ?!
>
> If no, Can I implement my own text preprocessor and pass the final code
> after text replacement as a stream to Xtext ?!
>
> I want to know if you are planning to support "includes/macros" in
> future releases or not ?!
>
> I think it's too important to support this features so Xtext can cover
> more languages' grammar
> Best regards,
>
Re: Supporting macros/includes in Xtext ?! [message #741165 is a reply to message #740437] Wed, 19 October 2011 08:40 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 211
Registered: July 2009
Senior Member
Hi Mahmoud,

Mahmoud Moneeb wrote on Tue, 18 October 2011 10:06



I want to know if you are planning to support "includes/macros" in future releases or not ?!

I think it's too important to support this features so Xtext can cover more languages' grammar

Best regards,


IMHO preprocessor / macros are actually hell for any language design. I can see the need for support if you are talking about building grammars and editors for languages like C, but it makes analysis of the code extremly difficult.

When designing a new language / DSL, it is something to be avoided IMHO.

Regards,

Andreas

[Updated on: Wed, 19 October 2011 08:40]

Report message to a moderator

Re: Supporting macros/includes in Xtext ?! [message #741335 is a reply to message #741165] Wed, 19 October 2011 12:35 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 10/19/11 10:40 AM, Andreas Graf wrote:
>
> When designing a new language / DSL, it is something to be avoided IMHO.
>
IMHO, You can take out the IMHO :)

Repeat 1000 x times:
"When designing a new language / DSL, do not include preprocessing and
macros"!

You have been warned...

- henrik
Re: Supporting macros/includes in Xtext ?! [message #742432 is a reply to message #741335] Thu, 20 October 2011 13:40 Go to previous message
Moritz Eysholdt is currently offline Moritz EysholdtFriend
Messages: 161
Registered: July 2009
Location: Kiel, Germany
Senior Member
On 19.10.11 14:35, Henrik Lindberg wrote:
> On 10/19/11 10:40 AM, Andreas Graf wrote:
>>
>> When designing a new language / DSL, it is something to be avoided IMHO.
>>
> IMHO, You can take out the IMHO :)
>
> Repeat 1000 x times:
> "When designing a new language / DSL, do not include preprocessing and
> macros"!
>
> You have been warned...

well said. so true.

regards,
Moritz
Previous Topic:Linking with resource in separate ResourceSet
Next Topic:Implement the AbstractDomainmodelJavaValidator in a different project?
Goto Forum:
  


Current Time: Fri Apr 26 08:50:15 GMT 2024

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

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

Back to the top