1.. _full-grammar-specification: 2 3Full Grammar specification 4========================== 5 6This is the full Python grammar, derived directly from the grammar 7used to generate the CPython parser (see :source:`Grammar/python.gram`). 8The version here omits details related to code generation and 9error recovery. 10 11The notation is a mixture of `EBNF 12<https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form>`_ 13and `PEG <https://en.wikipedia.org/wiki/Parsing_expression_grammar>`_. 14In particular, ``&`` followed by a symbol, token or parenthesized 15group indicates a positive lookahead (i.e., is required to match but 16not consumed), while ``!`` indicates a negative lookahead (i.e., is 17required *not* to match). We use the ``|`` separator to mean PEG's 18"ordered choice" (written as ``/`` in traditional PEG grammars). See 19:pep:`617` for more details on the grammar's syntax. 20 21.. literalinclude:: ../../Grammar/python.gram 22 :language: peg 23