fix(ast): 规范AST输出

This commit is contained in:
jing
2026-02-28 21:03:40 +08:00
parent cd235e60cc
commit d08b23276a
6 changed files with 184 additions and 38 deletions

View File

@@ -10,10 +10,11 @@ void PrintHelp(std::ostream& os) {
os << "SysY Compiler (课程实验最小可运行示例)\n"
<< "\n"
<< "用法:\n"
<< " compiler [--help] <input.sy>\n"
<< " compiler [--help] [--ast-dot <file.dot>] <input.sy>\n"
<< "\n"
<< "选项:\n"
<< " -h, --help 打印帮助信息并退出\n"
<< " --ast-dot <path> 导出 AST Graphviz DOT 到指定文件\n"
<< "\n"
<< "说明:\n"
<< " - 当前默认将 IR 输出到标准输出,可使用重定向写入文件:\n"