| 118 | 
  | 
            //    continue; | 
| 119 | 
  | 
            //} | 
| 120 | 
  | 
            if (lookingAtDecimal((tokCommand & Token::negnums) != 0)) { | 
| 121 | 
< | 
                float value = lexi_cast<float>(script.substr(ichToken, ichToken + cchToken));           | 
| 122 | 
< | 
                ltoken.push_back(Token(Token::decimal, value));/**@todo*/ | 
| 121 | 
> | 
                float value = lexi_cast<float>(script.substr(ichToken, cchToken));         | 
| 122 | 
> | 
                std::cout << "encount an decimal: " << value << std::endl; | 
| 123 | 
> | 
                ltoken.push_back(Token(Token::decimal, boost::any(value))); | 
| 124 | 
  | 
                continue; | 
| 125 | 
  | 
            } | 
| 126 | 
  | 
            if (lookingAtInteger((tokCommand & Token::negnums) != 0)) { | 
| 127 | 
< | 
                std::string intString = script.substr(ichToken, ichToken + cchToken); | 
| 128 | 
< | 
                int val = lexi_cast<int>(intString); | 
| 129 | 
< | 
                ltoken.push_back(Token(Token::integer, val, intString));/**@todo*/ | 
| 127 | 
> | 
 | 
| 128 | 
> | 
                int val = lexi_cast<int>(script.substr(ichToken, cchToken)); | 
| 129 | 
> | 
                std::cout << "encount an integer: " << val << std::endl; | 
| 130 | 
> | 
                ltoken.push_back(Token(Token::integer,   boost::any(val))); | 
| 131 | 
  | 
                continue; | 
| 132 | 
  | 
            } | 
| 133 | 
  | 
        } | 
| 244 | 
  | 
      previousCharBackslash = ch == '\\' ? !previousCharBackslash : false; | 
| 245 | 
  | 
    } | 
| 246 | 
  | 
    cchToken = ichT - ichToken; | 
| 247 | 
+ | 
 | 
| 248 | 
+ | 
 | 
| 249 | 
+ | 
    std::cout << "lookingAtString: encount " << script.substr(ichToken, cchToken) << std::endl;  | 
| 250 | 
  | 
    return true; | 
| 251 | 
  | 
  } | 
| 252 | 
  | 
 | 
| 344 | 
  | 
        return false; | 
| 345 | 
  | 
    } | 
| 346 | 
  | 
 | 
| 347 | 
< | 
    // to support 1.ca, let's check the character after the dot | 
| 348 | 
< | 
    // to determine if it is an alpha | 
| 344 | 
< | 
    if (ch == '.' && (ichT + 1 < cchScript) && std::isalpha(script[ichT + 1])) { | 
| 347 | 
> | 
    // to support DMPC.1, let's check the character before the dot | 
| 348 | 
> | 
    if (ch == '.' && (ichT > 0) && std::isalpha(script[ichT - 1])) { | 
| 349 | 
  | 
        return false; | 
| 350 | 
  | 
    } | 
| 351 | 
  | 
 | 
| 429 | 
  | 
            } | 
| 430 | 
  | 
        break; | 
| 431 | 
  | 
    } | 
| 432 | 
+ | 
 | 
| 433 | 
  | 
    cchToken = ichT - ichToken; | 
| 434 | 
+ | 
 | 
| 435 | 
+ | 
    std::cout << "lookingAtLookupToken: encount " << script.substr(ichToken, cchToken) << std::endl;  | 
| 436 | 
  | 
    return true; | 
| 437 | 
  | 
} | 
| 438 | 
  | 
 | 
| 569 | 
  | 
        case Token::asterisk: | 
| 570 | 
  | 
        case Token::identifier: | 
| 571 | 
  | 
            return clauseChemObjName(); | 
| 572 | 
< | 
       | 
| 572 | 
> | 
 | 
| 573 | 
> | 
        case Token::integer : | 
| 574 | 
> | 
            return clauseIndex(); | 
| 575 | 
  | 
        default: | 
| 576 | 
  | 
            if ((tok & Token::atomproperty) == Token::atomproperty) { | 
| 577 | 
  | 
                return clauseComparator(); | 
| 617 | 
  | 
        return false; | 
| 618 | 
  | 
    } | 
| 619 | 
  | 
 | 
| 620 | 
+ | 
    boost::any floatVal; | 
| 621 | 
+ | 
    floatVal = val; | 
