This is an file based interpriter for Equation Parser.
generate the runfile using makefile and make command (on linux), requires gcc and g++, with c++ std 14 support.
For manual compiling :
- gcc -c cparser.c -lm ; which will give cparser.o
- g++ -c main.cpp; which will give main.o
- g++ -o eqparse cparser.o main.o; which will give eqparse
eqparse <script_file> [output_file] (Without Brackets)
script file is any valid text file written with valid syntax.
output file is optional.
If not given output will be given on standerd output - either console or redirected file if output redirection is done.
If given output will Overwrite the file.
- All Non-comment Lines should be less than 150 characters long in total.
- Lines starting with ' // ' and empty lines will be ignored.
- Contents of line starting with ' # ' will be copied as it is (except #) in the output.
- All inbuilt commands, equations and variable assignments must be given on a line by themselves,i.e. Comments cannot start mid-way in a line.
- Allowed inbuild commands Are : showvars , vardump , varload , varclear.
- to solve an equation, or for variable assignment, give the expression on the line by itself.
- Assignment of variable can be done as :
- $0 to $9 = expr ---for inbuilt variables
- varname = expr ---for custom named variables.
- To find roots of a polynomial equation , use polysolve <space> expr
- To solve system of linear equation with less than 9 variables:
- First give linsolve <space> <number of variables (n)>
- Then give the linear equations using variables x0 to x(n-1) on next consecutive lines.
Also look at syntax of Equation Parser Mk II for general syntax.