本文整理汇总了C++中tokenizer::offset方法的典型用法代码示例。如果您正苦于以下问题:C++ tokenizer::offset方法的具体用法?C++ tokenizer::offset怎么用?C++ tokenizer::offset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tokenizer
的用法示例。
在下文中一共展示了tokenizer::offset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseStatement
//.........这里部分代码省略.........
}
blk.subTokens().insert(blk.subTokens().end(), cur);
if (cur.subTokens().begin() != cur.subTokens().end() &&
(*(cur.subTokens().begin())).String.toUpper() == ("BEGIN"))
dcl = false;
}
while (cur.subTokens().begin() != cur.subTokens().end() &&
(*cur.subTokens().begin()).String.toUpper() != ("END"));
return blk;
}
else if (((first == "IF" && upp == "THEN") ||
(first == "WHEN" && upp == "THEN") ||
(first == "ELSIF" && upp == "THEN") ||
upp == ("BEGIN") ||
upp == ("EXCEPTION") ||
first == ("ELSE")) && !lst)
{
// qDebug() << "else if first==IF";
ret.subTokens().insert(ret.subTokens().end(), statement(statement::Keyword, token, tokens.line()));
return ret;
}
else if (first == ("ASSIGN") ||
first == ("SET") ||
first == ("PROMPT") ||
first == ("COLUMN") ||
first == ("SPOOL") ||
first == ("STORE") ||
first == ("REMARK") ||
first == ("REM"))
{
// qDebug() << "ASSIGN";
ret.subTokens().insert(ret.subTokens().end(), statement(statement::Keyword, token, tokens.line()));
int line = tokens.line();
int offset = tokens.offset();
for (QString tmp = tokens.getToken(true, true);line == tokens.line();tmp = tokens.getToken(true, true))
ret.subTokens().insert(ret.subTokens().end(), statement(statement::Token, tmp, line));
tokens.setLine(line);
tokens.setOffset(offset);
tokens.remaining(true);
return ret;
}
else if (upp == (",") ||
// if (upp == (",") ||
// (syntax.reservedWord(upp) &&
(isKeyword(upp) &&
upp != ("NOT") &&
upp != ("IS") &&
upp != ("LIKE") &&
upp != ("IN") &&
upp != ("ELSE") &&
upp != ("ELSIF") &&
upp != ("END") &&
upp != ("BETWEEN") &&
upp != ("ASC") &&
upp != ("DESC") &&
upp != ("NULL")) && !nokey)
{
}
else if (upp == ("("))
{
// qDebug() << "start (";
ret.subTokens().insert(ret.subTokens().end(), statement(statement::Token, token, tokens.line()));
statement lst = parseStatement(tokens, false, true);
statement t = toPop(lst.subTokens());
if (lst.Type != statement::List)