473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

writing an interpreter for a simple language

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
Nov 13 '05 #1
3 9719

"eyalkz" <ey****@openu.ac.il> wrote in message
news:1f**************************@posting.google.c om...
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
Nov 13 '05 #2
eyalkz wrote:

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
jv*@lessspamformother.virginia.edu
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/

"Science knows only one commandment: contribute to science."
-- Bertolt Brecht, "Galileo".
Nov 13 '05 #3
Hi,

try CioinaEval from http://www.delphipages.com/result.cfm?ID=3482

ey****@openu.ac.il (eyalkz) wrote in message news:<1f**************************@posting.google. com>...
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

Nov 13 '05 #4

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

Similar topics

12
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...
13
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...
1
by: Jonathan Fine | last post by:
I'm writing some routines for handling dvi files. In case you didn't know, these are TeX's typeset output. These are binary files containing opcodes. I wish to write one or more dvi opcode...
2
by: eyalkz | last post by:
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......
15
by: Douglas Garstang | last post by:
All, I posted a newsgroup question here a few weeks back, asking some questions that related to my 10 year quest (so far) to understand pointers. Someone suggested I write a simple emulator....
6
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...
5
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...
5
by: luvsat | last post by:
Hello all, I am new to python and working on a project that involves designing a new language. The grammar of the language is very much inspired from python as in is supports nearly all the...
6
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)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.