Extended attributes in the grammar (was: Re: [WebIDL] Java package mapping)

Kartikaya Gupta:
> > Also, I'm not sure if this matters, but while implementing I
> > realized that having both [TheExtendedAttribute=identifier] and
> > [TheExtendedAttribute=ScopedName] leads to an ambiguous grammar, since
> > [foo=bar] can be interpreted as both.

Cameron McCormack:
> Indeed, that’s part of why I’ve held off updating the grammar.  I plan
> to change the grammar to parse any balanced content between commas in
> square brackets as an ExtendedAttribute, and to then have rules like:
> 
>   ExtendedAttributeScopedName → identifier "=" ScopedName

I’ve done this now:

  http://dev.w3.org/2006/webapi/WebIDL/#idl-extended-attributes
  http://dev.w3.org/2006/webapi/WebIDL/#idl-grammar

Since ExtendedAttributeIdentifier and friends will never appear in a
derivation of Definitions, the main parsing of the IDL fragment won’t
have ambiguities.  The second pass, where the extended attribute forms
are determined will, but I expect it would be easier to do ad-hoc
parsing here instead of using the productions directly.

Thanks,

Cameron

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Wednesday, 3 December 2008 01:13:40 UTC