示例#1
0
文件: parser.c 项目: shunting1986/scc
/*
 * Parse either declarator or abstract declarator
 */
struct declarator *parse_declarator(struct parser *parser) {
	int old_disable_typedef = lexer_push_config(parser->lexer, disable_typedef, 1);
	struct dynarr *ptr_list = parse_pointer(parser);
	struct direct_declarator *direct_declarator = parse_direct_declarator(parser);
	struct declarator *declarator = declarator_init();
	declarator->ptr_list = ptr_list;
	declarator->direct_declarator = direct_declarator;
	lexer_pop_config(parser->lexer, disable_typedef, old_disable_typedef);
	return declarator;
}
示例#2
0
void CAipi_ExpParser::declarator_list_init()
{
	declarator_init();
	
	if( m_lookahead == COMMA )
	{
		while ( m_lookahead == COMMA )
		{
			getToken();
			declarator_init();
		}
	}
	
	//Multidimensional arrays
	if( m_lookahead == OPEN_BRACKET )
	{
		declarator_init();
	}
	

}