Changeset 8331 for code/branches/kicklib2/src/libraries/util/ExprParser.h
- Timestamp:
- Apr 26, 2011, 2:50:03 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2/src/libraries/util/ExprParser.h
r7401 r8331 57 57 COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << std::endl; 58 58 } 59 doubleresult = expr.getResult();59 float result = expr.getResult(); 60 60 } 61 61 else … … 125 125 void parse(const std::string& str); 126 126 const std::string& getRemains() { return this->remains_; } 127 doublegetResult() { return this->result_; }127 float getResult() { return this->result_; } 128 128 bool getSuccess() { return !this->failed_; } 129 129 130 void setVariable(const std::string& varname, doublevalue);130 void setVariable(const std::string& varname, float value); 131 131 132 132 private: 133 doubleparse_expr_1();134 doubleparse_expr_2();135 doubleparse_expr_3();136 doubleparse_expr_4();137 doubleparse_expr_5();138 doubleparse_expr_6();139 doubleparse_expr_7();140 doubleparse_expr_8();133 float parse_expr_1(); 134 float parse_expr_2(); 135 float parse_expr_3(); 136 float parse_expr_4(); 137 float parse_expr_5(); 138 float parse_expr_6(); 139 float parse_expr_7(); 140 float parse_expr_8(); 141 141 char* parse_word(char* str); 142 142 binary_operator parse_binary_operator(); 143 143 unary_operator parse_unary_operator(); 144 144 145 doubleparse_argument();146 doubleparse_last_argument();145 float parse_argument(); 146 float parse_last_argument(); 147 147 148 148 binary_operator op; 149 149 const char* reading_stream; 150 150 bool failed_; 151 doubleresult_;151 float result_; 152 152 std::string remains_; 153 std::map<std::string, double> variables_;153 std::map<std::string, float> variables_; 154 154 }; 155 155 156 156 //Endzeichen für float expression: ')', '}', ']', ',', ';' 157 _UtilExport bool parse_float(char* const, char**, double*);157 _UtilExport bool parse_float(char* const, char**, float*); 158 158 //Endzeichen angegeben 159 _UtilExport bool parse_float(char* const, char**, char, double*);159 _UtilExport bool parse_float(char* const, char**, char, float*); 160 160 //Letzter Teil-float eines Vektors parsen (keine Vergleichs- und Logikoperationen) 161 _UtilExport bool parse_vector_float(char* const, char**, bool, double*);161 _UtilExport bool parse_vector_float(char* const, char**, bool, float*); 162 162 } 163 163
Note: See TracChangeset
for help on using the changeset viewer.