help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: BISON To Represent BASIC Grammer


From: chris . cranford
Subject: RE: BISON To Represent BASIC Grammer
Date: Wed, 14 Apr 2004 15:26:42 -0400

On 4/14/2004 3:24 PM, address@hidden wrote to CHRIS CRANFORD:

I think it would be a great tutorial for people getting started with 
BISON/FLEX.  Once I finally started seeing the bigger picture and 
how it all works, its coming along.

Now I finally have BISON/FLEX embeded in my DLL ScriptToByteCode 
compiler.  Now comes the hard part of taking what the parser finds 
and actually storing it, creating the instruction stacks and then
dumping that to a BYTECODE file.

Anyways, I suppose the latter portion of this is more inline with 
the compiler group instead of here :-/

Thanks,
Chris


-> Hans:
-> Looking at the number of questions on things like this...
-> may I suggest that we work on a small example of simplified BASIC that is
-> implemented using flex and bison
-> and put that on Bison page.
-> What do you think?
-> Senthil
-> 
-> -----Original Message-----
-> From: address@hidden
-> [mailto:address@hidden Behalf Of
-> Hans Aberg
-> Sent: Wednesday, April 14, 2004 1:55 PM
-> To: Chris Cranford
-> Cc: Hans Aberg
-> Subject: Re: BISON To Represent BASIC Grammer
-> 
-> 
-> At 21:12 -0400 2004/04/13, Chris Cranford wrote:
-> >Hans -
-> 
-> Don't forget to cc Help-Bison.
-> 
-> >I looked around a little more detailed since I knew what to be looking for
-> >and found a great post in a newsgroup where someone has put their yacc/flex
-> >implementation of a subset of BASIC in their post.
-> >
-> >I followed this as an example and thus far it seems to be working.  So with
-> >that said, let me make sure I have an understanding of what I should do.
-> >
-> >1. Develop a way to pass the BASIC file's source to the yyparse()
-> >   function and detect if the parse is successful or not.
-> >
-> >2. Once the syntax pass #1 is successful, then I need to develop a
-> >   way to 'interpret' the code and generate a bytecode instruction
-> >   list of the code and this bytecode should then be stored in a
-> >   file.
-> >
-> >The the bytecode file will get used by the Virtual Machine in order to
-> >emulate/run the code ...
-> >
-> >Right?
-> 
-> People do this differently depending on what language one is working with.
-> For example, in comp.compilers, one recently suggested a assembler two-pass
-> approach: first set the labels, then generate the code. Other languages may
-> require only one pass.
-> 
->   Hans Aberg
-> 
-> 
-> 
-> 
-> _______________________________________________
-> address@hidden http://mail.gnu.org/mailman/listinfo/help-bison
-> 
-> 
-> _______________________________________________
-> address@hidden http://mail.gnu.org/mailman/listinfo/help-bison

 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]