PEG parsing progresses from top to down like LL(n) parsing. Thus, its behavior is similar with LL grammars. So, PEG cannot deal with left-recursive definition and it will cause stack overflow at run time.
The stack overflow is serious problem because it occurs at run time and makes target application crash.
To avoid such crash, static diagnosis is effective. So, the PEG parser should check the left-recursive definition on parsing.
As implementation changed from one-pass parsing to two-pass using parsed syntax treee, it will analyze such left-recursive. I would make it...
No comments:
Post a Comment