Expand description
A simple expression solver library
Parses and evaluates mathematical expressions with built-in functions and constants.
§Features
- Mathematical operators:
+,-,*,/,^, unary-,!(factorial) - Comparison operators:
==,!=,<,<=,>,>=(return 1.0 or 0.0) - Built-in constants:
pi,e,tau,ln2,ln10,sqrt2 - Basic math functions:
abs,floor,ceil,round,trunc,fract - Variadic functions:
min,max,sum,avg - 128-bit decimal arithmetic (no floating-point representation errors!)
- Error handling with source location information
Structs§
- Eval
- Expression evaluator with support for custom symbols and bytecode compilation.
- IrBuilder
- Builder for converting AST expressions into bytecode programs.
- Parser
- Recursive descent parser for mathematical expressions.
- Program
- Executable program containing bytecode instructions.
- Sema
- Semantic analyzer for type checking and symbol resolution.
- Source
- Source code container with input validation and error highlighting.
- SymTable
- Symbol table containing constants and functions.
- Vm
- Stack-based virtual machine for executing bytecode programs.
Enums§
- Symbol
- A symbol representing either a constant or function.
- Symbol
Error - Errors that can occur during symbol table operations.
- VmError
- Virtual machine runtime errors.