/arithmetic-parser

very tiny intro to compilers

Primary LanguageJavaScript

Tiny Compiler

Implementing a simple JS compiler

Input

mul 2 add 3 7

Output

(2 * (3 + 7))

Concepts Covered:

  1. Lexical Analysis
  2. Syntax Analysis
  3. Code Generation
  4. EBNF Grammar
  5. Recursive Descent Parser

Credits:

A blog written by @mgechev : Implementing a Simple Compiler on 25 Lines of JavaScript