Teen Programmers Unite  


Return to forum top

Interpreter Design using C/C++

Posted by CDR700 [send private reply] at November 17, 2002, 07:14:10 AM

I have for a long time been puzzled by such a simple thing as an Interpreter. My question is , to you people :

What is an interpreter and are there any resources online explaining interpretation ( without a VM )?

Thankyou in advance *sigh - people say this a lot*

Posted by Psion [send private reply] at November 17, 2002, 07:20:12 AM

This is a very simple concept. Your interpreter reads in a symbolic form and performs appropriate actions that it "thinks" these symbols indicate. A calculator program can be considered an interpreter.

Posted by CDR700 [send private reply] at November 17, 2002, 07:22:35 AM

Thanks , i'm not pushing the question too far , by asking if i person with a couple of years programming experience should be able to grasp the concepts of this. I wont ask the very stupid resources question ( unless someone knows any specific links ) as i have myself found plenty on google.com.

Posted by CViper [send private reply] at November 17, 2002, 09:28:48 AM

It depends on how complicated you want to make your interpreter. If I understand you correctly, you're thinking about scripting etc.

Here are a couple of articles explaining the basics (very simple scripts; including code examples)

If you want something more complicated, take a look at the mozilla JavaScript source (it's called Spider Monkey or something...) There's a lot of code though.

Posted by CDR700 [send private reply] at November 17, 2002, 10:18:25 AM

Thanks a lot, will do.I am thinking of scripting, so I'll have a look at some tutorials i've found.

Posted by gian [send private reply] at November 17, 2002, 02:20:52 PM

www.flipcode.com/tutorials/ has a pretty neat little bit about writing an interpreter for a game engine. It uses a VM, but could quite easily be adapted.

Posted by CDR700 [send private reply] at November 17, 2002, 02:38:20 PM

I read a little about the early days of interpreted programming and the Pascal Virtual Machine.I suppose a VM really hardens things ... however there are GPLed VM's avalible,if my memory is not failing me.

You must be logged in to post messages and see which you have already read.

Log on
Save for later automatic logon

Register as a new user
Copyright TPU 2002. See the Credits and About TPU for more information.