[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: Loops using flex/bison..
From: |
Olav Groehn |
Subject: |
AW: Loops using flex/bison.. |
Date: |
Tue, 5 Feb 2002 13:00:54 +0100 |
Hi Matthew,
check enclosed bison gramar (basic Interpreter)
Olav
-----Ursprüngliche Nachricht-----
Von: address@hidden [mailto:address@hidden
Auftrag von Matthew Tedder
Gesendet: Dienstag, 5. Februar 2002 21:45
An: address@hidden
Betreff: Loops using flex/bison..
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
_______________________________________________
Help-bison mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-bison
EmbeddedBasic.y
Description: Binary data