gfx/angle/src/compiler/preprocessor/DirectiveHandlerBase.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/compiler/preprocessor/DirectiveHandlerBase.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +//
     1.5 +// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
     1.6 +// Use of this source code is governed by a BSD-style license that can be
     1.7 +// found in the LICENSE file.
     1.8 +//
     1.9 +
    1.10 +#ifndef COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
    1.11 +#define COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
    1.12 +
    1.13 +#include <string>
    1.14 +
    1.15 +namespace pp
    1.16 +{
    1.17 +
    1.18 +struct SourceLocation;
    1.19 +
    1.20 +// Base class for handling directives.
    1.21 +// Preprocessor uses this class to notify the clients about certain
    1.22 +// preprocessor directives. Derived classes are responsible for
    1.23 +// handling them in an appropriate manner.
    1.24 +class DirectiveHandler
    1.25 +{
    1.26 +  public:
    1.27 +    virtual ~DirectiveHandler();
    1.28 +
    1.29 +    virtual void handleError(const SourceLocation& loc,
    1.30 +                             const std::string& msg) = 0;
    1.31 +
    1.32 +    // Handle pragma of form: #pragma name[(value)]
    1.33 +    virtual void handlePragma(const SourceLocation& loc,
    1.34 +                              const std::string& name,
    1.35 +                              const std::string& value) = 0;
    1.36 +
    1.37 +    virtual void handleExtension(const SourceLocation& loc,
    1.38 +                                 const std::string& name,
    1.39 +                                 const std::string& behavior) = 0;
    1.40 +
    1.41 +    virtual void handleVersion(const SourceLocation& loc,
    1.42 +                               int version) = 0;
    1.43 +};
    1.44 +
    1.45 +}  // namespace pp
    1.46 +#endif  // COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_

mercurial