本文整理汇总了C++中Keywords::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ Keywords::empty方法的具体用法?C++ Keywords::empty怎么用?C++ Keywords::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Keywords
的用法示例。
在下文中一共展示了Keywords::empty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
NitLexer::NitLexer()
{
static Keywords keywords;
if (keywords.empty())
{
keywords["base"] = TK_BASE;
keywords["switch"] = TK_SWITCH;
keywords["if"] = TK_IF;
keywords["else"] = TK_ELSE;
keywords["while"] = TK_WHILE;
keywords["break"] = TK_BREAK;
keywords["for"] = TK_FOR;
keywords["do"] = TK_DO;
keywords["null"] = TK_NULL;
keywords["foreach"] = TK_FOREACH;
keywords["in"] = TK_IN;
keywords["clone"] = TK_CLONE;
keywords["function"] = TK_FUNCTION;
keywords["return"] = TK_RETURN;
keywords["typeof"] = TK_TYPEOF;
keywords["continue"] = TK_CONTINUE;
keywords["yield"] = TK_YIELD;
keywords["try"] = TK_TRY;
keywords["catch"] = TK_CATCH;
keywords["throw"] = TK_THROW;
keywords["resume"] = TK_RESUME;
keywords["case"] = TK_CASE;
keywords["default"] = TK_DEFAULT;
keywords["this"] = TK_THIS;
keywords["class"] = TK_CLASS;
keywords["constructor"] = TK_CONSTRUCTOR;
keywords["is"] = TK_IS;
keywords["true"] = TK_TRUE;
keywords["false"] = TK_FALSE;
keywords["static"] = TK_STATIC;
keywords["enum"] = TK_ENUM;
keywords["const"] = TK_CONST;
keywords["property"] = TK_PROPERTY;
keywords["require"] = TK_REQUIRE;
keywords["div"] = TK_INTDIV;
keywords["mod"] = TK_INTMOD;
keywords["destructor"] = TK_DESTRUCTOR;
keywords["var"] = TK_VAR;
keywords["with"] = TK_WITH;
keywords["finally"] = TK_FINALLY;
keywords["import"] = TK_IMPORT;
keywords["by"] = TK_BY;
}
setKeywords(&keywords);
}