# 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):


import os
from .pgen2 import driver
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Export the Python grammar and symbols."""

# Python imports

# Local imports

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


class Symbols(object):

    def __init__(self, grammar):
        """Initializer.

        Creates an attribute for each grammar symbol (nonterminal),
        whose value is the symbol's type (an int >= 256).
        """
        for name, symbol in grammar.symbol2number.items():
            setattr(self, name, symbol)



# 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/pygram.py
import os
from .pgen2 import driver

# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Export the Python grammar and symbols."""

# Python imports

# Local imports

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


class Symbols(object):

    def __init__(self, grammar):
        """Initializer.

        Creates an attribute for each grammar symbol (nonterminal),
        whose value is the symbol's type (an int >= 256).
        """
        for name, symbol in grammar.symbol2number.items():
            setattr(self, name, symbol)



python_grammar = driver.load_grammar(_GRAMMAR_FILE)