Implementing a Parser and Simple Compiler for the Java Virtual Machine
1. Overview This document covers the implementation of a simple recursive-descent parser for an infix adder language with a lexer, parser, and compiler. The language is implemented with Java and compiles to Java Virtual Machine (JVM) bytecode. The first implementation of the compiler is different from other implementations because it is fully implemented in one class without third party parser generator libraries. The implementation of the language only uses the Java standard libraries. The code for the parser does not use a parser generator so it only contains pure Java standard libraries and no references to third-party libraries. I wanted to discuss this particular example it helps for you to understand the nature of programming languages and their implementation. Don't be scared about the parsing input token routines in them. They help as a tool to the developer. This a basic implementation but at least I provided a JVM compiler...