Skip to content

clarify ambiguous nonterminal references in recursive productions using "the derived" #3749

@michaelficarra

Description

@michaelficarra

In cases where an algorithm refers to a nonterminal that is used more than once in a production, we should use language that disambiguates the reference. For cases where the nonterminal appears multiple times on the RHS, we always use "the first", "the second", etc. for this. For cases where the nonterminal appears on both the LHS and the RHS, we sometimes but not always use "the derived" to make it clear we're referring to the occurrence on the RHS.

Image

I think we should always use this phrasing. You can find the 150-ish productions that require this phrasing by running the following in the console with the spec open:

$$('emu-clause[type=sdo] > emu-grammar:has(+ emu-alg) > emu-production').filter(p => [...p.querySelectorAll('emu-rhs emu-nt')].map(nt => nt.innerText).includes(p.children[0].innerText)).filter(p => [...p.parentNode.nextElementSibling.querySelectorAll('emu-nt')].map(nt => nt.innerText).includes(p.children[0].innerText))

This finds any SDO definition over a production that has a nonterminal that appears on both sides of the production and also in the associated algorithm steps.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions