ANTLR Support Libraries 2.7.1+
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Friends
Macros
Pages
antlr
MismatchedTokenException.hpp
Go to the documentation of this file.
1
#ifndef INC_MismatchedTokenException_hpp__
2
#define INC_MismatchedTokenException_hpp__
3
4
/* ANTLR Translator Generator
5
* Project led by Terence Parr at http://www.jGuru.com
6
* Software rights: http://www.antlr.org/license.html
7
*
8
* $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/MismatchedTokenException.hpp#2 $
9
*/
10
11
#include <
antlr/config.hpp
>
12
#include <
antlr/RecognitionException.hpp
>
13
#include <
antlr/BitSet.hpp
>
14
#include <
antlr/Token.hpp
>
15
#include <
antlr/AST.hpp
>
16
#include <vector>
17
18
#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
19
namespace
antlr {
20
#endif
21
22
class
ANTLR_API
MismatchedTokenException
:
public
RecognitionException
{
23
public
:
24
MismatchedTokenException
();
25
27
MismatchedTokenException
(
28
const
char
*
const
* tokenNames_,
29
const
int
numTokens_,
30
RefAST
node_,
31
int
lower,
32
int
upper_,
33
bool
matchNot
34
);
35
36
// Expected token / not token
37
MismatchedTokenException
(
38
const
char
*
const
* tokenNames_,
39
const
int
numTokens_,
40
RefAST
node_,
41
int
expecting_,
42
bool
matchNot
43
);
44
45
// Expected BitSet / not BitSet
46
MismatchedTokenException
(
47
const
char
*
const
* tokenNames_,
48
const
int
numTokens_,
49
RefAST
node_,
50
BitSet
set_,
51
bool
matchNot
52
);
53
54
// Expected range / not range
55
MismatchedTokenException
(
56
const
char
*
const
* tokenNames_,
57
const
int
numTokens_,
58
RefToken
token_,
59
int
lower,
60
int
upper_,
61
bool
matchNot,
62
const
ANTLR_USE_NAMESPACE
(std)
string
& fileName_
63
);
64
65
// Expected token / not token
66
MismatchedTokenException
(
67
const
char
*
const
* tokenNames_,
68
const
int
numTokens_,
69
RefToken
token_,
70
int
expecting_,
71
bool
matchNot,
72
const
ANTLR_USE_NAMESPACE
(std)
string
& fileName_
73
);
74
75
// Expected BitSet / not BitSet
76
MismatchedTokenException
(
77
const
char
*
const
* tokenNames_,
78
const
int
numTokens_,
79
RefToken
token_,
80
BitSet
set_,
81
bool
matchNot,
82
const
ANTLR_USE_NAMESPACE
(std)
string
& fileName_
83
);
84
~MismatchedTokenException
() throw() {}
85
89
ANTLR_USE_NAMESPACE
(std)string getMessage() const;
90
91
public:
93
const
RefToken
token;
95
const
RefAST
node;
97
ANTLR_USE_NAMESPACE
(std)
string
tokenText;
98
100
#ifndef NO_STATIC_CONSTS
101
static
const
int
TOKEN = 1;
102
static
const
int
NOT_TOKEN = 2;
103
static
const
int
RANGE = 3;
104
static
const
int
NOT_RANGE = 4;
105
static
const
int
SET = 5;
106
static
const
int
NOT_SET = 6;
107
#else
108
enum
{
109
TOKEN = 1,
110
NOT_TOKEN = 2,
111
RANGE = 3,
112
NOT_RANGE = 4,
113
SET = 5,
114
NOT_SET = 6
115
};
116
#endif
117
118
public
:
120
int
mismatchType
;
121
123
int
expecting
;
124
126
int
upper
;
127
129
BitSet
set
;
130
131
private
:
133
const
char
*
const
*
tokenNames
;
135
const
int
numTokens
;
137
ANTLR_USE_NAMESPACE
(std)string tokenName(
int
tokenType) const;
138
};
139
140
#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
141
}
142
#endif
143
144
#endif //INC_MismatchedTokenException_hpp__
Generated by
1.8.1.1