snapshot before regression test
This commit is contained in:
34
lib/core/translator.py
Normal file
34
lib/core/translator.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# 核心转换逻辑
|
||||
# 通过 Mixin 模式组合各功能模块
|
||||
#
|
||||
# 拆分后的模块位于 lib/core/Translator/ 目录下:
|
||||
# - BaseTranslator.py: __init__、日志、Handle 实例化
|
||||
# - AnnotationLoader.py: 注解模块加载
|
||||
# - PythonParser.py: Python 文件解析
|
||||
# - LlvmGenerator.py: LLVM IR 生成
|
||||
# - ConstEval.py: 常量表达式求值
|
||||
from __future__ import annotations
|
||||
|
||||
from lib.core.Translator.BaseTranslator import BaseTranslatorMixin, _StrictLog
|
||||
from lib.core.Translator.AnnotationLoader import AnnotationLoaderMixin
|
||||
from lib.core.Translator.PythonParser import PythonParserMixin
|
||||
from lib.core.Translator.LlvmGenerator import LlvmGeneratorMixin
|
||||
from lib.core.Translator.ConstEval import ConstEvalMixin
|
||||
|
||||
|
||||
class Translator(
|
||||
BaseTranslatorMixin,
|
||||
AnnotationLoaderMixin,
|
||||
PythonParserMixin,
|
||||
LlvmGeneratorMixin,
|
||||
ConstEvalMixin,
|
||||
):
|
||||
"""代码转换器
|
||||
|
||||
通过 Mixin 模式组合各功能模块。
|
||||
实际方法实现分布在 lib/core/Translator/ 下的各模块中。
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
__all__: list[str] = ['Translator', '_StrictLog']
|
||||
Reference in New Issue
Block a user