Solved

Designing a programming language

Posted on 2004-04-07
5
267 Views
Last Modified: 2010-04-17
Hi!

I'm interested in designing a simple scripting language.
I would like it to have a syntax like Lisp or Scheme (you know all that parens).
I do a lot of high-level programming, so I would like to write the high-level code in my language,
and then do the code below in C or C++.
I tried to do something with Bison, but I don't have any example how to do a language parser in Bison.
Well, bison.info explains the basics, but it's not enough - I got stucked on branching :-(
Please, tell me is there any easier way. GPL-ed if possible.

Thanx.
0
Comment
Question by:phraine
5 Comments
 
LVL 22

Accepted Solution

by:
NovaDenizen earned 25 total points
ID: 10777583

Sorry, but I don't think there's any easy shortcut.  It's tough to do anything with bison or yacc without first understanding parsing theory.  I would suggest looking at _Compilers_ by Aho, Sethi, and Ullman to learn about parsing.  There is a lot in that book about compilation that you don't really need, but the parsing bits are very necessary and helpful.

 -NovaDenizen
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 25 total points
ID: 10779515
0
 
LVL 5

Expert Comment

by:Droby10
ID: 10780282
the best "introductory" compiler book i can think of is writing compilers and interpreters by mak.  beyond that you might look at modern compilers and interpreters by grune, bal, jacobs & langendoen, as well as the mk series including advanced compiler design and implementation by muchnick and programming language pragmatics by scott.  most of these deal with compilation specifics but the bridge between interpretation and compilation has narrowed greatly over the last 10 years that knowledge of each is applicable.  mak's book is almost exclusively focused on parsing and runtime interpretation.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question