Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IMP » Importing Syntax parser to IMP
Importing Syntax parser to IMP [message #571795] Mon, 30 June 2008 08:45
Damien Thivolle is currently offline Damien ThivolleFriend
Messages: 25
Registered: July 2009
Junior Member

In the VASY team at INRIA, we have numerous compilers in our toolbox for
which we've used the Syntax (
parser generator.

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
characters set.

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?

Best regards,

Damien Thivolle | INRIA Rhone-Alpes / VASY
PHD Student | 655, Avenue de l'Europe | Montbonnot | 38 334 Saint Ismier Cedex France
Previous Topic:IDE crash because of lpg executable?
Next Topic:Native Library Usage
Goto Forum:

Current Time: Fri Mar 24 02:21:25 GMT 2017

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

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