bool tokenSkipToType (tokenInfo *token, tokenType t) { while (! (TOKEN_IS_EOF (token) || token->type == t)) tokenRead (token); return (token->type == t)? true: false; }
static void parseMethod (tokenInfo *token, int owner) { tokenRead (token); if (tokenIsType (token, TCL_IDENTIFIER)) { tagEntryInfo e; initTagEntry(&e, vStringValue (token->string), K_METHOD); e.extensionFields.scopeIndex = owner; makeTagEntry (&e); } skipToEndOfTclCmdline (token); }
static void parseSuperclass (tokenInfo *token, int this_class) { tokenRead (token); if (tokenIsType (token, TCL_IDENTIFIER)) { tagEntryInfo *e = getEntryInCorkQueue(this_class); if (e) { if (e->extensionFields.inheritance) { /* superclass is used twice in a class. */ eFree ((void *)e->extensionFields.inheritance); } e->extensionFields.inheritance = eStrdup(tokenString(token)); } } skipToEndOfTclCmdline (token); }
bool tokenSkipOverPair (tokenInfo *token) { int start = token->type; int end = token->klass->typeForUndefined; int i; for (i = 0; i < token->klass->pairCount; i++) if (start == token->klass->pairs[i].start) end = token->klass->pairs[i].end; if (end == token->klass->typeForUndefined) return false; int depth = 1; do { tokenRead (token); if (token->type == start) depth ++; else if (token->type == end) depth--; } while ((!TOKEN_IS_EOF(token)) && (depth > 0)); return (depth == 0)? true: false; }