public AsmCode(PascalProgram program) { GenerateSubprogramHeader(program.Block); var mainLabel = new AsmLabel("main"); Add(mainLabel); program.Block.Generate(this); Add(new AsmSpecial("exit")); GenerateSubprograms(program.Block); Add(new AsmSpecial($"END {mainLabel.ToArgString()}")); }
public static void Optimize(PascalProgram program) { OptimizeBlock(program.Block); }
public static void PrintProgram(StreamWriter writer, PascalProgram program) { writer.WriteLine($"program {program.Name.Name}"); PrintBlock(writer, program.Block, ""); }