philsupertramp/game-math
|
#include "MathNode.h"
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <memory>
#include <unordered_set>
Go to the source code of this file.
Classes | |
class | Operator |
class | Function |
Enumerations | |
enum | OperatorPriority { OPClassUnknown = 0 , OPClassLine = 1 , OPClassDot = 2 , OPClassPow = 3 , OPClassParentheses = 4 , OPClassFunction = 5 } |
enum | OperatorType { TYPE_ADDITION = 0 , TYPE_SUBTRACTION = 1 , TYPE_MULTIPLICATION = 2 , TYPE_DIVISION = 3 , TYPE_POWER = 4 , TYPE_PARENTHESES_OPEN = 5 , TYPE_PARENTHESES_CLOSE = 6 } |
enum | OperatorValue : char { VALUE_ADDITION = '+' , VALUE_SUBTRACTION = '-' , VALUE_MULTIPLICATION = '*' , VALUE_DIVISION = '/' , VALUE_POWER = '^' , VALUE_PARENTHESES_OPEN = '(' , VALUE_PARENTHESES_CLOSE = ')' } |
Functions | |
std::shared_ptr< Operator > | GenerateOperator (OperatorType type) |
bool | isFunction (const std::string &in) |
Variables | |
const std::map< std::string, std::shared_ptr< Function > > | DefaultFunctions |
enum OperatorPriority |
Priority definition for AST generation, used in shunting-yard algorithm, the Equation class builds nodes using a stack based on priorities
Enumerator | |
---|---|
OPClassUnknown | |
OPClassLine | |
OPClassDot | |
OPClassPow | |
OPClassParentheses | |
OPClassFunction |
enum OperatorType |
enum OperatorValue : char |
std::shared_ptr< Operator > GenerateOperator | ( | OperatorType | type | ) |
Operator factory, returns shared_ptr to operator with given type
type |
bool isFunction | ( | const std::string & | in | ) |
Helper function to test if string is function representation
in |
const std::map<std::string, std::shared_ptr<Function> > DefaultFunctions |
Default functions for parser