当前位置: 首页>>代码示例>>C++>>正文


C++ tokenizer::decrement方法代码示例

本文整理汇总了C++中tokenizer::decrement方法的典型用法代码示例。如果您正苦于以下问题:C++ tokenizer::decrement方法的具体用法?C++ tokenizer::decrement怎么用?C++ tokenizer::decrement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tokenizer的用法示例。


在下文中一共展示了tokenizer::decrement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: parse

void fieldValue::parse(tokenizer &tokens, void *data)
{
	tokens.syntax_start(this);

	if (type.substr(0,2) == "MF")
	{
		tokens.increment(false);
		tokens.expect("[");

		if (tokens.decrement(__FILE__, __LINE__, data))
		{
			tokens.next();

			tokens.increment(true);
			tokens.expect("]");

			tokens.increment(false);
			tokens.expect<sfValue>();

			while (tokens.decrement(__FILE__, __LINE__, data))
			{
				values.push_back(sfValue(tokens, "SF" + type.substr(2), data));

				tokens.increment(false);
				tokens.expect(",");

				if (tokens.decrement(__FILE__, __LINE__, data))
					tokens.next();

				tokens.increment(false);
				tokens.expect<sfValue>();
			}

			if (tokens.decrement(__FILE__, __LINE__, data))
				tokens.next();
		}
		else
		{
			tokens.increment(true);
			tokens.expect<sfValue>();

			if (tokens.decrement(__FILE__, __LINE__, data))
				values.push_back(sfValue(tokens, "SF" + type.substr(2), data));
		}
	}
	else
	{
		tokens.increment(true);
		tokens.expect<sfValue>();

		if (tokens.decrement(__FILE__, __LINE__, data))
			values.push_back(sfValue(tokens, type, data));
	}

	tokens.syntax_end(this);
}
开发者ID:yuchien302,项目名称:skeleton,代码行数:56,代码来源:fieldValue.cpp

示例2: parse

void attribute_list::parse(tokenizer &tokens, void *data)
{
	tokens.syntax_start(this);

	tokens.increment(false);
	tokens.expect<assignment_list>();

	while (tokens.decrement(__FILE__, __LINE__, data))
	{
		attributes.push_back(assignment_list(tokens, data));

		tokens.increment(false);
		tokens.expect<assignment_list>();
	}

	tokens.syntax_end(this);
}
开发者ID:nbingham1,项目名称:parse_dot,代码行数:17,代码来源:attribute_list.cpp

示例3: parse

void protoDeclaration::parse(tokenizer &tokens, void *data)
{
	tokens.syntax_start(this);

	tokens.increment(true);
	tokens.expect("]");

	tokens.increment(true);
	tokens.expect<interfaceDeclaration>();

	tokens.increment(true);
	tokens.expect("[");

	tokens.increment(true);
	tokens.expect<parse::instance>();

	tokens.increment(true);
	tokens.expect("PROTO");
	tokens.expect("EXTERNPROTO");

	if (tokens.decrement(__FILE__, __LINE__, data))
	{
		if (tokens.found("PROTO"))
			external = false;
		else if (tokens.found("EXTERNPROTO"))
			external = true;
	}

	if (tokens.decrement(__FILE__, __LINE__, data))
		nodeType = tokens.next();

	if (tokens.decrement(__FILE__, __LINE__, data))
		tokens.next();

	while (tokens.decrement(__FILE__, __LINE__, data))
	{
		interfaces.push_back(interfaceDeclaration(tokens, external, data));

		tokens.increment(false);
		tokens.expect<interfaceDeclaration>();
	}

	if (tokens.decrement(__FILE__, __LINE__, data))
		tokens.next();

	if (external)
	{
		tokens.increment(true);
		tokens.expect<fieldValue>();

		if (tokens.decrement(__FILE__, __LINE__, data))
			value = fieldValue(tokens, "MFString", data);
	}
	else
	{
		tokens.increment(true);
		tokens.expect("}");

		tokens.increment(true);
		tokens.expect<scene>();

		tokens.increment(true);
		tokens.expect("{");

		if (tokens.decrement(__FILE__, __LINE__, data))
			tokens.next();

		if (tokens.decrement(__FILE__, __LINE__, data))
			sub = new scene(tokens, data);

		if (tokens.decrement(__FILE__, __LINE__, data))
			tokens.next();
	}

	tokens.syntax_end(this);
}
开发者ID:yuchien302,项目名称:skeleton,代码行数:76,代码来源:protoDeclaration.cpp

示例4: parse

void statement::parse(tokenizer &tokens, void *data)
{
	tokens.syntax_start(this);

	statement_type = "node";
	tokens.increment(true);
	tokens.expect("graph");
	tokens.expect("node");
	tokens.expect("edge");
	tokens.expect<node_id>();
	tokens.expect("subgraph");

	if (tokens.decrement(__FILE__, __LINE__, data))
	{
		if (tokens.found("subgraph"))
			nodes.push_back(new graph(tokens, data));
		else if (tokens.found<node_id>())
			nodes.push_back(new node_id(tokens, data));
		else
		{
			statement_type = "attribute";
			attribute_type = tokens.next();
		}
	}

	if (statement_type != "attribute")
	{
		tokens.increment(false);
		tokens.expect("->");
		tokens.expect("--");
		while (tokens.decrement(__FILE__, __LINE__, data))
		{
			statement_type = "edge";
			tokens.next();

			tokens.increment(false);
			tokens.expect("->");
			tokens.expect("--");

			tokens.increment(true);
			tokens.expect<node_id>();
			tokens.expect("subgraph");

			if (tokens.decrement(__FILE__, __LINE__, data))
			{
				if (tokens.found("subgraph"))
					nodes.push_back(new graph(tokens, data));
				else if (tokens.found<node_id>())
					nodes.push_back(new node_id(tokens, data));
			}
		}
	}

	tokens.increment(statement_type == "attribute");
	tokens.expect<attribute_list>();

	if (tokens.decrement(__FILE__, __LINE__, data))
		attributes.parse(tokens, data);

	tokens.syntax_end(this);
}
开发者ID:nbingham1,项目名称:parse_dot,代码行数:61,代码来源:statement.cpp


注:本文中的tokenizer::decrement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。