A tiny evaluator and compiler of arithmetic expressions.
Clone or download
Latest commit bf0f393 Sep 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Update implementation Jan 23, 2018
README.md Update implementation Jan 23, 2018
tiny.js Remove redundant newline Sep 28, 2018

README.md

Tiny Interepter and Compiler

A tiny interpreter and compiler which shows the basics of compiler development.

For more details see the source or my blog post "Implementing a Simple Compiler on 25 Lines of JavaScript"

Along the implementation you can find sample (and simple) implementations of:

  • Lexer which produces a list of tokens (module for lexical analysis).
  • Parser which produces an Abstract Syntax Tree (AST) (module for syntax analysis).
  • Interpreter which traverses and evaluates the AST.
  • EBNF grammar.
  • Recursive Descent Parsing.

You want even smaller compiler?

Here it is!

Compiler in a Tweet

License

MIT