[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Loops using flex/bison..
From: |
Matthew Tedder |
Subject: |
Loops using flex/bison.. |
Date: |
Tue, 5 Feb 2002 15:45:12 -0500 |
Hi,
I wrote a little interpreter that's like a bucket with a big hole in the
bottom. I connected a flex-based lexer with a bison-based parser but don't
know how this combination is supposed to be able to support loops?
Is there a way to do this other than having flex output pcode into an array
and having a special program feed that to the parser?
All I need are FOR, WHILE, and GOTO/LABEL loops.. I figured out a goofy,
but effective way to make my IF .. THEN .. conditionals execute statements
only when a condition is set. But I feel very inefficient having to put
every single statement on the right side of bison's rules in an if(..)
condition..
It's a little BASIC interpreter. I have some great ideas for enhancing it.
I also thought about using flex to translate BASIC to C. Would it be
possible to turn such a thing easily into a gcc front-end?
--Matthew
- Loops using flex/bison..,
Matthew Tedder <=