Files
TransPyC/lib/constants/config.py
2026-07-18 19:25:40 +08:00

44 lines
1.3 KiB
Python

# 常量定义
from __future__ import annotations
DEFAULT_INPUT_FILE: str = 'test.py'
DEFAULT_OUTPUT_FILE: str = 'test.ll'
SLICE_THRESHOLD: int = 50
SLICE_LEVEL_DEFAULT: int = 3
SLICE_LEVELS: dict[int | str, str] = {
0: 'no_optimize',
1: 'conservative',
2: 'moderate',
3: 'aggressive',
's': 'size',
}
DEFAULT_COMPILE_COMMAND: str = 'gcc'
DEFAULT_COMPILE_FLAGS: str = ''
DEFAULT_METADATA: dict[str, str] = {
'PROJECT_NAME': 'TransPyC Project',
'AUTHOR': 'TransPyC Team',
'VERSION': '1.0.0',
'DESCRIPTION': 'Auto-generated LLVM IR file',
'COPYRIGHT_YEAR': '2026',
'COPYRIGHT_HOLDER': 'Galactic Vorpal Software Development Studio (e.g. GVSDS Inc.)'
}
ERROR_MESSAGES: dict[str, str] = {
'MISSING_ARGS': 'Missing required arguments -f and/or -o',
'UNKNOWN_ARG': 'Unknown argument',
'UNSUPPORTED_TYPE': 'Unsupported file type',
'FAILED_PARSE': 'Failed to parse file',
'COMPILE_FAILED': 'Compilation or execution failed'
}
HELP_MESSAGE: str = '''
Usage: python TransPyC.py -f InputFile -o OutputFile [-wh header_files] [-debug DebugFile]
[-cc compile_command] [-cflags CompileFlags] [-run] [-args RunArgs] [-h HelperFiles]
-h: Specify helper files (C or Python) to help identify structs, functions, variables, and ptrs
'''
mode: str = "strict"