• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ deleteToken函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中deleteToken函数的典型用法代码示例。如果您正苦于以下问题:C++ deleteToken函数的具体用法?C++ deleteToken怎么用?C++ deleteToken使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: parseType

static void parseType (tokenInfo *const token)
{
    tokenInfo *const name = newToken ();
    readToken (name);
    if (isType (name, TOKEN_IDENTIFIER))
    {
	readToken (token);
	if (isKeyword (token, KEYWORD_is))
	{
	    readToken (token);
	    switch (token->keyword)
	    {
		case KEYWORD_record:
		    makeSqlTag (name, SQLTAG_RECORD);
		    parseRecord (token);
		    break;

		case KEYWORD_table:
		    makeSqlTag (name, SQLTAG_TABLE);
		    break;

		case KEYWORD_ref:
		    readToken (token);
		    if (isKeyword (token, KEYWORD_cursor))
			makeSqlTag (name, SQLTAG_CURSOR);
		    break;

		default: break;
	    }
	}
    }
    deleteToken (name);
}
开发者ID:neil-yi,项目名称:ffsource,代码行数:33,代码来源:sql.c


示例2: parseModule

static void parseModule (tokenInfo * const token)
{
	tokenInfo *const name = newToken ();
	const vhdlKind kind = isKeyword (token, KEYWORD_ENTITY) ?
		VHDLTAG_ENTITY : VHDLTAG_COMPONENT;
	Assert (isKeyword (token, KEYWORD_ENTITY) ||
		isKeyword (token, KEYWORD_COMPONENT));
	readToken (name);
	if (kind == VHDLTAG_COMPONENT)
	{
		makeVhdlTag (name, VHDLTAG_COMPONENT);
		skipToKeyword (KEYWORD_END);
		fileSkipToCharacter (';');
	}
	else
	{
		readToken (token);
		if (isKeyword (token, KEYWORD_IS))
		{
			makeVhdlTag (name, VHDLTAG_ENTITY);
			skipToKeyword (KEYWORD_END);
			fileSkipToCharacter (';');
		}
	}
	deleteToken (name);
}
开发者ID:relaxdiego,项目名称:ctags,代码行数:26,代码来源:vhdl.c


示例3: parseSubProgram

static void parseSubProgram (tokenInfo *const token)
{
    tokenInfo *const name = newToken ();
    const sqlKind kind = isKeyword (token, KEYWORD_function) ?
	    SQLTAG_FUNCTION : SQLTAG_PROCEDURE;
    Assert (isKeyword (token, KEYWORD_function) ||
	    isKeyword (token, KEYWORD_procedure));
    readToken (name);
    readToken (token);
    skipArgumentList (token);
    if (isKeyword (token, KEYWORD_return))
    {
	do
	    readToken (token);			/* read return type */
	while (!(isKeyword (token, KEYWORD_is) ||
		    isType (token, TOKEN_SEMICOLON)));
    }
    if (isKeyword (token, KEYWORD_is))
    {
	if (isType (name, TOKEN_IDENTIFIER))
	    makeSqlTag (name, kind);
	parseBlock (token, TRUE);
    }
    else if (isType (token, TOKEN_SEMICOLON))
	makeSqlTag (name, SQLTAG_PROTOTYPE);
    deleteToken (name);
}
开发者ID:neil-yi,项目名称:ffsource,代码行数:27,代码来源:sql.c


示例4: parseTypes

static void parseTypes (tokenInfo * const token)
{
	tokenInfo *const name = newToken ();
	const vhdlKind kind = isKeyword (token, KEYWORD_TYPE) ?
		VHDLTAG_TYPE : VHDLTAG_SUBTYPE;
	Assert (isKeyword (token, KEYWORD_TYPE) ||
		isKeyword (token, KEYWORD_SUBTYPE));
	readToken (name);
	readToken (token);
	if (isKeyword (token, KEYWORD_IS))
	{
		readToken (token);	/* type */
		if (isKeyword (token, KEYWORD_RECORD))
		{
			makeVhdlTag (name, kind);
			/*TODO: make tags of the record's names */
			parseRecord (token);
		}
		else
		{
			makeVhdlTag (name, kind);
		}
	}
	deleteToken (name);
}
开发者ID:relaxdiego,项目名称:ctags,代码行数:25,代码来源:vhdl.c


