We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ceaac78 commit b09dc81Copy full SHA for b09dc81
pythonbpf/functions/func_registry_handlers.py
@@ -0,0 +1,22 @@
1
+from typing import Dict
2
+
3
4
+class StatementHandlerRegistry:
5
+ """Registry for statement handlers."""
6
7
+ _handlers: Dict = {}
8
9
+ @classmethod
10
+ def register(cls, stmt_type):
11
+ """Register a handler for a specific statement type."""
12
13
+ def decorator(handler):
14
+ cls._handlers[stmt_type] = handler
15
+ return handler
16
17
+ return decorator
18
19
20
+ def get_handler(cls, stmt_type):
21
+ """Get the handler for a specific statement type."""
22
+ return cls._handlers.get(stmt_type, None)
0 commit comments