John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [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 | |
Nicolas Capens | cc863da | 2015-01-21 15:50:55 -0500 | [diff] [blame] | 10 | #include "ExtensionBehavior.h" |
| 11 | #include "Pragma.h" |
| 12 | #include "preprocessor/DirectiveHandler.h" |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 13 | |
| 14 | class TDiagnostics; |
| 15 | |
| 16 | class TDirectiveHandler : public pp::DirectiveHandler |
| 17 | { |
Nicolas Capens | c684185 | 2015-02-15 14:25:37 -0500 | [diff] [blame^] | 18 | public: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 19 | TDirectiveHandler(TExtensionBehavior& extBehavior, |
Nicolas Capens | c684185 | 2015-02-15 14:25:37 -0500 | [diff] [blame^] | 20 | TDiagnostics& diagnostics, |
| 21 | int& shaderVersion); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 22 | virtual ~TDirectiveHandler(); |
| 23 | |
| 24 | const TPragma& pragma() const { return mPragma; } |
| 25 | const TExtensionBehavior& extensionBehavior() const { return mExtensionBehavior; } |
| 26 | |
| 27 | virtual void handleError(const pp::SourceLocation& loc, |
| 28 | const std::string& msg); |
| 29 | |
| 30 | virtual void handlePragma(const pp::SourceLocation& loc, |
| 31 | const std::string& name, |
| 32 | const std::string& value); |
| 33 | |
| 34 | virtual void handleExtension(const pp::SourceLocation& loc, |
| 35 | const std::string& name, |
| 36 | const std::string& behavior); |
| 37 | |
| 38 | virtual void handleVersion(const pp::SourceLocation& loc, |
| 39 | int version); |
| 40 | |
Nicolas Capens | c684185 | 2015-02-15 14:25:37 -0500 | [diff] [blame^] | 41 | private: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 42 | TPragma mPragma; |
| 43 | TExtensionBehavior& mExtensionBehavior; |
| 44 | TDiagnostics& mDiagnostics; |
Nicolas Capens | c684185 | 2015-02-15 14:25:37 -0500 | [diff] [blame^] | 45 | int& mShaderVersion; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | #endif // COMPILER_DIRECTIVE_HANDLER_H_ |