示例5: parseVariable

/* parses declarations of the form
 * 	$var = VALUE
 */
static bool parseVariable (tokenInfo *const token)
{
	tokenInfo *name;
	bool readNext = true;
	const char *access;

	name = newToken ();
	copyToken (name, token, true);

	readToken (token);
	if (token->type == TOKEN_EQUAL_SIGN)
	{
		if (token->parentKind != K_FUNCTION)
		{	/* ignore local variables (i.e. within a function) */
			access = parsePowerShellScope (name);
			makeSimplePowerShellTag (name, K_VARIABLE, access);
			readNext = true;
		}
	}
	else
		readNext = false;

	deleteToken (name);

	return readNext;
}
开发者ID:ParrotSec,项目名称:geany,代码行数:29,代码来源:powershell.c


示例6: findVhdlTags

static void findVhdlTags (void)
{
	tokenInfo *const token = newToken ();

	while (parseVhdlFile (token) != TOKEN_EOF);

	deleteToken (token);
}
开发者ID:relaxdiego,项目名称:ctags,代码行数:8,代码来源:vhdl.c


示例7: findSqlTags

static void findSqlTags (void)
{
    tokenInfo *const token = newToken ();
    exception_t exception = (exception_t) (setjmp (Exception));
    while (exception == ExceptionNone)
	parseSqlFile (token);
    deleteToken (token);
}
开发者ID:neil-yi,项目名称:ffsource,代码行数:8,代码来源:sql.c


示例8: findEiffelTags

static void findEiffelTags (void)
{
	tokenInfo *const token = newToken ();

	while (findKeyword (token, KEYWORD_class))
		parseClass (token);
	deleteToken (token);
}
开发者ID:amosbird,项目名称:ctags,代码行数:8,代码来源:eiffel.c


示例9: parseClassOrIface

/* parses a class or an interface:
 * 	class Foo {}
 * 	class Foo extends Bar {}
 * 	class Foo extends Bar implements iFoo, iBar {}
 * 	interface iFoo {}
 * 	interface iBar extends iFoo {}
 *
 * if @name is not NULL, parses an anonymous class with name @name
 * 	new class {}
 * 	new class(1, 2) {}
 * 	new class(1, 2) extends Foo implements iFoo, iBar {} */
static boolean parseClassOrIface (tokenInfo *const token, const phpKind kind,
                                  const tokenInfo *name)
{
	boolean readNext = TRUE;
	implType impl = CurrentStatement.impl;
	tokenInfo *nameFree = NULL;
	vString *inheritance = NULL;

	readToken (token);
	if (name) /* anonymous class */
	{
		/* skip possible construction arguments */
		skipOverParens (token);
	}
	else /* normal, named class */
	{
		if (token->type != TOKEN_IDENTIFIER)
			return FALSE;

		name = nameFree = newToken ();
		copyToken (nameFree, token, TRUE);

		readToken (token);
	}

	inheritance = vStringNew ();
	/* read every identifiers, keywords and commas, and assume each
	 *  identifier (not keyword) is an inheritance
	 * (like in "class Foo extends Bar implements iA, iB") */
	while (token->type == TOKEN_IDENTIFIER ||
	       token->type == TOKEN_KEYWORD ||
	       token->type == TOKEN_COMMA)
	{
		if (token->type == TOKEN_IDENTIFIER)
		{
			if (vStringLength (inheritance) > 0)
				vStringPut (inheritance, ',');
			vStringCat (inheritance, token->string);
		}

		readToken (token);
	}

	makeClassOrIfaceTag (kind, name, inheritance, impl);

	if (token->type == TOKEN_OPEN_CURLY)
		enterScope (token, name->string, kind);
	else
		readNext = FALSE;

	if (nameFree)
		deleteToken (nameFree);
	vStringDelete (inheritance);

	return readNext;
}
开发者ID:blackb1rd,项目名称:ctags,代码行数:67,代码来源:php.c


示例10: skipToKeyword

