00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 #ifndef COMMA_AST_CUNIT_HDR_GUARD
00010 #define COMMA_AST_CUNIT_HDR_GUARD
00011 
00012 #include "comma/ast/AstBase.h"
00013 #include "llvm/System/Path.h"
00014 #include <iosfwd>
00015 #include <vector>
00016 
00017 namespace comma {
00018 
00019 
00020 
00021 
00022 class CompilationUnit {
00023 
00024 public:
00025     
00026     CompilationUnit(const llvm::sys::Path &path)
00027         : path(path) { }
00028 
00029     
00030     const llvm::sys::Path &getPath() const { return path; }
00031 
00032     
00033     void addDeclaration(Decl *decl) {
00034         declarations.push_back(decl);
00035     }
00036 
00037     
00038     
00039     
00040     typedef std::vector<Decl *>::const_iterator decl_iterator;
00041     decl_iterator beginDeclarations() const { return declarations.begin(); }
00042     decl_iterator endDeclarations()   const { return declarations.end(); }
00043 
00044 private:
00045     llvm::sys::Path path;
00046 
00047     std::vector<Decl *> declarations;
00048 };
00049 
00050 } 
00051 
00052 #endif