Re: Widl: Conditionals, Dotted Versions, Handles
Ove Kaaven <ovek(a)arcticnet.no> 04/18/04 15:25 PM >>> lør, 17.04.2004 kl. 18.53 skrev Robert Shearman: Hi,
This patch adds support for several features I found lacking whilst attempting to generate headers for RPC interfaces.
Is this needed?
@@ -350,6 +354,7 @@ | tSWITCHTYPE '(' type ')' { $$ = make_attrp(ATTR_SWITCHTYPE, type_ref($3)); } | tUUID '(' aUUID ')' { $$ = make_attrp(ATTR_UUID, $3); } | tV1ENUM { $$ = make_attr(ATTR_V1ENUM); } + | tVERSION '(' version '.' version ')' { $$ = make_attrv2(ATTR_VERSION, $3, $5); } | tVERSION '(' version ')' { $$ = make_attrv(ATTR_VERSION, $3); } | tWIREMARSHAL '(' type ')' { $$ = make_attrp(ATTR_WIREMARSHAL, type_ref($3)); } | pointer_type { $$ = make_attrv(ATTR_POINTERTYPE, $1); }
Doesn't the "version" rule already handle this?
It would appear not. The 'version' type is declared as a number further up and when it attempts to parse a dotted version it just returns 0. Rob
man, 19.04.2004 kl. 17.03 skrev Robert Shearman:
Doesn't the "version" rule already handle this?
It would appear not. The 'version' type is declared as a number further up
It's declared that the rule *returns* a number, you mean. The actual rule is defined as version: aNUM { $$ = MAKELONG($1, 0); } | aNUM '.' aNUM { $$ = MAKELONG($1, $3); } ; Now if this somehow returns 0, then you need to fix that rule, not add another rule which makes a version of e.g. "1.2.3.4" valid syntax (but still return a wrong result).
participants (2)
-
Ove Kaaven -
Robert Shearman