本文整理汇总了C++中CTokenizer::CheckTokenIsQuotedString方法的典型用法代码示例。如果您正苦于以下问题:C++ CTokenizer::CheckTokenIsQuotedString方法的具体用法?C++ CTokenizer::CheckTokenIsQuotedString怎么用?C++ CTokenizer::CheckTokenIsQuotedString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTokenizer
的用法示例。
在下文中一共展示了CTokenizer::CheckTokenIsQuotedString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Primary
//evaluates a primary
void CStateParser::Primary(CTokenizer &tok,CStateManager &StateManager)
{
//a negate operator
if( tok.CheckToken("-") )
{
//EvaluateExpression(tok,StateManager);
Primary(tok,StateManager);
StateManager.AddInstruction(OP_NEG,0,"#");
}else if( tok.CheckTokenIsNumber() ) //we have a number
{
StateManager.AddInstruction(OP_PUSH,tok.GetFloat(),"#");
}else if( tok.CheckTokenIsQuotedString() ) //it is a "quitedstring"
{
StateManager.AddInstruction(OP_PUSH,0,tok.GetToken());
}else if( tok.CheckToken("(") ) //here we have to check a lot of possibilitys
{
EvaluateExpression(tok,StateManager);
if( !tok.CheckToken(")") )
Error("Missing )",tok);
}else if( tok.CheckToken("!") )
{
Primary(tok,StateManager);
StateManager.AddInstruction(OP_NOT,0,"#");
}
else //check for a trigger name
{
std::string ret = tok.GetToken();
int i=GetTriggerType(ret.c_str(),tok);
if ( i == OP_Vel - OP_Abs)
{
if (tok.CheckToken("x"))
{
StateManager.AddInstruction(OP_Vel,1.0,"#");
}
else if (tok.CheckToken("y"))
{
StateManager.AddInstruction(OP_Vel,0.0,"#");
}
}else if ( i == OP_Pos - OP_Abs)
{
if (tok.CheckToken("x"))
{
StateManager.AddInstruction(OP_Pos,1.0,"#");
}
else if (tok.CheckToken("y"))
{
StateManager.AddInstruction(OP_Pos,0.0,"#");
}
}
else if ( i == OP_Const - OP_Abs)
{
if (!tok.CheckToken("("))
Error("Missing (",tok);
StateManager.AddInstruction(OP_Const,0.0,tok.GetToken());
if (!tok.CheckToken(")"))
Error("Missing )",tok);
}
else if ( i == OP_IfElse - OP_Abs)
{
if (!tok.CheckToken("("))
Error("Missing (",tok);
EvaluateExpression(tok,StateManager);
if (!tok.CheckToken(","))
Error("Missing ,",tok);
Term(tok,StateManager);
if (!tok.CheckToken(","))
Error("Missing ,",tok);
Term(tok,StateManager);
StateManager.AddInstruction(OP_IfElse,0,"#");
if (!tok.CheckToken(")"))
Error("Missing )",tok);
}
else if (i == OP_StateType - OP_Abs)
{
if (tok.CheckToken("="))
{
StateManager.AddInstruction(OP_StateType,0,"#");
StateManager.AddInstruction(OP_PUSH,0,tok.GetToken());
StateManager.AddInstruction(OP_EQUAL,0,"#");
}else if (tok.CheckToken("!="))
{
StateManager.AddInstruction(OP_StateType,0,"#");
StateManager.AddInstruction(OP_PUSH,0,tok.GetToken());
StateManager.AddInstruction(OP_NOTEQUAL,0,"#");
}
}
else if (i == OP_P2StateType - OP_Abs)
{
if (tok.CheckToken("="))
//.........这里部分代码省略.........