2 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
\r
3 // Use of this source code is governed by a BSD-style license that can be
\r
4 // found in the LICENSE file.
\r
7 #ifndef COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
\r
8 #define COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
\r
15 struct SourceLocation;
\r
17 // Base class for handling directives.
\r
18 // Preprocessor uses this class to notify the clients about certain
\r
19 // preprocessor directives. Derived classes are responsible for
\r
20 // handling them in an appropriate manner.
\r
21 class DirectiveHandler
\r
24 virtual ~DirectiveHandler();
\r
26 virtual void handleError(const SourceLocation& loc,
\r
27 const std::string& msg) = 0;
\r
29 // Handle pragma of form: #pragma name[(value)]
\r
30 virtual void handlePragma(const SourceLocation& loc,
\r
31 const std::string& name,
\r
32 const std::string& value) = 0;
\r
34 virtual void handleExtension(const SourceLocation& loc,
\r
35 const std::string& name,
\r
36 const std::string& behavior) = 0;
\r
38 virtual void handleVersion(const SourceLocation& loc,
\r
43 #endif // COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
\r