# Path: py3kwarn2to3/pgen2/driver.py
# class Driver(object):
#     def __init__(self, grammar, convert=None, logger=None):
#     def parse_tokens(self, tokens, debug=False):
#     def parse_stream_raw(self, stream, debug=False):
#     def parse_stream(self, stream, debug=False):
#     def parse_file(self, filename, encoding=None, debug=False):
#     def parse_string(self, text, debug=False):
# def load_grammar(gt="Grammar.txt", gp=None,
#                  save=True, force=False, logger=None):
# def _newer(a, b):
# 
# Path: py3kwarn2to3/pgen2/literals.py
# def escape(m):
# def evalString(s):
# def test():
# 
# Path: py3kwarn2to3/pgen2/tokenize.py
# def tokenize(readline, tokeneater=printtoken):
#     """
#     The tokenize() function accepts two parameters: one representing the
#     input stream, and one providing an output mechanism for tokenize().
# 
#     The first parameter, readline, must be a callable object which provides
#     the same interface as the readline() method of built-in file objects.
#     Each call to the function should return one line of input as a string.
# 
#     The second parameter, tokeneater, must also be a callable object. It is
#     called once for each token, with five arguments, corresponding to the
#     tuples generated by generate_tokens().
#     """
#     try:
#         tokenize_loop(readline, tokeneater)
#     except StopTokenizing:
#         pass
# 
# Path: py3kwarn2to3/pgen2/grammar.py
# class Grammar(object):
#     def __init__(self):
#     def dump(self, filename):
#     def load(self, filename):
#     def copy(self):
#     def report(self):


import os
    from StringIO import StringIO
    from io import StringIO
from .pgen2 import driver, literals, token, tokenize, parse, grammar
from . import pytree
from . import pygram

__author__ = "Guido van Rossum <guido@python.org>"

# Python imports
try:
except ImportError:

# Fairly local imports

# Really local imports


try:
    unicode
except NameError:
    unicode = str


# The pattern grammar file
_PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__),
                                     "PatternGrammar.txt")


class PatternSyntaxError(Exception):
    pass


def tokenize_wrapper(input):
    """Tokenizes a string suppressing significant whitespace."""
    skip = set((token.NEWLINE, token.INDENT, token.DEDENT))

# Path: py3kwarn2to3/pgen2/driver.py
# class Driver(object):
#     def __init__(self, grammar, convert=None, logger=None):
#     def parse_tokens(self, tokens, debug=False):
#     def parse_stream_raw(self, stream, debug=False):
#     def parse_stream(self, stream, debug=False):
#     def parse_file(self, filename, encoding=None, debug=False):
#     def parse_string(self, text, debug=False):
# def load_grammar(gt="Grammar.txt", gp=None,
#                  save=True, force=False, logger=None):
# def _newer(a, b):
# 
# Path: py3kwarn2to3/pgen2/literals.py
# def escape(m):
# def evalString(s):
# def test():
# 
# Path: py3kwarn2to3/pgen2/tokenize.py
# def tokenize(readline, tokeneater=printtoken):
#     """
#     The tokenize() function accepts two parameters: one representing the
#     input stream, and one providing an output mechanism for tokenize().
# 
#     The first parameter, readline, must be a callable object which provides
#     the same interface as the readline() method of built-in file objects.
#     Each call to the function should return one line of input as a string.
# 
#     The second parameter, tokeneater, must also be a callable object. It is
#     called once for each token, with five arguments, corresponding to the
#     tuples generated by generate_tokens().
#     """
#     try:
#         tokenize_loop(readline, tokeneater)
#     except StopTokenizing:
#         pass
# 
# Path: py3kwarn2to3/pgen2/grammar.py
# class Grammar(object):
#     def __init__(self):
#     def dump(self, filename):
#     def load(self, filename):
#     def copy(self):
#     def report(self):


# Path: py3kwarn2to3/patcomp.py
import os
    from StringIO import StringIO
    from io import StringIO
from .pgen2 import driver, literals, token, tokenize, parse, grammar
from . import pytree
from . import pygram


__author__ = "Guido van Rossum <guido@python.org>"

# Python imports
try:
except ImportError:

# Fairly local imports

# Really local imports


try:
    unicode
except NameError:
    unicode = str


# The pattern grammar file
_PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__),
                                     "PatternGrammar.txt")


class PatternSyntaxError(Exception):
    pass


def tokenize_wrapper(input):
    """Tokenizes a string suppressing significant whitespace."""
    skip = set((token.NEWLINE, token.INDENT, token.DEDENT))

    tokens = tokenize.generate_tokens(StringIO(input).readline)