Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I wouldn't quite put it that way, because PEGs are defined abstractly, not in terms of any particular parsing method.

I thought one of the core things in PEGs was ordered choice, which implies execution order. Packrat parsing is just a space vs. speed tradeoff, converting super-linear time (thanks to backtracking) into linear time with linear space (thanks to memoization). Are there PEGs that have unordered choice? (lpeg doesn't)

> It gives you no help in understanding whether any of your language's productions are ambiguous to a user.

Point taken.



> Are there PEGs that have unordered choice? (lpeg doesn't)

No, PEGs are defined in terms of ordered choice. All I'm saying is that they are not defined in terms of one particular algorithm that implements ordered choice. That's why I objected to the characterization that PEGs have their ambiguity resolved "by implementation." That's inaccurate; their ambiguity is resolved by definition, not by implementation. PEGs are unambiguous even if there is no parsing implementation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: