# Path: ayrton/parser/pyparser/future.py
# class FutureFlags(object):
# class TokenIterator:
#     def __init__(self, version):
#     def get_flag_names(self, space, flags):
#     def get_compiler_feature(self, name):
#     def __init__(self, tokens):
#     def next(self):
#     def skip(self, n):
#     def skip_name(self, name):
#     def next_feature_name(self):
#     def skip_newlines(self):
# def add_future_flags(future_flags, tokens):
# 
# Path: ayrton/parser/pyparser/parser.py
# class Grammar(object):
# class Node(object):
# class ParseError(Exception):
# class Parser(object):
#     def __init__(self):
#     def shared_copy(self):
#     def _freeze_(self):
#     def __init__(self, type, value, children, lineno, column):
#     def __eq__(self, other):
#     def __repr__(self):
#     def __init__(self, msg, token_type, value, lineno, column, line,
#                  expected=-1):
#     def __str__(self):
#     def __init__(self, grammar):
#     def prepare(self, start=-1):
#     def add_token(self, token_type, value, lineno, column, line):
#     def classify(self, token_type, value, lineno, column, line):
#     def shift(self, next_state, token_type, value, lineno, column):
#     def push(self, next_dfa, next_state, node_type, lineno, column):
#     def pop(self):
# 
# Path: ayrton/parser/pyparser/pytokenizer.py
# NAMECHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_'
# NUMCHARS = '0123456789'
# ALNUMCHARS = NAMECHARS + NUMCHARS
# EXTENDED_ALNUMCHARS = ALNUMCHARS + '-.'
# WHITESPACES = ' \t\n\r\v\f'
# def match_encoding_declaration(comment):
# def verify_identifier(token):
# def generate_tokens(lines, flags):
# 
# Path: ayrton/parser/pyparser/pygram.py
# class PythonGrammar(parser.Grammar):
# class _Tokens(object):
# class _Symbols(object):
#     KEYWORD_TOKEN = pytoken.python_tokens["NAME"]
#     TOKENS = pytoken.python_tokens
#     OPERATOR_MAP = pytoken.python_opmap
# def _get_python_grammar():
# 
# Path: ayrton/parser/pyparser/error.py
# class SyntaxError(Exception):
# class IndentationError(SyntaxError):
# class TabError(IndentationError):
# class ASTError(Exception):
# class TokenError(SyntaxError):
# class TokenIndentationError(IndentationError):
#     def __init__(self, msg, lineno=0, offset=0, text=None, filename=None,
#                  lastlineno=0):
#     def wrap_info(self, space):
#     def __str__(self):
#     def __init__(self, lineno=0, offset=0, text=None, filename=None,
#                  lastlineno=0):
#     def __init__(self, msg, ast_node ):
#     def __init__(self, msg, line, lineno, column, tokens, lastlineno=0):
#     def __init__(self, msg, line, lineno, column, tokens):
# 
# Path: ayrton/parser/astcompiler/consts.py
# CO_OPTIMIZED = 0x0001
# CO_NEWLOCALS = 0x0002
# CO_VARARGS = 0x0004
# CO_VARKEYWORDS = 0x0008
# CO_NESTED = 0x0010
# CO_GENERATOR = 0x0020
# CO_NOFREE = 0x0040
# CO_COROUTINE = 0x0080
# CO_ITERABLE_COROUTINE = 0x0100    # set by @types.coroutine
# CO_GENERATOR_ALLOWED = 0x1000
# CO_FUTURE_DIVISION = 0x2000
# CO_FUTURE_ABSOLUTE_IMPORT = 0x4000
# CO_FUTURE_WITH_STATEMENT = 0x8000
# CO_FUTURE_PRINT_FUNCTION = 0x10000
# CO_FUTURE_UNICODE_LITERALS = 0x20000
# CO_FUTURE_BARRY_AS_BDFL = 0x40000
# CO_FUTURE_GENERATOR_STOP = 0x80000
# CO_KILL_DOCSTRING = 0x100000
# CO_YIELD_INSIDE_TRY = 0x200000
# FVC_MASK      = 0x3
# FVC_NONE      = 0x0
# FVC_STR       = 0x1
# FVC_REPR      = 0x2
# FVC_ASCII     = 0x3
# FVS_MASK      = 0x4
# FVS_HAVE_SPEC = 0x4


from ayrton.parser.error import OperationError
from ayrton.parser.pyparser import future, parser, pytokenizer, pygram, error
from ayrton.parser.astcompiler import consts
                tokens_stream = iter(tokens)

                for tp, value, lineno, column, line in tokens_stream:
                    if self.add_token(tp, value, lineno, column, line):
                        break

                if compile_info.mode == 'single':
                    for tp, value, lineno, column, line in tokens_stream:
                        if tp == pygram.tokens.ENDMARKER:
                            break
                        if tp == pygram.tokens.NEWLINE:
                            continue

                        if tp == pygram.tokens.COMMENT:
                            for tp, _, _, _, _ in tokens_stream:
                                if tp == pygram.tokens.NEWLINE:
                                    break
                        else:
                            new_err = error.SyntaxError
                            msg = ("multiple statements found while "
                                   "compiling a single statement")
                            raise new_err(msg, lineno, column,
                                          line, compile_info.filename)

            except error.TokenError as e:
                e.filename = compile_info.filename
                raise
            except error.TokenIndentationError as e:
                e.filename = compile_info.filename
                raise