static void skipToKeyword (const keywordId keyword)
{
	tokenInfo *const token = newToken ();
	do
	{
		readToken (token);
	}
	while (!isType (token, TOKEN_EOF) && !isKeyword (token, keyword));
	deleteToken (token);
}
开发者ID:relaxdiego,项目名称:ctags,代码行数:10,代码来源:vhdl.c


示例11: findGoTags

static void findGoTags (void)
{
	tokenInfo *const token = newToken ();

	parseGoFile (token);

	deleteToken (token);
	vStringDelete (scope);
	scope = NULL;
}
开发者ID:Dev0Null,项目名称:ctags,代码行数:10,代码来源:go.c


示例12: parseFunctionOrMethod

static void parseFunctionOrMethod (tokenInfo *const token)
{
	// FunctionDecl = "func" identifier Signature [ Body ] .
	// Body         = Block.
	//
	// MethodDecl   = "func" Receiver MethodName Signature [ Body ] .
	// Receiver     = "(" [ identifier ] [ "*" ] BaseTypeName ")" .
	// BaseTypeName = identifier .

	// Skip over receiver.
	readToken (token);
	if (isType (token, TOKEN_OPEN_PAREN))
		skipToMatched (token);

	if (isType (token, TOKEN_IDENTIFIER))
	{
		vString *argList;
		tokenInfo *functionToken = copyToken (token);

		// Start recording signature
		signature = vStringNew ();

		// Skip over parameters.
		readToken (token);
		skipToMatchedNoRead (token);

		vStringStripLeading (signature);
		vStringStripTrailing (signature);
		argList = signature;
		signature = vStringNew ();

		readToken (token);

		// Skip over result.
		skipType (token);

		// Remove the extra { we have just read
		vStringStripTrailing (signature);
		vStringChop (signature);

		vStringStripLeading (signature);
		vStringStripTrailing (signature);
		makeTag (functionToken, GOTAG_FUNCTION, NULL, GOTAG_UNDEFINED, argList->buffer, signature->buffer);
		deleteToken (functionToken);
		vStringDelete(signature);
		vStringDelete(argList);

		// Stop recording signature
		signature = NULL;

		// Skip over function body.
		if (isType (token, TOKEN_OPEN_CURLY))
			skipToMatched (token);
	}
}
开发者ID:15ramky,项目名称:geany,代码行数:55,代码来源:go.c


示例13: deleteToken

static tokenInfo *popToken (tokenInfo * const token)
{
	tokenInfo *localToken;
	if (token != NULL)
	{
		localToken = token->scope;
		deleteToken (token);
		return localToken;
	}
	return NULL;
}
开发者ID:shunlir,项目名称:ctags,代码行数:11,代码来源:verilog.c


示例14: findVerilogTags

static void findVerilogTags (void)
{
	tokenInfo *const token = newToken ();
	int c = '\0';
	currentContext = newToken ();

	while (c != EOF)
	{
		c = vGetc ();
		c = skipWhite (c);
		switch (c)
		{
			/* Store current block name whenever a : is found
			 * This is used later by any tag type that requires this information
			 * */
			case ':':
				vStringCopy (currentContext->blockName, token->name);
				break;
			/* Skip interface modport port declarations */
			case '(':
				if (currentContext && currentContext->lastKind == K_MODPORT)
				{
					skipPastMatch ("()");
				}
				break;
			/* Drop context on prototypes because they don't have an end
			 * statement */
			case ';':
				if (currentContext->scope && currentContext->scope->prototype)
				{
					verbose ("Dropping context %s\n", vStringValue (currentContext->name));
					currentContext = popToken (currentContext);
					currentContext->prototype = FALSE;
				}
				/* Prototypes end at the end of statement */
				if (currentContext->prototype)
				{
					currentContext->prototype = FALSE;
				}
				break;
			default :
				if (isIdentifierCharacter (c))
				{
					readIdentifier (token, c);
					updateKind (token);
					findTag (token);
				}
		}
	}

	deleteToken (token);
	pruneTokens (currentContext);
	currentContext = NULL;
}
开发者ID:Luoben,项目名称:ctags,代码行数:54,代码来源:verilog.c


示例15: findPowerShellTags

