0.17.2 • Published 4 years ago

@exomath/math-compiler v0.17.2

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

Quick Start

const compiler = require('math-compiler')

// compiling
compiler.compile('basic-infix', 'basic-postfix', 'a + b^(c - d)')) // 'a b c d - ^ +'

// lexing
compiler.lex('basic-infix', 'a + b^(c - d)') // [ IdentifierToken { value: 'a' }, OperatorToken { value: '+' }, ... ]

// parsing
compiler.parse('basic-infix', 'a + b^(c - d)') // OperationNode { operator: '+', ... }

// transforming
compiler.transform('basic-infix', OperationNode) // Exomath-compliant OperationNode

// generating
compiler.generate('basic-infix', Node) // 'a + b ^ ( c - d )'

Formats

NameFormat
'basic-infix'Basic infix (1)
'basic-prefix'Basic prefix (Polish) (1)
'basic-postfix'Basic postfix (reverse Polish) (1)
'exomath-postfix' (alias: 'exomath')Exomath
'mathcad-prefix' (alias: 'mathcad')Mathcad Prime's internal prefix notation
  1. Formats with the prefix "basic" have limited functionality and are for educational purposes only.

Future Formats

NameFormat
'mathcad-xml'Mathcad Prime's internal XML notation
'mathjs'math.js
'matlab'MATLAB
'octave'GNU Octave

Installation

NPM

$ npm i @exomath/math-compiler

Yarn

$ yarn add @exomath/math-compiler
0.17.2

4 years ago

0.17.1

4 years ago

0.17.0

4 years ago

0.16.2

4 years ago

0.16.1

4 years ago

0.16.0

4 years ago

0.15.1

4 years ago

0.14.1

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago