Re: Basic Yacc Question

ct7@datatel.com (W. Craig Trader)
Thu, 20 Apr 1995 04:13:11 GMT

          From comp.compilers

Related articles
Basic Yacc Question mbbad@s-crim1.daresbury.ac.uk (1995-04-05)
Re: Basic Yacc Question salomon@silver.cs.umanitoba.ca (1995-04-14)
Re: Basic Yacc Question ct7@datatel.com (1995-04-20)
| List of all articles for this month |

Newsgroups: comp.compilers
From: ct7@datatel.com (W. Craig Trader)
Keywords: yacc, design
Organization: Compilers Central
References: 95-04-069
Date: Thu, 20 Apr 1995 04:13:11 GMT

> > Basically I picked up the Gnu-Bison documentation and started to read
> > through it with a view to creating a pre-processor. Everything is (nearly)
> > clear to be *except* if (as in this case) you're writting an interpretter
> > instead of a compiler, how do you implement a definite-loop ?


> [I'd parse the entire program and turn it into RPN or trees, then run my
> interpreter on that. Interpreting on the fly is a losing battle for any but
> the most simple languages. -John]


There's a particularly good example of this in _The UNIX Programming
Environment_ by Kernighan & Pike (Prentice Hall, 1984) that covers building
an interpreted calculator using Yacc (and to a lesser extent, Lex).
Particularly useful is the iterative design/develop/test methodolgy they use.


      W. Craig Trader, Programmer/Analyst, Datatel, Inc. <ct7@datatel.com>
--


Post a followup to this message

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