Numo is a collection of small math expression parsers and a Tiny Math Language (TML) interpreter written in JavaScript.
The TML implementation supports variables, arithmetic expressions, function
calls, and print statements.
The project follows the Math Expression Parser in JavaScript series and explores several parsing techniques:
- RPN evaluator
- Shunting yard algorithm
- LL parser generator
- LR parser generator
- PEG parser generator
- Recursive descent parser
- Pratt parser
node src/pratt/ast-example.js
node src/shunting_yard/main.jsEach parser implementation is under src/ with its grammar, tokenizer, parser, and examples where applicable.
The src/tml directory contains the TML grammar, parser, AST support, and
command-line runner:
node src/tml/tml-runner src/tml/example.tmlExample TML program:
var x = 1;
var y = 2;
print(x + y);