PreviousUpNext

14.4.93  Simple_Prettyprinter

The standard library Simple_Prettyprinter api defines a fast, simple prettyprinter. Its major advantage is that the complete implementation is only 300 lines of code — you can read and understand it completely in an hour.

The Simple_Prettyprinter api is implemented by the simple_prettyprinter package.

The Simple_Prettyprinter api source code is in src/lib/prettyprint/simple/simple-prettyprinter.api.

See also: Prettyprint.

The above information is manually maintained and may contain errors.

api {   Prettyprint_Expression
        = ALPHABETIC
        String
        |
        BOOL
        Bool
        |
        BRACKETED_BLOCK
        {body:Prettyprint_Expression, leftbracket:String, rightbracket:String}
        |
        CAT
        List(Prettyprint_Expression )
        |
        CHAR
        Char
        |
        CONS
        (Prettyprint_Expression , Prettyprint_Expression)
        |
        ENTER_DEEPLY_INDENTED_BLOCK
        |
        ENTER_INDENTED_BLOCK
        |
        FLOAT
        Float
        |
        INDENT
        |
        INDENTED_BLOCK
        Prettyprint_Expression
        |
        INDENTED_LINE
        Prettyprint_Expression
        |
        INDENT_OFFSET
        Int
        |
        INT
        Int
        |
        INT1
        one_word_int::Int
        |
        INTEGER
        multiword_int::Int
        |
        IN_PARENTHESES
        Prettyprint_Expression
        |
        LEAVE_INDENTED_BLOCK
        |
        LIST    {elements:List(Prettyprint_Expression ), leftbracket:Prettyprint_Expression,
                rightbracket:Prettyprint_Expression, separator:Prettyprint_Expression}
        |
        MAYBE_BLANK
        |
        MAYBE_LINEWRAP
        {indent_offset:Int, right_margin:Int}
        |
        NEWLINE
        |
        NOP
        |
        PER_MODE
        String -> Prettyprint_Expression
        |
        POP_MODE
        |
        PUNCTUATION
        String
        |
        PUSH_MODE
        String
        |
        SET_WRAP_COLUMN
        Int
        |
        STRING
        String
        |
        UNT
        Unt
        |
        UNT1
        one_word_unt::Unt;
    prettyprint_expression_to_string : Prettyprint_Expression -> String;
    longest_line_in_prettyprint_expression : Prettyprint_Expression -> Int;};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext