コード例 #1
0
        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()}"));
        }
コード例 #2
0
 public static void Optimize(PascalProgram program)
 {
     OptimizeBlock(program.Block);
 }
コード例 #3
0
 public static void PrintProgram(StreamWriter writer, PascalProgram program)
 {
     writer.WriteLine($"program {program.Name.Name}");
     PrintBlock(writer, program.Block, "");
 }