dynamic yacc-tables?

canver@cyborg.informatik.uni-ulm.de (Ercument Canver)
Mon, 12 Aug 91 16:12:27 GMT

          From comp.compilers

Related articles
dynamic yacc-tables? canver@cyborg.informatik.uni-ulm.de (1991-08-12)
Re: dynamic yacc-tables? pardo@gar.cs.washington.edu (1991-08-13)
Re: dynamic yacc-tables? rekers@cwi.nl (1991-08-13)
Re: dynamic yacc-tables? joshua@veritas.com (1991-08-13)
Re: dynamic yacc-tables? salomon@ccu.umanitoba.ca (1991-08-13)
Re: dynamic yacc-tables? kjell@cs.ucsc.edu (Kjell Post) (1991-08-14)
Re: dynamic yacc-tables? markh@csd4.csd.uwm.edu (1991-08-16)
| List of all articles for this month |

Newsgroups: comp.lang.c,comp.compilers
From: canver@cyborg.informatik.uni-ulm.de (Ercument Canver)
Keywords: parse, yacc
Organization: University of Ulm, Germany
Date: Mon, 12 Aug 91 16:12:27 GMT

I got the following problem: I need to extend the parse tables generated
by yacc dynamically during parsing a text. I could think of a function like


yynewrule( _grammarRule_ );


which takes a grammar rule as input and extends the table appropriately. This
funtion may be called during parsing and returns an error code if there are
any problems (like shift/reduce, reduce/reduce, ...). Do extensions of that
type already exist for yacc? I am of course aware of the fact, that such a
parser would have to contain the entire functionality of yacc in addition.
This and the the necessity to keep the tables dynamic, rather than static as
in current yacc versions, would require rewriting of an completely new yacc.


Background: I'm posting this request because I have to write a parser suitable
for declaring mixfix operators and overloading.


I'd also appreciate pointers to parser generaters dealing with this kinda
problem (not necessarily yacc-like).


Thanx,


Ercument Canver
e-mail: canver@informatik.uni-ulm.de
[There have certainly been parsers that handle extensible and ambiguous
grammars, such as Irons' IMP72 at Yale and Wegbreit's EL/1 at Harvard. I
suspect that it's a losing battle to try and force yacc to do this. It'd be
easier to use some method driven more directly from the grammar. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.