Exemple #1
0
void print_remaining_tokens(std::ostream& out, TokenStream& tokens)
{
    for (int i=0; i < tokens.remaining(); i++) {
        if (i != 0) out << " ";
        out << get_token_text(tokens.next(i).match);
        out << "(" << tokens.nextStr(i) << ")";
    }
}
Exemple #2
0
void dump_remaining_tokens(TokenStream& tokens)
{
    for (int i=0; i < tokens.remaining(); i++) {
        if (i != 0)
            printf(" ");
        Value nextStr;
        tokens.getNextStr(&nextStr, i);
        printf("%s(%s)", get_token_text(tokens.next(i).match), as_cstring(&nextStr));
    }
    printf("\n");
}