aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/antlr3_cpp_runtime/include/antlr3recognizersharedstate.inl
blob: 27732cb34fc21e9554ebb680546b4ee6914fe24e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
namespace antlr3 {

template<class ImplTraits, class StreamType>
RecognizerSharedState<ImplTraits, StreamType>::RecognizerSharedState()
{
	m_exception = NULL;
	m_sizeHint = 0;
	m_error = false;
	m_errorRecovery = false;
	m_failed = false;
	m_token_present = false;
	m_lastErrorIndex = 0;
	m_errorCount = 0;
	m_backtracking = false;
	m_ruleMemo = NULL;
	m_tokenNames = NULL;
	m_tokSource = NULL;
	m_channel = 0;
	m_type = 0;
	m_tokenStartLine = 0;
	m_tokenStartCharPositionInLine = 0;
	m_tokenStartCharIndex = 0;
	m_treeAdaptor = NULL;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::FollowingType& RecognizerSharedState<ImplTraits, StreamType>::get_following()
{
	return m_following;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_UINT32 RecognizerSharedState<ImplTraits, StreamType>::get_sizeHint() const
{
	return m_sizeHint;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE bool RecognizerSharedState<ImplTraits, StreamType>::get_error() const
{
	return m_error;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::ExceptionBaseType* 
RecognizerSharedState<ImplTraits, StreamType>::get_exception() const
{
	return m_exception;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE bool RecognizerSharedState<ImplTraits, StreamType>::get_errorRecovery() const
{
	return m_errorRecovery;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE bool RecognizerSharedState<ImplTraits, StreamType>::get_failed() const
{
	return m_failed;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE bool RecognizerSharedState<ImplTraits, StreamType>::get_token_present() const
{
	return m_token_present;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_MARKER RecognizerSharedState<ImplTraits, StreamType>::get_lastErrorIndex() const
{
	return m_lastErrorIndex;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_UINT32 RecognizerSharedState<ImplTraits, StreamType>::get_errorCount() const
{
	return m_errorCount;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_INT32 RecognizerSharedState<ImplTraits, StreamType>::get_backtracking() const
{
	return m_backtracking;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::RuleMemoType* RecognizerSharedState<ImplTraits, StreamType>::get_ruleMemo() const
{
	return m_ruleMemo;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_UINT8** RecognizerSharedState<ImplTraits, StreamType>::get_tokenNames() const
{
	return m_tokenNames;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_UINT8* RecognizerSharedState<ImplTraits, StreamType>::get_tokenName( ANTLR_UINT32 i ) const
{
	return m_tokenNames[i];
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::CommonTokenType* RecognizerSharedState<ImplTraits, StreamType>::get_token()
{
	return &m_token;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::TokenSourceType* RecognizerSharedState<ImplTraits, StreamType>::get_tokSource() const
{
	return m_tokSource;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_UINT32& RecognizerSharedState<ImplTraits, StreamType>::get_channel()
{
	return m_channel;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_UINT32 RecognizerSharedState<ImplTraits, StreamType>::get_type() const
{
	return m_type;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_INT32 RecognizerSharedState<ImplTraits, StreamType>::get_tokenStartLine() const
{
	return m_tokenStartLine;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_INT32 RecognizerSharedState<ImplTraits, StreamType>::get_tokenStartCharPositionInLine() const
{
	return m_tokenStartCharPositionInLine;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE ANTLR_MARKER RecognizerSharedState<ImplTraits, StreamType>::get_tokenStartCharIndex() const
{
	return m_tokenStartCharIndex;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::StringType& RecognizerSharedState<ImplTraits, StreamType>::get_text()
{
	return m_text;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::StreamsType& RecognizerSharedState<ImplTraits, StreamType>::get_streams()
{
	return m_streams;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::TreeAdaptorType* RecognizerSharedState<ImplTraits, StreamType>::get_treeAdaptor() const
{
	return m_treeAdaptor;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_exception( ExceptionBaseType* exception )
{
	m_exception = exception;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_following( const FollowingType& following )
{
	m_following = following;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_sizeHint( ANTLR_UINT32 sizeHint )
{
	m_sizeHint = sizeHint;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_error( bool error )
{
	m_error = error;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_errorRecovery( bool errorRecovery )
{
	m_errorRecovery = errorRecovery;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_failed( bool failed )
{
	m_failed = failed;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void  RecognizerSharedState<ImplTraits, StreamType>::set_token_present(bool token_present)
{
	m_token_present = token_present;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_lastErrorIndex( ANTLR_MARKER lastErrorIndex )
{
	m_lastErrorIndex = lastErrorIndex;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_errorCount( ANTLR_UINT32 errorCount )
{
	m_errorCount = errorCount;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_backtracking( ANTLR_INT32 backtracking )
{
	m_backtracking = backtracking;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_ruleMemo( RuleMemoType* ruleMemo )
{
	m_ruleMemo = ruleMemo;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokenNames( ANTLR_UINT8** tokenNames )
{
	m_tokenNames = tokenNames;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokSource( TokenSourceType* tokSource )
{
	m_tokSource = tokSource;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_channel( ANTLR_UINT32 channel )
{
	m_channel = channel;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE void  RecognizerSharedState<ImplTraits, StreamType>::set_token(const CommonTokenType* tok)
{
	this->set_token_present( tok != NULL );
	if( tok != NULL )
		m_token = *tok;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_type( ANTLR_UINT32 type )
{
	m_type = type;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokenStartLine( ANTLR_INT32 tokenStartLine )
{
	m_tokenStartLine = tokenStartLine;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokenStartCharPositionInLine( ANTLR_INT32 tokenStartCharPositionInLine )
{
	m_tokenStartCharPositionInLine = tokenStartCharPositionInLine;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokenStartCharIndex( ANTLR_MARKER tokenStartCharIndex )
{
	m_tokenStartCharIndex = tokenStartCharIndex;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_text( const StringType& text )
{
	m_text = text;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_streams( const InputStreamsType& streams )
{
	m_streams = streams;
}
template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_treeAdaptor( TreeAdaptorType* adaptor )
{
	m_treeAdaptor = adaptor;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::inc_errorCount()
{
	++m_errorCount;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::inc_backtracking()
{
	++m_backtracking;
}

template<class ImplTraits, class StreamType>
ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::dec_backtracking()
{
	--m_backtracking;
}

}