|LALR parser to LPG & error recovery [message #18393]
||Sat, 12 April 2008 11:04
Originally posted by: nospam.no.mail.com|
I have a working LALR parser, can I easily transform it into an LPG
LPG doesn't seem to have associativities and precedence keywords. What
kind of parser technology does LPG use?
I am particularly interested in error recovery, so that an AST can always
be built for programs that are being edited in Eclipse. I have read that
LPG has a good error recovery mechanism. How do I use it?
|Re: LALR parser to LPG & error recovery [message #570248 is a reply to message #18393]
||Wed, 16 April 2008 16:01
| Philippe Charles
Registered: July 2009
Right now, LPG accepts LALR(K) grammars from which you can build a |
deterministic parser or a parser with backtracking.
There are a few things left to do that we have not had the chance to
fully address (some of which you touched upon) ...
. Precedence specification (a la YACC? ... to resolve conflicts)
. Complete the implementation of a semi-automatic method for
constructing ASTs for erroneous input - adding prosthetic nodes where
needed to complete the tree.
. A GLR (Generalized LR Parser) driver (for ambiguous grammars)
The error recovery is automatic so you don't have to do anything to use
it. However, the prosthesis component has not been fully implemented.
So, for now, it only issues diagnostic messages and does not always
produce an AST.
Powered by FUDForum
. Page generated in 0.01985 seconds