arithmetic-parser-demo

Arithmetic Parser Demo using parexgram.js

Usage no npm install needed!

<script type="module">
  import arithmeticParserDemo from 'https://cdn.skypack.dev/arithmetic-parser-demo';
</script>

README

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