#include <parser.h>
Public Member Functions | |
Parser () | |
Equation * | TextToTree (char *) |
void | TidyUpEqn (Equation *) |
void | TreeToText (Equation *) |
~Parser () | |
Private Member Functions | |
void | AddToken (func_type) |
void | Alpha (char *, char *) |
void | Digit (char *, double *, bool *, int *) |
void | EndFunc (char *) |
void | EndNum (double *, bool *, int *) |
void | ErrorCheck () |
void | NodeText (int, Node *, char *, int &) |
void | PassOne () |
void | PassTwo () |
bool | Priority (func_type, func_type) |
void | RemoveBrackets () |
void | Symbol (char *) |
void | TidyNode (Node *&) |
void | TidyUp () |
char * | TreeToText (Node *) |
void | TreeToText () |
Private Attributes | |
Equation * | equation |
char * | EquationText |
Token * | EquationTokenEnd |
Token * | EquationTokenStart |
Definition at line 37 of file parser.h.
Parser | ( | ) |
Definition at line 38 of file parser.cpp.
References equation, EquationText, EquationTokenEnd, and EquationTokenStart.
~Parser | ( | ) |
Definition at line 47 of file parser.cpp.
References EquationTokenEnd, EquationTokenStart, Token::Last, and Token::Next.
void AddToken | ( | func_type | WhichType | ) | [private] |
Definition at line 326 of file parser.cpp.
References EquationTokenEnd, EquationTokenStart, Token::Last, Token::Next, and Token::Type.
void Alpha | ( | char * | Pointer, | |
char * | ThisFunc | |||
) | [private] |
Definition at line 217 of file parser.cpp.
void Digit | ( | char * | Pointer, | |
double * | ThisDigit, | |||
bool * | DoDigit, | |||
int * | DecPt | |||
) | [private] |
Definition at line 203 of file parser.cpp.
Referenced by PassOne().
void EndFunc | ( | char * | ThisFunc | ) | [private] |
Definition at line 263 of file parser.cpp.
References AddToken(), Alpha(), QList< type >::append(), QList< type >::at(), QList< type >::count(), equation, EquationTokenEnd, QList< type >::first(), func_details, MTK_COMBINATION, MTK_FRAC, MTK_LN, MTK_NOFUNC, MTK_PERMUTATION, MTK_PI_SYM, MTK_VARIABLE, variable::Name, QList< type >::next(), NumVar::Number, variable::Value, Token::Value, Equation::Variables, and NumVar::WhichVar.
Referenced by PassOne().
void EndNum | ( | double * | ThisDigit, | |
bool * | DoDigit, | |||
int * | DecPt | |||
) | [private] |
Definition at line 315 of file parser.cpp.
References AddToken(), EquationTokenEnd, MTK_NUMBER, and Token::Value.
Referenced by PassOne().
void ErrorCheck | ( | ) | [private] |
Definition at line 350 of file parser.cpp.
References Equation::brackets, equation, EquationTokenEnd, EquationTokenStart, ERR_BRACKET, ERR_FUNCTION, ERR_NO_TEXT, ERR_OPERATOR, Token::Last, MTK_ADD, MTK_BESSJ, MTK_COMBINATION, MTK_COMMA, MTK_DIVIDE, MTK_FACTORIAL, MTK_FRAC, MTK_INT, MTK_LBRACKET, MTK_MULTIPLY, MTK_NUMBER, MTK_PERMUTATION, MTK_PI_SYM, MTK_POWER, MTK_RBRACKET, MTK_SUBTRACT, Token::Next, NumVar::Number, Token::Type, and Token::Value.
Referenced by TextToTree().
void NodeText | ( | int | type, | |
Node * | TreePos, | |||
char * | Buffer, | |||
int & | BufferSize | |||
) | [private] |
Definition at line 1001 of file parser.cpp.
References QList< type >::at(), Node::Brackets, Node::Child_One, Node::Child_Two, equation, ERR_FUNCTION, func_details, MTK_MULTIPLY, MTK_NUMBER, MTK_NUMBER_OF_FUNCS, MTK_VARIABLE, variable::Name, Node::Value, Equation::Variables, and NumVar::WhichVar.
Referenced by TreeToText().
void PassOne | ( | ) | [private] |
Definition at line 146 of file parser.cpp.
References Alpha(), Equation::brackets, Digit(), EndFunc(), EndNum(), equation, EquationText, and Symbol().
Referenced by TextToTree().
void PassTwo | ( | ) | [private] |
Definition at line 501 of file parser.cpp.
References TTree::AddChildOne(), TTree::AddChildTwo(), TTree::AddParent(), Node::Child_One, Node::Child_Two, equation, EquationTokenStart, ERR_BRACKET, Node::evalfn, func_details, mathfunc_s::func_ptr, TTree::InitNode(), MTK_ADD, MTK_COMMA, MTK_FACTORIAL, MTK_LBRACKET, MTK_POWER, MTK_RBRACKET, Token::Next, Node::Parent, Priority(), TTree::Root, Token::Type, Node::Type, Token::Value, and Node::Value.
Referenced by TextToTree().
Definition at line 570 of file parser.cpp.
References MTK_ADD, MTK_BESSJ, MTK_COMMA, MTK_DIVIDE, MTK_FACTORIAL, MTK_LBRACKET, MTK_MULTIPLY, MTK_NUMBER, MTK_RBRACKET, and MTK_SUBTRACT.
Referenced by PassTwo(), and TreeToText().
void RemoveBrackets | ( | ) | [private] |
Definition at line 597 of file parser.cpp.
References Node::Brackets, Node::Child_One, Node::Child_Two, TTree::Delete(), TTree::DeleteNode(), equation, ERR_FUNCTION, MTK_BESSJ, MTK_COMMA, MTK_LBRACKET, MTK_RBRACKET, Node::Parent, TTree::Reset(), TTree::Root, and Node::Type.
Referenced by TextToTree().
void Symbol | ( | char * | Pointer | ) | [private] |
Definition at line 226 of file parser.cpp.
References AddToken(), Equation::brackets, equation, EquationTokenEnd, ERR_SYMBOL, MTK_ADD, MTK_COMMA, MTK_DIVIDE, MTK_FACTORIAL, MTK_LBRACKET, MTK_MULTIPLY, MTK_NOFUNC, MTK_POWER, MTK_RBRACKET, MTK_SUBTRACT, and Token::Value.
Referenced by PassOne().
Equation * TextToTree | ( | char * | text | ) |
Definition at line 58 of file parser.cpp.
References equation, Equation::EquationText, EquationText, EquationTokenEnd, EquationTokenStart, ERR_NO_TEXT, ErrorCheck(), Token::Last, Token::Next, PassOne(), PassTwo(), RemoveBrackets(), and TidyUp().
Referenced by gfunct::copy(), entitybocon::getval(), pvalt::read(), graphmat::read(), entityload::read(), bocon::read(), gfunct::read(), and gfunct::read_prop().
void TidyNode | ( | Node *& | TreePos | ) | [private] |
Definition at line 701 of file parser.cpp.
References ansi_jn(), Node::Brackets, Node::Child_One, Node::Child_Two, combination(), DEGTORAD, TTree::Delete(), TTree::DeleteNode(), equation, ERR_DIV_ZERO, Node::evalfn, func_details, mathfunc_s::func_ptr, MTK_ADD, MTK_ARCTAN, MTK_BESSJ, MTK_COMBINATION, MTK_COT, MTK_DIVIDE, MTK_FACTORIAL, MTK_FRAC, MTK_LN, MTK_MULTIPLY, MTK_NUMBER, MTK_PERMUTATION, MTK_POWER, MTK_SIN, MTK_SUBTRACT, NumVar::Number, permutation(), Equation::Radians, Node::Type, and Node::Value.
Referenced by TidyUp().
void TidyUp | ( | ) | [private] |
Definition at line 670 of file parser.cpp.
References Node::Brackets, Node::Child_One, Node::Child_Two, equation, Node::Parent, TTree::Reset(), TTree::Root, and TidyNode().
Referenced by TextToTree(), TidyUpEqn(), and TreeToText().
void TidyUpEqn | ( | Equation * | eqn | ) |
Definition at line 137 of file parser.cpp.
References equation, and TidyUp().
Referenced by Equation::AddPowerSeriesTerm(), and Equation::PowerSeries().
char * TreeToText | ( | Node * | TreeRoot | ) | [private] |
Definition at line 914 of file parser.cpp.
References Node::Brackets, Node::Child_One, Node::Child_Two, ERR_FUNCTION, length(), MTK_ADD, MTK_BESSJ, MTK_DIVIDE, MTK_FRAC, MTK_LBRACKET, MTK_LN, MTK_MULTIPLY, MTK_RBRACKET, MTK_SUBTRACT, NodeText(), Node::Parent, Priority(), TreeToText(), and Node::Type.
void TreeToText | ( | ) | [private] |
Definition at line 896 of file parser.cpp.
References equation, EquationText, TTree::Reset(), and TTree::Root.
Referenced by TreeToText().
void TreeToText | ( | Equation * | eqn | ) |
Definition at line 116 of file parser.cpp.
References equation, Equation::EquationText, EquationText, TidyUp(), and TreeToText().
Referenced by Equation::Differentiate(), and Equation::PowerSeries().
Definition at line 68 of file parser.h.
Referenced by EndFunc(), ErrorCheck(), NodeText(), Parser(), PassOne(), PassTwo(), RemoveBrackets(), Symbol(), TextToTree(), TidyNode(), TidyUp(), TidyUpEqn(), and TreeToText().
char* EquationText [private] |
Definition at line 65 of file parser.h.
Referenced by Parser(), PassOne(), TextToTree(), and TreeToText().
Token* EquationTokenEnd [private] |
Definition at line 67 of file parser.h.
Referenced by AddToken(), EndFunc(), EndNum(), ErrorCheck(), Parser(), Symbol(), TextToTree(), and ~Parser().
Token* EquationTokenStart [private] |
Definition at line 66 of file parser.h.
Referenced by AddToken(), ErrorCheck(), Parser(), PassTwo(), TextToTree(), and ~Parser().