Lulu Marketplace

Ratings & Reviews

Log in to review this item
Lulu Sales Rank: 88181
3 People Reviewed This Product
  • By ernie
    Nov 17, 2010
    I actually have to disagree with the previous post. I've been working on a derivative version of mini basic (and adding my own derivation to it) and was happy to find the chapter "How to write a BASIC interpreter" starting on page 44. While not a complete guide to writing an interpreter it does a credibly job of laying out some fundamentals of how the statement parsing works (rather, why it works as it does) and more importantly to me, how the expression parsing works. Well worth the two fifty for the download, I'd pay 10 times that for the 750 page detailed version.
  • By Carl Gundel
    Feb 9, 2010
    This book is more about MiniBasic than it is about how to write an interpreter. There is some description of MiniBasic, and then about a chapter's worth of how the expression parser works, and then the book is all just C code to the end. To the author: Please write a second edition with much more information in the middle part of the book.
  • By David Whale
    Oct 15, 2009
    "Mini Basic" This little book on lulu.com caught my eye, and I purchased it via download. Malcolm clearly achieves what his strapline advertises - explaining to you "how to write a BASIC interpreter" - by writing a really good interpretor, and explaining it. Don't be put off by the sketchy cover and lack of contents page and index - the content of this book is very well written and very accessible. It sets the scene by showing a number of sample BASIC programs of increasing complexity, to get the reader into the context of BASIC and what can be expected of an interpretor. The BASIC is reminiscent of the early BASIC interpretors like Pet BASIC or 8052 BASIC, having no support for more advanced control structures that something like BBC BASIC introduced, but the fact there are only 39 keywords in the language makes it quick to learn, and makes the interpretor very tiny and fast. Tiny and fast is good if you were considering embedding this language inside a bigger... More > containing application, e.g. as a scripting language. Next, the book takes on a reference-style and explains the key syntax, followed by an alphabetical list of keywords and their function, each with small but useful examples of how to use them, followed by an error-message reference (there are only 25 errors and 39 keywords). Next, and these next two sections are the most interesting from a design point of view, the author looks at how to write an interpreter, and specifically some of the design decisions made while writing MiniBasic. He carefully navigates from some of the initial issues such as expression parsing and evaluation and control structures, through to I/O. This is then followed by focussing on some of the key design decisions and design compromises of MiniBasic, with a number of complete example MiniBasic programs to illustrate. Malcolm then completes the book with a 64 page listing of the C code that implements MiniBasic. While the code in some places has terse comments, the code is well written, well structured, and the accompanying notes in earlier text clearly describe the design and operation of the code. This is the right choice by Malcolm, because sometimes too many comments can clutter the code and make it hard to read. His programming style and layout style makes the code very clean to read and understand. MiniBasic uses a recursive-descent parsing technique, and because of this, the book would suite anyone wanting to learn about parsing techniques without having to get too sucked into the intricate detail that one expects from books like Aho, Sethi and Ullman. Having a complete working BASIC interpretor that you can compile and run and change yourself is by far the best way to absorb the techniques - by looking at and using real code. The choice of the author to put the whole interpretor in a single C file was the correct one I think, because although 64 A4 pages of code is quite long, this actually keeps the code simpler due to their being no need for module linkage and externals which would make the program much larger. An example driver module is provided that wraps the interpretor with a main(), and demonstrates the power of the fact that the BASIC program sent to the interpretor can come from anywhere - an external file, or even embedded inside the C program as a string. I spent many happy hours pouring over the source code for MiniBasic and experimenting with it, and can highly recommend this book as both an interesting and useful resource. David Whale, www.thinkingbinaries.com, February 2009.< Less
Refreshing...

> Find Reviews for Previous Versions

There are no reviews for previous versions of this product
Refreshing...

Product Details

Publisher
Malcolm McLean
Published
May 1, 2006
Language
English
Pages
131
Binding
Perfect-bound Paperback
Interior Ink
Black & white
Weight
0.55 lbs.
Dimensions (inches)
6 wide x 9 tall
Report This Content to Lulu >

Moderation of Questionable Content

Thank you for your interest in helping us moderate questionable content on Lulu. If you need assistance with an order or the publishing process, please contact our support team directly.

How does this content violate the Lulu Membership Agreement?

Keywords

Listed In

More From Malcolm McLean