Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mgechev/tiny-compiler

A tiny evaluator and compiler of arithmetic expressions.
https://github.com/mgechev/tiny-compiler

ast compiler compiler-construction compiler-principles interpreter

Last synced: 11 days ago
JSON representation

A tiny evaluator and compiler of arithmetic expressions.

Awesome Lists containing this project

README

        

# Tiny Interpreter and Compiler

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

For more details see [the source](./tiny.js) or my blog post "[Implementing a Simple Compiler on 25 Lines of JavaScript](http://blog.mgechev.com/2017/09/16/developing-simple-interpreter-transpiler-compiler-tutorial/)"

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](/assets/tweet.png)](https://twitter.com/mgechev/status/955211214719602688)

# License

MIT