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

C++ skipWhite函数代码示例

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

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



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

示例1: attSetNames

eFlag Tree::extractUsedSets(Sit S, Element *e) 
{
    Attribute *a = e -> atts.find(XSLA_USE_ATTR_SETS); 
    if (a) 
    {
	QNameList *names = e -> attSetNames(TRUE);
	names -> freeall(FALSE);
	char *p, *q;

	q = (char*) (a -> cont);
	skipWhite(q);
	p = q;
	int i = strcspn(q, theWhitespace);
	while (*q && i) {
	    q += i;
	    char save = *q;
	    *q = 0;

	    Str token = p;
	    GP( QName ) name = new QName;
	    E( e -> setLogical(S, *name, token, FALSE) );

	    names -> append( name.keep() );
	    *q = save;
	    skipWhite(q);
	    p = q;
	    i = strcspn(q, theWhitespace);
	}

    }
    return OK;
}
开发者ID:alepharchives,项目名称:Sablotron,代码行数:32,代码来源:tree.cpp


示例2: skipWhite

eFlag Tree::getSpaceNames(Sit S, Element &e, Str &str, SpaceNameList &where)
{
  char *p, *q;
  q = (char*)str;
  skipWhite(q);
  p = q;
  int i = strcspn(q, theWhitespace);
  while (*q && i) 
    {
      q += i;
      char save = *q;
      *q = 0;
      
      Str token = p;
      QName name;
      E( e.setLogical(S, name, token, FALSE) );
      GP(EQName) ename = new EQName;
      expandQ(name, *ename);
      where.append(ename.keep());

      *q = save;
      skipWhite(q);
      p = q;
      i = strcspn(q, theWhitespace);
    }

  return OK;
}
开发者ID:alepharchives,项目名称:Sablotron,代码行数:28,代码来源:tree.cpp


示例3: findTag

static void findTag (vString *const name)
{
    const verilogKind kind = (verilogKind)
	    lookupKeyword (vStringValue (name), Lang_verilog);
    if (kind != K_UNDEFINED)
    {
	int c = skipWhite (vGetc ());

	/* Many keywords can have bit width.
	*   reg [3:0] net_name;
	*   inout [(`DBUSWIDTH-1):0] databus;
	*/
	if (c == '(')
	    c = skipPastMatch ("()");
	c = skipWhite (c);
	if (c == '[')
	    c = skipPastMatch ("[]");
	c = skipWhite (c);
	if (c == '#')
	{
	    c = vGetc ();
	    if (c == '(')
		c = skipPastMatch ("()");
	}
	c = skipWhite (c);
	if (isIdentifierCharacter (c))
	    tagNameList (kind, c);
    }
}
开发者ID:att,项目名称:uwin,代码行数:29,代码来源:verilog.c


示例4: parseKeyword

 QVariant parseKeyword()
 {
     if(source.mid(pos, 4) == "true")
     {
         pos += 4;
         skipWhite();
         return QVariant(true);
     }
     else if(source.mid(pos, 5) == "false")
     {
         pos += 5;
         skipWhite();
         return QVariant(false);
     }
     else if(source.mid(pos, 4) == "null")
     {
         pos += 4;
         skipWhite();
         return QVariant(0);
     }
     else
     {
         error("unknown keyword");
     }
     return QVariant();
 }
开发者ID:gnuzinho,项目名称:Doomsday-Engine,代码行数:26,代码来源:json.cpp


示例5: findTag

static void findTag (vString *const name)
{
	int c = '\0';
	vhdlKind kind;
    vStringCopyToLower (Keyword, name);
    kind = (vhdlKind)lookupKeyword (vStringValue (Keyword), Lang_vhdl);
    if (kind == K_UNDEFINED)
	{
		c = skipWhite (vGetc ());
		vStringCopyS(Lastname,vStringValue(name));
			if (c == ':')
			{
				c = skipWhite (vGetc ());
				if (isIdentifierCharacter (c))
				{
					readIdentifier (name, c);
					vStringCopyToLower (Keyword, name);
					lookupKeyword (vStringValue (Keyword), Lang_vhdl);
					kind = (vhdlKind)lookupKeyword (vStringValue (Keyword), Lang_vhdl);
					if (kind == K_PROCESS || kind == K_BLOCK || kind == K_PORT)
					{
						makeSimpleTag (Lastname, VhdlKinds, kind);
					}
				}
			} else {
				vUngetc (c);
			}
	}
	else
	{
		if (kind == K_SIGNAL) {
			while (c!=':') {
				c = skipWhite (vGetc ());
				if (c==',')
					c = vGetc ();
				if (isIdentifierCharacter (c))
					tagNameList (kind, c);
				else
					break;
				c = vGetc ();
			}
		}
		else if (kind == K_PROCESS || kind == K_BLOCK) {
			vStringCopyS(TagName,"unnamed");
			makeSimpleTag (TagName, VhdlKinds, kind);
		} else {
			c = skipWhite (vGetc ());
			if (c=='\"')
				c = vGetc ();
			if (isIdentifierCharacter (c))
				tagNameList (kind, c);
		}
	}
}
开发者ID:Fordi,项目名称:geany,代码行数:54,代码来源:vhdl.c


