84

GitHub - mgechev/tiny-compiler: A tiny evaluator and transpiler of arithmetic ex...

 6 years ago
source link: https://github.com/mgechev/tiny-compiler
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Tiny Interpreter 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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK