Related articles |
---|
help my compiler: designed by novice ycai@lehman.com (Cai, Yong) (1999-03-23) |
From: | "Cai, Yong" <ycai@lehman.com> |
Newsgroups: | comp.compilers |
Date: | 23 Mar 1999 12:32:46 -0500 |
Organization: | Compilers Central |
Keywords: | question, interpreter |
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,
bison...)?
My thanks in advance for any help you might lend me.
Yong Cai
[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
comp.compilers page.
Search the
comp.compilers archives again.