What are the differences between PEGs and CFGs?

前端 未结 2 584
耶瑟儿~
耶瑟儿~ 2021-01-30 13:30

From this wikipedia page:

The fundamental difference between context-free grammars and parsing expression grammars is that the PEG\'s choice operato

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 14:07

    I think you're confusing CFG with LR and with ambiguity. Grammars are not deterministic/nondeterministic, though their parsers may be. An ambiguous grammar is still CFG if it complies with the definition, and a deterministic parser can be built for it doing what PEG does.

提交回复
热议问题