flush
[m6w6/ext-psi] / src / parser_proc.y
index efffcf79fdc0061da00aa89c609190d9d8cb0cc1..62e8011992d36fa3d6acb530a0b1e0f3002f7fa2 100644 (file)
@@ -17,6 +17,9 @@
 %syntax_error {
        PSI_ParserSyntaxError(P, P->fn, P->line, "Unexpected token '%s'", TOKEN->text);
 }
 %syntax_error {
        PSI_ParserSyntaxError(P, P->fn, P->line, "Unexpected token '%s'", TOKEN->text);
 }
+
+%nonassoc NAME.
+
 file ::= blocks.
 
 blocks ::= block.
 file ::= blocks.
 
 blocks ::= block.
@@ -240,6 +243,11 @@ decl_type(type_) ::= NAME(T). {
        type_ = init_decl_type(T->type, T->text);
        free(T);
 }
        type_ = init_decl_type(T->type, T->text);
        free(T);
 }
+decl_type(type_) ::= STRUCT(S) NAME(T). {
+       type_ = init_decl_type(S->type, T->text);
+       free(S);
+       free(T);
+}
 
 %type impl {impl*}
 %destructor impl {free_impl($$);}
 
 %type impl {impl*}
 %destructor impl {free_impl($$);}