alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | #ifndef COMPILER_DIRECTIVE_HANDLER_H_ |
| 8 | #define COMPILER_DIRECTIVE_HANDLER_H_ |
| 9 | |
| 10 | #include "compiler/ExtensionBehavior.h" |
| 11 | #include "compiler/Pragma.h" |
daniel@transgaming.com | b3077d0 | 2013-01-11 04:12:09 +0000 | [diff] [blame] | 12 | #include "compiler/preprocessor/DirectiveHandlerBase.h" |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 13 | |
| 14 | class TDiagnostics; |
| 15 | |
| 16 | class TDirectiveHandler : public pp::DirectiveHandler |
| 17 | { |
| 18 | public: |
| 19 | TDirectiveHandler(TExtensionBehavior& extBehavior, |
| 20 | TDiagnostics& diagnostics); |
| 21 | virtual ~TDirectiveHandler(); |
| 22 | |
| 23 | const TPragma& pragma() const { return mPragma; } |
alokp@chromium.org | 73bc298 | 2012-06-19 18:48:05 +0000 | [diff] [blame] | 24 | const TExtensionBehavior& extensionBehavior() const { return mExtensionBehavior; } |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 25 | |
| 26 | virtual void handleError(const pp::SourceLocation& loc, |
| 27 | const std::string& msg); |
| 28 | |
| 29 | virtual void handlePragma(const pp::SourceLocation& loc, |
| 30 | const std::string& name, |
| 31 | const std::string& value); |
| 32 | |
| 33 | virtual void handleExtension(const pp::SourceLocation& loc, |
| 34 | const std::string& name, |
| 35 | const std::string& behavior); |
| 36 | |
| 37 | virtual void handleVersion(const pp::SourceLocation& loc, |
| 38 | int version); |
| 39 | |
| 40 | private: |
| 41 | TPragma mPragma; |
alokp@chromium.org | 73bc298 | 2012-06-19 18:48:05 +0000 | [diff] [blame] | 42 | TExtensionBehavior& mExtensionBehavior; |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 43 | TDiagnostics& mDiagnostics; |
| 44 | }; |
| 45 | |
| 46 | #endif // COMPILER_DIRECTIVE_HANDLER_H_ |