Code for Part 11 of my math expression parser series at inspirnathan.com
-
npm install
: Install the necessary dependencies to run the syntax-cli parser generator tool. -
npm run parse
: Parse thecalc.g
grammar using LALR1 mode. -
npm run generate
: Generate a parser namedcalc-parser.js
from thecalc.g
grammar using LALR1 mode. -
npm run parse-ast
: Parse thecalc-ast.g
grammar using LALR1 mode. -
npm run generate-ast
: Generate a parser namedcalc-ast-parser.js
from thecalc-ast.g
grammar using LALR1 mode. -
node calc-example
: Run example code for evaluating a math expression using a generated parser from thecalc.g
grammar file. -
node calc-ast-example
: Run example code for displaying an abstract syntax tree (AST) from a math expression using a generated parser from thecalc-ast.g
grammar file.