00001 //===-- typecheck/Checker.h ----------------------------------- -*- C++ -*-===// 00002 // 00003 // This file is distributed under the MIT license. See LICENSE.txt for details. 00004 // 00005 // Copyright (C) 2009, Stephen Wilson 00006 // 00007 //===----------------------------------------------------------------------===// 00008 00009 //===----------------------------------------------------------------------===// 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef COMMA_TYPECHECK_CHECKER_HDR_GUARD 00016 #define COMMA_TYPECHECK_CHECKER_HDR_GUARD 00017 00018 #include "comma/parser/ParseClient.h" 00019 00020 namespace comma { 00021 00022 class AstResource; 00023 class CompilationUnit; 00024 class Diagnostic; 00025 00028 class Checker : public ParseClient { 00029 00030 public: 00033 virtual bool checkSuccessful() const = 0; 00034 00036 virtual CompilationUnit *getCompilationUnit() const = 0; 00037 00039 static Checker *create(Diagnostic &diag, AstResource &resource, 00040 CompilationUnit *cunit); 00041 00042 private: 00043 Checker(const Checker &checker); // Do not implement. 00044 Checker &operator =(const Checker &checker); // Likewise. 00045 00046 protected: 00047 Checker() { } // Construct via subclass only. 00048 }; 00049 00050 } // end comma namespace. 00051 00052 #endif