Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to replace ANTLR?(Or, how to support left recursion in XText)
How to replace ANTLR? [message #715230] Fri, 12 August 2011 21:01 Go to next message
ted stockwell is currently offline ted stockwellFriend
Messages: 123
Registered: July 2009
Senior Member
Hi All,

I have developed a Java parser combinator library that supports left recursive grammars.
I am in the process of releasing it here: http://code.google.com/p/lingwah/

I would like to integrate my parser into XText and thus eliminate the need to left factor XText grammars.
I have not used XText a lot, I once downloaded it and created a simple example.

So... I have a couple of questions...

... is ANTLR the only barrier to supporting left recursion in XText?

... is it possible to replace ANTLR? If so how would I go about doing this?


Thanks...

ted stockwell
(no subject) [message #715327 is a reply to message #715230] Sat, 13 August 2011 10:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7106
Registered: July 2009
Senior Member
Hi Ted

In http://journal.ub.tu-berlin.de/eceasst/article/view/444 I describe
the re-engineering the Eclipse OCL grammar from LPG (LALR) to Xtext LL.

In a naive LL, the change in recursion would be a problem. In practice
Xtext's EBNF capabilities (*, ?, +) are left recursive, and so far from
being deficient Xtext is actually much better.

The generated ANTLR grammars are huge and so one activity I would like
to progress is an Xtext to LPG transformation so that, for compile-only
purposes, a somewhat faster and much smaller grammar can be used while
retaining the power of Xtext as a model-integrated grammar with
auto-generated editor tooling.

If you're interested in Xtext to LALR mapping let me know.

Regards

Ed Willink

On 12/08/2011 22:01, ted stockwell wrote:
> Hi All,
>
> I have developed a Java parser combinator library that supports left
> recursive grammars.
> I am in the process of releasing it here:
> http://code.google.com/p/lingwah/
>
> I would like to integrate my parser into XText and thus eliminate the
> need to left factor XText grammars. I have not used XText a lot, I
> once downloaded it and created a simple example.
>
> So... I have a couple of questions...
>
> .. is ANTLR the only barrier to supporting left recursion in XText?
>
> .. is it possible to replace ANTLR? If so how would I go about doing
> this?
>
>
> Thanks...
>
> ted stockwell
(no subject) [message #715688 is a reply to message #715230] Mon, 15 August 2011 08:24 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3109
Registered: July 2009
Senior Member
Hi Ted,

no, it's not easily possible to replace the parser. There are a lot of
invariants that have to be fulfilled when it comes to error recovery for
incomplete models, partial parsing and the construction of the node model.

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

On 12.08.11 23:01, ted stockwell wrote:
> Hi All,
>
> I have developed a Java parser combinator library that supports left
> recursive grammars.
> I am in the process of releasing it here: http://code.google.com/p/lingwah/
>
> I would like to integrate my parser into XText and thus eliminate the
> need to left factor XText grammars. I have not used XText a lot, I once
> downloaded it and created a simple example.
>
> So... I have a couple of questions...
>
> .. is ANTLR the only barrier to supporting left recursion in XText?
>
> .. is it possible to replace ANTLR? If so how would I go about doing this?
>
>
> Thanks...
>
> ted stockwell
Previous Topic:How to integrate Xtext with an existing eclipse plug-in developed for a DSL?
Next Topic:How to open the file specified by "importURI"?
Goto Forum:
  


Current Time: Wed Apr 21 19:37:29 GMT 2021

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

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

Back to the top