ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/selection/SelectionCompiler.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/selection/SelectionCompiler.cpp (file contents):
Revision 1979 by tim, Mon Feb 7 19:13:18 2005 UTC vs.
Revision 2099 by tim, Wed Mar 9 18:46:16 2005 UTC

# Line 119 | Line 119 | bool SelectionCompiler::internalCompile(){
119              //}
120              if (lookingAtDecimal((tokCommand & Token::negnums) != 0)) {
121                  float value = lexi_cast<float>(script.substr(ichToken, cchToken));        
122                std::cout << "encount an decimal: " << value << std::endl;
122                  ltoken.push_back(Token(Token::decimal, boost::any(value)));
123                  continue;
124              }
125              if (lookingAtInteger((tokCommand & Token::negnums) != 0)) {
126  
127                  int val = lexi_cast<int>(script.substr(ichToken, cchToken));
129                std::cout << "encount an integer: " << val << std::endl;
128                  ltoken.push_back(Token(Token::integer,   boost::any(val)));
129                  continue;
130              }
# Line 244 | Line 242 | bool SelectionCompiler::internalCompile(){
242        previousCharBackslash = ch == '\\' ? !previousCharBackslash : false;
243      }
244      cchToken = ichT - ichToken;
247
245  
249    std::cout << "lookingAtString: encount " << script.substr(ichToken, cchToken) << std::endl;
246      return true;
247    }
248  
# Line 344 | Line 340 | bool SelectionCompiler::lookingAtDecimal(bool allowNeg
340          return false;
341      }
342  
343 <    // to support 1.ca, let's check the character after the dot
344 <    // to determine if it is an alpha
349 <    if (ch == '.' && (ichT + 1 < cchScript) && std::isalpha(script[ichT + 1])) {
343 >    // to support DMPC.1, let's check the character before the dot
344 >    if (ch == '.' && (ichT > 0) && std::isalpha(script[ichT - 1])) {
345          return false;
346      }
347  
# Line 433 | Line 428 | bool SelectionCompiler::lookingAtLookupToken() {
428  
429      cchToken = ichT - ichToken;
430  
436    std::cout << "lookingAtLookupToken: encount " << script.substr(ichToken, cchToken) << std::endl;
431      return true;
432   }
433  
# Line 690 | Line 684 | bool SelectionCompiler:: clauseName(std::string& name)
684  
685      int tok = tokPeek();
686  
687 <    if (tok == Token::asterisk || tok == Token::identifier) {
688 <        name += boost::any_cast<std::string>(tokenNext().value);
689 <        
687 >    if (tok == Token::asterisk || tok == Token::identifier || tok == Token::integer) {
688 >
689 >        Token token = tokenNext();
690 >        if (token.value.type() == typeid(std::string)) {
691 >            name += boost::any_cast<std::string>(token.value);
692 >        } else if (token.value.type() == typeid(int)){
693 >            int intVal = boost::any_cast<int>(token.value);
694 >            char buffer[255];
695 >            sprintf(buffer,"%d", intVal);
696 >            name += buffer; /** @todo */
697 >            //name += toString<int>(intVal);
698 >        }
699          while(true){
700              tok = tokPeek();
701              switch (tok) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines