- 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:
Randy Heit 2012-07-20 02:54:51 +00:00
commit 2d139f3846
4 changed files with 23 additions and 11 deletions

View file

@ -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)