00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00017 
00018 
00019 #ifndef COMMA_AST_TYPEDUMPER_HDR_GUARD
00020 #define COMMA_AST_TYPEDUMPER_HDR_GUARD
00021 
00022 #include "AstDumper.h"
00023 #include "comma/ast/TypeVisitor.h"
00024 
00025 #include "llvm/Support/raw_ostream.h"
00026 
00027 namespace comma {
00028 
00029 class TypeDumper : public AstDumperBase, private TypeVisitor {
00030 
00031 public:
00034     TypeDumper(llvm::raw_ostream &stream, AstDumper *dumper)
00035         : AstDumperBase(stream), dumper(dumper) { }
00036 
00039     llvm::raw_ostream &dump(Type *type, unsigned level = 0);
00040 
00041 private:
00043     AstDumper *dumper;
00044 
00048     llvm::raw_ostream &dumpParameters(SubroutineType *node);
00049 
00051     llvm::raw_ostream &printHeader(Type *node);
00052 
00054     llvm::raw_ostream &dumpAST(Ast *node);
00055 
00066     void visitDomainType(DomainType *node);
00067     void visitFunctionType(FunctionType *node);
00068     void visitProcedureType(ProcedureType *node);
00069     void visitEnumerationType(EnumerationType *node);
00070     void visitIncompleteType(IncompleteType *node);
00071     void visitIntegerType(IntegerType *node);
00072     void visitArrayType(ArrayType *node);
00073     void visitAccessType(AccessType *node);
00074     void visitRecordType(RecordType *node);
00075 };
00076 
00077 } 
00078 
00079 #endif
00080