PEG.js-FN
Slow but Functional Parser Generator for JavaScript
Original PEG.js
Online Version
Documentation
Development
Loading...
1
Write your PEG.js-FN grammar
/* * Classic example grammar, which recognizes simple arithmetic expressions like * "2*(3+4)". The parser generated from this grammar then computes their value. */ start = additive additive = left:multiplicative "+" right:additive { return left + right; } / multiplicative multiplicative = left:primary "*" right:multiplicative { return left * right; } / primary primary = integer / "(" additive:additive ")" { return additive; } integer "integer" = digits:[0-9]+ { return parseInt(digits.join(""), 10); }
The parser will be generated automatically as you type.
Loading...
2
Test the generated parser with some input
2*(3+4)
The input will be processed by the parser automatically as you type.
Parser not available.
Output
Output not available.
3
Download the parser code
Download parser
Parser variable:
Use results cache
Track line and column