1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * > www.orxonox.net < * |
---|
4 | * |
---|
5 | * License notice: |
---|
6 | * |
---|
7 | * This program is free software; you can redistribute it and/or |
---|
8 | * modify it under the terms of the GNU General Public License |
---|
9 | * as published by the Free Software Foundation; either version 2 |
---|
10 | * of the License, or (at your option) any later version. |
---|
11 | * |
---|
12 | * This program is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * GNU General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU General Public License |
---|
18 | * along with this program; if not, write to the Free Software |
---|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
20 | * |
---|
21 | * Author: |
---|
22 | * Reto Grieder |
---|
23 | * Co-authors: |
---|
24 | * ... |
---|
25 | * |
---|
26 | */ |
---|
27 | |
---|
28 | /** |
---|
29 | @file |
---|
30 | @brief Declaration of FloatParser |
---|
31 | */ |
---|
32 | #ifndef _FloatParser_H__#define _FloatParser_H__#include "UtilPrereqs.h"#include <string>class _UtilExport ExprParser{public: enum binary_operator { b_plus, b_minus, mal, durch, modulo, hoch, undef, oder, und, gleich, b_nicht, kleiner, groesser, ungleich, kleinergleich, groessergleich }; enum unary_operator { u_plus, u_minus, u_nicht }; ExprParser(const std::string& str); std::string& getRemains() { return this->remains_; } double getResult() { return this->result_; } bool getSuccess() { return !this->failed_; }private: double parse_expr_1(); double parse_expr_2(); double parse_expr_3(); double parse_expr_4(); double parse_expr_5(); double parse_expr_6(); double parse_expr_7(); double parse_expr_8(); char* parse_word(char* str); binary_operator parse_binary_operator(); unary_operator parse_unary_operator(); double parse_argument(); double parse_last_argument(); binary_operator op; const char* reading_stream; bool failed_; double result_; std::string remains_;};//Endzeichen für float expression: ')', '}', ']', ',', ';'_UtilExport bool parse_float(char* const, char**, double*);//Endzeichen angegeben_UtilExport bool parse_float(char* const, char**, char, double*);//Letzter Teil-float eines Vektors parsen (keine Vergleichs- und Logikoperationen)_UtilExport bool parse_vector_float(char* const, char**, bool, double*);#endif /* _FloatParser_H__ */ |
---|