/* cppparser_scan */ int cppparser_scan(CppParser * cp, Token ** token) { if(cp->subparser != NULL) { if(cppparser_scan(cp->subparser, token) != 0) return 1; if(*token != NULL) return 0; cppparser_delete(cp->subparser); /* end of file */ cp->subparser = NULL; } return parser_get_token(cp->parser, token); }
static struct token *token_read(struct parser_context *context) { return parser_get_token(context->p_tokens, context->p_position++); }
static int token_match(struct parser_context *context, token_type type) { struct token *tok = parser_get_token(context->p_tokens, context->p_position); return tok != NULL && tok->type == type; }