Help needed with grammar problem

ymishory@study.haifa.ac.il (Yuval Mishory)
9 Mar 2003 17:29:40 -0500

          From comp.compilers

Related articles
Help needed with grammar problem ymishory@study.haifa.ac.il (2003-03-09)
Re: Help needed with grammar problem kgw-news@stiscan.com (2003-03-14)
| List of all articles for this month |

From: ymishory@study.haifa.ac.il (Yuval Mishory)
Newsgroups: comp.compilers
Date: 9 Mar 2003 17:29:40 -0500
Organization: http://groups.google.com/
Keywords: parse, question
Posted-Date: 09 Mar 2003 17:29:40 EST

hello everyone,
I'm facing a problem:


Among other rules, I have a syntax rule that goes E -> E R E , which
is of course a left recursion. now, this syntax rule is supposed to be
interpreted into a syntax subtree that is supposed to be binary and
created preorder, meaning I'd like the lefthand side E to become a
node of type R, which has two 'sons' of type E (each of which may
become another R itself and so on).


Simple left recursion elimination algorithms can't help me here,
because eventually it still comes down to inorder processing, which
gives me a non-binary tree (E may become a single node, three nodes,
five nodes and so on).


anyone?


Post a followup to this message

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