# Path: css2video/parsers/property.py
# class Property(BaseParser):
#     """Parse a CSS property"""
# 
#     ParseException = PropertyParseException
# 
#     @classmethod
#     def grammar(cls):
#         """Grammar to parse a CSS property"""
#         name = pp.Word(pp.alphas + '-')
#         value = Value.parser()
#         return (
#             name +
#             pp.Suppress(pp.Literal(':')) +
#             value +
#             pp.Suppress(pp.Literal(";"))
#         )
# 
#     @classmethod
#     def parse_action(cls, tokens):
#         """Returns a dictionary from the parsed tokens"""
#         return {
#             'property_name': tokens[0].lower(),  # Normalize the name
#             'property_value': tokens[1]
#         }
# 
# Path: css2video/parsers/rule.py
# class Rule(object):
#     """Parse any CSS rule"""
# 
#     @classmethod
#     def parser(cls):
#         """Grammar to parse any CSS rule"""
#         return (
#             Style.parser() ^
#             Keyframes.parser()
#         )
# 
# Path: css2video/parsers/stylesheet.py
# class StyleSheet(BaseParser):
#     '''Parse a stylesheet'''
# 
#     @classmethod
#     def grammar(cls):
#         '''Grammar to parse a style sheet'''
#         return pp.ZeroOrMore(Rule.parser())
# 
#     @classmethod
#     def parse_action(cls, tokens):
#         '''Returns a dictionary from the parsed tokens'''
#         return {
#             'rules': [rule for rule in tokens]
#         }
# 
# Path: css2video/parsers/value.py
# class Value(object):
#     """Parse any CSS property value"""
# 
#     @classmethod
#     def parser(cls):
#         """Grammar to parse any CSS Property value"""
#         return (
#             Number.parser() ^
#             Length.parser() ^
#             Percentage.parser() ^
#             Time.parser() ^
#             Color.parser() ^
#             Text.parser() ^
#             Url.parser() ^
#             Function.parser() ^
#             Array.parser()
#         )


from .property import Property
from .rule import Rule
from .stylesheet import StyleSheet
from .value import Value


def parse_value(string):
    '''Parse a value'''
    return Value.parser().parseString(string)[0]


def parse_property(string):
    '''Parse a CSS property'''
    return Property.parser().parseString(string)[0]


def parse_rule(string):
    '''Parse a CSS rule'''

# Path: css2video/parsers/property.py
# class Property(BaseParser):
#     """Parse a CSS property"""
# 
#     ParseException = PropertyParseException
# 
#     @classmethod
#     def grammar(cls):
#         """Grammar to parse a CSS property"""
#         name = pp.Word(pp.alphas + '-')
#         value = Value.parser()
#         return (
#             name +
#             pp.Suppress(pp.Literal(':')) +
#             value +
#             pp.Suppress(pp.Literal(";"))
#         )
# 
#     @classmethod
#     def parse_action(cls, tokens):
#         """Returns a dictionary from the parsed tokens"""
#         return {
#             'property_name': tokens[0].lower(),  # Normalize the name
#             'property_value': tokens[1]
#         }
# 
# Path: css2video/parsers/rule.py
# class Rule(object):
#     """Parse any CSS rule"""
# 
#     @classmethod
#     def parser(cls):
#         """Grammar to parse any CSS rule"""
#         return (
#             Style.parser() ^
#             Keyframes.parser()
#         )
# 
# Path: css2video/parsers/stylesheet.py
# class StyleSheet(BaseParser):
#     '''Parse a stylesheet'''
# 
#     @classmethod
#     def grammar(cls):
#         '''Grammar to parse a style sheet'''
#         return pp.ZeroOrMore(Rule.parser())
# 
#     @classmethod
#     def parse_action(cls, tokens):
#         '''Returns a dictionary from the parsed tokens'''
#         return {
#             'rules': [rule for rule in tokens]
#         }
# 
# Path: css2video/parsers/value.py
# class Value(object):
#     """Parse any CSS property value"""
# 
#     @classmethod
#     def parser(cls):
#         """Grammar to parse any CSS Property value"""
#         return (
#             Number.parser() ^
#             Length.parser() ^
#             Percentage.parser() ^
#             Time.parser() ^
#             Color.parser() ^
#             Text.parser() ^
#             Url.parser() ^
#             Function.parser() ^
#             Array.parser()
#         )


# Path: css2video/parsers/api.py
from .property import Property
from .rule import Rule
from .stylesheet import StyleSheet
from .value import Value



def parse_value(string):
    '''Parse a value'''
    return Value.parser().parseString(string)[0]


def parse_property(string):
    '''Parse a CSS property'''
    return Property.parser().parseString(string)[0]


def parse_rule(string):
    '''Parse a CSS rule'''

    return Rule.parser().parseString(string)[0]