#include <string>
#include <vector>
#include <conio.h>
#include "assert.h"
#include "tokenize.h"
#include "skip_ws.h"
Go to the source code of this file.
◆ tokenize()
Definition at line 18 of file tokenize.cpp.
19{
24 {
25
27
29 {
30
32 for ( ;; )
33 {
35 {
38 {
39 case 'x':
40 case 'X':
42 break;
43 case '0':
45 break;
46 default:
48 break;
49 }
50 }
51 else if ( *
end ==
'\"' )
52 {
54 break;
55 }
56 else
58 }
61 }
63 {
69 }
71 {
77 {
82 }
83 if ( *
end ==
'f' || *
end ==
'F' )
85 else if ( !
f && ( *
end ==
'l' || *
end ==
'L' ) )
89 }
91 {
92 case '.':
95 break;
96 case ',':
99 break;
100 case '(':
103 break;
104 case ')':
107 break;
108 case '{':
111 break;
112 case '}':
115 break;
116 case '[':
119 break;
120 case ']':
123 break;
124 case ';':
127 break;
128 case '\\':
130 {
131 case '\n':
134 break;
135 default:
139 break;
140 }
141 break;
142 case '|':
144 {
145 case '|':
148 break;
149 default:
152 break;
153 }
154 break;
155 case '&':
157 {
158 case '&':
161 break;
162 default:
165 break;
166 }
167 break;
168 case '<':
170 {
171 case '<':
174 else
176 break;
177 case '=':
180 break;
181 default:
184 break;
185 }
186 break;
187 case '>':
189 {
190 case '>':
193 else
195 break;
196 case '=':
199 break;
200 default:
203 break;
204 }
205 break;
206 case '!':
208 {
209 case '=':
212 break;
213 default:
216 break;
217 }
218 break;
219 case '=':
221 {
222 case '=':
225 break;
226 default:
229 break;
230 }
231 break;
232 case ':':
234 {
235 case ':':
238 break;
239 default:
242 break;
243 }
244 break;
245 case '*':
247 {
248 case '=':
251 break;
252 default:
255 break;
256 }
257 break;
258 case '/':
260 {
261 case '=':
264 break;
265 default:
268 break;
269 }
270 break;
271 case '+':
273 {
274 case '+':
275 case '=':
278 break;
279 default:
282 break;
283 }
284 break;
285 case '-':
287 {
288 case '-':
289 case '=':
292 break;
293 default:
296 break;
297 }
298 break;
299 case '#':
300 while ( *
p && *
p !=
'\n' )
302 break;
303 case 0:
304 break;
305 default:
306 printf (
"choked on '%c' in tokenize() - press any key to continue\n", *
p );
309 break;
310 }
311 }
312}
_Check_return_ _CRTIMP int __cdecl getch(void)
static LPCTSTR skip_ws(LPCTSTR p)
void push_back(const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
void resize(size_type __new_size, const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
Referenced by process().