An investigation into the underlying components of compilation. This implementation would likely be considered "source to source" compilation, as it is best prepared to translate two high level languages. This was built in Ruby with comprehension and readability in mind, not performance.
Generally, the steps of a compiler can be broken down into:
- Lexical Analysis (Tokenization): "Identify components (tokens) of given code"
- Parsing: "Transform token stream into a tree structure representing token relations"
- Generation: "Generate the desired code"
Real compilers will feature additional subtasks and speed optimizations, such as "preprocessing" and "dead code elimination".