Solved

Designing a programming language

Posted on 2004-04-07
5
264 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

770 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