473,830 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

build an interpreter for a simple language

Hi all,

I need help and source code in a school project
the project is in c - building an interpreter for a simple (invented) language

how do I implement: routines, variables and numbers...
routines can also call other routines (recursion is allowed)
do I need to build a symbol Table? what else?

where can I found source code for that kind of project?
I understand it is usually given to students...
Thanks, Eyal
Nov 13 '05 #1
2 4534

"eyalkz" <ey****@openu.a c.il> wrote in message
news:1f******** *************** ***@posting.goo gle.com...
Hi all,

I need help and source code in a school project
the project is in c - building an interpreter for a simple (invented) language
how do I implement: routines, variables and numbers...
routines can also call other routines (recursion is allowed)
do I need to build a symbol Table? what else?


You really should have shown up to class. Sucker.

If you're totally lost go buy the Dragon book and read it.

Tom
Nov 13 '05 #2
Greetings.

In article <1f************ **************@ posting.google. com>, eyalkz wrote:
I need help and source code in a school project
the project is in c - building an interpreter for a simple (invented)
language


What, were the responses you got to the exact same question you posted in
article <1f************ **************@ posting.google. com> not good enough
for you?

Use flex and bison (or lex and yacc).

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2417
by: Anon | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all I am a beginner teaching myself python, and I am enjoying it immensely :) As a language it is great, I real treat to study, I actually find it fun to study the language heh Anyways to the point of my post.....
13
4039
by: Rolf Magnus | last post by:
Hi, I would like to embed a python interpreter within a program, but since that program would be able to automatically download scripts from the internet, I'd like to run those in a restricted environment, which basically means that I want to allow only a specific set of modules to be used by the scripts, so that it wouldn't be possible for them to remove files from the hard drive, kill processes or do other nasty stuff. Is there any...
3
9736
by: eyalkz | last post by:
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...?
6
2097
by: wooks | last post by:
Sorry if this is very basic. I have bought a Functional Programming book that uses the language Hope. I have managed to locate and extract Ross Pattersons hope interpreter from http://www.soi.city.ac.uk/~ros s/Hope/ However it seems what I have got is the C source code and I haven't got a clue what to do with it.
6
5517
by: gr | last post by:
hi.. I must implement an interpreter in C programming language that will get the source code of a program in text file format and execute it. but i don't know C language enough to write this interpreter. so I need this interpreter code that is written with C language.(or it can be C++) I searched this codes in google and some websites, but codes which I found are useless.. if you can help me, you gladden me.
5
10649
by: Joel | last post by:
In the course of my project, I must include some custom logic and would like to integrate a small script language in my application for that purpose. In C++, I used the LUA script language and I know that bindings exists for a LUA/c# integration, but only using the binary DLL. However, I would prefer a native c# solution and for a small language, not a huge interpreter like Python. Has anybody seen such implementation ? Thanks,
6
2039
by: Rafael Almeida | last post by:
Hello, I'm studying compilers now on my university and I can't quite understand one thing about the python interpreter. Why is its input a binary file (pyc)? The LOAD_CONST opcode is 100 (dec) and STORE_FAST's is 125 (dec). The translation of the following code: foo.py: x = 10
13
12806
by: jkimbler | last post by:
As part of our QA of hardware and firmware for the company I work for, we need to automate some testing of devices and firmware. Since not everybody here knows C#, I'm looking to create a new scripting language that makes writing automated tests simpler. Really, I'm looking to kind of abstract the power of the C# language into a simpler language that's easier to learn. The script files would be interpreted by a script interpreter...
40
2389
by: castironpi | last post by:
I'm curious about some of the details of the internals of the Python interpreter: I understand C from a hardware perspective. x= y+ 1; Move value from place y into a register Add 1 to the value in the register Move the addition's result to place x
0
9786
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9641
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10769
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9312
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6948
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4409
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3956
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3073
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.