Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IMP » Experiences; custom parser?
Experiences; custom parser? [message #567328] Tue, 16 October 2007 11:00
Lennart Kats is currently offline Lennart Kats
Messages: 3
Registered: July 2009
Junior Member
Hi,

At Delft University we're very much interested in the IMP Project. In
the future, we may be interested in integrating it with the SDF2
parser and Stratego/XT program transformation suite. At the moment
though, I have just been playing around with the current
implementation a bit, creating an IDE for an experimental language
developed here. First, a list of some things I ran into, which I hope
is useful:

* The wizards seem to be very picky about the inputs. (Something
common to most early implementations of Eclipse plugins...)

- They require the project to be in the workspace _directory_, not
just imported into the workspace from a different location.

- For LPG to work, I had to place Eclipse in a directory without
spaces in the path (i.e., outside "Program Files" under Windows)

- Not all wizards correctly convert the package name to lowercase.

* The editors don't seem to fully support multiple instances of the
same file (right click "new editor" on any editor pane). Quickly
pasting content into a duplicated editor seems to break it.

* The LPG editors are very helpful with their support for
hyperlinking and inline error reporting. It is a bit strict about
rules that are unused though, shouldn't those result in a warning
rather than an error?

* Finally, one issue came up when I was rewriting our existing grammar
to use LPG. In our grammar we currently have a comment block in the
form of "description { ... }". This caused a conflict with the
"define" keyword, even with backtracking enabled, apparently because
they share a common prefix. I was finally able to work around this
by placing the "define" keyword in the regular lexer rather than in
the keyword lexer...

Other than these issues, it seems the current implementation already
provides some really nice, time-safing abstractions over the regular
Eclipse API, mainly thanks to the AST-based approach. What took the
most time when creating my editor, of course, was writing the
grammar. I had an existing SDF2 grammar as a basis (that is,
scannerless generalized LR; SGLR), which included quite a few nasty
language features that were hard to translate to LPG. (Such as the
comment blocks and - at the moment - a complete lack of reserved
keywords.)

As I understand from the documentation, the current implementation
isn't quite ready yet for custom parsers, due to the use of concrete
types rather than interfaces. Other than that, are there any current
hurdles that may be inhibiting the use of a custom parser? Does the
fact that the SGLR parser doesn't employ a separate lexer form any
problem?

Regards,

--
Lennart Kats
------------------------------------------------------------ ---------
Software Engineering Research Group,
Department of Software Technology,
Delft University of Technology.
Previous Topic:Regarding the IMP project!
Next Topic:Missing IMP projects available
Goto Forum:
  


Current Time: Thu Aug 28 07:13:54 EDT 2014

Powered by FUDForum. Page generated in 0.01583 seconds