Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/mgechev/tiny-compiler
- Owner: mgechev
- Created: 2017-09-08T08:12:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-21T21:08:16.000Z (almost 5 years ago)
- Last Synced: 2024-10-22T12:51:18.348Z (18 days ago)
- Topics: ast, compiler, compiler-construction, compiler-principles, interpreter
- Language: JavaScript
- Homepage: https://mgv.io/tiny
- Size: 409 KB
- Stars: 777
- Watchers: 19
- Forks: 78
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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