Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Preprocessing in XText(Integrating a preprocessor)
Preprocessing in XText [message #893422] Wed, 04 July 2012 01:37 Go to next message
Eclipse UserFriend
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 ?
Re: Preprocessing in XText [message #893603 is a reply to message #893422] Wed, 04 July 2012 15:28 Go to previous messageGo to next message
Eclipse UserFriend
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 07:04 Go to previous messageGo to next message
Eclipse UserFriend
Can you tell me what is a good starting point? I already got a preprocessor, so that is not an issue.
Re: Preprocessing in XText [message #894493 is a reply to message #894471] Mon, 09 July 2012 08:34 Go to previous messageGo to next message
Eclipse UserFriend
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 13:00 Go to previous message
Eclipse UserFriend
Righto Smile
Thanks a lot man Smile This is a lot of help!
Previous Topic:manage syntax highlighting
Next Topic:Giving the lexer a different stream
Goto Forum:
  


Current Time: Tue Jul 08 01:08:02 EDT 2025

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

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

Back to the top