^^CFG vs PEG.  Context-Free Gram  VS  Parsing Expression Gram.

credits: arxiv/pdf 

CFG ontext-free grammar. Context-sensitive grammar.

 

PEG Parsing Expression Grammars

  1. is an alternative formalism for describing a language’s syntax.
  2. Unlike CFGs, PEGs are unambiguous by construction, and their standard semantics is based on recognizing strings instead of generating them.
  3. PEG can be considered both the specification of a language
    and the specification of a top-down parser for that language.

Personal History. Come ci sono arrivato.

20-8-2020  Davo un'occhiata al sito di Python, ogni qualche mese, per le novita' whatsnew/3.9 e mi ritrovo quasi all'inizio "PEP 617: New Parser", leggo.

Guarda caso !  di recente avevo incontrato Parsing timeline, e cosi' mi sono incuriosito a leggere, e proseguo quando la nota termina con "See PEP 617 for more details".

Tra le ref finali: gvanrossum/peg-parsing-series.

Links

wp/ PEG Parsing_expression_grammar

 

Ambiguous_grammar

Deterministic context-free grammars