BitC-pp.cxx File Reference

Pretty printer for BitC ASTs, optionally with type information. More...

#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <string>
#include <iostream>
#include "Options.hxx"
#include "UocInfo.hxx"
#include "AST.hxx"
#include "Type.hxx"
#include "TypeInfer.hxx"
#include "inter-pass.hxx"
#include "TypeScheme.hxx"
#include "libsherpa/EnumSet.hxx"

Go to the source code of this file.

Namespaces

namespace  std

Functions

static void print_type (INOstream &out, shared_ptr< const AST > ast)
static void blk_BitcP (INOstream &out, shared_ptr< const AST > ast, PrettyPrintFlags)
static void doChildren (void(*BitcP)(INOstream &out, shared_ptr< const AST > ast, PrettyPrintFlags), INOstream &out, shared_ptr< const AST > ast, size_t from, const std::string &startMark, const std::string &sep, const std::string &endMark, PrettyPrintFlags flags)
 Wrapper to iterate across all children of ast starting at from, optionally padding the first element with leading white space if firstPad is true and optionally printing types according to showTypes.
static void doShowTypes (std::ostream &out, shared_ptr< AST > ast, shared_ptr< TSEnvironment > gamma, bool showMangName, bool raw=false, shared_ptr< TvPrinter > tvP=GC_NULL)
 Display the type associated with a form.

Variables

const PrettyPrintFlags NonRecursiveFlags = pp_InLayoutBlock | pp_FinalNewline


Detailed Description

Pretty printer for BitC ASTs, optionally with type information.

Definition in file BitC-pp.cxx.


Function Documentation

static void blk_BitcP ( INOstream out,
shared_ptr< const AST ast,
PrettyPrintFlags   
) [static]

Definition at line 121 of file BitC-pp.cxx.

References assert(), at_allocREF, at_and, at_apply, at_argVec, at_array, at_array_nth, at_array_ref_nth, at_arrayRefType, at_arrayType, at_begin, at_bitfieldType, at_bitsizeof, at_boolLiteral, at_boxedCat, at_boxedType, at_byRefType, at_charLiteral, at_cond, at_cond_leg, at_constructor, at_constType, at_container, at_copyREF, at_declrepr, at_declstruct, at_declunion, at_defexception, at_define, at_definstance, at_defrepr, at_defstruct, at_deftypeclass, at_defunion, at_deref, at_dummyType, at_dup, at_exceptionType, at_field, at_fields, at_fieldType, at_fill, at_floatLiteral, at_fn, at_fnargVec, at_fqCtr, at_ident, at_identPattern, at_if, at_ifident, at_ifsel, at_import, at_importAs, at_interface, at_intLiteral, at_labeledBlock, at_lambda, at_let, at_letbinding, at_letGather, at_letrec, at_letStar, at_localFrame, at_loop, at_loopbinding, at_looptest, at_MakeVector, at_methdecl, at_method_decl, at_methType, at_mixfix, at_mkArrayRef, at_mkClosure, at_module, at_mutableType, at_nth, at_Null, at_object_apply, at_oc_closed, at_oc_open, at_opaqueCat, at_or, at_otherwise, at_primaryType, at_proclaim, at_provide, at_recdef, at_reprctr, at_reprrepr, at_return_from, at_sel_ctr, at_select, at_setbang, at_setClosure, at_sizeof, at_stringLiteral, at_struct_apply, at_tcapp, at_tcmethod_binding, at_throw, at_try, at_tvlist, at_tyfn, at_typeAnnotation, at_typeapp, at_ucon_apply, at_unboxedCat, at_unboxedType, at_unit, at_unless, at_usesel, at_usw_leg, at_uswitch, at_vector, at_vector_nth, at_vectorType, at_when, DEF_IS_EXTERNAL, doChildren(), flags, FLD_IS_DISCM, iLambda, sherpa::INOstream::indentToHere(), sherpa::INOstream::less(), sherpa::INOstream::more(), NonRecursiveFlags, pf_IMPLIED, pp_InLayoutBlock, pp_LitValues, pp_Raw, pp_ShowTypes, Options::ppFQNS, print_type(), sherpa::INOstream::setIndent(), tvlist, and UNION_IS_REPR.

Referenced by AST::PrettyPrint().

static void doChildren ( void(*)(INOstream &out, shared_ptr< const AST > ast, PrettyPrintFlags BitcP,
INOstream out,
shared_ptr< const AST ast,
size_t  from,
const std::string &  startMark,
const std::string &  sep,
const std::string &  endMark,
PrettyPrintFlags  flags 
) [static]

Wrapper to iterate across all children of ast starting at from, optionally padding the first element with leading white space if firstPad is true and optionally printing types according to showTypes.

Definition at line 88 of file BitC-pp.cxx.

References assert(), BitcP(), flags, NonRecursiveFlags, and pp_NONE.

Referenced by blk_BitcP().

static void doShowTypes ( std::ostream &  out,
shared_ptr< AST ast,
shared_ptr< TSEnvironment gamma,
bool  showMangName,
bool  raw = false,
shared_ptr< TvPrinter tvP = GC_NULL 
) [static]

Display the type associated with a form.

Definition at line 1058 of file BitC-pp.cxx.

References at_declare, at_declstruct, at_declunion, at_defexception, at_define, at_definstance, at_defstruct, at_deftypeclass, at_defunion, at_ident, at_identPattern, at_importAs, at_interface, at_module, at_proclaim, at_provide, at_recdef, at_usesel, and TvPrinter::make().

Referenced by UocInfo::ShowTypes().

static void print_type ( INOstream out,
shared_ptr< const AST ast 
) [static]

Definition at line 68 of file BitC-pp.cxx.

Referenced by blk_BitcP().


Variable Documentation

const PrettyPrintFlags NonRecursiveFlags = pp_InLayoutBlock | pp_FinalNewline

Definition at line 64 of file BitC-pp.cxx.

Referenced by blk_BitcP(), and doChildren().


Generated on Sat Feb 4 23:59:29 2012 for BitC Compiler by  doxygen 1.4.7