Home | History | Annotate | Download | only in preprocessor

Lines Matching refs:ch

74 static void noop(InputSrc *in, int ch, yystypepp * yylvalpp) {}
162 static void str_ungetch(StringInputSrc *in, int ch, yystypepp *type) {
163 if (in->p[-1] == ch)in->p--;
168 if (ch == '\n') {
195 #define APPEND_CHAR_S(ch, str, len, max_len) \
197 str[len++] = ch; \
207 * ch - '.' or 'e'
211 static int lFloatConst(int ch, int len, yystypepp * yylvalpp)
214 assert((ch == '.') || (ch == 'e') || (ch == 'E'));
216 if (ch == '.') {
218 APPEND_CHAR_S(ch, yylvalpp->symbol_name, len, MAX_SYMBOL_NAME_LEN);
219 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
220 } while (ch >= '0' && ch <= '9');
224 if (ch == 'e' || ch == 'E') {
225 APPEND_CHAR_S(ch, yylvalpp->symbol_name, len, MAX_SYMBOL_NAME_LEN);
226 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
227 if (ch == '+') {
228 APPEND_CHAR_S(ch, yylvalpp->symbol_name, len, MAX_SYMBOL_NAME_LEN);
229 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
230 } else if (ch == '-') {
231 APPEND_CHAR_S(ch, yylvalpp->symbol_name, len, MAX_SYMBOL_NAME_LEN);
232 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
234 if (ch >= '0' && ch <= '9') {
235 while (ch >= '0' && ch <= '9') {
236 APPEND_CHAR_S(ch, yylvalpp->symbol_name, len, MAX_SYMBOL_NAME_LEN);
237 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
243 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
262 int len, ch, ii, ival = 0;
266 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
268 while (ch == ' ' || ch == '\t' || ch == '\r') {
270 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
277 switch (ch) {
279 return ch; // Single character token
295 APPEND_CHAR_S(ch, yylvalpp->symbol_name, len, MAX_SYMBOL_NAME_LEN);
296 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
297 } while ((ch >= 'a' && ch <= 'z') ||
298 (ch >= 'A' && ch <= 'Z') ||
299 (ch >= '0' && ch <= '9') ||
300 ch == '_');
303 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
308 APPEND_CHAR_S(ch, yylvalpp->symbol_name, len, MAX_SYMBOL_NAME_LEN);
309 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
310 if (ch == 'x' || ch == 'X') { // hexadecimal integer constants
311 APPEND_CHAR_S(ch, yylvalpp->symbol_name, len, MAX_SYMBOL_NAME_LEN);
312 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
313 if ((ch >= '0' && ch <= '9') ||
314 (ch >= 'A' && ch <= 'F') ||
315 (ch >= 'a' && ch <= 'f'))
320 yylvalpp->symbol_name[len++] = ch;
321 if (ch >= '0' && ch <= '9') {
322 ii = ch - '0';
323 } else if (ch >= 'A' && ch <= 'F') {
324 ii = ch - 'A' + 10;
326 ii = ch - 'a' + 10;
333 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
334 } while ((ch >= '0' && ch <= '9') ||
335 (ch >= 'A' && ch <= 'F') ||
336 (ch >= 'a' && ch <= 'f'));
342 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
345 } else if (ch >= '0' && ch <= '7') { // octal integer constants
349 yylvalpp->symbol_name[len++] = ch;
350 ii = ch - '0';
356 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
357 } while (ch >= '0' && ch <= '7');
358 if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'h' || ch == 'x'|| ch == 'E')
359 return lFloatConst(ch, len, yylvalpp);
362 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
366 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
367 ch = '0';
373 APPEND_CHAR_S(ch, yylvalpp->symbol_name, len, MAX_SYMBOL_NAME_LEN);
374 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
375 } while (ch >= '0' && ch <= '9');
376 if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'h' || ch == 'x'|| ch == 'E') {
377 return lFloatConst(ch, len, yylvalpp);
381 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
384 ch = yylvalpp->symbol_name[ii] - '0';
385 ival = ival*10 + ch;
386 if ((ival > 214748364) || (ival == 214748364 && ch >= 8)) {
398 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
399 if (ch == '-') {
401 } else if (ch == '=') {
404 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
408 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
409 if (ch == '+') {
411 } else if (ch == '=') {
414 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
418 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
419 if (ch == '=') {
422 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
426 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
427 if (ch == '=') {
429 } else if (ch == '>'){
432 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
436 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
437 if (ch == '>') {
440 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
444 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
445 if (ch == '^') {
448 if (ch == '=')
451 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
457 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
458 if (ch == '=') {
461 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
465 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
466 if (ch == '=') {
469 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
473 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
474 if (ch == '|') {
477 if (ch == '=')
480 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
485 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
486 if (ch == '&') {
489 if (ch == '=')
492 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
497 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
498 if (ch == '<') {
499 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
500 if(ch == '=')
503 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
507 if (ch == '=') {
510 if (ch == '%')
512 else if (ch == ':')
515 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
521 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
522 if (ch == '>') {
523 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
524 if(ch == '=')
527 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
531 if (ch == '=') {
534 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
539 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
540 if (ch >= '0' && ch <= '9') {
541 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
544 if (ch == '.') {
547 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
552 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
553 if (ch == '/') {
555 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
556 } while (ch != '\n' && ch != EOF);
557 if (ch == EOF)
560 } else if (ch == '*') {
562 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
564 while (ch != '*') {
565 if (ch == '\n') nlcount++;
566 if (ch == EOF) {
570 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
572 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
573 if (ch == EOF) {
577 } while (ch != '/');
582 } else if (ch == '=') {
585 cpp->currentInput->ungetch(cpp->currentInput, ch, yylvalpp);
590 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
591 while (ch != '"' && ch != '\n' && ch != EOF) {
592 if (ch == '\\') {
596 APPEND_CHAR_S(ch, string_val, len, MAX_STRING_LEN);
597 ch = cpp->currentInput->getch(cpp->currentInput, yylvalpp);
601 if (ch == '"') {