4 ms·
Well yeah if the grammar you wrote doesn't match what you intended to write then it's not going to work. Not sure how that's saying anything useful though? If
by chrisseaton 5y ago
Well yeah if the grammar you wrote doesn't match what you intended to write then it's not going to work.
Not sure how that's saying anything useful though? If you write the wrong grammar with any parsing system it's also not going to work.
- frabert 5y agoMost other parser generator systems give you indication that what you're writing is probably wrong, by stating e.g. that a grammar is ambiguous. S := A '+' A | A '*' A A := ... If you do that in most PEG systems I've tried, you're just going to get the wrong result with no indication of what might have gone wrong, unless you know where to look.
- chrisseaton 5y agoBut that's the point - other parsing systems let you design an ambiguous language and then tell you about it. PEGs don't let you design an ambiguous language in the first place. Unambiguous by construction.