diff --git a/src/tools/rc/docs/grammar.html b/src/tools/rc/docs/grammar.html index 0d473ea48a..b67c5292d3 100644 --- a/src/tools/rc/docs/grammar.html +++ b/src/tools/rc/docs/grammar.html @@ -283,6 +283,8 @@ resource mytype 123;
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.
+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!
+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.
diff --git a/src/tools/rc/parser.y b/src/tools/rc/parser.y index 5eec2cd328..fc658253db 100644 --- a/src/tools/rc/parser.y +++ b/src/tools/rc/parser.y @@ -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)); } diff --git a/src/tools/rc/tests/expr.rdef b/src/tools/rc/tests/expr.rdef index 589b1d0d7a..618cb29a3d 100644 --- a/src/tools/rc/tests/expr.rdef +++ b/src/tools/rc/tests/expr.rdef @@ -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;