danm v0.1.4 Danm.SimpleExpr

SimpleExpr parse and evaluate expression with integers.

Link to this section Summary

Functions

ast_string(ast) return a string representation of ast

eval(ast) evaluate ast without identifier map

eval(ast, in: dict) evaluate ast with identifier map in: dict

optimize(ast) try to optimize the ast

parse(str) parse the str 3 orders of operator precedance

valid?(ast) check ast without identifier map

valid?(ast, in: dict) check ast with identifier map in: dict

Link to this section Functions

ast_string(ast) return a string representation of ast

eval(ast) evaluate ast without identifier map

eval(ast, in: dict) evaluate ast with identifier map in: dict

optimize(ast) try to optimize the ast

parse(str) parse the str 3 orders of operator precedance:

  1. * / %
  2. + -
  3. << >>

valid?(ast) check ast without identifier map

Link to this function

valid?(n, list)

valid?(ast, in: dict) check ast with identifier map in: dict