# Path: ayrton/parser/pyparser/future.py
# class FutureFlags(object):
# class TokenIterator:
#     def __init__(self, version):
#     def get_flag_names(self, space, flags):
#     def get_compiler_feature(self, name):
#     def __init__(self, tokens):
#     def next(self):
#     def skip(self, n):
#     def skip_name(self, name):
#     def next_feature_name(self):
#     def skip_newlines(self):
# def add_future_flags(future_flags, tokens):
# 
# Path: ayrton/parser/pyparser/parser.py
# class Grammar(object):
# class Node(object):
# class ParseError(Exception):
# class Parser(object):
#     def __init__(self):
#     def shared_copy(self):
#     def _freeze_(self):
#     def __init__(self, type, value, children, lineno, column):
#     def __eq__(self, other):
#     def __repr__(self):
#     def __init__(self, msg, token_type, value, lineno, column, line,
#                  expected=-1):
#     def __str__(self):
#     def __init__(self, grammar):
#     def prepare(self, start=-1):
#     def add_token(self, token_type, value, lineno, column, line):
#     def classify(self, token_type, value, lineno, column, line):
#     def shift(self, next_state, token_type, value, lineno, column):
#     def push(self, next_dfa, next_state, node_type, lineno, column):
#     def pop(self):
# 
# Path: ayrton/parser/pyparser/pytokenizer.py
# NAMECHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_'
# NUMCHARS = '0123456789'
# ALNUMCHARS = NAMECHARS + NUMCHARS
# EXTENDED_ALNUMCHARS = ALNUMCHARS + '-.'
# WHITESPACES = ' \t\n\r\v\f'
# def match_encoding_declaration(comment):
# def verify_identifier(token):
# def generate_tokens(lines, flags):
# 
# Path: ayrton/parser/pyparser/pygram.py
# class PythonGrammar(parser.Grammar):
# class _Tokens(object):
# class _Symbols(object):
#     KEYWORD_TOKEN = pytoken.python_tokens["NAME"]
#     TOKENS = pytoken.python_tokens
#     OPERATOR_MAP = pytoken.python_opmap
# def _get_python_grammar():
# 
# Path: ayrton/parser/pyparser/error.py
# class SyntaxError(Exception):
# class IndentationError(SyntaxError):
# class TabError(IndentationError):
# class ASTError(Exception):
# class TokenError(SyntaxError):
# class TokenIndentationError(IndentationError):
#     def __init__(self, msg, lineno=0, offset=0, text=None, filename=None,
#                  lastlineno=0):
#     def wrap_info(self, space):
#     def __str__(self):
#     def __init__(self, lineno=0, offset=0, text=None, filename=None,
#                  lastlineno=0):
#     def __init__(self, msg, ast_node ):
#     def __init__(self, msg, line, lineno, column, tokens, lastlineno=0):
#     def __init__(self, msg, line, lineno, column, tokens):
# 
# Path: ayrton/parser/astcompiler/consts.py
# CO_OPTIMIZED = 0x0001
# CO_NEWLOCALS = 0x0002
# CO_VARARGS = 0x0004
# CO_VARKEYWORDS = 0x0008
# CO_NESTED = 0x0010
# CO_GENERATOR = 0x0020
# CO_NOFREE = 0x0040
# CO_COROUTINE = 0x0080
# CO_ITERABLE_COROUTINE = 0x0100    # set by @types.coroutine
# CO_GENERATOR_ALLOWED = 0x1000
# CO_FUTURE_DIVISION = 0x2000
# CO_FUTURE_ABSOLUTE_IMPORT = 0x4000
# CO_FUTURE_WITH_STATEMENT = 0x8000
# CO_FUTURE_PRINT_FUNCTION = 0x10000
# CO_FUTURE_UNICODE_LITERALS = 0x20000
# CO_FUTURE_BARRY_AS_BDFL = 0x40000
# CO_FUTURE_GENERATOR_STOP = 0x80000
# CO_KILL_DOCSTRING = 0x100000
# CO_YIELD_INSIDE_TRY = 0x200000
# FVC_MASK      = 0x3
# FVC_NONE      = 0x0
# FVC_STR       = 0x1
# FVC_REPR      = 0x2
# FVC_ASCII     = 0x3
# FVS_MASK      = 0x4
# FVS_HAVE_SPEC = 0x4


# Path: ayrton/parser/pyparser/pyparse.py
from ayrton.parser.error import OperationError
from ayrton.parser.pyparser import future, parser, pytokenizer, pygram, error
from ayrton.parser.astcompiler import consts

                tokens_stream = iter(tokens)

                for tp, value, lineno, column, line in tokens_stream:
                    if self.add_token(tp, value, lineno, column, line):
                        break

                if compile_info.mode == 'single':
                    for tp, value, lineno, column, line in tokens_stream:
                        if tp == pygram.tokens.ENDMARKER:
                            break
                        if tp == pygram.tokens.NEWLINE:
                            continue

                        if tp == pygram.tokens.COMMENT:
                            for tp, _, _, _, _ in tokens_stream:
                                if tp == pygram.tokens.NEWLINE:
                                    break
                        else:
                            new_err = error.SyntaxError
                            msg = ("multiple statements found while "
                                   "compiling a single statement")
                            raise new_err(msg, lineno, column,
                                          line, compile_info.filename)

            except error.TokenError as e:
                e.filename = compile_info.filename
                raise
            except error.TokenIndentationError as e:
                e.filename = compile_info.filename
                raise

            except parser.ParseError as e: