Public Member Functions | |
my_do_simple_comparison (ParserStore &rp, bool param_on_left) | |
void | operator() (char const *a, char const *b) const |
Public Attributes | |
bool | m_param_on_left |
ParserStore & | m_store |
Definition at line 155 of file CreateRules.cc.
my_do_simple_comparison< T >::my_do_simple_comparison | ( | ParserStore & | rp, | |
bool | param_on_left | |||
) | [inline] |
Definition at line 157 of file CreateRules.cc.
00157 : mySemantic(rp), m_param_on_left(param_on_left){};
void my_do_simple_comparison< T >::operator() | ( | char const * | a, | |
char const * | b | |||
) | const [inline] |
Definition at line 160 of file CreateRules.cc.
00160 { 00161 00162 //cout<<"cmp string a: "<<a<<endl; 00163 //cout<<"cmp string b: "<<b<<endl; 00164 00165 string s(a,b); 00166 T val; 00167 m_store.popval(val); 00168 00169 ParameterDescription par = m_store.mStackParam.top(); 00170 m_store.mStackParam.pop(); 00171 00172 string op = m_store.mStackOperators.top(); 00173 m_store.mStackOperators.pop(); 00174 00175 // check handedness.. flip if not 'standard handedness' 00176 if(m_param_on_left != true) { 00177 if(op == "<" ) op = ">"; 00178 if(op == "<=") op = ">="; 00179 if(op == ">" ) op = "<"; 00180 if(op == ">=") op = "<="; 00181 } 00182 00183 Rule* outRule = 0; 00184 if(op=="<" ) outRule = new LT_Rule<T>(s,par.id(),val); 00185 if(op=="<=") outRule = new LE_Rule<T>(s,par.id(),val); 00186 if(op==">" ) outRule = new GT_Rule<T>(s,par.id(),val); 00187 if(op==">=") outRule = new GE_Rule<T>(s,par.id(),val); 00188 if(op=="==" || op=="=") outRule = new EQ_Rule<T>(s,par.id(),val); 00189 if(op=="!=") outRule = new NEQ_Rule<T>(s,par.id(),val); 00190 00191 assert(outRule); 00192 m_store.mStackRules.push(outRule); 00193 //cout << "STACK rule " << typeid(*outRule).name() << " \"" << outRule->name() << "\"" << endl; 00194 }
bool my_do_simple_comparison< T >::m_param_on_left |
Definition at line 157 of file CreateRules.cc.
ParserStore& mySemantic::m_store [inherited] |
Definition at line 82 of file CreateRules.cc.