Re: Example interpreter C

Laurence Finston <>
16 Aug 2005 11:16:05 -0400

          From comp.compilers

Related articles
Example interpreter C (Henry Butwsky) (2005-08-13)
Re: Example interpreter C (Laurence Finston) (2005-08-16)
Re: Example interpreter C (Rafael 'Dido' Sevilla) (2005-08-16)
Re: Example interpreter C (2005-08-21)
Re: Example interpreter C (Laurence Finston) (2005-08-21)
Re: Example interpreter C (George Neuner) (2005-08-24)
Re: Example interpreter C (2005-08-24)
Re: Example interpreter C (Julian Stecklina) (2005-08-31)
[8 later articles]
| List of all articles for this month |

From: Laurence Finston <>
Newsgroups: comp.compilers
Date: 16 Aug 2005 11:16:05 -0400
Organization: GWDG, Goettingen
References: 05-08-055
Keywords: C, interpreter, comment
Posted-Date: 16 Aug 2005 11:16:05 EDT

On Sat, 13 Aug 2005, Henry Butwsky wrote:

> I have written a basic parser (with flex and Bison) that evaluates
> simple expressions , but now I want to add IF/THEN construct and also
> loops
> I understand that I need to write a parser that creates and AST
> (abstract symbol table) . Can any one point in the direction of an
> such an expale interpreter ?

> [Uh, AST stands for Abstract Syntax Tree. You'll find a lot more
> references if you use the right name. -John]

I don't know what "expale" is, nor what an abstract syntax tree is.
However, I have written an interpreter with conditionals and loops.
I've also implemented macros using similar techniques.
It's available at:
The input files for the parser have names of the pattern "p*.w".
The one with the rules for loops is 'ploops.w' and the one with
rules for conditionals is 'pcondit.w'.

This topic also comes up regularly on the "help-bison" mailing list.
You might want to check the archives:

Laurence Finston
[Expale is a typo for example, and I have to say that if you don't know what
an AST is, you should consider learning a little about compiler basics. -John]

Post a followup to this message

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