Hello. Welcome to tea with the mad hacker. I’m Dominick (just one of many mad hackers out there). I’m writing an open source interpreter in VB.Net and Java – to help myself learn the basics of scanning, parsing, interpretation, and eventually, compilation. If you are interested in learning how to do these things, please check out the material I have written so far.
Link to chapter one introduction.
Chapter One: Starting With Simple Toys.
Part 1: A Simple Grammar for ‘Toy Basic.’
Part 2: A Toy Scanner, Tokens, and a File to Scan.
Part 3: A Toy Parser, Instructions, Tokens to Read and a Control Flow Graph (C.F.G.) to build.
Part 4: A Toy Interpreter, a C.F.G. to Read, and Instructions to Interpret.
Part 5: Listing of VB.Net code so far.
Chapter Two: More Compatible Simple Toys in Java.
Part 1: Why Java? The Pros and Cons of Using Java.
Part 2: The Differences Between the Java and VB.Net Code.
Part 3: The JDK, Eclipse, and The Source Code.
Part 4: Listing of Java code so far.
Chapter Three: More Complexity For a Domain Specific Language
Part 1: Where we go from here… defining Toy Basic Instructions.
Part 2: Toy Basic Input Instructions.
Part 3: Toy Basic Output Instructions.
Part 4: Toy Basic Arithmetic Operations.
Part 5: Toy Basic Conditional Instructions.
Part 6: Toy Basic Repetition Instructions.
Part 7: Where to go from here… Toy Basic V0.1.
Chapter 4: Input Instructions
Part 1: Changing the Grammar.
Part 2: Introducing New Tokens to the Scanner.
Part 3: Introducing New Rules to the Parser.
Part 4: ProgramState, Symbol, and SymbolLink.
Part 5: The Source Code.
Chapter 5: Output Instructions
Part 1: Modifying PrintStatement.
Part 2: Modifying ProcessPrintStatement.
Part 3: Modifying LoadInstruction.
Part 4: The Source Code.
Complete Interpreter available here.