PreviousUpNext

14.4.2  Base_Prettyprinter

The Base_Prettyprinter api defines the external interface to the base_prettyprinter package.

The Base_Prettyprinter api is implemented by the base_prettyprinter package.

The Base_Prettyprinter api source code is src/lib/prettyprint/big/src/base-prettyprinter.api.

The above information is manually maintained and may contain errors.

api {   package typ
          : api {   package out
                      : api {
                            Prettyprint_Output_Stream;
                            Texttraits;
                            same_texttraits : (Texttraits , Texttraits) -> Bool;
                            push_texttraits : (Prettyprint_Output_Stream , Texttraits) -> Void;
                            pop_texttraits : Prettyprint_Output_Stream -> Void;
                            default_texttraits : Prettyprint_Output_Stream -> Texttraits;
                            put_string : (Prettyprint_Output_Stream , String) -> Void;
                            flush : Prettyprint_Output_Stream -> Void;
                            close : Prettyprint_Output_Stream -> Void;};;
                    Left_Margin_Is
                    = BOX_RELATIVE
                    {blanks:Int, tab_to:Int, tabstops_are_every:Int}
                    |
                    CURSOR_RELATIVE
                    {blanks:Int, tab_to:Int, tabstops_are_every:Int};
                    Phase1_Token
                    = BLANKS
                    Int
                    |
                    BOX
                    Box
                    |
                    BREAK
                    Break
                    |
                    CONTROL
                    out::Prettyprint_Output_Stream -> Void
                    |
                    ENDLIT
                    String
                    |
                    INDENT
                    Int
                    |
                    LIT
                    String
                    |
                    NEWLINE
                    |
                    POP_TT
                    |
                    PUSH_TT
                    out::Texttraits
                    |
                    TAB
                    {blanks:Int, tab_to:Int, tabstops_are_every:Int};
                      Break  =      {ifnotwrap:{blanks:Int, tab_to:Int, tabstops_are_every:Int},
                                    ifwrap:{blanks:Int, tab_to:Int, tabstops_are_every:Int}, wrap:Ref(Bool )};
                      Wrap_Policy  =
                            {code:{box_contents:List(Phase1_Token ), target_width:Int} -> {actual_box_width:Int, is_multiline:Bool},
                            name:String};
                      Box  ={actual_width:Ref(Int ), contents:Ref(List(Phase1_Token ) ), id:Int, is_multiline:Ref(Bool ),
                            left_margin_is:Left_Margin_Is, reversed_contents:Ref(List(Phase1_Token ) ), rulename:Ref(String ),
                            target_width:Int, wrap_policy:Wrap_Policy};
                    Prettyprinter_Configuration_Args
                    = DEFAULT_LEFT_MARGIN_IS
                    Left_Margin_Is
                    |
                    DEFAULT_TARGET_BOX_WIDTH
                    Int
                    |
                    DEFAULT_WRAP_POLICY
                    Wrap_Policy
                    |
                    TABSTOPS_ARE_EVERY
                    Int;
                      Prettyprinter  =
                            {box:Ref(Box ), box_nesting:Ref(Int ), nested_boxes:Ref(List(Box ) ), next_box_id:Ref(Int ),
                            output_stream:out::Prettyprint_Output_Stream, output_stream_is_closed:Ref(Bool ),
                            texttraits_stack:Ref(List(out::Texttraits ) )};
                    package b
                      : api {   Phase2_Token
                                = BLANKS
                                Int
                                |
                                CONTROL
                                out::Prettyprint_Output_Stream -> Void
                                |
                                ENDLIT
                                String
                                |
                                LIT
                                String
                                |
                                NEWLINE
                                |
                                POP_TT
                                |
                                PUSH_TT
                                out::Texttraits;};;
                    package c
                      : api {   Phase3_Token
                                = BLANKS
                                Int
                                |
                                CONTROL
                                out::Prettyprint_Output_Stream -> Void
                                |
                                LIT
                                String
                                |
                                NEWLINE
                                |
                                POP_TT
                                |
                                PUSH_TT
                                out::Texttraits;};;
                    package d
                      : api {   Phase4_Token
                                = BLANKS
                                Int
                                |
                                CONTROL
                                out::Prettyprint_Output_Stream -> Void
                                |
                                LIT
                                String
                                |
                                POP_TT
                                |
                                PUSH_TT
                                out::Texttraits;};;};;
    Prettyprinter;
    Pp  = Prettyprinter;
    Npp  = Null_Or(Prettyprinter );
    Prettyprint_Output_Stream;
    Traitful_Text;
    Texttraits;
    open_box : (Prettyprinter , typ::Left_Margin_Is , typ::Wrap_Policy , Int) -> Void;
    indent : (Prettyprinter , Int) -> Void;
        break' :
            (   Prettyprinter ,
                    {ifnotwrap:{blanks:Int, tab_to:Int, tabstops_are_every:Int},
                    ifwrap:{blanks:Int, tab_to:Int, tabstops_are_every:Int}}
            )
            ->
            Void;
    horizontal : typ::Wrap_Policy;
    vertical : typ::Wrap_Policy;
    normal : typ::Wrap_Policy;
    ragged_right : typ::Wrap_Policy;
        make_prettyprinter :
        Prettyprint_Output_Stream -> List(typ::Prettyprinter_Configuration_Args ) -> Pp;
        process_mill_options :
            List(typ::Prettyprinter_Configuration_Args )
            ->  {default_left_margin_is:typ::Left_Margin_Is, default_target_box_width:Int,
                default_wrap_policy:typ::Wrap_Policy, tabstops_are_every:Int};
    get_prettyprint_output_stream : Pp -> Prettyprint_Output_Stream;
    flush_prettyprinter : Pp -> Void;
    close_prettyprinter : Pp -> Void;
    traitful_text : Pp -> Traitful_Text -> Void;
    set_rulename_for_current_box : (Pp , String) -> Void;
    nblanks : Int -> String;
    shut_box : Pp -> Void;
    lit : Pp -> String -> Void;
    endlit : Pp -> String -> Void;
    break : Pp -> {blanks:Int, indent_on_wrap:Int} -> Void;
    blank : Pp -> Int -> Void;
    cut : Pp -> Void;
    newline : Pp -> Void;
    nonbreakable_blanks : Pp -> Int -> Void;
    tab : Pp -> {blanks:Int, tab_to:Int, tabstops_are_every:Int} -> Void;
    push_texttraits : (Pp , Texttraits) -> Void;
    pop_texttraits : Pp -> Void;
    control : Pp -> (Prettyprint_Output_Stream -> Void) -> Void;};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext