You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
// 日志模块:
// - 统一输出调试信息、阶段信息与错误信息
// - 提供可配置的日志级别与输出位置(按需要实现)
# include "utils/Log.h"
# include <ostream>
void PrintHelp ( std : : ostream & os ) {
os < < " SysY Compiler (课程实验最小可运行示例) \n "
< < " \n "
< < " 用法: \n "
< < " compiler [--help] [--emit-ast] [--emit-ir] [--emit-asm] [--ast-dot <file.dot>] <input.sy> \n "
< < " \n "
< < " 选项: \n "
< < " -h, --help 打印帮助信息并退出 \n "
< < " --emit-ast 仅在显式模式下启用 AST 文本输出 \n "
< < " --emit-ir 仅在显式模式下启用 IR 输出 \n "
< < " --emit-asm 仅在显式模式下启用 AArch64 汇编输出 \n "
< < " --ast-dot <path> 导出 AST Graphviz DOT 到指定文件 \n "
< < " \n "
< < " 说明: \n "
< < " - 默认同时输出 AST 与 IR \n "
< < " - 若使用 --emit-ast/--emit-ir/--emit-asm, 则仅输出显式选择的阶段 \n "
< < " - 可使用重定向写入文件: \n "
< < " compiler --emit-asm test/test_case/simple_add.sy > out.s \n " ;
}