Your IP : 52.15.191.241
�
^
bc @ s d Z d Z d d g Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m
Z
m Z m Z m
Z
m Z d e f d � � YZ d � Z d
d e e d d � Z d � Z d
� Z d � Z e d k r e j e e � � � n d S( sZ Parser driver.
This provides a high-level interface to parse a file into a syntax tree.
s# Guido van Rossum <guido@python.org>t Drivert load_grammari����Ni ( t grammart parset tokent tokenizet pgenc B sV e Z d d d � Z e d � Z e d � Z e d � Z d e d � Z e d � Z RS( c C s: | | _ | d k r$ t j � } n | | _ | | _ d S( N( R t Nonet loggingt getLoggert loggert convert( t selfR R R
( ( s9 /opt/alt/python27/lib64/python2.7/lib2to3/pgen2/driver.pyt __init__ s
c C s t j | j | j � } | j � d } d } d } } } } }
d } x�| D]�} | \ } } } } }
| | | f k r� | \ }
} | |
k r� | d |
| 7} |
} d } n | | k r� | |
| | !7} | } q� n | t j t j f k r6| | 7} | \ } } | j d � rQ | d 7} d } qQ qQ n | t
j k rUt j | } n | r~| j
j d t
j | | | � n | j | | | | f � r�| r�| j
j d � n Pn d } | \ } } | j d � rQ | d 7} d } qQ qQ Wt j d | | | | f � � | j S(
s4 Parse a series of tokens and return the syntax tree.i i u s
s %s %r (prefix=%r)s Stop.t s incomplete inputN( R t ParserR R t setupR R t COMMENTt NLt endswithR t OPt opmapR
t debugt tok_namet addtokent
ParseErrort rootnode( R t tokensR t pt linenot columnt typet valuet startt endt line_textt prefixt quintuplet s_linenot s_column( ( s9 /opt/alt/python27/lib64/python2.7/lib2to3/pgen2/driver.pyt parse_tokens'