static boolean parseFeature (tokenInfo *const token) { boolean found = FALSE; while (readFeatureName (token)) { found = TRUE; #ifndef TYPE_REFERENCE_TOOL makeEiffelFeatureTag (token); #endif readToken (token); if (isType (token, TOKEN_COMMA)) readToken (token); } if (found) { if (isType (token, TOKEN_OPEN_PAREN)) /* arguments? */ parseArguments (token); if (isType (token, TOKEN_COLON)) /* a query? */ parseEntityType (token); if (isKeyword (token, KEYWORD_obsolete)) { readToken (token); if (isType (token, TOKEN_STRING)) readToken (token); } if (isKeyword (token, KEYWORD_is)) findFeatureEnd (token); } return found; }
static void parseLocal (tokenInfo *const token) { Assert (isKeyword (token, KEYWORD_local)); readToken (token); /* Check keyword first in case local clause is empty */ while (! isKeyword (token, KEYWORD_do) && ! isKeyword (token, KEYWORD_once) && ! isType (token, TOKEN_EOF)) { if (isType (token, TOKEN_IDENTIFIER)) makeEiffelLocalTag (token); readToken (token); if (isType (token, TOKEN_COLON)) parseEntityType (token); } }
static void parseArguments (tokenInfo *const token) { #ifndef TYPE_REFERENCE_TOOL findToken (token, TOKEN_CLOSE_PAREN); readToken (token); #else Assert (isType (token, TOKEN_OPEN_PAREN)); readToken (token); do { if (isType (token, TOKEN_COLON)) parseEntityType (token); else readToken (token); } while (! isType (token, TOKEN_CLOSE_PAREN)); readToken (token); #endif }