Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

lxsmnsyc/arithmetic-parser-demo

Repository files navigation

arithmetic-parser-demo

Arithmetic Parser Demo using parexgram.js

Platform Build Status
Linux Build Status
Windows Build status

codecov

Known Vulnerabilities dependencies Status devDependencies Status

Grammar

arithmetic
  : addition
  ;

addition
  : multiplication ( ('+' | '-') addition )*
  ;

multiplication
  : exponentiation ( ('*' | '/') multiplication)*
  ;

exponentiation
  : negation ('^' exponentiation)*
  ;

negation
  : '-'? atom
  ;

atom
  : value
  | '(' addition ')'
  ;

value
  : [0-9]* '.' [0-9]*
  ;

Install

npm i arithmetic-parser-demo

Build

npm install
npm run build