- DoParse() now writes out the parsed AST for the input file to <file>.ast.
Maybe TODO: Find a simple LISP pretty printer that isn't written in LISP so that the output isn't all on one big long line. - zcc-parse.lemon now returns the complete AST through the parse state. - Fixed crash in PrintEnumNode(). SVN r3773 (scripting)
This commit is contained in:
parent
a5c938445a
commit
2d139f3846
4 changed files with 23 additions and 11 deletions
|
|
@ -229,6 +229,15 @@ static void DoParse(const char *filename)
|
|||
fclose(f);
|
||||
}
|
||||
#endif
|
||||
FString ast = ZCC_PrintAST(state.TopNode);
|
||||
FString astfile = ExtractFileBase(filename, false);
|
||||
astfile << ".ast";
|
||||
f = fopen(astfile, "w");
|
||||
if (f != NULL)
|
||||
{
|
||||
fputs(ast.GetChars(), f);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
CCMD(parse)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue