blob: cf678957646950f3cade9603016242706db55c20 [file] [log] [blame]
alokp@chromium.org36124de82012-05-24 02:17:43 +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_PREPROCESSOR_DIRECTIVEHANDLERBASE_H_
8#define COMPILER_PREPROCESSOR_DIRECTIVEHANDLERBASE_H_
alokp@chromium.org36124de82012-05-24 02:17:43 +00009
10#include <string>
11
12namespace pp
13{
14
15struct SourceLocation;
16
17// Base class for handling directives.
18// Preprocessor uses this class to notify the clients about certain
19// preprocessor directives. Derived classes are responsible for
20// handling them in an appropriate manner.
21class DirectiveHandler
22{
23 public:
24 virtual ~DirectiveHandler();
25
Zhenyao Mod526f982014-05-13 14:51:19 -070026 virtual void handleError(const SourceLocation &loc,
27 const std::string &msg) = 0;
alokp@chromium.org36124de82012-05-24 02:17:43 +000028
29 // Handle pragma of form: #pragma name[(value)]
Zhenyao Mod526f982014-05-13 14:51:19 -070030 virtual void handlePragma(const SourceLocation &loc,
31 const std::string &name,
Zhenyao Mo94ac7b72014-10-15 18:22:08 -070032 const std::string &value,
33 bool stdgl) = 0;
alokp@chromium.org7c884542012-05-24 19:13:03 +000034
Zhenyao Mod526f982014-05-13 14:51:19 -070035 virtual void handleExtension(const SourceLocation &loc,
36 const std::string &name,
37 const std::string &behavior) = 0;
alokp@chromium.org7c884542012-05-24 19:13:03 +000038
Zhenyao Mod526f982014-05-13 14:51:19 -070039 virtual void handleVersion(const SourceLocation &loc,
alokp@chromium.org7c884542012-05-24 19:13:03 +000040 int version) = 0;
alokp@chromium.org36124de82012-05-24 02:17:43 +000041};
42
43} // namespace pp
Geoff Lang0a73dd82014-11-19 16:18:08 -050044
45#endif // COMPILER_PREPROCESSOR_DIRECTIVEHANDLERBASE_H_