KiCad PCB EDA Suite
Loading...
Searching...
No Matches
evaluate.cpp File Reference
#include <am_param.h>

Go to the source code of this file.

Functions

double Evaluate (AM_PARAM_EVAL_STACK &aExp)
 Evaluate an basic arithmetic expression (infix notation) with precedence The expression is a sequence of numbers (double) and arith operators: operators are + - x / ( and ) the expression is stored in a std::vector each item is a AM_PARAM_EVAL (each item is an operator or a double)
 

Function Documentation

◆ Evaluate()

double Evaluate ( AM_PARAM_EVAL_STACK aExp)

Evaluate an basic arithmetic expression (infix notation) with precedence The expression is a sequence of numbers (double) and arith operators: operators are + - x / ( and ) the expression is stored in a std::vector each item is a AM_PARAM_EVAL (each item is an operator or a double)

Parameters
aExp= the arithmetic expression to evaluate
Returns
the value

Definition at line 102 of file evaluate.cpp.

References ADD, CLOSE_PAR, DIV, AM_PARAM_EVAL::GetOperator(), AM_PARAM_EVAL::GetPriority(), AM_PARAM_EVAL::GetValue(), AM_PARAM_EVAL::IsOperator(), MUL, OPEN_PAR, POPVALUE, and SUB.

Referenced by AM_PARAM::GetValueFromMacro().