|Importing Syntax parser to IMP [message #571795]
||Mon, 30 June 2008 08:45
| Damien Thivolle
Registered: July 2009
In the VASY team at INRIA, we have numerous compilers in our toolbox for
which we've used the Syntax (http://alpage.inria.fr/syntax.fr.html)
To build an Eclipse interface for our toolbox, we would need to somehow
port the grammars we wrote for Syntax to IMP.
I already see several problems in doing that. Syntax is C-based and we
can embed C code in grammar rules to tune them. Also, Syntax provides
predicates and actions that we typically use to recognize nested
structures or handle priorities. There are other things like the
terminals and the grammar rules being defined in different files with
different formats. The grammar in Syntax is described with a BNF
language while the terminals are described with regexp and operators on
Facing these problems, we thought it might be easier to connect Syntax
to IMP (solution #2 in IMP manual). That would require a bit of hacking
but we think it might be easier than trying to translate the grammars
from the Syntax format to the LPG format.
The problem is that Syntax is written in C. I think we can implement the
interfaces to interact with IMP but the problem is the AST. If we have
to construct manually an AST for each grammar we're trying to port, then
it's easier to manually port the grammar. So I was thinking of
building an AST that follows the grammar rules. This wouldn't really be
an AST per se but does it really matter if we only need it for the editor?
This is very similar to the problem of importing existing lex/yacc
grammars to IMP.
Anyway, I wanted to ask you if I missed key points in my analysis. Would
you agree it's more feasible to connect Syntax to IMP (via the
interfaces you mentionned in the manual) than building a tool that'd
translate the grammar rules from Syntax to LPG?
Damien Thivolle | INRIA Rhone-Alpes / VASY
PHD Student | 655, Avenue de l'Europe
email@example.com | Montbonnot
http://www.inrialpes.fr/vasy | 38 334 Saint Ismier Cedex France
Powered by FUDForum
. Page generated in 0.09310 seconds