示例6: findBlockName

static boolean findBlockName (tokenInfo *const token)
{
	int c;

	c = skipWhite (vGetc ());
	if (c == ':')
	{
		c = skipWhite (vGetc ());
		readIdentifier (token, c);
		return (boolean) (vStringLength (token->name) > 0);
	}
	else
		vUngetc (c);
	return FALSE;
}
开发者ID:shunlir,项目名称:ctags,代码行数:15,代码来源:verilog.c


示例7: parseObject

 QVariant parseObject()
 {
     QVariantMap result;
     QChar c = next();
     DENG2_ASSERT(c == '{');
     forever
     {
         QString name = parseString().toString();
         c = next();
         if(c != ':') error("object keys and values must be separated by a colon");
         QVariant value = parse();
         // Add to the result.
         result.insert(name, value);
         // Move forward.
         skipWhite();
         c = next();            
         if(c == '}')
         {
             // End of object.
             break;
         }
         else if(c != ',')
         {
             LOG_DEBUG(de::String("got %1 instead of ,").arg(c));
             error("key/value pairs must be separated by comma");
         }
     }
     return result;
 }
开发者ID:gnuzinho,项目名称:Doomsday-Engine,代码行数:29,代码来源:json.cpp


示例8: match

/* verifica se entrada combina com o esperado */
void match(char c){
        if (look != c)
                expected("'%c'", c);

        nextChar();
        skipWhite();
}
开发者ID:daniloluca,项目名称:compiler-c,代码行数:8,代码来源:compiler-string-and-white-space.c


示例9: parseLineDirective

