|help my compiler: designed by novice firstname.lastname@example.org (Cai, Yong) (1999-03-23)|
|From:||"Cai, Yong" <email@example.com>|
|Date:||23 Mar 1999 12:32:46 -0500|
I wrote a compiler in C++ that reads a language I defined. It has
var-declaration, function-definition and statements(including control and
assignment). My goal is to have my program call and execute user-defined
functions written in this special language. Without resorting to lex/yacc
and dynamic linking, my parser reads the language and store the user
functions, variables and statements in pointer stacks, and these pointers
are used as reference in the functions. Here are my questions:
i) Is my method efficient? And how could I improve it?
ii) Is it possible for me to make use of existing technique(flex,
My thanks in advance for any help you might lend me.
[I usually suggest that you compile to RPN byte codes and interpret that,
so you don't have to reparse each time you re-execute something. -John]
Return to the
Search the comp.compilers archives again.