TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: PASCAL SCHMIDT
from: CHRIS CRANFORD
date: 2004-04-15 01:23:42
subject: RE: Scripting/Basic Compiler/Interpretor

On 4/15/2004 1:21 AM, PASCAL SCHMIDT wrote to CHRIS CRANFORD:

-> Hi CHRIS! :-)
-> 
->  CC> Can anyone offer some suggestions on how you would go about defining
->  CC> your functions, keywords/syntax parser and then how to execute it in
->  CC> the internal interpretor engine?
-> On Unix/Linux: for the parser, come up with a decent grammar, then use lex 
-> (or flex) and yacc (or bison) to automatically generate most of the C code 
-> for the parser. You'd also need to define some data structures to hold the 
-> contents of a script, filled out by the parser.
-> 
-> For the interpreter, you need to come up with a runtime system, basically 
-> abstractions for all the actions a script can take. So if your scripts are 
-> allowed to declare arrays, you'd need a full memory management system for 
-> that.

OK, so far I have defined my grammer and have a fully functioning parser 
with BISON/FLEX.  It detects when parse errors occur and terminates as 
it should.

Now, from what I have read thus far, I need to, as my parser is reading the
source file(s), need to create a number of stacks that hold information
like:

  Labels, Symbols, and Constants
  Commands
  Values (Integers, Strings - ie: Parameters)

I know this can be done from the BISON grammer file to call C functions which 
populate these things, but I'm unsure of really how I should best structure 
this monster.  

Any more ideas or thoughts?  

Appreciate the help.
Chris

--- Mail-ennium/32 v2.0-alpha-r12
* Origin: Mail-ennium/32 v2 Beta Coming Soon! (1:379/1200.0)
SEEN-BY: 633/267 270
@PATH: 379/1200 1 396/45 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™.