00001
00002
00003
00004
00005
00006
00007
00008
00009
00017
00018
00019 #ifndef COMMA_AST_DECLDUMPER_HDR_GUARD
00020 #define COMMA_AST_DECLDUMPER_HDR_GUARD
00021
00022 #include "AstDumper.h"
00023 #include "TypeDumper.h"
00024 #include "StmtDumper.h"
00025 #include "comma/ast/DeclVisitor.h"
00026
00027 #include "llvm/Support/raw_ostream.h"
00028
00029 namespace comma {
00030
00031 class DeclDumper : public AstDumperBase, private DeclVisitor {
00032
00033 public:
00036 DeclDumper(llvm::raw_ostream &stream, AstDumper *dumper)
00037 : AstDumperBase(stream),
00038 dumper(dumper) { }
00039
00042 llvm::raw_ostream &dump(Decl *decl, unsigned level = 0);
00043
00044 private:
00046 AstDumper *dumper;
00047
00049 llvm::raw_ostream &dumpAST(Ast *node) {
00050 return dumper->dump(node, indentLevel);
00051 }
00052
00055 llvm::raw_ostream &printHeader(Ast *node);
00056
00063 void visitImportDecl(ImportDecl *node);
00064 void visitSignatureDecl(SignatureDecl *node);
00065 void visitVarietyDecl(VarietyDecl *node);
00066 void visitSigInstanceDecl(SigInstanceDecl *node);
00067 void visitAddDecl(AddDecl *node);
00068 void visitDomainDecl(DomainDecl *node);
00069 void visitFunctorDecl(FunctorDecl *node);
00070 void visitSubroutineDecl(SubroutineDecl *node);
00071 void visitFunctionDecl(FunctionDecl *node);
00072 void visitProcedureDecl(ProcedureDecl *node);
00073 void visitCarrierDecl(CarrierDecl *node);
00074 void visitDomainTypeDecl(DomainTypeDecl *node);
00075 void visitAbstractDomainDecl(AbstractDomainDecl *node);
00076 void visitDomainInstanceDecl(DomainInstanceDecl *node);
00077 void visitPercentDecl(PercentDecl *node);
00078 void visitLoopDecl(LoopDecl *node);
00079 void visitParamValueDecl(ParamValueDecl *node);
00080 void visitObjectDecl(ObjectDecl *node);
00081 void visitEnumLiteral(EnumLiteral *node);
00082 void visitEnumerationDecl(EnumerationDecl *node);
00083 void visitIntegerDecl(IntegerDecl *node);
00084 void visitArrayDecl(ArrayDecl *node);
00085 void visitExceptionDecl(ExceptionDecl *node);
00086 void visitIncompleteTypeDecl(IncompleteTypeDecl *node);
00087 };
00088
00089 }
00090
00091 #endif