Whoops! One of the parser rules was incorrect, making this impossible:

resource app_flags B_FOO | B_BAR;
Sloppy, because allowing this was the reason for making these changes
in the first place ;-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5723 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
mahlzeit 2003-12-22 16:52:14 +00:00
parent eed2e48e69
commit 0ebe713837
3 changed files with 6 additions and 2 deletions

View File

@ -283,6 +283,8 @@ resource mytype 123;</PRE></BLOCKQUOTE>
<P>The unary minus operator is not part of the "expr" (or "data") rules, but of "integer" and "float". This also causes a shift/reduce warning.</P>
<P>And finally, "type" is a member of "data" which is called by "expr". One of the rules of "type" refers back to "expr". This introduces a recursive dependency and a whole bunch of shift/reduce conflicts. Fortunately, it seems to have no bad side effects. Yay!</P>
<H3>Symbol table</H3>
<P>The compiler uses two symbol tables: one for the enum symbols, and one with the data type definitions. We need those tables to find the numeric ID/type definition that corresponds with an identifier, and to make sure that there are no duplicate or missing identifiers. These two symbol tables are independent, so you may use the same identifier both as an enum symbol and a type name.</P>

View File

@ -100,7 +100,7 @@ static void add_resource(id_t, type_code, data_t);
//------------------------------------------------------------------------------
%}
%expect 7
%expect 15
%union
{
@ -398,7 +398,7 @@ type
list_t list; list.count = 0; list.items = NULL;
$$ = make_type($1, list);
}
| IDENT data
| IDENT expr
{
$$ = make_type($1, make_data_list($2));
}

View File

@ -60,3 +60,5 @@ resource(10081) my_int32 my_int32 my_int32; // and so on
resource(10100) B_SINGLE_LAUNCH;
resource(10101) (int8) B_EXCLUSIVE_LAUNCH;
resource(10102) B_MULTIPLE_LAUNCH | B_BACKGROUND_APP | B_ARGV_ONLY;
//resource app_flags B_MULTIPLE_LAUNCH | B_BACKGROUND_APP;