Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve extended attribute ambiguity #8

Open
sgodwincs opened this issue Jun 27, 2017 · 0 comments
Open

Resolve extended attribute ambiguity #8

sgodwincs opened this issue Jun 27, 2017 · 0 comments

Comments

@sgodwincs
Copy link
Owner

Currently, due to an ambiguity between different patterns of extended attributes, the current parser is not as expressive as it should be as defined by the official grammar. This is due to an ambiguity that arises between specific patterns of extended attributes and the generalized form. For example:

[Attribute=Attribute=Attribute]

is an extended attribute that could be parsed in multiple ways if the general and specific patterns were mixed. I'm not sure how to resolve these ambiguities in the grammar using larlpop, so for now I've traded expressiveness with ease of use. The WebIDL specification states that it only uses 5 specific patterns of extended attributes which are all able to be parsed currently. But, an example from the Mozilla repository shows that this is not enough to be able to parse the entire file. Specifically, that file uses extended attributes of the form [Identifier=StringLiteral] but this is not one of the common patterns mentioned in the specification.

Because of this, I have slightly extended the grammar to also support extended attributes of the form [Other] and [Identifier=Other] which seems to be enough to parse the above file. But there still may be other files in the Mozilla repository that cannot be parsed. I will be writing tests to parse all the files in that directory and see if it can handle them all.

Ideally this ambiguity would be resolved, but I'm not sure how to resolve it, so this is the current workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant