Your IP : 216.73.216.213
Z��Z�/ � @ s� d d l m Z d d l Z e j d e d e d e d e � d d l m Z d d l m Z m Z m
Z
e � Z Gd
d � d e � Z d S)� )�absolute_importN�BOL�EOL�EOF� NOT_FOUND� )�Errors)r r r c @ s� e Z d Z d Z d d d d � Z d d � Z d d � Z d
d � Z d d
� Z d d � Z d d � Z
d d � Z d d d � Z d d � Z
d S)�Scannera�
A Scanner is used to read tokens from a stream of characters
using the token set specified by a Plex.Lexicon.
Constructor:
Scanner(lexicon, stream, name = '')
See the docstring of the __init__ method for details.
Methods:
See the docstrings of the individual methods for more
information.
read() --> (value, text)
Reads the next lexical token from the stream.
position() --> (name, line, col)
Returns the position of the last token read using the
read() method.
begin(state_name)
Causes scanner to change state.
produce(value [, text])
Causes return of a token value to the caller of the
Scanner.
� Nc C s� d | _ d | _ d | _ d | _ d | _ d | _ d | _ d | _ d | _ d | _ d | _
| | _ | | _ | | _
g | _ d | _ | j d � d | _ d | _ d | _ t | _ d | _ | d k r� | d | d | _ | _ d S)a�
Scanner(lexicon, stream, name = '')
|lexicon| is a Plex.Lexicon instance specifying the lexical tokens
to be recognised.
|stream| can be a file object or anything which implements a
compatible read() method.
|name| is optional, and may be the name of the file being
scanned or any other identifying string.
r r
r N� )�trace�buffer�
buf_start_pos�next_pos�cur_pos�cur_line� start_pos�
start_line� start_col�text�
state_name�lexicon�stream�name�queue�
initial_state�begin�cur_line_startr �cur_char�input_state)�selfr r r Zinitial_pos� r! �G/opt/alt/python35/lib64/python3.5/site-packages/Cython/Plex/Scanners.py�__init__H s0
zScanner.__init__c C s� | j } xs | s~ | j � \ | _ } | d k rM | j d � | j � q | j | | j � } | d k r | j | � q W| d } | d =| S)a"
Read the next lexical token from the stream and return a
tuple (value, text), where |value| is the value associated with
the token as specified by the Lexicon, and |text| is the actual
string read from the stream. Returns (None, '') on end of file.
Nr )r �scan_a_tokenr �produce�eofZperform)r r �action�value�resultr! r! r"