2 ms·
It takes fairly small extensions to BNF, though. When I write parser generators (sentences I didn't think I'd write, but it's been quite a few), there are a few
by vidarh 3y ago
It takes fairly small extensions to BNF, though. When I write parser generators (sentences I didn't think I'd write, but it's been quite a few), there are a few things I'd often add extra constructs for. One being lists (term = value ("," term)? or variants occur often enough that introducing a list syntax that reduces pointless recursion is helpful), and other being patterns, e.g. when defining operator precedence, which I'm guessing is what you're thinking of?
Being able to recursively generate a rule-set where each level takes the head of a list is very useful.