Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
google-cloud-sdk /
lib /
third_party /
lark /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
__pyinstaller
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
grammars
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
parsers
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
tools
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
LICENSE
1.03
KB
-rw-r--r--
1980-01-01 08:00
__init__.py
744
B
-rw-r--r--
1980-01-01 08:00
ast_utils.py
2.04
KB
-rw-r--r--
1980-01-01 08:00
common.py
2.83
KB
-rw-r--r--
1980-01-01 08:00
exceptions.py
10.68
KB
-rw-r--r--
1980-01-01 08:00
grammar.py
3.35
KB
-rw-r--r--
1980-01-01 08:00
indenter.py
3
KB
-rw-r--r--
1980-01-01 08:00
lark.py
27.09
KB
-rw-r--r--
1980-01-01 08:00
lexer.py
22.98
KB
-rw-r--r--
1980-01-01 08:00
load_grammar.py
52.23
KB
-rw-r--r--
1980-01-01 08:00
parse_tree_builder.py
13.78
KB
-rw-r--r--
1980-01-01 08:00
parser_frontends.py
9.82
KB
-rw-r--r--
1980-01-01 08:00
py.typed
0
B
-rw-r--r--
1980-01-01 08:00
reconstruct.py
3.63
KB
-rw-r--r--
1980-01-01 08:00
tree.py
8.04
KB
-rw-r--r--
1980-01-01 08:00
tree_matcher.py
5.86
KB
-rw-r--r--
1980-01-01 08:00
tree_templates.py
6
KB
-rw-r--r--
1980-01-01 08:00
utils.py
10.73
KB
-rw-r--r--
1980-01-01 08:00
visitors.py
20.6
KB
-rw-r--r--
1980-01-01 08:00
Save
Rename
""" Module of utilities for transforming a lark.Tree into a custom Abstract Syntax Tree """ import inspect, re import types from typing import Optional, Callable from lark import Transformer, v_args class Ast: """Abstract class Subclasses will be collected by `create_transformer()` """ pass class AsList: """Abstract class Subclasses will be instantiated with the parse results as a single list, instead of as arguments. """ class WithMeta: """Abstract class Subclasses will be instantiated with the Meta instance of the tree. (see ``v_args`` for more detail) """ pass def camel_to_snake(name): return re.sub(r'(?<!^)(?=[A-Z])', '_', name).lower() def create_transformer(ast_module: types.ModuleType, transformer: Optional[Transformer]=None, decorator_factory: Callable=v_args) -> Transformer: """Collects `Ast` subclasses from the given module, and creates a Lark transformer that builds the AST. For each class, we create a corresponding rule in the transformer, with a matching name. CamelCase names will be converted into snake_case. Example: "CodeBlock" -> "code_block". Classes starting with an underscore (`_`) will be skipped. Parameters: ast_module: A Python module containing all the subclasses of ``ast_utils.Ast`` transformer (Optional[Transformer]): An initial transformer. Its attributes may be overwritten. decorator_factory (Callable): An optional callable accepting two booleans, inline, and meta, and returning a decorator for the methods of ``transformer``. (default: ``v_args``). """ t = transformer or Transformer() for name, obj in inspect.getmembers(ast_module): if not name.startswith('_') and inspect.isclass(obj): if issubclass(obj, Ast): wrapper = decorator_factory(inline=not issubclass(obj, AsList), meta=issubclass(obj, WithMeta)) obj = wrapper(obj).__get__(t) setattr(t, camel_to_snake(name), obj) return t