U ifQ@sdZdZddgZddlZddlZddlZddlZddlZddlm Z m Z m Z m Z m Z GdddeZd d ZdddZddZddZddZedkreee dS)zZParser driver. This provides a high-level interface to parse a file into a syntax tree. z#Guido van Rossum Driver load_grammarN)grammarparsetokentokenizepgenc@sHeZdZdddZdddZdddZdd d Zdd d Zdd dZdS)rNcCs&||_|dkrt}||_||_dS)N)rlogging getLoggerloggerconvert)selfrr r r9/opt/alt/python38/lib64/python3.8/lib2to3/pgen2/driver.py__init__s zDriver.__init__FcCst|j|j}|d}d}d}}}} } d} |D]8} | \}}}} } |||fkr||f|ksxt||f|f|\} }|| kr| d| |7} | }d}||kr| | ||7} |}|tjtjfkr| |7} | \}}| dr<|d7}d}q<|t j kr tj |}|r(|j dt j||| |||| |frT|rN|j dqd} | \}}| dr<|d7}d}qargvr Z basicConfigINFOstdoutr)argsr@rrrmains ra__main__)rDNTFN)__doc__ __author____all__r-r8r rUr>rrrrrr objectrrCrrErZrar4exitintrrrrs(M