blob: 5b591ab7dc4c248c978f393dbf0100ee1b51922b [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
Geoff Lang0a73dd82014-11-19 16:18:08 -05007#ifndef COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_
8#define COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_
alokp@chromium.org8b851c62012-06-15 16:25:11 +00009
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,
Zhenyao Mo94ac7b72014-10-15 18:22:08 -070032 const std::string& value,
33 bool stdgl);
alokp@chromium.org8b851c62012-06-15 16:25:11 +000034
35 virtual void handleExtension(const pp::SourceLocation& loc,
36 const std::string& name,
37 const std::string& behavior);
38
39 virtual void handleVersion(const pp::SourceLocation& loc,
40 int version);
41
42 private:
43 TPragma mPragma;
alokp@chromium.org73bc2982012-06-19 18:48:05 +000044 TExtensionBehavior& mExtensionBehavior;
alokp@chromium.org8b851c62012-06-15 16:25:11 +000045 TDiagnostics& mDiagnostics;
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +000046 int& mShaderVersion;
alokp@chromium.org8b851c62012-06-15 16:25:11 +000047};
48
Geoff Lang0a73dd82014-11-19 16:18:08 -050049#endif // COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_