本文整理汇总了C++中skipWhite函数的典型用法代码示例。如果您正苦于以下问题:C++ skipWhite函数的具体用法?C++ skipWhite怎么用?C++ skipWhite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了skipWhite函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
}
示例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();
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例8: match
/* verifica se entrada combina com o esperado */
void match(char c){
if (look != c)
expected("'%c'", c);
nextChar();
skipWhite();
}
示例9: parseLineDirective
static boolean parseLineDirective (void)
{
boolean result = FALSE;
int c = skipWhite ();
DebugStatement ( const char* lineStr = ""; )
if (isdigit (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;
}
示例11: stripWhite
void stripWhite(char *s)
{
const char *t = s;
skipWhite(&t);
if (t > s)
strmove(s, t);
trimWhite(s);
} /* stripWhite */
示例12: parseLineDirective
static bool parseLineDirective (char *s)
{
bool result = false;
skipWhite (&s);
DebugStatement ( const char* lineStr = ""; )
if (isdigit (*s))
示例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;
}
示例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;
}
示例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);
}
}