-
I understand that PEST uses PEG as a formal language grammar. My understanding is that PEG is just the grammar type, and there are multiple algorithms to parse PEGs. (Just like LL(1) LALR(1) can both parse context-free grammars*). In my reading of the PEST documentation I can't find a clear answer to which PEG parser algorithm PEST actually implements. Am I missing something? * I understand that LALR(1) and LL(1) can't actually parse all of context-free grammars. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
pest's grammar isn't a vanilla PEG but has a few ad-hoc extensions (such as the symbol stack operations)
it's more or less using a plain recursive descent, not the Packrat parsing algorithm. According to @dragostis , even though Packrat has better theoretical bounds, it had a bigger performance overhead for common grammars, so it wasn't worth it.