writing an interpreter for a simple language

E

eyalkz

Hi Everybody,

I need to write a simple interpreter (in C) for a very Simple language...
the language (was invented for the project) has only

variable or numbers (there are also built-in variables)
routines and expressions (routines can have recursion )

where can I find help and source code on that project...?

I heard this assignment is often given to students on programming courses...

Please Help,
Egal Konn
 
J

Julian V. Noble

eyalkz said:
Hi Everybody,

I need to write a simple interpreter (in C) for a very Simple language...
the language (was invented for the project) has only

variable or numbers (there are also built-in variables)
routines and expressions (routines can have recursion )

where can I find help and source code on that project...?

I heard this assignment is often given to students on programming courses...

Please Help,
Egal Konn

Try using YACC to generate your interpreter since you want it in C.

--
Julian V. Noble
Professor Emeritus of Physics
(e-mail address removed)
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/

"Science knows only one commandment: contribute to science."
-- Bertolt Brecht, "Galileo".
 
G

Glen Herrmannsfeldt

eyalkz said:
Hi Everybody,

I need to write a simple interpreter (in C) for a very Simple language...
the language (was invented for the project) has only

variable or numbers (there are also built-in variables)
routines and expressions (routines can have recursion )

where can I find help and source code on that project...?

I heard this assignment is often given to students on programming
courses...

Books on compilers should describe how to write parsers, which are the most
important part. You might also look to lex/flex and bison/yacc, tools to
make parser writing easier.

-- glen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top