-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
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.
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.