| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| 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 <=- ---* Origin: Money is the root of all wealth. (3:640/1042) SEEN-BY: 633/267 270 @PATH: 640/1042 531 954 774/605 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™.