|dynamic yacc-tables? firstname.lastname@example.org (1991-08-12)|
|Re: dynamic yacc-tables? email@example.com (1991-08-13)|
|Re: dynamic yacc-tables? firstname.lastname@example.org (1991-08-13)|
|Re: dynamic yacc-tables? email@example.com (1991-08-13)|
|Re: dynamic yacc-tables? firstname.lastname@example.org (1991-08-13)|
|Re: dynamic yacc-tables? email@example.com (Kjell Post) (1991-08-14)|
|Re: dynamic yacc-tables? firstname.lastname@example.org (1991-08-16)|
|From:||email@example.com (Joshua Levy)|
|Date:||Tue, 13 Aug 1991 17:26:18 GMT|
In article 91-08-043 firstname.lastname@example.org (Ercument Canver) writes:
>I got the following problem: I need to extend the parse tables generated
>by yacc dynamically during parsing a text. ...
>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).
You may want to attack the problem with lex instead of yacc. Read:
PARSING DISTFIX OPERATORS by Edgar H. Sibley in Commmunications of the ACM
February 1986, Vol 29, num 2, page 118.
The advantages of user-defined distfix operators -- a syntactic
convenience that enhances the readability of programs -- can be
obtained as an extension of almost any programming language without
requiring dynamic changes to the parser.
We have described a simple technique whereby a fixed BNF grammar can
describe languages including user-defined infix, postfix, and distfix
operators. The technique requires only that the parts of disfix
operators be lexically distinguishable. ...
The idea has been successfully implemented [with YACC] with minimal
Note that "lexically distinguishable" means that lex can look up the
answer in a table, which can grow dynamically. I'm not sure how Sibley's
ideas interact with overloading.
Joshua Levy (email@example.com)
Return to the
Search the comp.compilers archives again.