static boolean parseLineDirective (void)
{
	boolean result = FALSE;
	int c = skipWhite ();
	DebugStatement ( const char* lineStr = ""; )

	if (isdigit (c))
开发者ID:acarlson1029,项目名称:ctags,代码行数:7,代码来源:read.c


示例10: skipWhite

bool StreamSource::parseInt( int& val) {
	val = 0;
	bool  pos = true;
	skipWhite();
	if (**this == '-') {
		pos = false;
		++*this;
	}
	if (**this == '+') {
		++*this;
	}
	bool ok = **this >= '0' && **this <= '9';
	int d;
	while (**this >= '0' && **this <= '9') {
		d    = **this - '0';
		assert((val < (INT_MAX/10)
			|| ((val==(INT_MAX/10)) && ((INT_MAX-(val*10))>=d)))
			&& "Integer overflow while parsing");
		val *= 10;
		val += d;
		++*this;
	}
	val = pos ? val : -val;
	return ok;
}
开发者ID:RayHuo,项目名称:iASP,代码行数:25,代码来源:reader.cpp


示例11: stripWhite

void stripWhite(char *s)
{
	const char *t = s;
	skipWhite(&t);
	if (t > s)
		strmove(s, t);
trimWhite(s);
}				/* stripWhite */
开发者ID:georgesilva,项目名称:edbrowse,代码行数:8,代码来源:stringfile.c


示例12: parseLineDirective

static bool parseLineDirective (char *s)
{
	bool result = false;

	skipWhite (&s);
	DebugStatement ( const char* lineStr = ""; )

	if (isdigit (*s))
开发者ID:pragmaware,项目名称:ctags,代码行数:8,代码来源:read.c


示例13: getWhDelimString

//string parsing
Bool getWhDelimString(char *&list, Str& firstPart)
{
    skipWhite(list);
    if (!*list) return FALSE;
    char *list_was = list;
    for(; *list && !isWhite(*list); list++);
    firstPart.nset(list_was, (int)(list - list_was));
    return TRUE;
}
开发者ID:alepharchives,项目名称:Sablotron,代码行数:10,代码来源:base.cpp


示例14: restoreString

// assume called when tokenEnd on close quote of name
bool JsonScanner::thisValue(char type) {
    restoreString();
    char *at = skipWhite(tokenEnd + 1);
    if(*at == ':') {
        at = skipWhite(at + 1);
        if(*at == type) {
            if(type == STRING_TYPE) {
                return scanString(at);
            }
            else { // array
                tokenStart = at;
                return true;
            }
        }
    }

    return false;
}
开发者ID:RobertLeyland,项目名称:chirpino,代码行数:19,代码来源:JsonScanner.cpp


示例15: processFunction

static void processFunction (tokenInfo *const token)
{
	int c;
	tokenInfo *classType;

	/* Search for function name
	 * Last identifier found before a '(' or a ';' is the function name */
	c = skipWhite (vGetc ());
	do
	{
		readIdentifier (token, c);
		c = skipWhite (vGetc ());
		/* Identify class type prefixes and create respective context*/
		if (isLanguage (Lang_systemverilog) && c == ':')
		{
			c = vGetc ();
			if (c == ':')
			{
				verbose ("Found function declaration with class type %s\n", vStringValue (token->name));
				classType = newToken ();
				vStringCopy (classType->name, token->name);
				classType->kind = K_CLASS;
				createContext (classType);
				currentContext->classScope = TRUE;
			}
			else
			{
				vUngetc (c);
			}
		}
	} while (c != '(' && c != ';' && c != EOF);

	if ( vStringLength (token->name) > 0 )
	{
		verbose ("Found function: %s\n", vStringValue (token->name));

		/* Create tag */
		createTag (token);

		/* Get port list from function */
		processPortList (c);
	}
}
开发者ID:Luoben,项目名称:ctags,代码行数:43,代码来源:verilog.c


示例16: tagNameList

static void tagNameList (const verilogKind kind, int c)
{
	vString *name = vStringNew ();
	bool repeat;
	Assert (isIdentifierCharacter (c));
	do
	{
		repeat = false;
		if (isIdentifierCharacter (c))
		{
			readIdentifier (name, c);
			makeSimpleTag (name, VerilogKinds, kind);
		}
		else
			break;
		c = skipWhite (vGetc ());
		if (c == '[')
			c = skipPastMatch ("[]");
		c = skipWhite (c);
		if (c == '=')
		{
			c = skipWhite (vGetc ());
			if (c == '{')
				skipPastMatch ("{}");
			else
			{
				do
					c = vGetc ();
				while (c != ','  &&  c != ';');
			}
		}
		if (c == ',')
		{
			c = skipWhite (vGetc ());
			repeat = true;
		}
		else
			repeat = false;
	} while (repeat);
	vStringDelete (name);
	vUngetc (c);
}
开发者ID:ParrotSec,项目名称:geany,代码行数:42,代码来源:verilog.c


示例17: skipWhite

char *
MIFrfile::getWord()
{
  static char Word[LineMax];
  char *cptr = Word;
  int ch;

  skipWhite();
  while ((ch = getChar()) != EOF) {
    if (isalnum(ch))
      *cptr++ = ch;
    else {
      ungetChar(ch);
      break;
    }
  }
  *cptr = '\0';
  skipWhite();
  return Word;
}
开发者ID:omsys-dev,项目名称:original-source,代码行数:20,代码来源:drmiffl.cpp


示例18: 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


示例19: findTag

static void findTag (vString *const name)
{
	const verilogKind kind = (verilogKind) lookupKeyword (vStringValue (name), Lang_verilog);
	if (kind == K_CONSTANT && vStringItem (name, 0) == '`')
	{
		/* Bug #961001: Verilog compiler directives are line-based. */
		int c = skipWhite (vGetc ());
		readIdentifier (name, c);
		makeSimpleTag (name, VerilogKinds, kind);
		/* Skip the rest of the line. */
		do {
			c = vGetc();
		} while (c != '\n');
		vUngetc (c);
	}
	else if (kind != K_UNDEFINED)
	{
		int c = skipWhite (vGetc ());

		/* Many keywords can have bit width.
		*   reg [3:0] net_name;
		*   inout [(`DBUSWIDTH-1):0] databus;
		*/
		if (c == '(')
			c = skipPastMatch ("()");
		c = skipWhite (c);
		if (c == '[')
			c = skipPastMatch ("[]");
		c = skipWhite (c);
		if (c == '#')
		{
			c = vGetc ();
			if (c == '(')
				c = skipPastMatch ("()");
		}
		c = skipWhite (c);
		if (isIdentifierCharacter (c))
			tagNameList (kind, c);
	}
}
开发者ID:ParrotSec,项目名称:geany,代码行数:40,代码来源:verilog.c


示例20: create

static asynStatus create(void *drvPvt,asynUser *pasynUser,
                         const char *drvInfo, const char **pptypeName,size_t *psize)
{
    const char *pnext;
    long  reason = 0;

    if(!drvInfo) {
        reason = 0;
    } else {
        char *endp;

        pnext = skipWhite(drvInfo);
        if(strlen(pnext)==0) {
            reason = 0;
        } else {
            pnext = strstr(pnext,"reason");
            if(!pnext) goto error;
            pnext += strlen("reason");
            pnext = skipWhite(pnext);
            if(*pnext!='(') goto error;
            pnext++;
            pnext = skipWhite(pnext);
            errno = 0;
            reason = strtol(pnext,&endp,0);
            if(errno) {
                printf("strtol failed %s\n",strerror(errno));
                goto error;
            }
        }
    }
    pasynUser->reason = reason;
    if(pptypeName) *pptypeName = testDriverReason;
    if(psize) *psize = sizeof(int);
    return asynSuccess;
error:
    printf("asynDrvUser failed. got |%s| expecting reason(<int>)\n",drvInfo);
    epicsSnprintf(pasynUser->errorMessage,pasynUser->errorMessageSize,
                  "asynDrvUser failed. got |%s| expecting reason(<int>)",drvInfo);
    return asynError;
}
开发者ID:ukaea,项目名称:epics,代码行数:40,代码来源:uint32DigitalDriver.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ skipWhiteSpace函数代码示例发布时间:2022-05-30
下一篇:
C++ skipSpaces函数代码示例发布时间: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