Bison games

"Patrick Clochesy" <>
8 Sep 2000 02:10:30 -0400

          From comp.compilers

Related articles
Bison games (Patrick Clochesy) (2000-09-08)
Re: Bison games (Chris F Clark) (2000-09-09)
| List of all articles for this month |

From: "Patrick Clochesy" <>
Newsgroups: comp.compilers
Date: 8 Sep 2000 02:10:30 -0400
Organization: Compilers Central
Keywords: parse, question, comment

This is an extremely simple question, but it needs to be addressed and I
have not found a proper answer. I'm sure you all know it though.

What I want to do is create while() { ... } and if() { ... } else { ... }
syntax. How can I do this with Bison? I have a working grammar that
processes the single lines fine. I do not do anything past that.

A simple example would be great. I have read the epaperpress one but i just
don't get it.
[Yacc and its relatives make one pass through the input. If you want to
do something like a loop, you either have to arrange to keep feeding the
input to yacc each time through the loop (not recommended) or first
translate into something easy to interpret like RPN or a parse tree
and then write an interpreter that runs what you parsed. -John]

Post a followup to this message

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