⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prettier.mod

📁 一个Modula-2语言分析器
💻 MOD
字号:
IMPLEMENTATION MODULE Prettier;
(* Pretty printing auxiliary functions for use with Taste pretty printing
   program generated by COCO from an attributed grammar
   P.D. Terry, Rhodes University, 17 May 1991 *)

  IMPORT FileIO;

  VAR
    Indentation : CARDINAL;

  PROCEDURE Append (String : ARRAY OF CHAR);
    BEGIN
      FileIO.WriteString(results, String);
    END Append;

  PROCEDURE NewLine;
    VAR
      I : CARDINAL;
    BEGIN
      FileIO.WriteLn(results);
      FOR I := 1 TO Indentation DO FileIO.Write(results, ' ') END;
    END NewLine;

  PROCEDURE IndentNextLine;
    BEGIN
      INC(Indentation, 2); NewLine
    END IndentNextLine;

  PROCEDURE ExdentNextLine;
    BEGIN
      DEC(Indentation, 2); NewLine
    END ExdentNextLine;

  PROCEDURE Indent;
    BEGIN
      INC(Indentation, 2)
    END Indent;

  PROCEDURE Exdent;
    BEGIN
      DEC(Indentation, 2)
    END Exdent;

  BEGIN
    Indentation := 0
  END Prettier.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -