Temporarily splice the class's ivar chain into the symbol table.

The root class's ivar symbol table needs to be connected to the global
symbol table while building the current class's ivar symbol table. This
allows access to other classes and typedefs.
This commit is contained in:
Bill Currie 2011-02-03 18:02:49 +09:00
parent 79df3d2cca
commit 2203903bb2
1 changed files with 11 additions and 3 deletions

View File

@ -1353,15 +1353,23 @@ protocol_list
; ;
ivar_decl_list ivar_decl_list
: /* */ : /* empty */
{ {
symtab_t *tab, *ivars;
ivars = class_new_ivars ($<class>0);
for (tab = ivars; tab->parent; tab = tab->parent)
;
$<symtab>$ = tab;
tab->parent = current_symtab;
current_symtab = ivars;
current_visibility = vis_protected; current_visibility = vis_protected;
current_symtab = class_new_ivars ($<class>0);
} }
ivar_decl_list_2 ivar_decl_list_2
{ {
$$ = current_symtab; $$ = current_symtab;
current_symtab = $$->parent; current_symtab = $<symtab>1->parent;
$<symtab>1->parent = 0;
build_struct ('s', 0, $$, 0); build_struct ('s', 0, $$, 0);
} }