blob: 69418c277af89af1582410a6e593049e7f2f2bbd [file] [log] [blame]
alokp@chromium.org8b851c62012-06-15 16:25:11 +00001//
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
Geoff Lang17732822013-08-29 13:46:49 -040010#include "compiler/translator/ExtensionBehavior.h"
11#include "compiler/translator/Pragma.h"
daniel@transgaming.comb3077d02013-01-11 04:12:09 +000012#include "compiler/preprocessor/DirectiveHandlerBase.h"
alokp@chromium.org8b851c62012-06-15 16:25:11 +000013
14class TDiagnostics;
15
16class TDirectiveHandler : public pp::DirectiveHandler
17{
18 public:
19 TDirectiveHandler(TExtensionBehavior& extBehavior,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +000020 TDiagnostics& diagnostics,
21 int& shaderVersion);
alokp@chromium.org8b851c62012-06-15 16:25:11 +000022 virtual ~TDirectiveHandler();
23
24 const TPragma& pragma() const { return mPragma; }
alokp@chromium.org73bc2982012-06-19 18:48:05 +000025 const TExtensionBehavior& extensionBehavior() const { return mExtensionBehavior; }
alokp@chromium.org8b851c62012-06-15 16:25:11 +000026
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
41 private:
42 TPragma mPragma;
alokp@chromium.org73bc2982012-06-19 18:48:05 +000043 TExtensionBehavior& mExtensionBehavior;
alokp@chromium.org8b851c62012-06-15 16:25:11 +000044 TDiagnostics& mDiagnostics;
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +000045 int& mShaderVersion;
alokp@chromium.org8b851c62012-06-15 16:25:11 +000046};
47
48#endif // COMPILER_DIRECTIVE_HANDLER_H_