43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
# 常量定义
|
|
|
|
DEFAULT_INPUT_FILE = 'test.py'
|
|
DEFAULT_OUTPUT_FILE = 'test.ll'
|
|
|
|
SLICE_THRESHOLD = 50
|
|
SLICE_LEVEL_DEFAULT = 3
|
|
SLICE_LEVELS = {
|
|
0: 'no_optimize',
|
|
1: 'conservative',
|
|
2: 'moderate',
|
|
3: 'aggressive',
|
|
's': 'size',
|
|
}
|
|
|
|
DEFAULT_COMPILE_COMMAND = 'gcc'
|
|
DEFAULT_COMPILE_FLAGS = ''
|
|
|
|
DEFAULT_METADATA = {
|
|
'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 = {
|
|
'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 = '''
|
|
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 = "strict"
|