• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1ANTLR_BEGIN_NAMESPACE()
2
3template<class ImplTraits, class StreamType>
4RecognizerSharedState<ImplTraits, StreamType>::RecognizerSharedState()
5{
6	m_exception = NULL;
7	m_sizeHint = 0;
8	m_error = false;
9	m_errorRecovery = false;
10	m_failed = false;
11	m_lastErrorIndex = 0;
12	m_errorCount = 0;
13	m_backtracking = false;
14	m_ruleMemo = NULL;
15	m_tokenNames = NULL;
16	m_tokSource = NULL;
17	m_channel = 0;
18	m_type = 0;
19	m_tokenStartLine = 0;
20	m_tokenStartCharPositionInLine = 0;
21	m_tokenStartCharIndex = 0;
22}
23
24template<class ImplTraits, class StreamType>
25ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::FollowingType& RecognizerSharedState<ImplTraits, StreamType>::get_following()
26{
27	return m_following;
28}
29template<class ImplTraits, class StreamType>
30ANTLR_INLINE ANTLR_UINT32 RecognizerSharedState<ImplTraits, StreamType>::get_sizeHint() const
31{
32	return m_sizeHint;
33}
34template<class ImplTraits, class StreamType>
35ANTLR_INLINE bool RecognizerSharedState<ImplTraits, StreamType>::get_error() const
36{
37	return m_error;
38}
39template<class ImplTraits, class StreamType>
40ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::ExceptionBaseType*
41RecognizerSharedState<ImplTraits, StreamType>::get_exception() const
42{
43	return m_exception;
44}
45
46template<class ImplTraits, class StreamType>
47ANTLR_INLINE bool RecognizerSharedState<ImplTraits, StreamType>::get_errorRecovery() const
48{
49	return m_errorRecovery;
50}
51template<class ImplTraits, class StreamType>
52ANTLR_INLINE bool RecognizerSharedState<ImplTraits, StreamType>::get_failed() const
53{
54	return m_failed;
55}
56
57template<class ImplTraits, class StreamType>
58ANTLR_INLINE bool RecognizerSharedState<ImplTraits, StreamType>::get_token_present() const
59{
60	return m_token_present;
61}
62
63template<class ImplTraits, class StreamType>
64ANTLR_INLINE ANTLR_MARKER RecognizerSharedState<ImplTraits, StreamType>::get_lastErrorIndex() const
65{
66	return m_lastErrorIndex;
67}
68template<class ImplTraits, class StreamType>
69ANTLR_INLINE ANTLR_UINT32 RecognizerSharedState<ImplTraits, StreamType>::get_errorCount() const
70{
71	return m_errorCount;
72}
73template<class ImplTraits, class StreamType>
74ANTLR_INLINE ANTLR_INT32 RecognizerSharedState<ImplTraits, StreamType>::get_backtracking() const
75{
76	return m_backtracking;
77}
78template<class ImplTraits, class StreamType>
79ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::RuleMemoType* RecognizerSharedState<ImplTraits, StreamType>::get_ruleMemo() const
80{
81	return m_ruleMemo;
82}
83template<class ImplTraits, class StreamType>
84ANTLR_INLINE ANTLR_UINT8** RecognizerSharedState<ImplTraits, StreamType>::get_tokenNames() const
85{
86	return m_tokenNames;
87}
88template<class ImplTraits, class StreamType>
89ANTLR_INLINE ANTLR_UINT8* RecognizerSharedState<ImplTraits, StreamType>::get_tokenName( ANTLR_UINT32 i ) const
90{
91	return m_tokenNames[i];
92}
93template<class ImplTraits, class StreamType>
94ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::CommonTokenType* RecognizerSharedState<ImplTraits, StreamType>::get_token()
95{
96	return &m_token;
97}
98template<class ImplTraits, class StreamType>
99ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::TokenSourceType* RecognizerSharedState<ImplTraits, StreamType>::get_tokSource() const
100{
101	return m_tokSource;
102}
103template<class ImplTraits, class StreamType>
104ANTLR_INLINE ANTLR_UINT32& RecognizerSharedState<ImplTraits, StreamType>::get_channel()
105{
106	return m_channel;
107}
108template<class ImplTraits, class StreamType>
109ANTLR_INLINE ANTLR_UINT32 RecognizerSharedState<ImplTraits, StreamType>::get_type() const
110{
111	return m_type;
112}
113template<class ImplTraits, class StreamType>
114ANTLR_INLINE ANTLR_INT32 RecognizerSharedState<ImplTraits, StreamType>::get_tokenStartLine() const
115{
116	return m_tokenStartLine;
117}
118template<class ImplTraits, class StreamType>
119ANTLR_INLINE ANTLR_INT32 RecognizerSharedState<ImplTraits, StreamType>::get_tokenStartCharPositionInLine() const
120{
121	return m_tokenStartCharPositionInLine;
122}
123template<class ImplTraits, class StreamType>
124ANTLR_INLINE ANTLR_MARKER RecognizerSharedState<ImplTraits, StreamType>::get_tokenStartCharIndex() const
125{
126	return m_tokenStartCharIndex;
127}
128template<class ImplTraits, class StreamType>
129ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::StringType& RecognizerSharedState<ImplTraits, StreamType>::get_text()
130{
131	return m_text;
132}
133template<class ImplTraits, class StreamType>
134ANTLR_INLINE typename RecognizerSharedState<ImplTraits, StreamType>::StreamsType& RecognizerSharedState<ImplTraits, StreamType>::get_streams()
135{
136	return m_streams;
137}
138template<class ImplTraits, class StreamType>
139ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_exception( ExceptionBaseType* exception )
140{
141	m_exception = exception;
142}
143template<class ImplTraits, class StreamType>
144ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_following( const FollowingType& following )
145{
146	m_following = following;
147}
148template<class ImplTraits, class StreamType>
149ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_sizeHint( ANTLR_UINT32 sizeHint )
150{
151	m_sizeHint = sizeHint;
152}
153template<class ImplTraits, class StreamType>
154ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_error( bool error )
155{
156	m_error = error;
157}
158template<class ImplTraits, class StreamType>
159ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_errorRecovery( bool errorRecovery )
160{
161	m_errorRecovery = errorRecovery;
162}
163template<class ImplTraits, class StreamType>
164ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_failed( bool failed )
165{
166	m_failed = failed;
167}
168template<class ImplTraits, class StreamType>
169ANTLR_INLINE void  RecognizerSharedState<ImplTraits, StreamType>::set_token_present(bool token_present)
170{
171	m_token_present = token_present;
172}
173template<class ImplTraits, class StreamType>
174ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_lastErrorIndex( ANTLR_MARKER lastErrorIndex )
175{
176	m_lastErrorIndex = lastErrorIndex;
177}
178template<class ImplTraits, class StreamType>
179ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_errorCount( ANTLR_UINT32 errorCount )
180{
181	m_errorCount = errorCount;
182}
183template<class ImplTraits, class StreamType>
184ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_backtracking( ANTLR_INT32 backtracking )
185{
186	m_backtracking = backtracking;
187}
188template<class ImplTraits, class StreamType>
189ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_ruleMemo( RuleMemoType* ruleMemo )
190{
191	m_ruleMemo = ruleMemo;
192}
193template<class ImplTraits, class StreamType>
194ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokenNames( ANTLR_UINT8** tokenNames )
195{
196	m_tokenNames = tokenNames;
197}
198
199template<class ImplTraits, class StreamType>
200ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokSource( TokenSourceType* tokSource )
201{
202	m_tokSource = tokSource;
203}
204template<class ImplTraits, class StreamType>
205ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_channel( ANTLR_UINT32 channel )
206{
207	m_channel = channel;
208}
209
210template<class ImplTraits, class StreamType>
211ANTLR_INLINE void  RecognizerSharedState<ImplTraits, StreamType>::set_token(const CommonTokenType* tok)
212{
213	this->set_token_present( tok != NULL );
214	if( tok != NULL )
215		m_token = *tok;
216}
217
218template<class ImplTraits, class StreamType>
219ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_type( ANTLR_UINT32 type )
220{
221	m_type = type;
222}
223template<class ImplTraits, class StreamType>
224ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokenStartLine( ANTLR_INT32 tokenStartLine )
225{
226	m_tokenStartLine = tokenStartLine;
227}
228template<class ImplTraits, class StreamType>
229ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokenStartCharPositionInLine( ANTLR_INT32 tokenStartCharPositionInLine )
230{
231	m_tokenStartCharPositionInLine = tokenStartCharPositionInLine;
232}
233template<class ImplTraits, class StreamType>
234ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_tokenStartCharIndex( ANTLR_MARKER tokenStartCharIndex )
235{
236	m_tokenStartCharIndex = tokenStartCharIndex;
237}
238template<class ImplTraits, class StreamType>
239ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_text( const StringType& text )
240{
241	m_text = text;
242}
243template<class ImplTraits, class StreamType>
244ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::set_streams( const InputStreamsType& streams )
245{
246	m_streams = streams;
247}
248
249template<class ImplTraits, class StreamType>
250ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::inc_errorCount()
251{
252	++m_errorCount;
253}
254
255template<class ImplTraits, class StreamType>
256ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::inc_backtracking()
257{
258	++m_backtracking;
259}
260
261template<class ImplTraits, class StreamType>
262ANTLR_INLINE void RecognizerSharedState<ImplTraits, StreamType>::dec_backtracking()
263{
264	--m_backtracking;
265}
266
267ANTLR_END_NAMESPACE()
268