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 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 7 | #ifndef COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_ |
| 8 | #define COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_ |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 9 | |
Geoff Lang | 1773282 | 2013-08-29 13:46:49 -0400 | [diff] [blame] | 10 | #include "compiler/translator/ExtensionBehavior.h" |
| 11 | #include "compiler/translator/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, |
shannon.woods%transgaming.com@gtempaccount.com | 5524db0 | 2013-04-13 03:38:16 +0000 | [diff] [blame] | 20 | TDiagnostics& diagnostics, |
Olli Etuaho | 853dc1a | 2014-11-06 17:25:48 +0200 | [diff] [blame^] | 21 | int& shaderVersion, |
| 22 | bool debugShaderPrecisionSupported); |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 23 | virtual ~TDirectiveHandler(); |
| 24 | |
| 25 | const TPragma& pragma() const { return mPragma; } |
alokp@chromium.org | 73bc298 | 2012-06-19 18:48:05 +0000 | [diff] [blame] | 26 | const TExtensionBehavior& extensionBehavior() const { return mExtensionBehavior; } |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 27 | |
| 28 | virtual void handleError(const pp::SourceLocation& loc, |
| 29 | const std::string& msg); |
| 30 | |
| 31 | virtual void handlePragma(const pp::SourceLocation& loc, |
| 32 | const std::string& name, |
Zhenyao Mo | 94ac7b7 | 2014-10-15 18:22:08 -0700 | [diff] [blame] | 33 | const std::string& value, |
| 34 | bool stdgl); |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 35 | |
| 36 | virtual void handleExtension(const pp::SourceLocation& loc, |
| 37 | const std::string& name, |
| 38 | const std::string& behavior); |
| 39 | |
| 40 | virtual void handleVersion(const pp::SourceLocation& loc, |
| 41 | int version); |
| 42 | |
| 43 | private: |
| 44 | TPragma mPragma; |
alokp@chromium.org | 73bc298 | 2012-06-19 18:48:05 +0000 | [diff] [blame] | 45 | TExtensionBehavior& mExtensionBehavior; |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 46 | TDiagnostics& mDiagnostics; |
shannon.woods%transgaming.com@gtempaccount.com | 5524db0 | 2013-04-13 03:38:16 +0000 | [diff] [blame] | 47 | int& mShaderVersion; |
Olli Etuaho | 853dc1a | 2014-11-06 17:25:48 +0200 | [diff] [blame^] | 48 | bool mDebugShaderPrecisionSupported; |
alokp@chromium.org | 8b851c6 | 2012-06-15 16:25:11 +0000 | [diff] [blame] | 49 | }; |
| 50 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 51 | #endif // COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_ |