help my compiler: designed by novice

"Cai, Yong" <>
23 Mar 1999 12:32:46 -0500

          From comp.compilers

Related articles
help my compiler: designed by novice (Cai, Yong) (1999-03-23)
| List of all articles for this month |

From: "Cai, Yong" <>
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,

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]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.