static void findPowerShellTags (void)
{
	tokenInfo *const token = newToken ();

	do
	{
		enterScope (token, NULL, -1);
	}
	while (token->type != TOKEN_EOF); /* keep going even with unmatched braces */

	deleteToken (token);
}
开发者ID:ParrotSec,项目名称:geany,代码行数:12,代码来源:powershell.c


示例16: findEiffelTags

static void findEiffelTags (void)
{
    tokenInfo *const token = newToken ();
    exception_t exception;

    exception = (exception_t) (setjmp (Exception));
    while (exception == ExceptionNone)
    {
        findKeyword (token, KEYWORD_class);
        parseClass (token);
    }
    deleteToken (token);
}
开发者ID:Figoer,项目名称:i_figoer,代码行数:13,代码来源:eiffel.c


示例17: parseVariable

/* parses declarations of the form
 * 	$var = VALUE
 * 	$var; */
static boolean parseVariable (tokenInfo *const token)
{
	tokenInfo *name;
	boolean readNext = TRUE;
	accessType access = CurrentStatement.access;

	name = newToken ();
	copyToken (name, token, TRUE);

	readToken (token);
	if (token->type == TOKEN_EQUAL_SIGN)
	{
		phpKind kind = K_VARIABLE;

		if (token->parentKind == K_FUNCTION)
			kind = K_LOCAL_VARIABLE;

		readToken (token);
		if (token->type == TOKEN_KEYWORD &&
			token->keyword == KEYWORD_function &&
			PhpKinds[kind].enabled)
		{
			if (parseFunction (token, name))
				readToken (token);
			readNext = (boolean) (token->type == TOKEN_SEMICOLON);
		}
		else
		{
			makeSimplePhpTag (name, kind, access);
			readNext = FALSE;
		}
	}
	else if (token->type == TOKEN_SEMICOLON)
	{
		/* generate tags for variable declarations in classes
		 * 	class Foo {
		 * 		protected $foo;
		 * 	}
		 * but don't get fooled by stuff like $foo = $bar; */
		if (token->parentKind == K_CLASS ||
		    token->parentKind == K_INTERFACE ||
		    token->parentKind == K_TRAIT)
			makeSimplePhpTag (name, K_VARIABLE, access);
	}
	else
		readNext = FALSE;

	deleteToken (name);

	return readNext;
}
开发者ID:blackb1rd,项目名称:ctags,代码行数:54,代码来源:php.c


示例18: parseConstant

static void parseConstant (boolean local)
{
	tokenInfo *const name = newToken ();
	readToken (name);
	if (local)
	{
		makeVhdlTag (name, VHDLTAG_LOCAL);
	}
	else
	{
		makeVhdlTag (name, VHDLTAG_CONSTANT);
	}
	fileSkipToCharacter (';');
	deleteToken (name);
}
开发者ID:relaxdiego,项目名称:ctags,代码行数:15,代码来源:vhdl.c


示例19: parseTable

static void parseTable (tokenInfo *const token)
{
    tokenInfo *const name = newToken ();
    readToken (name);
    readToken (token);
    if (isType (token, TOKEN_OPEN_PAREN))
    {
	if (isType (name, TOKEN_IDENTIFIER))
	{
	    makeSqlTag (name, SQLTAG_TABLE);
	    parseRecord (token);
	}
    }
    findToken (token, TOKEN_SEMICOLON);
    deleteToken (name);
}
开发者ID:neil-yi,项目名称:ffsource,代码行数:16,代码来源:sql.c


示例20: parsePackage

static void parsePackage (tokenInfo *const token)
{
    tokenInfo *const name = newToken ();
    readToken (name);
    if (isKeyword (name, KEYWORD_body))
	readToken (name);
    readToken (token);
    if (isKeyword (token, KEYWORD_is))
    {
	if (isType (name, TOKEN_IDENTIFIER))
	    makeSqlTag (name, SQLTAG_PACKAGE);
	parseBlock (token, FALSE);
    }
    findToken (token, TOKEN_SEMICOLON);
    deleteToken (name);
}
开发者ID:neil-yi,项目名称:ffsource,代码行数:16,代码来源:sql.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ deleteTree函数代码示例发布时间:2022-05-30
下一篇:
C++ deleteTexture函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap