uqexpr is a C program developed for CSSE2310 Assignment 1 at The University of Queensland. It evaluates mathematical expressions and assignment operations from standard input or a file, supporting variable definitions and loopable variables.
- Evaluate mathematical expressions using the tinyexpr library.
- Support assignment operations to variables.
- Define variables via command line (
--def) or dynamically. - Define loopable variables with ranges (
--loopable). - Print variables and loop variables with the
@printcommand. - Redefine loop variable ranges with the
@rangecommand. - Loop through expressions using the
@loopcommand. - Configurable significant figures for output (
--sigfigs).
To compile on moss or a compatible Linux environment:
makeThis will build the uqexpr executable.
./uqexpr [--sigfigs num] [--loopable string] [--def string] [inputfilename]--sigfigs 2..8: Set significant figures for output.--def name=value: Define a variable.--loopable name,start,increment,end: Define a loopable variable.inputfilename: Optional file containing expressions/assignments.
./uqexpr --sigfigs 5 --def x=3.14 --loopable y,0,1,10 input.txt@print: Print all variables and loop variables.@range var,start,increment,end: Redefine or add a loop variable.@loop var expression: Loop through a variable and evaluate an expression.
- tinyexpr library (UQ provided version)
- CSSE2310 Assignment 1 Specification
Zephyr JIANG (s4910970)