00001 #ifndef SIM_LANGUAGE_H 00002 #define SIM_LANGUAGE_H 00003 00004 #include <string> 00005 #include <vector> 00006 00007 using namespace std; 00008 00011 const int NUMBER = 0; 00012 const int VARIABLE = 1; 00013 const int TERM = 2; 00015 const int POW = 0; 00016 const int DIV = 1; 00017 const int MULT = 2; 00018 const int SUBT = 3; 00019 const int ADD = 4; 00020 00025 class term 00026 { 00027 public: 00028 unsigned long evaluate( vector<unsigned char> params ); 00029 double precisely_evaluate( vector<double> params ); 00030 string strip(); 00031 00032 short atype; 00033 short btype; 00034 long avalue; 00035 long bvalue; 00036 vector<term> aterm; 00037 vector<term> bterm; 00038 short op; 00039 }; 00040 00043 struct conf_command 00044 { 00045 string name; 00046 term formula; 00047 }; 00048 00049 vector<conf_command> term_parse_cmd(string input); 00050 string term_set_parenthesis(string input); 00051 vector<term> term_terminate(string input); 00052 00053 #endif