# Path: pydsl/grammar/PEG.py
# class Sequence(Grammar, list):
#     def __init__(self, *args, **kwargs):
#         base_alphabet = kwargs.pop('base_alphabet', None)
#         Grammar.__init__(self, base_alphabet)
#         list.__init__(self, *args, **kwargs)
#         for x in self:
#             if not isinstance(x, Grammar):
#                 raise TypeError(x)
# 
#     def __hash__(self):
#         return hash(tuple(self))
# 
#     @classmethod
#     def from_string(cls, string):
#         from .definition import String
#         return cls([String(x) for x in string])


from pydsl.grammar.PEG import Sequence
__all__ = ['repository', 'iclass', 'root_rule', 'rules']
rules = """digit = anything:x ?(x in '0123456789')
number = <digit+>:ds -> int(ds)
expr = number:left ( '+' number:right -> left + right
                   | -> left)"""

root_rule="expr"


# Path: pydsl/grammar/PEG.py
# class Sequence(Grammar, list):
#     def __init__(self, *args, **kwargs):
#         base_alphabet = kwargs.pop('base_alphabet', None)
#         Grammar.__init__(self, base_alphabet)
#         list.__init__(self, *args, **kwargs)
#         for x in self:
#             if not isinstance(x, Grammar):
#                 raise TypeError(x)
# 
#     def __hash__(self):
#         return hash(tuple(self))
# 
#     @classmethod
#     def from_string(cls, string):
#         from .definition import String
#         return cls([String(x) for x in string])


# Path: pydsl/contrib/translator/calculator.py
from pydsl.grammar.PEG import Sequence

__all__ = ['repository', 'iclass', 'root_rule', 'rules']
rules = """digit = anything:x ?(x in '0123456789')
number = <digit+>:ds -> int(ds)
expr = number:left ( '+' number:right -> left + right
                   | -> left)"""

root_rule="expr"


repository={'string':Sequence.from_string('fas')}