Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 26, 2011, 2:50:03 AM (13 years ago)
Author:
rgrieder
Message:

Converted ExprParser to use float instead of double.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib2/src/libraries/util/ExprParser.h

    r7401 r8331  
    5757                COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << std::endl;
    5858            }
    59             double result = expr.getResult();
     59            float result = expr.getResult();
    6060        }
    6161        else
     
    125125        void parse(const std::string& str);
    126126        const std::string& getRemains() { return  this->remains_; }
    127         double             getResult()  { return  this->result_; }
     127        float              getResult()  { return  this->result_; }
    128128        bool               getSuccess() { return !this->failed_; }
    129129
    130         void setVariable(const std::string& varname, double value);
     130        void setVariable(const std::string& varname, float value);
    131131
    132132    private:
    133         double parse_expr_1();
    134         double parse_expr_2();
    135         double parse_expr_3();
    136         double parse_expr_4();
    137         double parse_expr_5();
    138         double parse_expr_6();
    139         double parse_expr_7();
    140         double parse_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();
    141141        char* parse_word(char* str);
    142142        binary_operator parse_binary_operator();
    143143        unary_operator parse_unary_operator();
    144144
    145         double parse_argument();
    146         double parse_last_argument();
     145        float parse_argument();
     146        float parse_last_argument();
    147147
    148148        binary_operator op;
    149149        const char* reading_stream;
    150150        bool failed_;
    151         double result_;
     151        float result_;
    152152        std::string remains_;
    153         std::map<std::string, double> variables_;
     153        std::map<std::string, float> variables_;
    154154    };
    155155
    156156    //Endzeichen für float expression: ')', '}', ']', ',', ';'
    157     _UtilExport bool parse_float(char* const, char**, double*);
     157    _UtilExport bool parse_float(char* const, char**, float*);
    158158    //Endzeichen angegeben
    159     _UtilExport bool parse_float(char* const, char**, char, double*);
     159    _UtilExport bool parse_float(char* const, char**, char, float*);
    160160    //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*);
    162162}
    163163
Note: See TracChangeset for help on using the changeset viewer.