Code Monkey home page Code Monkey logo

bookpart2's Introduction

BookPart2

Source code for the book "Writing an Interpreter for Object Pascal: Part 2

This is the second part of a series that will show you how to write an interactive interpreter in Object Pascal. Part 2 describes the building of the first version of a virtual machine together with a simple assembler. The book combines the virtual machine with the syntax checker for the Rhodus language. Intermediate code is generated directly as the source code is parsed. At the end of Part II, the reader will be a very serviceable interpreter that supports user-defined functions, built-in functions, string, and list support together with a range of looping constructs. A simple console application is provided to allow users to exercise the interpreter.

The book provides fully working open-source code (also deposited at Github) and explains in plain English how the code works and why certain decisions were made. The book makes liberal use of code throughout the book chapters. Everything is done without the help of third-party tools. All you need is a standard installation of Free Pascal or Embarcaderos's excellent Delphi (including the free community edition). The text is geared to hobbyists and midlevel developers who need an easy introduction to building a simple virtual machine and code generator. The book is also for students starting out in compiler and interpreter design and need something more digestible before getting immersed in theory.

How to compile the source code:

Get the code either by downling the zip file or running the following from the command line

git clone https://github.com/penavon/BookPart2.git

Start Delphi and load the group file:

RhodusVersionOneGroup.groupproj

then build the RhodusVersionOneProject and run

bookpart2's People

Contributors

penavon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.