Magic stuff: Module meta

This module provides usefull functions or decorators.

pyrser.meta.enum(sequential, named)[source]

Build an enum statement

pyrser.meta.checktypes(func)[source]

Decorator to verify arguments and return types.

pyrser.meta.set_one(chainmap, thing_name, callobject)[source]

Add a mapping with key thing_name for callobject in chainmap with namespace handling.

pyrser.meta._get_base_class(cls)[source]
pyrser.meta.add_method(cls)[source]

Attach a method to a class.

pyrser.meta.hook(cls, hookname= None)[source]

Attach a method to a parsing class and register it as a parser hook.

The method is registered with its name unless hookname is provided.

pyrser.meta.rule(cls, rulename= None)[source]

Attach a method to a parsing class and register it as a parser rule.

The method is registered with its name unless rulename is provided.

pyrser.meta.directive(directname= None)[source]

Attach a class to a parsing class and register it as a parser directive.

The class is registered with its name unless directname is provided.

pyrser.meta.decorator(directname= None)[source]

Attach a class to a parsing decorator and register it to the global decorator list. The class is registered with its name unless directname is provided