|
|
|
|
|
by chrisseaton
1420 days ago
|
|
If you choose to specify your language using a class of grammar which permits ambiguity, then you have to resolve that ambiguity. If instead you choose to specify your language using a class of grammar which does not permit ambiguity, then you don't have to resolve it because it never existed. That's the point. The suggestion is to either specify your language using a formal grammar which does not permit ambiguity, or to specify your language imperatively, using a reference parser. I've written many parsers, both using parser generators and manually. I'd choose to write one manually. In fact, I'm currently looking at a project at work right now to take a generated parser and to re-write it manually because it's easier to work with. That's a pretty mainstream opinion amongst professionals in the industry - not sure why you think it's surreal or why it's throwing you. |
|
I added an edit after which you may not have seen:
So what grammar can you suggest that's even weaker than context-free (to make expressions of ambiguity impossible) and still useful?> I'd choose to write one manually
Matter of taste I guess.