--- trunk/src/selection/SelectionCompiler.cpp 2005/02/07 19:13:18 295 +++ trunk/src/selection/SelectionCompiler.cpp 2005/03/09 18:46:16 415 @@ -119,14 +119,12 @@ bool SelectionCompiler::internalCompile(){ //} if (lookingAtDecimal((tokCommand & Token::negnums) != 0)) { float value = lexi_cast(script.substr(ichToken, cchToken)); - std::cout << "encount an decimal: " << value << std::endl; ltoken.push_back(Token(Token::decimal, boost::any(value))); continue; } if (lookingAtInteger((tokCommand & Token::negnums) != 0)) { int val = lexi_cast(script.substr(ichToken, cchToken)); - std::cout << "encount an integer: " << val << std::endl; ltoken.push_back(Token(Token::integer, boost::any(val))); continue; } @@ -244,9 +242,7 @@ bool SelectionCompiler::internalCompile(){ previousCharBackslash = ch == '\\' ? !previousCharBackslash : false; } cchToken = ichT - ichToken; - - std::cout << "lookingAtString: encount " << script.substr(ichToken, cchToken) << std::endl; return true; } @@ -344,9 +340,8 @@ bool SelectionCompiler::lookingAtDecimal(bool allowNeg return false; } - // to support 1.ca, let's check the character after the dot - // to determine if it is an alpha - if (ch == '.' && (ichT + 1 < cchScript) && std::isalpha(script[ichT + 1])) { + // to support DMPC.1, let's check the character before the dot + if (ch == '.' && (ichT > 0) && std::isalpha(script[ichT - 1])) { return false; } @@ -433,7 +428,6 @@ bool SelectionCompiler::lookingAtLookupToken() { cchToken = ichT - ichToken; - std::cout << "lookingAtLookupToken: encount " << script.substr(ichToken, cchToken) << std::endl; return true; } @@ -690,9 +684,18 @@ bool SelectionCompiler:: clauseName(std::string& name) int tok = tokPeek(); - if (tok == Token::asterisk || tok == Token::identifier) { - name += boost::any_cast(tokenNext().value); - + if (tok == Token::asterisk || tok == Token::identifier || tok == Token::integer) { + + Token token = tokenNext(); + if (token.value.type() == typeid(std::string)) { + name += boost::any_cast(token.value); + } else if (token.value.type() == typeid(int)){ + int intVal = boost::any_cast(token.value); + char buffer[255]; + sprintf(buffer,"%d", intVal); + name += buffer; /** @todo */ + //name += toString(intVal); + } while(true){ tok = tokPeek(); switch (tok) {