Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Preprocessing in XText(Integrating a preprocessor)
Preprocessing in XText [message #893422] Wed, 04 July 2012 05:37 Go to next message
Prajeet Missing name is currently offline Prajeet Missing nameFriend
Messages: 14
Registered: November 2010
Location: B'Lore
Junior Member
Is there a way to integrate a preprocessor into XText editor?

I have a DSL which has macros and i need a preprocessor that can preprocess the file (expand macros and do other jobs) and also i need to integrate it into the editor. Is this possible ?


In order to gain something, something of equal value must be sacrificed.
Re: Preprocessing in XText [message #893603 is a reply to message #893422] Wed, 04 July 2012 19:28 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-03-07 22:37, Prajeet Mising name wrote:
> Is there a way to integrate a preprocessor into XText editor?
> I have a DSL which has macros and i need a preprocessor that can
> preprocess the file (expand macros and do other jobs) and also i need to
> integrate it into the editor. Is this possible ?

It is not impossible, but is difficult and requires a lot of work.
Various aspects of this has been discussed a number of times in this forum.

Regards
- henrik
Re: Preprocessing in XText [message #894471 is a reply to message #893603] Mon, 09 July 2012 11:04 Go to previous messageGo to next message
Prajeet Missing name is currently offline Prajeet Missing nameFriend
Messages: 14
Registered: November 2010
Location: B'Lore
Junior Member
Can you tell me what is a good starting point? I already got a preprocessor, so that is not an issue.

In order to gain something, something of equal value must be sacrificed.
Re: Preprocessing in XText [message #894493 is a reply to message #894471] Mon, 09 July 2012 12:34 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 2012-09-07 13:04, Prajeet Mising name wrote:
> Can you tell me what is a good starting point? I already got a
> preprocessor, so that is not an issue.

The difficulty is that you want to edit the original text (unprocessed)
while the parser must operate on the processed stream.

Now you have several problems:
- Creating an input stream with the preprocessed content (the easiest part)
- Making the editor show unprocessed content only
- Handling errors in included / expanded logic
- Handle text based references (positions, lines etc. as they will be
different in processed and unprocessed text).
- Making builders react to changes in included logic
- Serializing the model (should only contain unprocessed content)
- You will probably also have to customize many features that otherwise
work out of the box - cross references becomes tricky, as well as
formatting.

This is a major undertaking and requires a good understanding of
Xtext/Eclipse.

Regards
- henrik
Re: Preprocessing in XText [message #894581 is a reply to message #894493] Mon, 09 July 2012 17:00 Go to previous message
Prajeet Missing name is currently offline Prajeet Missing nameFriend
Messages: 14
Registered: November 2010
Location: B'Lore
Junior Member
Righto Smile
Thanks a lot man Smile This is a lot of help!


In order to gain something, something of equal value must be sacrificed.
Previous Topic:manage syntax highlighting
Next Topic:Giving the lexer a different stream
Goto Forum:
  


Current Time: Fri Mar 29 08:48:46 GMT 2024

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

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

Back to the top