michael@0: // michael@0: // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: #ifndef COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_ michael@0: #define COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_ michael@0: michael@0: #include michael@0: michael@0: namespace pp michael@0: { michael@0: michael@0: struct SourceLocation; michael@0: michael@0: // Base class for handling directives. michael@0: // Preprocessor uses this class to notify the clients about certain michael@0: // preprocessor directives. Derived classes are responsible for michael@0: // handling them in an appropriate manner. michael@0: class DirectiveHandler michael@0: { michael@0: public: michael@0: virtual ~DirectiveHandler(); michael@0: michael@0: virtual void handleError(const SourceLocation& loc, michael@0: const std::string& msg) = 0; michael@0: michael@0: // Handle pragma of form: #pragma name[(value)] michael@0: virtual void handlePragma(const SourceLocation& loc, michael@0: const std::string& name, michael@0: const std::string& value) = 0; michael@0: michael@0: virtual void handleExtension(const SourceLocation& loc, michael@0: const std::string& name, michael@0: const std::string& behavior) = 0; michael@0: michael@0: virtual void handleVersion(const SourceLocation& loc, michael@0: int version) = 0; michael@0: }; michael@0: michael@0: } // namespace pp michael@0: #endif // COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_