# Path: pysmi/lexer/smi.py
# def lexerFactory(**grammarOptions):
#     classAttr = {}
# 
#     for option in grammarOptions:
#         if grammarOptions[option]:
#             if option not in relaxedGrammar:
#                 raise error.PySmiError('Unknown lexer relaxation option: %s' % option)
# 
#             for func in relaxedGrammar[option]:
#                 if sys.version_info[0] > 2:
#                     classAttr[func.__name__] = func()
#                 else:
#                     classAttr[func.func_name] = func()
# 
#     return type('SmiLexer', (SmiV2Lexer,), classAttr)
# 
# Path: pysmi/parser/base.py
# class AbstractParser(object):
#     def reset(self):
#         raise NotImplementedError()
# 
#     def parse(self, data, **kwargs):
#         raise NotImplementedError()
# 
# Path: pysmi/error.py
# class PySmiError(Exception):
# class PySmiLexerError(PySmiError):
# class PySmiParserError(PySmiLexerError):
# class PySmiSyntaxError(PySmiParserError):
# class PySmiSearcherError(PySmiError):
# class PySmiFileNotModifiedError(PySmiSearcherError):
# class PySmiFileNotFoundError(PySmiSearcherError):
# class PySmiReaderError(PySmiError):
# class PySmiReaderFileNotModifiedError(PySmiReaderError):
# class PySmiReaderFileNotFoundError(PySmiReaderError):
# class PySmiCodegenError(PySmiError):
# class PySmiSemanticError(PySmiCodegenError):
# class PySmiWriterError(PySmiError):
#     def __init__(self, *args, **kwargs):
#     def __repr__(self):
#     def __str__(self):
#     def __str__(self):
# 
# Path: pysmi/debug.py
# class Printer(object):
#     class NullHandler(logging.Handler):
# class Debug(object):
#     def __init__(self, logger=None, handler=None, formatter=None):
#     def __call__(self, msg):
#     def __str__(self):
#     def getCurrentLogger(self):
#         def emit(self, record):
#     def __init__(self, *flags, **options):
#     def __str__(self):
#     def __call__(self, msg):
#     def __and__(self, flag):
#     def __rand__(self, flag):
#     def getCurrentPrinter(self):
#     def getCurrentLogger(self):
# def setLogger(l):


import os
import sys
import ply.yacc as yacc
from pysmi.lexer.smi import lexerFactory
from pysmi.parser.base import AbstractParser
from pysmi import error
from pysmi import debug

    def p_VariationAccess(self, p):
        """VariationAccess : LOWERCASE_IDENTIFIER"""
        # p[0] = p[1]

    def p_CreationPart(self, p):
        """CreationPart : CREATION_REQUIRES '{' Cells '}'
                        | empty"""
        if p[1]:
            p[0] = (p[1], p[3])

    def p_Cells(self, p):
        """Cells : Cells ',' Cell
                 | Cell"""
        n = len(p)
        if n == 4:
            p[0] = ('Cells', p[1][1] + [p[3]])
        elif n == 2:
            p[0] = ('Cells', [p[1]])

    def p_Cell(self, p):
        """Cell : ObjectName"""
        p[0] = ('Cell', p[1])

    def p_empty(self, p):
        """empty :"""

    # Error rule for syntax errors
    def p_error(self, p):
        if p:

# Path: pysmi/lexer/smi.py
# def lexerFactory(**grammarOptions):
#     classAttr = {}
# 
#     for option in grammarOptions:
#         if grammarOptions[option]:
#             if option not in relaxedGrammar:
#                 raise error.PySmiError('Unknown lexer relaxation option: %s' % option)
# 
#             for func in relaxedGrammar[option]:
#                 if sys.version_info[0] > 2:
#                     classAttr[func.__name__] = func()
#                 else:
#                     classAttr[func.func_name] = func()
# 
#     return type('SmiLexer', (SmiV2Lexer,), classAttr)
# 
# Path: pysmi/parser/base.py
# class AbstractParser(object):
#     def reset(self):
#         raise NotImplementedError()
# 
#     def parse(self, data, **kwargs):
#         raise NotImplementedError()
# 
# Path: pysmi/error.py
# class PySmiError(Exception):
# class PySmiLexerError(PySmiError):
# class PySmiParserError(PySmiLexerError):
# class PySmiSyntaxError(PySmiParserError):
# class PySmiSearcherError(PySmiError):
# class PySmiFileNotModifiedError(PySmiSearcherError):
# class PySmiFileNotFoundError(PySmiSearcherError):
# class PySmiReaderError(PySmiError):
# class PySmiReaderFileNotModifiedError(PySmiReaderError):
# class PySmiReaderFileNotFoundError(PySmiReaderError):
# class PySmiCodegenError(PySmiError):
# class PySmiSemanticError(PySmiCodegenError):
# class PySmiWriterError(PySmiError):
#     def __init__(self, *args, **kwargs):
#     def __repr__(self):
#     def __str__(self):
#     def __str__(self):
# 
# Path: pysmi/debug.py
# class Printer(object):
#     class NullHandler(logging.Handler):
# class Debug(object):
#     def __init__(self, logger=None, handler=None, formatter=None):
#     def __call__(self, msg):
#     def __str__(self):
#     def getCurrentLogger(self):
#         def emit(self, record):
#     def __init__(self, *flags, **options):
#     def __str__(self):
#     def __call__(self, msg):
#     def __and__(self, flag):
#     def __rand__(self, flag):
#     def getCurrentPrinter(self):
#     def getCurrentLogger(self):
# def setLogger(l):


# Path: pysmi/parser/smi.py
import os
import sys
import ply.yacc as yacc
from pysmi.lexer.smi import lexerFactory
from pysmi.parser.base import AbstractParser
from pysmi import error
from pysmi import debug


    def p_VariationAccess(self, p):
        """VariationAccess : LOWERCASE_IDENTIFIER"""
        # p[0] = p[1]

    def p_CreationPart(self, p):
        """CreationPart : CREATION_REQUIRES '{' Cells '}'
                        | empty"""
        if p[1]:
            p[0] = (p[1], p[3])

    def p_Cells(self, p):
        """Cells : Cells ',' Cell
                 | Cell"""
        n = len(p)
        if n == 4:
            p[0] = ('Cells', p[1][1] + [p[3]])
        elif n == 2:
            p[0] = ('Cells', [p[1]])

    def p_Cell(self, p):
        """Cell : ObjectName"""
        p[0] = ('Cell', p[1])

    def p_empty(self, p):
        """empty :"""

    # Error rule for syntax errors
    def p_error(self, p):
        if p:

            raise error.PySmiParserError("Bad grammar near token type %s, value %s" % (p.type, p.value),