TIP: Click on subject to list as thread! ANSI
echo: nascar
to: Chris Cranford
from: Jasen Betts
date: 2004-04-16 13:01:00
subject: Bison/flex

Hi CHRIS.

15-Apr-04 01:16:50, CHRIS CRANFORD wrote to ALL

 CC> I am trying to implement a BASIC-like language compiler with the
 CC> caveat that the compiler doesn't actually take source to machine
 CC> language but to a bytecode type language which an embedded virtual
 CC> machine would process.

Most (if not all) basic interpreters work that way.
(well, they convert keywords to tokens, and labels/structure items to
addresses atleast)

 CC> Anyone done anything like this in the past generating symbol
 CC> tables, and populating the stacks with commands, arguments,
 CC> labels, etc ???  If so, I'd be interested in discussing this
 CC> further with you as I have hit a slight road-block.

I'd like to know more than I do about it.

I take it from the above that you are using bison (or somethink like it) to
parse the language and it's giving you back a stack full of language and
context symbols

I think one way to do it is to arrage for each closure of an
expression/line/block/function etc to cause the compiler to emit the
apropriate bytecode, and then at the end (or when you encounter the
targets) go back and fill in the addresses of the forwards references.

am I close?

what's the road-block?

is the design of the byte-code under your control?
do you have the byte-code interpreter working?

it seems to me you could use flex and bison (generated software) to do most
of the work generating the byte-code

 -=> Bye <=-

---
---
 # BgNet 1.0#12 # ASN Host 1/0: Capitol City Online * KY * 502/875-8938


--- GTMail 1.26 

--- Squish v1.11
* Origin: Money is the root of all wealth. (3:640/1042)
* Origin: Kentucky's Capitol City Online * 502/875-8938 (1:2320/105.0)
* Origin: Kentucky's Capitol City Online * 502/875-8938 * USA (1:2320/105)
SEEN-BY: 633/267 270
@PATH: 2320/105 261/38 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.