PreviousUpNext

15.4.705  src/lib/compiler/toplevel/main/print-hooks.pkg

## print-hooks.pkg
## (C) 2001 Lucent Technologies, Bell Labs

# Compiled by:
#     src/lib/compiler/core.sublib

stipulate
    package ds  =  deep_syntax;                                 # deep_syntax                   is from   src/lib/compiler/front/typer-stuff/deep-syntax/deep-syntax.pkg
    package err =  error_message;                               # error_message                 is from   src/lib/compiler/front/basics/errormsg/error-message.pkg
    package pp  =  standard_prettyprinter;                      # standard_prettyprinter        is from   src/lib/prettyprint/big/src/standard-prettyprinter.pkg
    package sci =  sourcecode_info;                             # sourcecode_info               is from   src/lib/compiler/front/basics/source/sourcecode-info.pkg
    package syx =  symbolmapstack;                              # symbolmapstack                is from   src/lib/compiler/front/typer-stuff/symbolmapstack/symbolmapstack.pkg
    package uds =  unparse_deep_syntax;                         # unparse_deep_syntax           is from   src/lib/compiler/front/typer/print/unparse-deep-syntax.pkg
herein

    package print_hooks
    : (weak)
    api {
        # All output goes to controls::print::out: 
        #
        unparse_deep_syntax_tree
            :
            syx::Symbolmapstack
            ->
            ds::Declaration
            ->
            Void;
    }

    {   fun unparse_deep_syntax_tree  symbolmapstack  declaration
            = 
            pp::with_standard_prettyprinter
                #
                (err::default_plaint_sink ())   []
                #
                (\\ pp:   pp::Prettyprinter
                    =
                    uds::unparse_declaration
                        ( symbolmapstack,
                          NULL:         Null_Or( sci::Sourcecode_Info )
                        )
                        pp
                        ( declaration,
                          200                   # Maximum prettyprint recursion depth.
                        )
                    );
    };
end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext