zenilib: zenilib/jni/external/angle/src/compiler/preprocessor/DiagnosticsBase.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DiagnosticsBase.h
Go to the documentation of this file.
1 //
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
7 #ifndef COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
8 #define COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
9
10 #include <string>
11
12 namespace pp
13 {
14
15 struct SourceLocation;
16
17 // Base class for reporting diagnostic messages.
18 // Derived classes are responsible for formatting and printing the messages.
19 class Diagnostics
20 {
21 public:
22 enum Severity
23 {
24 ERROR,
25 WARNING
26 };
27 enum ID
28 {
29 ERROR_BEGIN,
30 INTERNAL_ERROR,
31 OUT_OF_MEMORY,
32 INVALID_CHARACTER,
33 INVALID_NUMBER,
34 INTEGER_OVERFLOW,
35 FLOAT_OVERFLOW,
36 TOKEN_TOO_LONG,
37 INVALID_EXPRESSION,
38 DIVISION_BY_ZERO,
39 EOF_IN_COMMENT,
40 UNEXPECTED_TOKEN,
41 DIRECTIVE_INVALID_NAME,
42 MACRO_NAME_RESERVED,
43 MACRO_REDEFINED,
44 MACRO_PREDEFINED_REDEFINED,
45 MACRO_PREDEFINED_UNDEFINED,
46 MACRO_UNTERMINATED_INVOCATION,
47 MACRO_TOO_FEW_ARGS,
48 MACRO_TOO_MANY_ARGS,
49 CONDITIONAL_ENDIF_WITHOUT_IF,
50 CONDITIONAL_ELSE_WITHOUT_IF,
51 CONDITIONAL_ELSE_AFTER_ELSE,
52 CONDITIONAL_ELIF_WITHOUT_IF,
53 CONDITIONAL_ELIF_AFTER_ELSE,
54 CONDITIONAL_UNTERMINATED,
55 INVALID_EXTENSION_NAME,
56 INVALID_EXTENSION_BEHAVIOR,
57 INVALID_EXTENSION_DIRECTIVE,
58 INVALID_VERSION_NUMBER,
59 INVALID_VERSION_DIRECTIVE,
60 VERSION_NOT_FIRST_STATEMENT,
61 INVALID_LINE_NUMBER,
62 INVALID_FILE_NUMBER,
63 INVALID_LINE_DIRECTIVE,
64 ERROR_END,
65
66 WARNING_BEGIN,
67 EOF_IN_DIRECTIVE,
68 CONDITIONAL_UNEXPECTED_TOKEN,
69 UNRECOGNIZED_PRAGMA,
70 WARNING_END
71 };
72
73 virtual ~Diagnostics();
74
75 void report(ID id, const SourceLocation& loc, const std::string& text);
76
77 protected:
78 Severity severity(ID id);
79 std::string message(ID id);
80
81 virtual void print(ID id,
82 const SourceLocation& loc,
83 const std::string& text) = 0;
84 };
85
86 } // namespace pp
87 #endif // COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
pp::Diagnostics::CONDITIONAL_ELIF_WITHOUT_IF
Definition: DiagnosticsBase.h:52
pp::Diagnostics::~Diagnostics
virtual ~Diagnostics()
Definition: DiagnosticsBase.cpp:14
pp::Diagnostics::WARNING_BEGIN
Definition: DiagnosticsBase.h:66
pp::Diagnostics::EOF_IN_DIRECTIVE
Definition: DiagnosticsBase.h:67
pp::Diagnostics::INVALID_NUMBER
Definition: DiagnosticsBase.h:33
pp::Diagnostics::ERROR_END
Definition: DiagnosticsBase.h:64
pp::Diagnostics::MACRO_NAME_RESERVED
Definition: DiagnosticsBase.h:42
pp::Diagnostics::INVALID_EXTENSION_DIRECTIVE
Definition: DiagnosticsBase.h:57
pp::Diagnostics::MACRO_REDEFINED
Definition: DiagnosticsBase.h:43
pp::Diagnostics::INVALID_LINE_NUMBER
Definition: DiagnosticsBase.h:61
pp
png_sPLT_entryp pp
Definition: pngrutil.c:1375
pp::Diagnostics::INVALID_FILE_NUMBER
Definition: DiagnosticsBase.h:62
pp::Diagnostics::DIRECTIVE_INVALID_NAME
Definition: DiagnosticsBase.h:41
pp::Diagnostics::INTEGER_OVERFLOW
Definition: DiagnosticsBase.h:34
pp::Diagnostics::INVALID_EXPRESSION
Definition: DiagnosticsBase.h:37
pp::Diagnostics::WARNING
Definition: DiagnosticsBase.h:25
pp::Diagnostics::INVALID_LINE_DIRECTIVE
Definition: DiagnosticsBase.h:63
pp::Diagnostics::CONDITIONAL_UNEXPECTED_TOKEN
Definition: DiagnosticsBase.h:68
pp::Diagnostics::UNRECOGNIZED_PRAGMA
Definition: DiagnosticsBase.h:69
pp::Diagnostics::CONDITIONAL_ELIF_AFTER_ELSE
Definition: DiagnosticsBase.h:53
pp::Diagnostics::INVALID_CHARACTER
Definition: DiagnosticsBase.h:32
pp::Diagnostics::INVALID_VERSION_NUMBER
Definition: DiagnosticsBase.h:58
pp::Diagnostics::UNEXPECTED_TOKEN
Definition: DiagnosticsBase.h:40
pp::Diagnostics::ERROR
Definition: DiagnosticsBase.h:24
pp::Diagnostics::CONDITIONAL_ELSE_AFTER_ELSE
Definition: DiagnosticsBase.h:51
pp::Diagnostics::MACRO_UNTERMINATED_INVOCATION
Definition: DiagnosticsBase.h:46
pp::Diagnostics::CONDITIONAL_ENDIF_WITHOUT_IF
Definition: DiagnosticsBase.h:49
pp::Diagnostics::EOF_IN_COMMENT
Definition: DiagnosticsBase.h:39
pp::Diagnostics::MACRO_TOO_MANY_ARGS
Definition: DiagnosticsBase.h:48
pp::Diagnostics::report
void report(ID id, const SourceLocation &loc, const std::string &text)
Definition: DiagnosticsBase.cpp:18
pp::Diagnostics::WARNING_END
Definition: DiagnosticsBase.h:70
pp::Diagnostics::print
virtual void print(ID id, const SourceLocation &loc, const std::string &text)=0
pp::Diagnostics::MACRO_PREDEFINED_UNDEFINED
Definition: DiagnosticsBase.h:45
pp::Diagnostics::ERROR_BEGIN
Definition: DiagnosticsBase.h:29
pp::Diagnostics
Definition: DiagnosticsBase.h:19
pp::Diagnostics::FLOAT_OVERFLOW
Definition: DiagnosticsBase.h:35
string
GLsizei const GLcharARB ** string
Definition: glew.h:5638
pp::Diagnostics::message
std::string message(ID id)
Definition: DiagnosticsBase.cpp:38
pp::Diagnostics::TOKEN_TOO_LONG
Definition: DiagnosticsBase.h:36
pp::Diagnostics::DIVISION_BY_ZERO
Definition: DiagnosticsBase.h:38
pp::Diagnostics::MACRO_PREDEFINED_REDEFINED
Definition: DiagnosticsBase.h:44
pp::Diagnostics::severity
Severity severity(ID id)
Definition: DiagnosticsBase.cpp:26
pp::Diagnostics::CONDITIONAL_UNTERMINATED
Definition: DiagnosticsBase.h:54
pp::Diagnostics::INVALID_VERSION_DIRECTIVE
Definition: DiagnosticsBase.h:59
pp::Diagnostics::ID
ID
Definition: DiagnosticsBase.h:27
pp::Diagnostics::INVALID_EXTENSION_BEHAVIOR
Definition: DiagnosticsBase.h:56
pp::Diagnostics::OUT_OF_MEMORY
Definition: DiagnosticsBase.h:31
pp::Diagnostics::CONDITIONAL_ELSE_WITHOUT_IF
Definition: DiagnosticsBase.h:50
pp::Diagnostics::MACRO_TOO_FEW_ARGS
Definition: DiagnosticsBase.h:47
pp::SourceLocation
Definition: SourceLocation.h:13
pp::Diagnostics::INTERNAL_ERROR
Definition: DiagnosticsBase.h:30
pp::Diagnostics::INVALID_EXTENSION_NAME
Definition: DiagnosticsBase.h:55
pp::Diagnostics::Severity
Severity
Definition: DiagnosticsBase.h:22
pp::Diagnostics::VERSION_NOT_FIRST_STATEMENT
Definition: DiagnosticsBase.h:60