| 622 | 
  | 
    return addTokenToPostfix(Token(tokenComparator.tok, | 
| 623 | 
< | 
                       tokenAtomProperty.tok, boost::any(val))); | 
| 623 | 
> | 
                       tokenAtomProperty.tok, floatVal)); | 
| 624 | 
  | 
} | 
| 625 | 
  | 
 | 
| 626 | 
  | 
bool SelectionCompiler::clauseWithin() { | 
| 633 | 
  | 
    Token tokenDistance = tokenNext();       // distance | 
| 634 | 
  | 
    switch(tokenDistance.tok) { | 
| 635 | 
  | 
        case Token::integer: | 
| 625 | 
– | 
            distance = float(tokenDistance.intValue); | 
| 626 | 
– | 
            break; | 
| 636 | 
  | 
        case Token::decimal: | 
| 637 | 
  | 
            distance = tokenDistance.value; | 
| 638 | 
  | 
            break; | 
| 689 | 
  | 
 | 
| 690 | 
  | 
    int tok = tokPeek(); | 
| 691 | 
  | 
 | 
| 692 | 
< | 
    if (tok == Token::asterisk || tok == Token::identifier) { | 
| 693 | 
< | 
        name += boost::any_cast<std::string>(tokenNext().value); | 
| 694 | 
< | 
         | 
| 692 | 
> | 
    if (tok == Token::asterisk || tok == Token::identifier || tok == Token::integer) { | 
| 693 | 
> | 
 | 
| 694 | 
> | 
        Token token = tokenNext(); | 
| 695 | 
> | 
        if (token.value.type() == typeid(std::string)) { | 
| 696 | 
> | 
            name += boost::any_cast<std::string>(token.value); | 
| 697 | 
> | 
        } else if (token.value.type() == typeid(int)){ | 
| 698 | 
> | 
            int intVal = boost::any_cast<int>(token.value); | 
| 699 | 
> | 
            char buffer[255]; | 
| 700 | 
> | 
            sprintf(buffer,"%d", intVal); | 
| 701 | 
> | 
            name += buffer; /** @todo */ | 
| 702 | 
> | 
            //name += toString<int>(intVal); | 
| 703 | 
> | 
        } | 
| 704 | 
  | 
        while(true){ | 
| 705 | 
  | 
            tok = tokPeek(); | 
| 706 | 
  | 
            switch (tok) { | 
| 727 | 
  | 
 | 
| 728 | 
  | 
} | 
| 729 | 
  | 
 | 
| 730 | 
+ | 
bool SelectionCompiler::clauseIndex(){ | 
| 731 | 
+ | 
    Token token = tokenNext(); | 
| 732 | 
+ | 
    if (token.tok == Token::integer) { | 
| 733 | 
+ | 
        int index = boost::any_cast<int>(token.value); | 
| 734 | 
+ | 
        int tok = tokPeek(); | 
| 735 | 
+ | 
        std::cout << "Token::to is " << Token::to << ", tok = " << tok << std::endl; | 
| 736 | 
+ | 
        if (tok == Token::to) { | 
| 737 | 
+ | 
            tokenNext(); | 
| 738 | 
+ | 
            tok = tokPeek(); | 
| 739 | 
+ | 
            if (tok != Token::integer) { | 
| 740 | 
+ | 
                return numberExpected(); | 
| 741 | 
+ | 
            } | 
| 742 | 
+ | 
             | 
| 743 | 
+ | 
            boost::any intVal = tokenNext().value; | 
| 744 | 
+ | 
            int first = index; | 
| 745 | 
+ | 
            if (intVal.type() != typeid(int)){ | 
| 746 | 
+ | 
                return false; | 
| 747 | 
+ | 
            } | 
| 748 | 
+ | 
            int second = boost::any_cast<int>(intVal); | 
| 749 | 
  | 
 | 
| 750 | 
+ | 
            return addTokenToPostfix(Token(Token::index, boost::any(std::make_pair(first, second)))); | 
| 751 | 
+ | 
             | 
| 752 | 
+ | 
        }else { | 
| 753 | 
+ | 
            return addTokenToPostfix(Token(Token::index, boost::any(index))); | 
| 754 | 
+ | 
        } | 
| 755 | 
+ | 
    } else { | 
| 756 | 
+ | 
        return numberExpected(); | 
| 757 | 
+ | 
    } | 
| 758 | 
  | 
} | 
| 759 | 
+ | 
 | 
| 760 | 
+ | 
} |