1 /* Lexical analyzer for C and Objective C.
2 Copyright (C) 1987, 88, 89, 92, 94-97, 1998 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
36 /* MULTIBYTE_CHARS support only works for native compilers.
37 ??? Ideally what we want is to model widechar support after
38 the current floating point support. */
40 #undef MULTIBYTE_CHARS
43 #ifdef MULTIBYTE_CHARS
46 #endif /* MULTIBYTE_CHARS */
50 extern cpp_reader parse_in;
51 extern cpp_options parse_options;
53 /* Stream for reading from the input file. */
57 extern void yyprint PROTO((FILE *, int, YYSTYPE));
59 /* The elements of `ridpointers' are identifier nodes
60 for the reserved type names and storage classes.
61 It is indexed by a RID_... value. */
62 tree ridpointers[(int) RID_MAX];
64 /* Cause the `yydebug' variable to be defined. */
68 extern unsigned char *yy_cur, *yy_lim;
70 extern int yy_get_token ();
72 #define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
73 #define UNGETC(c) ((c) == EOF ? 0 : yy_cur--)
75 #else /* ! USE_CPPLIB */
77 #define GETC() getch ()
78 #define UNGETC(c) put_back (c)
80 struct putback_buffer {
86 static struct putback_buffer putback = {NULL, 0, -1};
91 if (putback.index != -1)
93 int ch = putback.buffer[putback.index];
106 if (putback.index == putback.buffer_size - 1)
108 putback.buffer_size += 16;
109 putback.buffer = xrealloc (putback.buffer, putback.buffer_size);
111 putback.buffer[++putback.index] = ch;
114 #endif /* ! USE_CPPLIB */
116 /* the declaration found for the last IDENTIFIER token read in.
117 yylex must look this up to detect typedefs, which get token type TYPENAME,
118 so it is left around in case the identifier is not a typedef but is
119 used in a context which makes it a reference to a variable. */
122 /* Nonzero enables objc features. */
124 int doing_objc_thang;
128 /* File used for outputting assembler code. */
129 extern FILE *asm_out_file;
131 #ifndef WCHAR_TYPE_SIZE
133 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
135 #define WCHAR_TYPE_SIZE BITS_PER_WORD
139 /* Number of bytes in a wide character. */
140 #define WCHAR_BYTES (WCHAR_TYPE_SIZE / BITS_PER_UNIT)
142 static int maxtoken; /* Current nominal length of token buffer. */
143 char *token_buffer; /* Pointer to token buffer.
144 Actual allocated length is maxtoken + 2.
145 This is not static because objc-parse.y uses it. */
147 static int indent_level = 0; /* Number of { minus number of }. */
149 /* Nonzero if end-of-file has been seen on input. */
150 static int end_of_file;
153 /* Buffered-back input character; faster than using ungetc. */
154 static int nextchar = -1;
157 #ifdef HANDLE_GENERIC_PRAGMAS
158 static int handle_generic_pragma PROTO((int));
159 #endif /* HANDLE_GENERIC_PRAGMAS */
160 static int whitespace_cr PROTO((int));
161 static int skip_white_space PROTO((int));
162 static int skip_white_space_on_line PROTO((void));
163 static char *extend_token_buffer PROTO((const char *));
164 static int readescape PROTO((int *));
165 static void parse_float PROTO((PTR));
167 /* Do not insert generated code into the source, instead, include it.
168 This allows us to build gcc automatically even for targets that
169 need to add or modify the reserved keyword lists. */
172 /* Return something to represent absolute declarators containing a *.
173 TARGET is the absolute declarator that the * contains.
174 TYPE_QUALS is a list of modifiers such as const or volatile
175 to apply to the pointer type, represented as identifiers.
177 We return an INDIRECT_REF whose "contents" are TARGET
178 and whose type is the modifier list. */
181 make_pointer_declarator (type_quals, target)
182 tree type_quals, target;
184 return build1 (INDIRECT_REF, type_quals, target);
188 forget_protocol_qualifiers ()
190 int i, n = sizeof wordlist / sizeof (struct resword);
192 for (i = 0; i < n; i++)
193 if ((int) wordlist[i].rid >= (int) RID_IN
194 && (int) wordlist[i].rid <= (int) RID_ONEWAY)
195 wordlist[i].name = "";
199 remember_protocol_qualifiers ()
201 int i, n = sizeof wordlist / sizeof (struct resword);
203 for (i = 0; i < n; i++)
204 if (wordlist[i].rid == RID_IN)
205 wordlist[i].name = "in";
206 else if (wordlist[i].rid == RID_OUT)
207 wordlist[i].name = "out";
208 else if (wordlist[i].rid == RID_INOUT)
209 wordlist[i].name = "inout";
210 else if (wordlist[i].rid == RID_BYCOPY)
211 wordlist[i].name = "bycopy";
212 else if (wordlist[i].rid == RID_BYREF)
213 wordlist[i].name = "byref";
214 else if (wordlist[i].rid == RID_ONEWAY)
215 wordlist[i].name = "oneway";
219 init_parse (filename)
223 /* Open input file. */
224 if (filename == 0 || !strcmp (filename, "-"))
230 finput = fopen (filename, "r");
232 pfatal_with_name (filename);
234 #ifdef IO_BUFFER_SIZE
235 setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
237 #else /* !USE_CPPLIB */
238 parse_in.show_column = 1;
239 if (! cpp_start_read (&parse_in, filename))
242 if (filename == 0 || !strcmp (filename, "-"))
245 /* cpp_start_read always puts at least one line directive into the
246 token buffer. We must arrange to read it out here. */
247 yy_cur = parse_in.token_buffer;
248 yy_lim = CPP_PWRITTEN (&parse_in);
260 cpp_finish (&parse_in);
261 errorcount += parse_in.errors;
270 /* Make identifier nodes long enough for the language-specific slots. */
271 set_identifier_size (sizeof (struct lang_identifier));
273 /* Start it at 0, because check_newline is called at the very beginning
274 and will increment it to 1. */
277 #ifdef MULTIBYTE_CHARS
278 /* Change to the native locale for multibyte conversions. */
279 setlocale (LC_CTYPE, "");
280 literal_codeset = getenv ("LANG");
284 token_buffer = (char *) xmalloc (maxtoken + 2);
286 ridpointers[(int) RID_INT] = get_identifier ("int");
287 ridpointers[(int) RID_CHAR] = get_identifier ("char");
288 ridpointers[(int) RID_VOID] = get_identifier ("void");
289 ridpointers[(int) RID_FLOAT] = get_identifier ("float");
290 ridpointers[(int) RID_DOUBLE] = get_identifier ("double");
291 ridpointers[(int) RID_SHORT] = get_identifier ("short");
292 ridpointers[(int) RID_LONG] = get_identifier ("long");
293 ridpointers[(int) RID_UNSIGNED] = get_identifier ("unsigned");
294 ridpointers[(int) RID_SIGNED] = get_identifier ("signed");
295 ridpointers[(int) RID_INLINE] = get_identifier ("inline");
296 ridpointers[(int) RID_CONST] = get_identifier ("const");
297 ridpointers[(int) RID_RESTRICT] = get_identifier ("restrict");
298 ridpointers[(int) RID_VOLATILE] = get_identifier ("volatile");
299 ridpointers[(int) RID_AUTO] = get_identifier ("auto");
300 ridpointers[(int) RID_STATIC] = get_identifier ("static");
301 ridpointers[(int) RID_EXTERN] = get_identifier ("extern");
302 ridpointers[(int) RID_TYPEDEF] = get_identifier ("typedef");
303 ridpointers[(int) RID_REGISTER] = get_identifier ("register");
304 ridpointers[(int) RID_ITERATOR] = get_identifier ("iterator");
305 ridpointers[(int) RID_COMPLEX] = get_identifier ("complex");
306 ridpointers[(int) RID_ID] = get_identifier ("id");
307 ridpointers[(int) RID_IN] = get_identifier ("in");
308 ridpointers[(int) RID_OUT] = get_identifier ("out");
309 ridpointers[(int) RID_INOUT] = get_identifier ("inout");
310 ridpointers[(int) RID_BYCOPY] = get_identifier ("bycopy");
311 ridpointers[(int) RID_BYREF] = get_identifier ("byref");
312 ridpointers[(int) RID_ONEWAY] = get_identifier ("oneway");
313 forget_protocol_qualifiers();
315 /* Some options inhibit certain reserved words.
316 Clear those words out of the hash table so they won't be recognized. */
317 #define UNSET_RESERVED_WORD(STRING) \
318 do { struct resword *s = is_reserved_word (STRING, sizeof (STRING) - 1); \
319 if (s) s->name = ""; } while (0)
321 if (! doing_objc_thang)
322 UNSET_RESERVED_WORD ("id");
324 if (flag_traditional)
326 UNSET_RESERVED_WORD ("const");
327 UNSET_RESERVED_WORD ("restrict");
328 UNSET_RESERVED_WORD ("volatile");
329 UNSET_RESERVED_WORD ("typeof");
330 UNSET_RESERVED_WORD ("signed");
331 UNSET_RESERVED_WORD ("inline");
332 UNSET_RESERVED_WORD ("iterator");
333 UNSET_RESERVED_WORD ("complex");
335 else if (!flag_isoc9x)
336 UNSET_RESERVED_WORD ("restrict");
340 UNSET_RESERVED_WORD ("asm");
341 UNSET_RESERVED_WORD ("typeof");
342 UNSET_RESERVED_WORD ("inline");
343 UNSET_RESERVED_WORD ("iterator");
344 UNSET_RESERVED_WORD ("complex");
349 reinit_parse_for_function ()
353 /* Function used when yydebug is set, to print a token in more detail. */
356 yyprint (file, yychar, yylval)
368 if (IDENTIFIER_POINTER (t))
369 fprintf (file, " `%s'", IDENTIFIER_POINTER (t));
374 if (TREE_CODE (t) == INTEGER_CST)
376 #if HOST_BITS_PER_WIDE_INT == 64
377 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
380 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
387 #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
393 TREE_INT_CST_HIGH (t), TREE_INT_CST_LOW (t));
398 /* Iff C is a carriage return, warn about it - if appropriate -
399 and return nonzero. */
404 static int newline_warning = 0;
408 /* ANSI C says the effects of a carriage return in a source file
410 if (pedantic && !newline_warning)
412 warning ("carriage return in source file");
413 warning ("(we only warn about the first carriage return)");
421 /* If C is not whitespace, return C.
422 Otherwise skip whitespace and return first nonwhite char read. */
432 /* We don't recognize comments here, because
433 cpp output can include / and * consecutively as operators.
434 Also, there's no need, since cpp removes all comments. */
437 c = check_newline ();
458 error ("stray '\\' in program");
468 /* Skips all of the white space at the current location in the input file.
469 Must use and reset nextchar if it has the next character. */
472 position_after_white_space ()
478 c = nextchar, nextchar = -1;
483 UNGETC (skip_white_space (c));
486 /* Like skip_white_space, but don't advance beyond the end of line.
487 Moreover, we don't get passed a character to start with. */
489 skip_white_space_on_line ()
518 /* Make the token buffer longer, preserving the data in it.
519 P should point to just beyond the last valid character in the old buffer.
520 The value we return is a pointer to the new buffer
521 at a place corresponding to P. */
524 extend_token_buffer (p)
527 int offset = p - token_buffer;
529 maxtoken = maxtoken * 2 + 10;
530 token_buffer = (char *) xrealloc (token_buffer, maxtoken + 2);
532 return token_buffer + offset;
535 #if defined HANDLE_PRAGMA
536 /* Local versions of these macros, that can be passed as function pointers. */
551 /* At the beginning of a line, increment the line number
552 and process any #-directive on this line.
553 If the line is a #-directive, read the entire line and return a newline.
554 Otherwise, return the line's first non-whitespace character. */
564 /* Read first nonwhite char on the line. */
567 while (c == ' ' || c == '\t')
572 /* If not #, return it so caller will use it. */
576 /* Read first nonwhite char after the `#'. */
579 while (c == ' ' || c == '\t')
582 /* If a letter follows, then if the word here is `line', skip
583 it and ignore it; otherwise, ignore the line, with an error
584 if the word isn't `pragma', `ident', `define', or `undef'. */
586 if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
595 && ((c = GETC()) == ' ' || c == '\t' || c == '\n'
596 || whitespace_cr (c) ))
598 while (c == ' ' || c == '\t' || whitespace_cr (c))
603 #if defined HANDLE_PRAGMA || defined HANDLE_GENERIC_PRAGMAS
606 if (token != IDENTIFIER)
608 #endif /* HANDLE_PRAGMA || HANDLE_GENERIC_PRAGMAS */
611 /* We invoke HANDLE_PRAGMA before HANDLE_GENERIC_PRAGMAS (if
612 both are defined), in order to give the back end a chance to
613 override the interpretation of generic style pragmas. */
617 c = nextchar, nextchar = -1;
620 #endif /* !USE_CPPLIB */
622 if (TREE_CODE (yylval.ttype) != IDENTIFIER_NODE)
625 if (HANDLE_PRAGMA (pragma_getc, pragma_ungetc,
626 IDENTIFIER_POINTER (yylval.ttype)))
628 #endif /* HANDLE_PRAGMA */
630 #ifdef HANDLE_GENERIC_PRAGMAS
631 if (handle_generic_pragma (token))
633 #endif /* HANDLE_GENERIC_PRAGMAS */
635 /* Issue a warning message if we have been asked to do so.
636 Ignoring unknown pragmas in system header file unless
637 an explcit -Wunknown-pragmas has been given. */
638 if (warn_unknown_pragmas > 1
639 || (warn_unknown_pragmas && ! in_system_header))
640 warning ("ignoring pragma: %s", token_buffer);
653 && ((c = GETC()) == ' ' || c == '\t' || c == '\n'))
656 debug_define (lineno, GET_DIRECTIVE_LINE ());
666 && ((c = GETC()) == ' ' || c == '\t' || c == '\n'))
669 debug_undef (lineno, GET_DIRECTIVE_LINE ());
678 && ((c = GETC()) == ' ' || c == '\t'))
687 && ((c = GETC()) == ' ' || c == '\t'))
689 /* #ident. The pedantic warning is now in cccp.c. */
691 /* Here we have just seen `#ident '.
692 A string constant should follow. */
694 c = skip_white_space_on_line ();
696 /* If no argument, ignore the line. */
703 || TREE_CODE (yylval.ttype) != STRING_CST)
705 error ("invalid #ident");
711 #ifdef ASM_OUTPUT_IDENT
712 ASM_OUTPUT_IDENT (asm_out_file, TREE_STRING_POINTER (yylval.ttype));
716 /* Skip the rest of this line. */
721 error ("undefined or invalid # directive");
726 /* Here we have either `#line' or `# <nonletter>'.
727 In either case, it should be a line number; a digit should follow. */
729 /* Can't use skip_white_space here, but must handle all whitespace
730 that is not '\n', lest we get a recursion for '\r' '\n' when
733 c = skip_white_space_on_line ();
735 /* If the # is the only nonwhite char on the line,
736 just ignore it. Check the new newline. */
740 /* Something follows the #; read a token. */
745 if (token == CONSTANT
746 && TREE_CODE (yylval.ttype) == INTEGER_CST)
748 int old_lineno = lineno;
750 /* subtract one, because it is the following line that
751 gets the specified number */
753 int l = TREE_INT_CST_LOW (yylval.ttype) - 1;
755 /* Is this the last nonwhite stuff on the line? */
756 c = skip_white_space_on_line ();
759 /* No more: store the line number and check following line. */
765 /* More follows: it must be a string constant (filename). */
767 /* Read the string constant. */
770 if (token != STRING || TREE_CODE (yylval.ttype) != STRING_CST)
772 error ("invalid #line");
777 = (char *) permalloc (TREE_STRING_LENGTH (yylval.ttype) + 1);
778 strcpy (input_filename, TREE_STRING_POINTER (yylval.ttype));
781 /* Each change of file name
782 reinitializes whether we are now in a system header. */
783 in_system_header = 0;
785 if (main_input_filename == 0)
786 main_input_filename = input_filename;
788 /* Is this the last nonwhite stuff on the line? */
789 c = skip_white_space_on_line ();
792 /* Update the name in the top element of input_file_stack. */
793 if (input_file_stack)
794 input_file_stack->name = input_filename;
803 /* `1' after file name means entering new file.
804 `2' after file name means just left a file. */
806 if (token == CONSTANT
807 && TREE_CODE (yylval.ttype) == INTEGER_CST)
809 if (TREE_INT_CST_LOW (yylval.ttype) == 1)
811 /* Pushing to a new file. */
813 = (struct file_stack *) xmalloc (sizeof (struct file_stack));
814 input_file_stack->line = old_lineno;
815 p->next = input_file_stack;
816 p->name = input_filename;
817 p->indent_level = indent_level;
818 input_file_stack = p;
819 input_file_stack_tick++;
820 debug_start_source_file (input_filename);
823 else if (TREE_INT_CST_LOW (yylval.ttype) == 2)
825 /* Popping out of a file. */
826 if (input_file_stack->next)
828 struct file_stack *p = input_file_stack;
829 if (indent_level != p->indent_level)
831 warning_with_file_and_line
832 (p->name, old_lineno,
833 "This file contains more `%c's than `%c's.",
834 indent_level > p->indent_level ? '{' : '}',
835 indent_level > p->indent_level ? '}' : '{');
837 input_file_stack = p->next;
839 input_file_stack_tick++;
840 debug_end_source_file (input_file_stack->line);
843 error ("#-lines for entering and leaving files don't match");
849 /* Now that we've pushed or popped the input stack,
850 update the name in the top element. */
851 if (input_file_stack)
852 input_file_stack->name = input_filename;
854 /* If we have handled a `1' or a `2',
855 see if there is another number to read. */
858 /* Is this the last nonwhite stuff on the line? */
859 c = skip_white_space_on_line ();
868 /* `3' after file name means this is a system header file. */
870 if (token == CONSTANT
871 && TREE_CODE (yylval.ttype) == INTEGER_CST
872 && TREE_INT_CST_LOW (yylval.ttype) == 3)
873 in_system_header = 1, used_up = 1;
877 /* Is this the last nonwhite stuff on the line? */
878 c = skip_white_space_on_line ();
884 warning ("unrecognized text at end of #line");
887 error ("invalid #-line");
889 /* skip the rest of this line. */
892 if (c != '\n' && c != EOF && nextchar >= 0)
893 c = nextchar, nextchar = -1;
895 while (c != '\n' && c != EOF)
900 #ifdef HANDLE_GENERIC_PRAGMAS
902 /* Handle a #pragma directive.
903 TOKEN is the token we read after `#pragma'. Processes the entire input
904 line and return non-zero iff the pragma has been successfully parsed. */
906 /* This function has to be in this file, in order to get at
910 handle_generic_pragma (token)
923 handle_pragma_token (token_buffer, yylval.ttype);
926 handle_pragma_token (token_buffer, NULL);
930 c = nextchar, nextchar = -1;
935 while (c == ' ' || c == '\t')
939 if (c == '\n' || c == EOF)
940 return handle_pragma_token (NULL, NULL);
946 #endif /* HANDLE_GENERIC_PRAGMAS */
948 #define ENDFILE -1 /* token that represents end-of-file */
950 /* Read an escape sequence, returning its equivalent as a character,
951 or store 1 in *ignore_ptr if it is backslash-newline. */
954 readescape (ignore_ptr)
957 register int c = GETC();
959 register unsigned count;
960 unsigned firstdig = 0;
966 if (warn_traditional)
967 warning ("the meaning of `\\x' varies with -traditional");
969 if (flag_traditional)
978 if (!(c >= 'a' && c <= 'f')
979 && !(c >= 'A' && c <= 'F')
980 && !(c >= '0' && c <= '9'))
986 if (c >= 'a' && c <= 'f')
987 code += c - 'a' + 10;
988 if (c >= 'A' && c <= 'F')
989 code += c - 'A' + 10;
990 if (c >= '0' && c <= '9')
992 if (code != 0 || count != 0)
1001 error ("\\x used with no following hex digits");
1002 else if (count == 0)
1003 /* Digits are all 0's. Ok. */
1005 else if ((count - 1) * 4 >= TYPE_PRECISION (integer_type_node)
1007 && (((unsigned)1 << (TYPE_PRECISION (integer_type_node) - (count - 1) * 4))
1009 pedwarn ("hex escape out of range");
1012 case '0': case '1': case '2': case '3': case '4':
1013 case '5': case '6': case '7':
1016 while ((c <= '7') && (c >= '0') && (count++ < 3))
1018 code = (code * 8) + (c - '0');
1024 case '\\': case '\'': case '"':
1033 return TARGET_NEWLINE;
1048 if (warn_traditional)
1049 warning ("the meaning of `\\a' varies with -traditional");
1051 if (flag_traditional)
1056 #if 0 /* Vertical tab is present in common usage compilers. */
1057 if (flag_traditional)
1065 pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c);
1071 /* `\(', etc, are used at beginning of line to avoid confusing Emacs. */
1075 /* `\%' is used to prevent SCCS from getting confused. */
1078 pedwarn ("non-ANSI escape sequence `\\%c'", c);
1081 if (c >= 040 && c < 0177)
1082 pedwarn ("unknown escape sequence `\\%c'", c);
1084 pedwarn ("unknown escape sequence: `\\' followed by char code 0x%x", c);
1092 const char *string = _(msgid);
1094 /* We can't print string and character constants well
1095 because the token_buffer contains the result of processing escapes. */
1097 error ("%s at end of input", string);
1098 else if (token_buffer[0] == 0)
1099 error ("%s at null character", string);
1100 else if (token_buffer[0] == '"')
1101 error ("%s before string constant", string);
1102 else if (token_buffer[0] == '\'')
1103 error ("%s before character constant", string);
1104 else if (token_buffer[0] < 040 || (unsigned char) token_buffer[0] >= 0177)
1105 error ("%s before character 0%o", string, (unsigned char) token_buffer[0]);
1107 error ("%s before `%s'", string, token_buffer);
1117 char long_long_flag;
1120 struct try_type type_sequence[] =
1122 { &integer_type_node, 0, 0, 0},
1123 { &unsigned_type_node, 1, 0, 0},
1124 { &long_integer_type_node, 0, 1, 0},
1125 { &long_unsigned_type_node, 1, 1, 0},
1126 { &long_long_integer_type_node, 0, 1, 1},
1127 { &long_long_unsigned_type_node, 1, 1, 1}
1140 int conversion_errno;
1142 REAL_VALUE_TYPE value;
1149 struct pf_args * args = (struct pf_args *) data;
1150 int fflag = 0, lflag = 0;
1151 /* Copy token_buffer now, while it has just the number
1152 and not the suffixes; once we add `f' or `i',
1153 REAL_VALUE_ATOF may not work any more. */
1154 char *copy = (char *) alloca (args->p - token_buffer + 1);
1155 bcopy (token_buffer, copy, args->p - token_buffer + 1);
1161 /* Read the suffixes to choose a data type. */
1166 error ("more than one `f' in numeric constant");
1172 error ("more than one `l' in numeric constant");
1178 error ("more than one `i' or `j' in numeric constant");
1180 pedwarn ("ANSI C forbids imaginary numeric constants");
1191 if (args->p >= token_buffer + maxtoken - 3)
1192 args->p = extend_token_buffer (args->p);
1193 *(args->p++) = args->c;
1198 /* The second argument, machine_mode, of REAL_VALUE_ATOF
1199 tells the desired precision of the binary result
1200 of decimal-to-binary conversion. */
1205 error ("both `f' and `l' in floating constant");
1207 args->type = float_type_node;
1209 if (args->base == 16)
1210 args->value = REAL_VALUE_HTOF (copy, TYPE_MODE (args->type));
1212 args->value = REAL_VALUE_ATOF (copy, TYPE_MODE (args->type));
1213 args->conversion_errno = errno;
1214 /* A diagnostic is required here by some ANSI C testsuites.
1215 This is not pedwarn, because some people don't want
1216 an error for this. */
1217 if (REAL_VALUE_ISINF (args->value) && pedantic)
1218 warning ("floating point number exceeds range of `float'");
1222 args->type = long_double_type_node;
1224 if (args->base == 16)
1225 args->value = REAL_VALUE_HTOF (copy, TYPE_MODE (args->type));
1227 args->value = REAL_VALUE_ATOF (copy, TYPE_MODE (args->type));
1228 args->conversion_errno = errno;
1229 if (REAL_VALUE_ISINF (args->value) && pedantic)
1230 warning ("floating point number exceeds range of `long double'");
1235 if (args->base == 16)
1236 args->value = REAL_VALUE_HTOF (copy, TYPE_MODE (args->type));
1238 args->value = REAL_VALUE_ATOF (copy, TYPE_MODE (args->type));
1239 args->conversion_errno = errno;
1240 if (REAL_VALUE_ISINF (args->value) && pedantic)
1241 warning ("floating point number exceeds range of `double'");
1256 c = nextchar, nextchar = -1;
1261 /* Effectively do c = skip_white_space (c)
1262 but do it faster in the usual cases. */
1275 /* Call skip_white_space so we can warn if appropriate. */
1280 c = skip_white_space (c);
1282 goto found_nonwhite;
1286 token_buffer[0] = c;
1287 token_buffer[1] = 0;
1289 /* yylloc.first_line = lineno; */
1295 token_buffer[0] = 0;
1300 /* Capital L may start a wide-string or wide-character constant. */
1302 register int c = GETC();
1311 goto string_constant;
1318 if (!doing_objc_thang)
1325 /* '@' may start a constant string object. */
1326 register int c = GETC ();
1330 goto string_constant;
1333 /* Fall through to treat '@' as the start of an identifier. */
1336 case 'A': case 'B': case 'C': case 'D': case 'E':
1337 case 'F': case 'G': case 'H': case 'I': case 'J':
1338 case 'K': case 'M': case 'N': case 'O':
1339 case 'P': case 'Q': case 'R': case 'S': case 'T':
1340 case 'U': case 'V': case 'W': case 'X': case 'Y':
1342 case 'a': case 'b': case 'c': case 'd': case 'e':
1343 case 'f': case 'g': case 'h': case 'i': case 'j':
1344 case 'k': case 'l': case 'm': case 'n': case 'o':
1345 case 'p': case 'q': case 'r': case 's': case 't':
1346 case 'u': case 'v': case 'w': case 'x': case 'y':
1352 while (ISALNUM (c) || c == '_' || c == '$' || c == '@')
1354 /* Make sure this char really belongs in an identifier. */
1357 if (! dollars_in_ident)
1358 error ("`$' in identifier");
1360 pedwarn ("`$' in identifier");
1363 if (p >= token_buffer + maxtoken)
1364 p = extend_token_buffer (p);
1380 /* Try to recognize a keyword. Uses minimum-perfect hash function */
1383 register struct resword *ptr;
1385 if ((ptr = is_reserved_word (token_buffer, p - token_buffer)))
1388 yylval.ttype = ridpointers[(int) ptr->rid];
1389 value = (int) ptr->token;
1391 /* Only return OBJECTNAME if it is a typedef. */
1392 if (doing_objc_thang && value == OBJECTNAME)
1394 lastiddecl = lookup_name(yylval.ttype);
1396 if (lastiddecl == NULL_TREE
1397 || TREE_CODE (lastiddecl) != TYPE_DECL)
1401 /* Even if we decided to recognize asm, still perhaps warn. */
1403 && (value == ASM_KEYWORD || value == TYPEOF
1404 || ptr->rid == RID_INLINE)
1405 && token_buffer[0] != '_')
1406 pedwarn ("ANSI does not permit the keyword `%s'",
1411 /* If we did not find a keyword, look for an identifier
1414 if (value == IDENTIFIER)
1416 if (token_buffer[0] == '@')
1417 error("invalid identifier `%s'", token_buffer);
1419 yylval.ttype = get_identifier (token_buffer);
1420 lastiddecl = lookup_name (yylval.ttype);
1422 if (lastiddecl != 0 && TREE_CODE (lastiddecl) == TYPE_DECL)
1424 /* A user-invisible read-only initialized variable
1425 should be replaced by its value.
1426 We handle only strings since that's the only case used in C. */
1427 else if (lastiddecl != 0 && TREE_CODE (lastiddecl) == VAR_DECL
1428 && DECL_IGNORED_P (lastiddecl)
1429 && TREE_READONLY (lastiddecl)
1430 && DECL_INITIAL (lastiddecl) != 0
1431 && TREE_CODE (DECL_INITIAL (lastiddecl)) == STRING_CST)
1433 tree stringval = DECL_INITIAL (lastiddecl);
1435 /* Copy the string value so that we won't clobber anything
1436 if we put something in the TREE_CHAIN of this one. */
1437 yylval.ttype = build_string (TREE_STRING_LENGTH (stringval),
1438 TREE_STRING_POINTER (stringval));
1441 else if (doing_objc_thang)
1443 tree objc_interface_decl = is_class_name (yylval.ttype);
1445 if (objc_interface_decl)
1448 yylval.ttype = objc_interface_decl;
1458 /* Check first for common special case: single-digit 0 or 1. */
1461 UNGETC (next_c); /* Always undo this lookahead. */
1462 if (!ISALNUM (next_c) && next_c != '.')
1464 token_buffer[0] = (char)c, token_buffer[1] = '\0';
1465 yylval.ttype = (c == '0') ? integer_zero_node : integer_one_node;
1471 case '2': case '3': case '4':
1472 case '5': case '6': case '7': case '8': case '9':
1477 int largest_digit = 0;
1481 /* We actually store only HOST_BITS_PER_CHAR bits in each part.
1482 The code below which fills the parts array assumes that a host
1483 int is at least twice as wide as a host char, and that
1484 HOST_BITS_PER_WIDE_INT is an even multiple of HOST_BITS_PER_CHAR.
1485 Two HOST_WIDE_INTs is the largest int literal we can store.
1486 In order to detect overflow below, the number of parts (TOTAL_PARTS)
1487 must be exactly the number of parts needed to hold the bits
1488 of two HOST_WIDE_INTs. */
1489 #define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2)
1490 unsigned int parts[TOTAL_PARTS];
1492 enum anon1 { NOT_FLOAT, AFTER_POINT, TOO_MANY_POINTS, AFTER_EXPON}
1493 floatflag = NOT_FLOAT;
1495 for (count = 0; count < TOTAL_PARTS; count++)
1503 *p++ = (c = GETC());
1504 if ((c == 'x') || (c == 'X'))
1507 *p++ = (c = GETC());
1509 /* Leading 0 forces octal unless the 0 is the only digit. */
1510 else if (c >= '0' && c <= '9')
1519 /* Read all the digits-and-decimal-points. */
1522 || (ISALNUM (c) && c != 'l' && c != 'L'
1523 && c != 'u' && c != 'U'
1524 && c != 'i' && c != 'I' && c != 'j' && c != 'J'
1525 && (floatflag == NOT_FLOAT || ((c != 'f') && (c != 'F')))))
1529 if (base == 16 && pedantic)
1530 error ("floating constant may not be in radix 16");
1531 if (floatflag == TOO_MANY_POINTS)
1532 /* We have already emitted an error. Don't need another. */
1534 else if (floatflag == AFTER_POINT || floatflag == AFTER_EXPON)
1536 error ("malformed floating constant");
1537 floatflag = TOO_MANY_POINTS;
1538 /* Avoid another error from atof by forcing all characters
1539 from here on to be ignored. */
1543 floatflag = AFTER_POINT;
1548 /* Accept '.' as the start of a floating-point number
1549 only when it is followed by a digit.
1550 Otherwise, unread the following non-digit
1551 and use the '.' as a structural token. */
1552 if (p == token_buffer + 2 && !ISDIGIT (c))
1563 error ("parse error at `..'");
1566 token_buffer[1] = 0;
1573 /* It is not a decimal point.
1574 It should be a digit (perhaps a hex digit). */
1580 else if (base <= 10)
1582 if (c == 'e' || c == 'E')
1585 floatflag = AFTER_EXPON;
1586 break; /* start of exponent */
1588 error ("nondigits in number and not hexadecimal");
1591 else if (base == 16 && (c == 'p' || c == 'P'))
1593 floatflag = AFTER_EXPON;
1594 break; /* start of exponent */
1604 if (c >= largest_digit)
1608 for (count = 0; count < TOTAL_PARTS; count++)
1610 parts[count] *= base;
1614 += (parts[count-1] >> HOST_BITS_PER_CHAR);
1616 &= (1 << HOST_BITS_PER_CHAR) - 1;
1622 /* If the highest-order part overflows (gets larger than
1623 a host char will hold) then the whole number has
1624 overflowed. Record this and truncate the highest-order
1626 if (parts[TOTAL_PARTS - 1] >> HOST_BITS_PER_CHAR)
1629 parts[TOTAL_PARTS - 1] &= (1 << HOST_BITS_PER_CHAR) - 1;
1632 if (p >= token_buffer + maxtoken - 3)
1633 p = extend_token_buffer (p);
1634 *p++ = (c = GETC());
1639 error ("numeric constant with no digits");
1641 if (largest_digit >= base)
1642 error ("numeric constant contains digits beyond the radix");
1644 /* Remove terminating char from the token buffer and delimit the string */
1647 if (floatflag != NOT_FLOAT)
1649 tree type = double_type_node;
1651 int conversion_errno = 0;
1652 REAL_VALUE_TYPE value;
1653 struct pf_args args;
1655 /* Read explicit exponent if any, and put it in tokenbuf. */
1657 if ((base == 10 && ((c == 'e') || (c == 'E')))
1658 || (base == 16 && (c == 'p' || c == 'P')))
1660 if (p >= token_buffer + maxtoken - 3)
1661 p = extend_token_buffer (p);
1664 if ((c == '+') || (c == '-'))
1669 /* Exponent is decimal, even if string is a hex float. */
1671 error ("floating constant exponent has no digits");
1674 if (p >= token_buffer + maxtoken - 3)
1675 p = extend_token_buffer (p);
1680 if (base == 16 && floatflag != AFTER_EXPON)
1681 error ("hexadecimal floating constant has no exponent");
1685 /* Setup input for parse_float() */
1691 args.conversion_errno = conversion_errno;
1693 /* Convert string to a double, checking for overflow. */
1694 if (do_float_handler (parse_float, (PTR) &args))
1696 /* Receive output from parse_float() */
1701 /* We got an exception from parse_float() */
1702 error ("floating constant out of range");
1706 /* Receive output from parse_float() */
1710 conversion_errno = args.conversion_errno;
1713 /* ERANGE is also reported for underflow,
1714 so test the value to distinguish overflow from that. */
1715 if (conversion_errno == ERANGE && !flag_traditional && pedantic
1716 && (REAL_VALUES_LESS (dconst1, value)
1717 || REAL_VALUES_LESS (value, dconstm1)))
1718 warning ("floating point number exceeds range of `double'");
1721 /* If the result is not a number, assume it must have been
1722 due to some error message above, so silently convert
1724 if (REAL_VALUE_ISNAN (value))
1727 /* Create a node with determined type and value. */
1729 yylval.ttype = build_complex (NULL_TREE,
1730 convert (type, integer_zero_node),
1731 build_real (type, value));
1733 yylval.ttype = build_real (type, value);
1737 tree traditional_type, ansi_type, type;
1738 HOST_WIDE_INT high, low;
1739 int spec_unsigned = 0;
1741 int spec_long_long = 0;
1745 traditional_type = ansi_type = type = NULL_TREE;
1748 if (c == 'u' || c == 'U')
1751 error ("two `u's in integer constant");
1754 else if (c == 'l' || c == 'L')
1759 error ("three `l's in integer constant");
1760 else if (pedantic && ! in_system_header && warn_long_long)
1761 pedwarn ("ANSI C forbids long long integer constants");
1766 else if (c == 'i' || c == 'j' || c == 'I' || c == 'J')
1769 error ("more than one `i' or `j' in numeric constant");
1771 pedwarn ("ANSI C forbids imaginary numeric constants");
1776 if (p >= token_buffer + maxtoken - 3)
1777 p = extend_token_buffer (p);
1782 /* If the literal overflowed, pedwarn about it now. */
1786 pedwarn ("integer constant is too large for this configuration of the compiler - truncated to %d bits", HOST_BITS_PER_WIDE_INT * 2);
1789 /* This is simplified by the fact that our constant
1790 is always positive. */
1794 for (i = 0; i < HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR; i++)
1796 high |= ((HOST_WIDE_INT) parts[i + (HOST_BITS_PER_WIDE_INT
1797 / HOST_BITS_PER_CHAR)]
1798 << (i * HOST_BITS_PER_CHAR));
1799 low |= (HOST_WIDE_INT) parts[i] << (i * HOST_BITS_PER_CHAR);
1802 yylval.ttype = build_int_2 (low, high);
1803 TREE_TYPE (yylval.ttype) = long_long_unsigned_type_node;
1805 /* If warn_traditional, calculate both the ANSI type and the
1806 traditional type, then see if they disagree.
1807 Otherwise, calculate only the type for the dialect in use. */
1808 if (warn_traditional || flag_traditional)
1810 /* Calculate the traditional type. */
1811 /* Traditionally, any constant is signed;
1812 but if unsigned is specified explicitly, obey that.
1813 Use the smallest size with the right number of bits,
1814 except for one special case with decimal constants. */
1815 if (! spec_long && base != 10
1816 && int_fits_type_p (yylval.ttype, unsigned_type_node))
1817 traditional_type = (spec_unsigned ? unsigned_type_node
1818 : integer_type_node);
1819 /* A decimal constant must be long
1820 if it does not fit in type int.
1821 I think this is independent of whether
1822 the constant is signed. */
1823 else if (! spec_long && base == 10
1824 && int_fits_type_p (yylval.ttype, integer_type_node))
1825 traditional_type = (spec_unsigned ? unsigned_type_node
1826 : integer_type_node);
1827 else if (! spec_long_long)
1828 traditional_type = (spec_unsigned ? long_unsigned_type_node
1829 : long_integer_type_node);
1830 else if (int_fits_type_p (yylval.ttype,
1832 ? long_long_unsigned_type_node
1833 : long_long_integer_type_node))
1834 traditional_type = (spec_unsigned
1835 ? long_long_unsigned_type_node
1836 : long_long_integer_type_node);
1838 traditional_type = (spec_unsigned
1839 ? widest_unsigned_literal_type_node
1840 : widest_integer_literal_type_node);
1842 if (warn_traditional || ! flag_traditional)
1844 /* Calculate the ANSI type. */
1845 if (! spec_long && ! spec_unsigned
1846 && int_fits_type_p (yylval.ttype, integer_type_node))
1847 ansi_type = integer_type_node;
1848 else if (! spec_long && (base != 10 || spec_unsigned)
1849 && int_fits_type_p (yylval.ttype, unsigned_type_node))
1850 ansi_type = unsigned_type_node;
1851 else if (! spec_unsigned && !spec_long_long
1852 && int_fits_type_p (yylval.ttype, long_integer_type_node))
1853 ansi_type = long_integer_type_node;
1854 else if (! spec_long_long
1855 && int_fits_type_p (yylval.ttype,
1856 long_unsigned_type_node))
1857 ansi_type = long_unsigned_type_node;
1858 else if (! spec_unsigned
1859 && int_fits_type_p (yylval.ttype,
1860 long_long_integer_type_node))
1861 ansi_type = long_long_integer_type_node;
1862 else if (int_fits_type_p (yylval.ttype,
1863 long_long_unsigned_type_node))
1864 ansi_type = long_long_unsigned_type_node;
1865 else if (! spec_unsigned
1866 && int_fits_type_p (yylval.ttype,
1867 widest_integer_literal_type_node))
1868 ansi_type = widest_integer_literal_type_node;
1870 ansi_type = widest_unsigned_literal_type_node;
1873 type = flag_traditional ? traditional_type : ansi_type;
1875 if (warn_traditional && traditional_type != ansi_type)
1877 if (TYPE_PRECISION (traditional_type)
1878 != TYPE_PRECISION (ansi_type))
1879 warning ("width of integer constant changes with -traditional");
1880 else if (TREE_UNSIGNED (traditional_type)
1881 != TREE_UNSIGNED (ansi_type))
1882 warning ("integer constant is unsigned in ANSI C, signed with -traditional");
1884 warning ("width of integer constant may change on other systems with -traditional");
1887 if (pedantic && !flag_traditional && !spec_long_long && !warn
1888 && (TYPE_PRECISION (long_integer_type_node)
1889 < TYPE_PRECISION (type)))
1892 pedwarn ("integer constant larger than the maximum value of an unsigned long int");
1895 if (base == 10 && ! spec_unsigned && TREE_UNSIGNED (type))
1896 warning ("decimal constant is so large that it is unsigned");
1900 if (TYPE_PRECISION (type)
1901 <= TYPE_PRECISION (integer_type_node))
1903 = build_complex (NULL_TREE, integer_zero_node,
1904 convert (integer_type_node,
1907 error ("complex integer constant is too wide for `complex int'");
1909 else if (flag_traditional && !int_fits_type_p (yylval.ttype, type))
1910 /* The traditional constant 0x80000000 is signed
1911 but doesn't fit in the range of int.
1912 This will change it to -0x80000000, which does fit. */
1914 TREE_TYPE (yylval.ttype) = unsigned_type (type);
1915 yylval.ttype = convert (type, yylval.ttype);
1916 TREE_OVERFLOW (yylval.ttype)
1917 = TREE_CONSTANT_OVERFLOW (yylval.ttype) = 0;
1920 TREE_TYPE (yylval.ttype) = type;
1923 /* If it's still an integer (not a complex), and it doesn't
1924 fit in the type we choose for it, then pedwarn. */
1927 && TREE_CODE (TREE_TYPE (yylval.ttype)) == INTEGER_TYPE
1928 && ! int_fits_type_p (yylval.ttype, TREE_TYPE (yylval.ttype)))
1929 pedwarn ("integer constant is larger than the maximum value for its type");
1935 if (ISALNUM (c) || c == '.' || c == '_' || c == '$'
1936 || (!flag_traditional && (c == '-' || c == '+')
1937 && (p[-1] == 'e' || p[-1] == 'E')))
1938 error ("missing white space after number `%s'", token_buffer);
1940 value = CONSTANT; break;
1946 register int result = 0;
1947 register int num_chars = 0;
1949 unsigned width = TYPE_PRECISION (char_type_node);
1951 #ifdef MULTIBYTE_CHARS
1952 int longest_char = local_mb_cur_max ();
1953 (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
1956 max_chars = TYPE_PRECISION (integer_type_node) / width;
1958 width = WCHAR_TYPE_SIZE;
1965 if (c == '\'' || c == EOF)
1972 c = readescape (&ignore);
1975 if (width < HOST_BITS_PER_INT
1976 && (unsigned) c >= ((unsigned)1 << width))
1977 pedwarn ("escape sequence out of range for character");
1978 #ifdef MAP_CHARACTER
1980 c = MAP_CHARACTER (c);
1986 pedwarn ("ANSI C forbids newline in character constant");
1991 #ifdef MULTIBYTE_CHARS
1995 for (i = 1; i <= longest_char; ++i)
1997 if (i > maxtoken - 4)
1998 extend_token_buffer (token_buffer);
2000 token_buffer[i] = c;
2001 char_len = local_mbtowc (& wc,
2010 /* mbtowc sometimes needs an extra char before accepting */
2015 /* Merge character into result; ignore excess chars. */
2016 for (i = 1; i <= char_len; ++i)
2020 if (width < HOST_BITS_PER_INT)
2021 result = (result << width)
2023 & ((1 << width) - 1));
2025 result = token_buffer[i];
2027 num_chars += char_len;
2036 warning ("Ignoring invalid multibyte character");
2037 /* Replace all but the first byte. */
2038 for (--i; i > 1; --i)
2039 UNGETC (token_buffer[i]);
2040 wc = token_buffer[1];
2042 #ifdef MAP_CHARACTER
2043 c = MAP_CHARACTER (wc);
2048 #else /* ! MULTIBYTE_CHARS */
2049 #ifdef MAP_CHARACTER
2050 c = MAP_CHARACTER (c);
2052 #endif /* ! MULTIBYTE_CHARS */
2057 if (chars_seen == 1) /* only keep the first one */
2062 /* Merge character into result; ignore excess chars. */
2063 num_chars += (width / TYPE_PRECISION (char_type_node));
2064 if (num_chars < max_chars + 1)
2066 if (width < HOST_BITS_PER_INT)
2067 result = (result << width) | (c & ((1 << width) - 1));
2074 error ("malformatted character constant");
2075 else if (chars_seen == 0)
2076 error ("empty character constant");
2077 else if (num_chars > max_chars)
2079 num_chars = max_chars;
2080 error ("character constant too long");
2082 else if (chars_seen != 1 && ! flag_traditional && warn_multichar)
2083 warning ("multi-character character constant");
2085 /* If char type is signed, sign-extend the constant. */
2088 int num_bits = num_chars * width;
2090 /* We already got an error; avoid invalid shift. */
2091 yylval.ttype = build_int_2 (0, 0);
2092 else if (TREE_UNSIGNED (char_type_node)
2093 || ((result >> (num_bits - 1)) & 1) == 0)
2095 = build_int_2 (result & (~(unsigned HOST_WIDE_INT) 0
2096 >> (HOST_BITS_PER_WIDE_INT - num_bits)),
2100 = build_int_2 (result | ~(~(unsigned HOST_WIDE_INT) 0
2101 >> (HOST_BITS_PER_WIDE_INT - num_bits)),
2103 TREE_TYPE (yylval.ttype) = integer_type_node;
2107 yylval.ttype = build_int_2 (result, 0);
2108 TREE_TYPE (yylval.ttype) = wchar_type_node;
2118 unsigned width = wide_flag ? WCHAR_TYPE_SIZE
2119 : TYPE_PRECISION (char_type_node);
2120 #ifdef MULTIBYTE_CHARS
2121 int longest_char = local_mb_cur_max ();
2122 (void) local_mbtowc (NULL_PTR, NULL_PTR, 0);
2125 p = token_buffer + 1;
2127 while (c != '"' && c >= 0)
2132 c = readescape (&ignore);
2135 if (width < HOST_BITS_PER_INT
2136 && (unsigned) c >= ((unsigned)1 << width))
2137 pedwarn ("escape sequence out of range for character");
2142 pedwarn ("ANSI C forbids newline in string constant");
2147 #ifdef MULTIBYTE_CHARS
2151 for (i = 0; i < longest_char; ++i)
2153 if (p + i >= token_buffer + maxtoken)
2154 p = extend_token_buffer (p);
2157 char_len = local_mbtowc (& wc, p, i + 1);
2164 warning ("Ignoring invalid multibyte character");
2165 /* Replace all except the first byte. */
2167 for (--i; i > 0; --i)
2171 /* mbtowc sometimes needs an extra char before accepting */
2181 #endif /* MULTIBYTE_CHARS */
2184 /* Add this single character into the buffer either as a wchar_t
2185 or as a single byte. */
2188 unsigned width = TYPE_PRECISION (char_type_node);
2189 unsigned bytemask = (1 << width) - 1;
2192 if (p + WCHAR_BYTES > token_buffer + maxtoken)
2193 p = extend_token_buffer (p);
2195 for (byte = 0; byte < WCHAR_BYTES; ++byte)
2198 if (byte >= (int) sizeof (c))
2201 value = (c >> (byte * width)) & bytemask;
2202 if (BYTES_BIG_ENDIAN)
2203 p[WCHAR_BYTES - byte - 1] = value;
2211 if (p >= token_buffer + maxtoken)
2212 p = extend_token_buffer (p);
2220 /* Terminate the string value, either with a single byte zero
2221 or with a wide zero. */
2224 if (p + WCHAR_BYTES > token_buffer + maxtoken)
2225 p = extend_token_buffer (p);
2226 bzero (p, WCHAR_BYTES);
2231 if (p >= token_buffer + maxtoken)
2232 p = extend_token_buffer (p);
2237 error ("Unterminated string constant");
2239 /* We have read the entire constant.
2240 Construct a STRING_CST for the result. */
2244 yylval.ttype = build_string (p - (token_buffer + 1),
2246 TREE_TYPE (yylval.ttype) = wchar_array_type_node;
2251 /* Return an Objective-C @"..." constant string object. */
2252 yylval.ttype = build_objc_string (p - (token_buffer + 1),
2254 TREE_TYPE (yylval.ttype) = char_array_type_node;
2255 value = OBJC_STRING;
2259 yylval.ttype = build_string (p - (token_buffer + 1),
2261 TREE_TYPE (yylval.ttype) = char_array_type_node;
2289 yylval.code = PLUS_EXPR; break;
2291 yylval.code = MINUS_EXPR; break;
2293 yylval.code = BIT_AND_EXPR; break;
2295 yylval.code = BIT_IOR_EXPR; break;
2297 yylval.code = MULT_EXPR; break;
2299 yylval.code = TRUNC_DIV_EXPR; break;
2301 yylval.code = TRUNC_MOD_EXPR; break;
2303 yylval.code = BIT_XOR_EXPR; break;
2305 yylval.code = LSHIFT_EXPR; break;
2307 yylval.code = RSHIFT_EXPR; break;
2309 yylval.code = LT_EXPR; break;
2311 yylval.code = GT_EXPR; break;
2314 token_buffer[1] = c1 = GETC();
2315 token_buffer[2] = 0;
2322 value = ARITHCOMPARE; yylval.code = LE_EXPR; goto done;
2324 value = ARITHCOMPARE; yylval.code = GE_EXPR; goto done;
2326 value = EQCOMPARE; yylval.code = NE_EXPR; goto done;
2328 value = EQCOMPARE; yylval.code = EQ_EXPR; goto done;
2330 value = ASSIGN; goto done;
2336 value = PLUSPLUS; goto done;
2338 value = MINUSMINUS; goto done;
2340 value = ANDAND; goto done;
2342 value = OROR; goto done;
2355 { value = POINTSAT; goto done; }
2359 { value = ']'; goto done; }
2363 { value = '{'; indent_level++; goto done; }
2365 { value = '['; goto done; }
2369 { value = '}'; indent_level--; goto done; }
2373 token_buffer[1] = 0;
2375 if ((c == '<') || (c == '>'))
2376 value = ARITHCOMPARE;
2382 /* Don't make yyparse think this is eof. */
2401 /* yylloc.last_line = lineno; */
2406 /* Sets the value of the 'yydebug' variable to VALUE.
2407 This is a function so we don't have to have YYDEBUG defined
2408 in order to build the compiler. */
2417 warning ("YYDEBUG not defined.");