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. */
34 /* MULTIBYTE_CHARS support only works for native compilers.
35 ??? Ideally what we want is to model widechar support after
36 the current floating point support. */
38 #undef MULTIBYTE_CHARS
41 #ifdef MULTIBYTE_CHARS
48 cpp_options parse_options
;
49 static enum cpp_token cpp_token
;
51 /* Stream for reading from the input file. */
55 /* The elements of `ridpointers' are identifier nodes
56 for the reserved type names and storage classes.
57 It is indexed by a RID_... value. */
58 tree ridpointers
[(int) RID_MAX
];
60 /* Cause the `yydebug' variable to be defined. */
64 static unsigned char *yy_cur
, *yy_lim
;
71 parse_in
.limit
= parse_in
.token_buffer
;
72 cpp_token
= cpp_get_token (&parse_in
);
73 if (cpp_token
== CPP_EOF
)
75 yy_lim
= CPP_PWRITTEN (&parse_in
);
76 yy_cur
= parse_in
.token_buffer
;
82 #define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
83 #define UNGETC(c) ((c), yy_cur--)
85 #define GETC() getc (finput)
86 #define UNGETC(c) ungetc (c, finput)
89 /* the declaration found for the last IDENTIFIER token read in.
90 yylex must look this up to detect typedefs, which get token type TYPENAME,
91 so it is left around in case the identifier is not a typedef but is
92 used in a context which makes it a reference to a variable. */
95 /* Nonzero enables objc features. */
101 /* File used for outputting assembler code. */
102 extern FILE *asm_out_file
;
104 #ifndef WCHAR_TYPE_SIZE
106 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
108 #define WCHAR_TYPE_SIZE BITS_PER_WORD
112 /* Number of bytes in a wide character. */
113 #define WCHAR_BYTES (WCHAR_TYPE_SIZE / BITS_PER_UNIT)
115 static int maxtoken
; /* Current nominal length of token buffer. */
116 char *token_buffer
; /* Pointer to token buffer.
117 Actual allocated length is maxtoken + 2.
118 This is not static because objc-parse.y uses it. */
120 static int indent_level
= 0; /* Number of { minus number of }. */
122 /* Nonzero if end-of-file has been seen on input. */
123 static int end_of_file
;
126 /* Buffered-back input character; faster than using ungetc. */
127 static int nextchar
= -1;
130 #ifdef HANDLE_SYSV_PRAGMA
131 static int handle_sysv_pragma
PROTO((int));
132 #endif /* HANDLE_SYSV_PRAGMA */
133 static int whitespace_cr
PROTO((int));
134 static int skip_white_space
PROTO((int));
135 static char *extend_token_buffer
PROTO((char *));
136 static int readescape
PROTO((int *));
137 int check_newline ();
139 /* Do not insert generated code into the source, instead, include it.
140 This allows us to build gcc automatically even for targets that
141 need to add or modify the reserved keyword lists. */
144 /* Return something to represent absolute declarators containing a *.
145 TARGET is the absolute declarator that the * contains.
146 TYPE_QUALS is a list of modifiers such as const or volatile
147 to apply to the pointer type, represented as identifiers.
149 We return an INDIRECT_REF whose "contents" are TARGET
150 and whose type is the modifier list. */
153 make_pointer_declarator (type_quals
, target
)
154 tree type_quals
, target
;
156 return build1 (INDIRECT_REF
, type_quals
, target
);
160 forget_protocol_qualifiers ()
162 int i
, n
= sizeof wordlist
/ sizeof (struct resword
);
164 for (i
= 0; i
< n
; i
++)
165 if ((int) wordlist
[i
].rid
>= (int) RID_IN
166 && (int) wordlist
[i
].rid
<= (int) RID_ONEWAY
)
167 wordlist
[i
].name
= "";
171 remember_protocol_qualifiers ()
173 int i
, n
= sizeof wordlist
/ sizeof (struct resword
);
175 for (i
= 0; i
< n
; i
++)
176 if (wordlist
[i
].rid
== RID_IN
)
177 wordlist
[i
].name
= "in";
178 else if (wordlist
[i
].rid
== RID_OUT
)
179 wordlist
[i
].name
= "out";
180 else if (wordlist
[i
].rid
== RID_INOUT
)
181 wordlist
[i
].name
= "inout";
182 else if (wordlist
[i
].rid
== RID_BYCOPY
)
183 wordlist
[i
].name
= "bycopy";
184 else if (wordlist
[i
].rid
== RID_ONEWAY
)
185 wordlist
[i
].name
= "oneway";
189 init_parse (filename
)
193 /* Open input file. */
194 if (filename
== 0 || !strcmp (filename
, "-"))
200 finput
= fopen (filename
, "r");
202 pfatal_with_name (filename
);
204 #ifdef IO_BUFFER_SIZE
205 setvbuf (finput
, (char *) xmalloc (IO_BUFFER_SIZE
), _IOFBF
, IO_BUFFER_SIZE
);
207 #endif /* !USE_CPPLIB */
215 cpp_reader_init (&parse_in
);
216 parse_in
.data
= &parse_options
;
217 cpp_options_init (&parse_options
);
218 cpp_handle_options (&parse_in
, 0, NULL
); /* FIXME */
219 parse_in
.show_column
= 1;
220 if (! cpp_start_read (&parse_in
, filename
))
231 cpp_finish (&parse_in
);
240 /* Make identifier nodes long enough for the language-specific slots. */
241 set_identifier_size (sizeof (struct lang_identifier
));
243 /* Start it at 0, because check_newline is called at the very beginning
244 and will increment it to 1. */
247 #ifdef MULTIBYTE_CHARS
248 /* Change to the native locale for multibyte conversions. */
249 setlocale (LC_CTYPE
, "");
253 token_buffer
= (char *) xmalloc (maxtoken
+ 2);
255 ridpointers
[(int) RID_INT
] = get_identifier ("int");
256 ridpointers
[(int) RID_CHAR
] = get_identifier ("char");
257 ridpointers
[(int) RID_VOID
] = get_identifier ("void");
258 ridpointers
[(int) RID_FLOAT
] = get_identifier ("float");
259 ridpointers
[(int) RID_DOUBLE
] = get_identifier ("double");
260 ridpointers
[(int) RID_SHORT
] = get_identifier ("short");
261 ridpointers
[(int) RID_LONG
] = get_identifier ("long");
262 ridpointers
[(int) RID_UNSIGNED
] = get_identifier ("unsigned");
263 ridpointers
[(int) RID_SIGNED
] = get_identifier ("signed");
264 ridpointers
[(int) RID_INLINE
] = get_identifier ("inline");
265 ridpointers
[(int) RID_CONST
] = get_identifier ("const");
266 ridpointers
[(int) RID_VOLATILE
] = get_identifier ("volatile");
267 ridpointers
[(int) RID_AUTO
] = get_identifier ("auto");
268 ridpointers
[(int) RID_STATIC
] = get_identifier ("static");
269 ridpointers
[(int) RID_EXTERN
] = get_identifier ("extern");
270 ridpointers
[(int) RID_TYPEDEF
] = get_identifier ("typedef");
271 ridpointers
[(int) RID_REGISTER
] = get_identifier ("register");
272 ridpointers
[(int) RID_ITERATOR
] = get_identifier ("iterator");
273 ridpointers
[(int) RID_COMPLEX
] = get_identifier ("complex");
274 ridpointers
[(int) RID_ID
] = get_identifier ("id");
275 ridpointers
[(int) RID_IN
] = get_identifier ("in");
276 ridpointers
[(int) RID_OUT
] = get_identifier ("out");
277 ridpointers
[(int) RID_INOUT
] = get_identifier ("inout");
278 ridpointers
[(int) RID_BYCOPY
] = get_identifier ("bycopy");
279 ridpointers
[(int) RID_ONEWAY
] = get_identifier ("oneway");
280 forget_protocol_qualifiers();
282 /* Some options inhibit certain reserved words.
283 Clear those words out of the hash table so they won't be recognized. */
284 #define UNSET_RESERVED_WORD(STRING) \
285 do { struct resword *s = is_reserved_word (STRING, sizeof (STRING) - 1); \
286 if (s) s->name = ""; } while (0)
288 if (! doing_objc_thang
)
289 UNSET_RESERVED_WORD ("id");
291 if (flag_traditional
)
293 UNSET_RESERVED_WORD ("const");
294 UNSET_RESERVED_WORD ("volatile");
295 UNSET_RESERVED_WORD ("typeof");
296 UNSET_RESERVED_WORD ("signed");
297 UNSET_RESERVED_WORD ("inline");
298 UNSET_RESERVED_WORD ("iterator");
299 UNSET_RESERVED_WORD ("complex");
303 UNSET_RESERVED_WORD ("asm");
304 UNSET_RESERVED_WORD ("typeof");
305 UNSET_RESERVED_WORD ("inline");
306 UNSET_RESERVED_WORD ("iterator");
307 UNSET_RESERVED_WORD ("complex");
312 reinit_parse_for_function ()
316 /* Function used when yydebug is set, to print a token in more detail. */
319 yyprint (file
, yychar
, yylval
)
331 if (IDENTIFIER_POINTER (t
))
332 fprintf (file
, " `%s'", IDENTIFIER_POINTER (t
));
337 if (TREE_CODE (t
) == INTEGER_CST
)
339 #if HOST_BITS_PER_WIDE_INT == 64
340 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
343 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
350 #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
356 TREE_INT_CST_HIGH (t
), TREE_INT_CST_LOW (t
));
361 /* Iff C is a carriage return, warn about it - if appropriate -
362 and return nonzero. */
367 static int newline_warning
= 0;
371 /* ANSI C says the effects of a carriage return in a source file
373 if (pedantic
&& !newline_warning
)
375 warning ("carriage return in source file");
376 warning ("(we only warn about the first carriage return)");
384 /* If C is not whitespace, return C.
385 Otherwise skip whitespace and return first nonwhite char read. */
395 /* We don't recognize comments here, because
396 cpp output can include / and * consecutively as operators.
397 Also, there's no need, since cpp removes all comments. */
400 c
= check_newline ();
421 error ("stray '\\' in program");
431 /* Skips all of the white space at the current location in the input file.
432 Must use and reset nextchar if it has the next character. */
435 position_after_white_space ()
441 c
= nextchar
, nextchar
= -1;
446 UNGETC (skip_white_space (c
));
449 /* Like skip_white_space, but don't advance beyond the end of line.
450 Moreover, we don't get passed a character to start with. */
452 skip_white_space_on_line ()
481 /* Make the token buffer longer, preserving the data in it.
482 P should point to just beyond the last valid character in the old buffer.
483 The value we return is a pointer to the new buffer
484 at a place corresponding to P. */
487 extend_token_buffer (p
)
490 int offset
= p
- token_buffer
;
492 maxtoken
= maxtoken
* 2 + 10;
493 token_buffer
= (char *) xrealloc (token_buffer
, maxtoken
+ 2);
495 return token_buffer
+ offset
;
499 #define GET_DIRECTIVE_LINE() get_directive_line (finput)
500 #else /* USE_CPPLIB */
501 /* Read the rest of a #-directive from input stream FINPUT.
502 In normal use, the directive name and the white space after it
503 have already been read, so they won't be included in the result.
504 We allow for the fact that the directive line may contain
505 a newline embedded within a character or string literal which forms
506 a part of the directive.
508 The value is a string in a reusable buffer. It remains valid
509 only until the next time this function is called. */
512 GET_DIRECTIVE_LINE ()
514 static char *directive_buffer
= NULL
;
515 static unsigned buffer_length
= 0;
517 register char *buffer_limit
;
518 register int looking_for
= 0;
519 register int char_escaped
= 0;
521 if (buffer_length
== 0)
523 directive_buffer
= (char *)xmalloc (128);
527 buffer_limit
= &directive_buffer
[buffer_length
];
529 for (p
= directive_buffer
; ; )
533 /* Make buffer bigger if it is full. */
534 if (p
>= buffer_limit
)
536 register unsigned bytes_used
= (p
- directive_buffer
);
540 = (char *)xrealloc (directive_buffer
, buffer_length
);
541 p
= &directive_buffer
[bytes_used
];
542 buffer_limit
= &directive_buffer
[buffer_length
];
547 /* Discard initial whitespace. */
548 if ((c
== ' ' || c
== '\t') && p
== directive_buffer
)
551 /* Detect the end of the directive. */
552 if (c
== '\n' && looking_for
== 0)
561 return directive_buffer
;
563 /* Handle string and character constant syntax. */
566 if (looking_for
== c
&& !char_escaped
)
567 looking_for
= 0; /* Found terminator... stop looking. */
570 if (c
== '\'' || c
== '"')
571 looking_for
= c
; /* Don't stop buffering until we see another
572 another one of these (or an EOF). */
574 /* Handle backslash. */
575 char_escaped
= (c
== '\\' && ! char_escaped
);
578 #endif /* USE_CPPLIB */
580 /* At the beginning of a line, increment the line number
581 and process any #-directive on this line.
582 If the line is a #-directive, read the entire line and return a newline.
583 Otherwise, return the line's first non-whitespace character. */
593 /* Read first nonwhite char on the line. */
596 while (c
== ' ' || c
== '\t')
601 /* If not #, return it so caller will use it. */
605 /* Read first nonwhite char after the `#'. */
608 while (c
== ' ' || c
== '\t')
611 /* If a letter follows, then if the word here is `line', skip
612 it and ignore it; otherwise, ignore the line, with an error
613 if the word isn't `pragma', `ident', `define', or `undef'. */
615 if ((c
>= 'a' && c
<= 'z') || (c
>= 'A' && c
<= 'Z'))
624 && ((c
= GETC()) == ' ' || c
== '\t' || c
== '\n'
625 || whitespace_cr (c
) ))
627 while (c
== ' ' || c
== '\t' || whitespace_cr (c
))
631 #ifdef HANDLE_SYSV_PRAGMA
634 if (token
!= IDENTIFIER
)
636 return handle_sysv_pragma (token
);
637 #else /* !HANDLE_SYSV_PRAGMA */
642 if (token
!= IDENTIFIER
)
644 if (HANDLE_PRAGMA (finput
, yylval
.ttype
))
650 ??? do not know what to
do ???;
651 #endif /* !USE_CPPLIB */
652 #endif /* HANDLE_PRAGMA */
653 #endif /* !HANDLE_SYSV_PRAGMA */
665 && ((c
= GETC()) == ' ' || c
== '\t' || c
== '\n'))
668 debug_define (lineno
, GET_DIRECTIVE_LINE ());
678 && ((c
= GETC()) == ' ' || c
== '\t' || c
== '\n'))
681 debug_undef (lineno
, GET_DIRECTIVE_LINE ());
690 && ((c
= GETC()) == ' ' || c
== '\t'))
699 && ((c
= GETC()) == ' ' || c
== '\t'))
701 /* #ident. The pedantic warning is now in cccp.c. */
703 /* Here we have just seen `#ident '.
704 A string constant should follow. */
706 c
= skip_white_space_on_line ();
708 /* If no argument, ignore the line. */
715 || TREE_CODE (yylval
.ttype
) != STRING_CST
)
717 error ("invalid #ident");
723 #ifdef ASM_OUTPUT_IDENT
724 ASM_OUTPUT_IDENT (asm_out_file
, TREE_STRING_POINTER (yylval
.ttype
));
728 /* Skip the rest of this line. */
733 error ("undefined or invalid # directive");
738 /* Here we have either `#line' or `# <nonletter>'.
739 In either case, it should be a line number; a digit should follow. */
741 /* Can't use skip_white_space here, but must handle all whitespace
742 that is not '\n', lest we get a recursion for '\r' '\n' when
745 c
= skip_white_space_on_line ();
747 /* If the # is the only nonwhite char on the line,
748 just ignore it. Check the new newline. */
752 /* Something follows the #; read a token. */
757 if (token
== CONSTANT
758 && TREE_CODE (yylval
.ttype
) == INTEGER_CST
)
760 int old_lineno
= lineno
;
762 /* subtract one, because it is the following line that
763 gets the specified number */
765 int l
= TREE_INT_CST_LOW (yylval
.ttype
) - 1;
767 /* Is this the last nonwhite stuff on the line? */
768 c
= skip_white_space_on_line ();
771 /* No more: store the line number and check following line. */
777 /* More follows: it must be a string constant (filename). */
779 /* Read the string constant. */
782 if (token
!= STRING
|| TREE_CODE (yylval
.ttype
) != STRING_CST
)
784 error ("invalid #line");
789 = (char *) permalloc (TREE_STRING_LENGTH (yylval
.ttype
) + 1);
790 strcpy (input_filename
, TREE_STRING_POINTER (yylval
.ttype
));
793 /* Each change of file name
794 reinitializes whether we are now in a system header. */
795 in_system_header
= 0;
797 if (main_input_filename
== 0)
798 main_input_filename
= input_filename
;
800 /* Is this the last nonwhite stuff on the line? */
801 c
= skip_white_space_on_line ();
804 /* Update the name in the top element of input_file_stack. */
805 if (input_file_stack
)
806 input_file_stack
->name
= input_filename
;
815 /* `1' after file name means entering new file.
816 `2' after file name means just left a file. */
818 if (token
== CONSTANT
819 && TREE_CODE (yylval
.ttype
) == INTEGER_CST
)
821 if (TREE_INT_CST_LOW (yylval
.ttype
) == 1)
823 /* Pushing to a new file. */
825 = (struct file_stack
*) xmalloc (sizeof (struct file_stack
));
826 input_file_stack
->line
= old_lineno
;
827 p
->next
= input_file_stack
;
828 p
->name
= input_filename
;
829 p
->indent_level
= indent_level
;
830 input_file_stack
= p
;
831 input_file_stack_tick
++;
832 debug_start_source_file (input_filename
);
835 else if (TREE_INT_CST_LOW (yylval
.ttype
) == 2)
837 /* Popping out of a file. */
838 if (input_file_stack
->next
)
840 struct file_stack
*p
= input_file_stack
;
841 if (indent_level
!= p
->indent_level
)
843 warning_with_file_and_line
844 (p
->name
, old_lineno
,
845 "This file contains more `%c's than `%c's.",
846 indent_level
> p
->indent_level
? '{' : '}',
847 indent_level
> p
->indent_level
? '}' : '{');
849 input_file_stack
= p
->next
;
851 input_file_stack_tick
++;
852 debug_end_source_file (input_file_stack
->line
);
855 error ("#-lines for entering and leaving files don't match");
861 /* Now that we've pushed or popped the input stack,
862 update the name in the top element. */
863 if (input_file_stack
)
864 input_file_stack
->name
= input_filename
;
866 /* If we have handled a `1' or a `2',
867 see if there is another number to read. */
870 /* Is this the last nonwhite stuff on the line? */
871 c
= skip_white_space_on_line ();
880 /* `3' after file name means this is a system header file. */
882 if (token
== CONSTANT
883 && TREE_CODE (yylval
.ttype
) == INTEGER_CST
884 && TREE_INT_CST_LOW (yylval
.ttype
) == 3)
885 in_system_header
= 1, used_up
= 1;
889 /* Is this the last nonwhite stuff on the line? */
890 c
= skip_white_space_on_line ();
896 warning ("unrecognized text at end of #line");
899 error ("invalid #-line");
901 /* skip the rest of this line. */
904 if (c
!= '\n' && c
!= EOF
&& nextchar
>= 0)
905 c
= nextchar
, nextchar
= -1;
907 while (c
!= '\n' && c
!= EOF
)
912 #ifdef HANDLE_SYSV_PRAGMA
914 /* Handle a #pragma directive.
915 TOKEN is the token we read after `#pragma'. Processes the entire input
916 line and returns a character for the caller to reread: either \n or EOF. */
918 /* This function has to be in this file, in order to get at
922 handle_sysv_pragma (token
)
935 handle_pragma_token (token_buffer
, yylval
.ttype
);
938 handle_pragma_token (token_buffer
, 0);
942 c
= nextchar
, nextchar
= -1;
947 while (c
== ' ' || c
== '\t')
949 if (c
== '\n' || c
== EOF
)
951 handle_pragma_token (0, 0);
959 #endif /* HANDLE_SYSV_PRAGMA */
961 #define ENDFILE -1 /* token that represents end-of-file */
963 /* Read an escape sequence, returning its equivalent as a character,
964 or store 1 in *ignore_ptr if it is backslash-newline. */
967 readescape (ignore_ptr
)
970 register int c
= GETC();
972 register unsigned count
;
973 unsigned firstdig
= 0;
979 if (warn_traditional
)
980 warning ("the meaning of `\\x' varies with -traditional");
982 if (flag_traditional
)
991 if (!(c
>= 'a' && c
<= 'f')
992 && !(c
>= 'A' && c
<= 'F')
993 && !(c
>= '0' && c
<= '9'))
999 if (c
>= 'a' && c
<= 'f')
1000 code
+= c
- 'a' + 10;
1001 if (c
>= 'A' && c
<= 'F')
1002 code
+= c
- 'A' + 10;
1003 if (c
>= '0' && c
<= '9')
1005 if (code
!= 0 || count
!= 0)
1014 error ("\\x used with no following hex digits");
1015 else if (count
== 0)
1016 /* Digits are all 0's. Ok. */
1018 else if ((count
- 1) * 4 >= TYPE_PRECISION (integer_type_node
)
1020 && ((1 << (TYPE_PRECISION (integer_type_node
) - (count
- 1) * 4))
1022 pedwarn ("hex escape out of range");
1025 case '0': case '1': case '2': case '3': case '4':
1026 case '5': case '6': case '7':
1029 while ((c
<= '7') && (c
>= '0') && (count
++ < 3))
1031 code
= (code
* 8) + (c
- '0');
1037 case '\\': case '\'': case '"':
1046 return TARGET_NEWLINE
;
1061 if (warn_traditional
)
1062 warning ("the meaning of `\\a' varies with -traditional");
1064 if (flag_traditional
)
1069 #if 0 /* Vertical tab is present in common usage compilers. */
1070 if (flag_traditional
)
1078 pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c
);
1084 /* `\(', etc, are used at beginning of line to avoid confusing Emacs. */
1088 /* `\%' is used to prevent SCCS from getting confused. */
1091 pedwarn ("non-ANSI escape sequence `\\%c'", c
);
1094 if (c
>= 040 && c
< 0177)
1095 pedwarn ("unknown escape sequence `\\%c'", c
);
1097 pedwarn ("unknown escape sequence: `\\' followed by char code 0x%x", c
);
1107 strcpy (buf
, string
);
1109 /* We can't print string and character constants well
1110 because the token_buffer contains the result of processing escapes. */
1112 strcat (buf
, " at end of input");
1113 else if (token_buffer
[0] == 0)
1114 strcat (buf
, " at null character");
1115 else if (token_buffer
[0] == '"')
1116 strcat (buf
, " before string constant");
1117 else if (token_buffer
[0] == '\'')
1118 strcat (buf
, " before character constant");
1119 else if (token_buffer
[0] < 040 || (unsigned char) token_buffer
[0] >= 0177)
1120 sprintf (buf
+ strlen (buf
), " before character 0%o",
1121 (unsigned char) token_buffer
[0]);
1123 strcat (buf
, " before `%s'");
1125 error (buf
, token_buffer
);
1135 char long_long_flag
;
1138 struct try_type type_sequence
[] =
1140 { &integer_type_node
, 0, 0, 0},
1141 { &unsigned_type_node
, 1, 0, 0},
1142 { &long_integer_type_node
, 0, 1, 0},
1143 { &long_unsigned_type_node
, 1, 1, 0},
1144 { &long_long_integer_type_node
, 0, 1, 1},
1145 { &long_long_unsigned_type_node
, 1, 1, 1}
1160 c
= nextchar
, nextchar
= -1;
1165 /* Effectively do c = skip_white_space (c)
1166 but do it faster in the usual cases. */
1179 /* Call skip_white_space so we can warn if appropriate. */
1184 c
= skip_white_space (c
);
1186 goto found_nonwhite
;
1190 token_buffer
[0] = c
;
1191 token_buffer
[1] = 0;
1193 /* yylloc.first_line = lineno; */
1199 token_buffer
[0] = 0;
1204 /* Capital L may start a wide-string or wide-character constant. */
1206 register int c
= GETC();
1215 goto string_constant
;
1222 if (!doing_objc_thang
)
1229 /* '@' may start a constant string object. */
1230 register int c
= GETC ();
1234 goto string_constant
;
1237 /* Fall through to treat '@' as the start of an identifier. */
1240 case 'A': case 'B': case 'C': case 'D': case 'E':
1241 case 'F': case 'G': case 'H': case 'I': case 'J':
1242 case 'K': case 'M': case 'N': case 'O':
1243 case 'P': case 'Q': case 'R': case 'S': case 'T':
1244 case 'U': case 'V': case 'W': case 'X': case 'Y':
1246 case 'a': case 'b': case 'c': case 'd': case 'e':
1247 case 'f': case 'g': case 'h': case 'i': case 'j':
1248 case 'k': case 'l': case 'm': case 'n': case 'o':
1249 case 'p': case 'q': case 'r': case 's': case 't':
1250 case 'u': case 'v': case 'w': case 'x': case 'y':
1256 while (isalnum (c
) || c
== '_' || c
== '$' || c
== '@')
1258 /* Make sure this char really belongs in an identifier. */
1259 if (c
== '@' && ! doing_objc_thang
)
1263 if (! dollars_in_ident
)
1264 error ("`$' in identifier");
1266 pedwarn ("`$' in identifier");
1269 if (p
>= token_buffer
+ maxtoken
)
1270 p
= extend_token_buffer (p
);
1286 /* Try to recognize a keyword. Uses minimum-perfect hash function */
1289 register struct resword
*ptr
;
1291 if ((ptr
= is_reserved_word (token_buffer
, p
- token_buffer
)))
1294 yylval
.ttype
= ridpointers
[(int) ptr
->rid
];
1295 value
= (int) ptr
->token
;
1297 /* Only return OBJECTNAME if it is a typedef. */
1298 if (doing_objc_thang
&& value
== OBJECTNAME
)
1300 lastiddecl
= lookup_name(yylval
.ttype
);
1302 if (lastiddecl
== NULL_TREE
1303 || TREE_CODE (lastiddecl
) != TYPE_DECL
)
1307 /* Even if we decided to recognize asm, still perhaps warn. */
1309 && (value
== ASM_KEYWORD
|| value
== TYPEOF
1310 || ptr
->rid
== RID_INLINE
)
1311 && token_buffer
[0] != '_')
1312 pedwarn ("ANSI does not permit the keyword `%s'",
1317 /* If we did not find a keyword, look for an identifier
1320 if (value
== IDENTIFIER
)
1322 if (token_buffer
[0] == '@')
1323 error("invalid identifier `%s'", token_buffer
);
1325 yylval
.ttype
= get_identifier (token_buffer
);
1326 lastiddecl
= lookup_name (yylval
.ttype
);
1328 if (lastiddecl
!= 0 && TREE_CODE (lastiddecl
) == TYPE_DECL
)
1330 /* A user-invisible read-only initialized variable
1331 should be replaced by its value.
1332 We handle only strings since that's the only case used in C. */
1333 else if (lastiddecl
!= 0 && TREE_CODE (lastiddecl
) == VAR_DECL
1334 && DECL_IGNORED_P (lastiddecl
)
1335 && TREE_READONLY (lastiddecl
)
1336 && DECL_INITIAL (lastiddecl
) != 0
1337 && TREE_CODE (DECL_INITIAL (lastiddecl
)) == STRING_CST
)
1339 tree stringval
= DECL_INITIAL (lastiddecl
);
1341 /* Copy the string value so that we won't clobber anything
1342 if we put something in the TREE_CHAIN of this one. */
1343 yylval
.ttype
= build_string (TREE_STRING_LENGTH (stringval
),
1344 TREE_STRING_POINTER (stringval
));
1347 else if (doing_objc_thang
)
1349 tree objc_interface_decl
= is_class_name (yylval
.ttype
);
1351 if (objc_interface_decl
)
1354 yylval
.ttype
= objc_interface_decl
;
1364 /* Check first for common special case: single-digit 0 or 1. */
1367 UNGETC (next_c
); /* Always undo this lookahead. */
1368 if (!isalnum (next_c
) && next_c
!= '.')
1370 token_buffer
[0] = (char)c
, token_buffer
[1] = '\0';
1371 yylval
.ttype
= (c
== '0') ? integer_zero_node
: integer_one_node
;
1377 case '2': case '3': case '4':
1378 case '5': case '6': case '7': case '8': case '9':
1383 int largest_digit
= 0;
1385 /* for multi-precision arithmetic,
1386 we actually store only HOST_BITS_PER_CHAR bits in each part.
1387 The number of parts is chosen so as to be sufficient to hold
1388 the enough bits to fit into the two HOST_WIDE_INTs that contain
1389 the integer value (this is always at least as many bits as are
1390 in a target `long long' value, but may be wider). */
1391 #define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2 + 2)
1392 int parts
[TOTAL_PARTS
];
1395 enum anon1
{ NOT_FLOAT
, AFTER_POINT
, TOO_MANY_POINTS
} floatflag
1398 for (count
= 0; count
< TOTAL_PARTS
; count
++)
1406 *p
++ = (c
= GETC());
1407 if ((c
== 'x') || (c
== 'X'))
1410 *p
++ = (c
= GETC());
1412 /* Leading 0 forces octal unless the 0 is the only digit. */
1413 else if (c
>= '0' && c
<= '9')
1422 /* Read all the digits-and-decimal-points. */
1425 || (isalnum (c
) && c
!= 'l' && c
!= 'L'
1426 && c
!= 'u' && c
!= 'U'
1427 && c
!= 'i' && c
!= 'I' && c
!= 'j' && c
!= 'J'
1428 && (floatflag
== NOT_FLOAT
|| ((c
!= 'f') && (c
!= 'F')))))
1433 error ("floating constant may not be in radix 16");
1434 if (floatflag
== TOO_MANY_POINTS
)
1435 /* We have already emitted an error. Don't need another. */
1437 else if (floatflag
== AFTER_POINT
)
1439 error ("malformed floating constant");
1440 floatflag
= TOO_MANY_POINTS
;
1441 /* Avoid another error from atof by forcing all characters
1442 from here on to be ignored. */
1446 floatflag
= AFTER_POINT
;
1450 /* Accept '.' as the start of a floating-point number
1451 only when it is followed by a digit.
1452 Otherwise, unread the following non-digit
1453 and use the '.' as a structural token. */
1454 if (p
== token_buffer
+ 2 && !isdigit (c
))
1465 error ("parse error at `..'");
1468 token_buffer
[1] = 0;
1475 /* It is not a decimal point.
1476 It should be a digit (perhaps a hex digit). */
1482 else if (base
<= 10)
1484 if (c
== 'e' || c
== 'E')
1487 floatflag
= AFTER_POINT
;
1488 break; /* start of exponent */
1490 error ("nondigits in number and not hexadecimal");
1501 if (c
>= largest_digit
)
1505 for (count
= 0; count
< TOTAL_PARTS
; count
++)
1507 parts
[count
] *= base
;
1511 += (parts
[count
-1] >> HOST_BITS_PER_CHAR
);
1513 &= (1 << HOST_BITS_PER_CHAR
) - 1;
1519 /* If the extra highest-order part ever gets anything in it,
1520 the number is certainly too big. */
1521 if (parts
[TOTAL_PARTS
- 1] != 0)
1524 if (p
>= token_buffer
+ maxtoken
- 3)
1525 p
= extend_token_buffer (p
);
1526 *p
++ = (c
= GETC());
1531 error ("numeric constant with no digits");
1533 if (largest_digit
>= base
)
1534 error ("numeric constant contains digits beyond the radix");
1536 /* Remove terminating char from the token buffer and delimit the string */
1539 if (floatflag
!= NOT_FLOAT
)
1541 tree type
= double_type_node
;
1543 int conversion_errno
= 0;
1544 REAL_VALUE_TYPE value
;
1547 /* Read explicit exponent if any, and put it in tokenbuf. */
1549 if ((c
== 'e') || (c
== 'E'))
1551 if (p
>= token_buffer
+ maxtoken
- 3)
1552 p
= extend_token_buffer (p
);
1555 if ((c
== '+') || (c
== '-'))
1561 error ("floating constant exponent has no digits");
1564 if (p
>= token_buffer
+ maxtoken
- 3)
1565 p
= extend_token_buffer (p
);
1573 /* Convert string to a double, checking for overflow. */
1574 if (setjmp (handler
))
1576 error ("floating constant out of range");
1581 int fflag
= 0, lflag
= 0;
1582 /* Copy token_buffer now, while it has just the number
1583 and not the suffixes; once we add `f' or `i',
1584 REAL_VALUE_ATOF may not work any more. */
1585 char *copy
= (char *) alloca (p
- token_buffer
+ 1);
1586 bcopy (token_buffer
, copy
, p
- token_buffer
+ 1);
1588 set_float_handler (handler
);
1594 /* Read the suffixes to choose a data type. */
1599 error ("more than one `f' in numeric constant");
1605 error ("more than one `l' in numeric constant");
1611 error ("more than one `i' or `j' in numeric constant");
1613 pedwarn ("ANSI C forbids imaginary numeric constants");
1624 if (p
>= token_buffer
+ maxtoken
- 3)
1625 p
= extend_token_buffer (p
);
1631 /* The second argument, machine_mode, of REAL_VALUE_ATOF
1632 tells the desired precision of the binary result
1633 of decimal-to-binary conversion. */
1638 error ("both `f' and `l' in floating constant");
1640 type
= float_type_node
;
1642 value
= REAL_VALUE_ATOF (copy
, TYPE_MODE (type
));
1643 conversion_errno
= errno
;
1644 /* A diagnostic is required here by some ANSI C testsuites.
1645 This is not pedwarn, become some people don't want
1646 an error for this. */
1647 if (REAL_VALUE_ISINF (value
) && pedantic
)
1648 warning ("floating point number exceeds range of `float'");
1652 type
= long_double_type_node
;
1654 value
= REAL_VALUE_ATOF (copy
, TYPE_MODE (type
));
1655 conversion_errno
= errno
;
1656 if (REAL_VALUE_ISINF (value
) && pedantic
)
1657 warning ("floating point number exceeds range of `long double'");
1662 value
= REAL_VALUE_ATOF (copy
, TYPE_MODE (type
));
1663 conversion_errno
= errno
;
1664 if (REAL_VALUE_ISINF (value
) && pedantic
)
1665 warning ("floating point number exceeds range of `double'");
1668 set_float_handler (NULL_PTR
);
1671 /* ERANGE is also reported for underflow,
1672 so test the value to distinguish overflow from that. */
1673 if (conversion_errno
== ERANGE
&& !flag_traditional
&& pedantic
1674 && (REAL_VALUES_LESS (dconst1
, value
)
1675 || REAL_VALUES_LESS (value
, dconstm1
)))
1676 warning ("floating point number exceeds range of `double'");
1679 /* If the result is not a number, assume it must have been
1680 due to some error message above, so silently convert
1682 if (REAL_VALUE_ISNAN (value
))
1685 /* Create a node with determined type and value. */
1687 yylval
.ttype
= build_complex (NULL_TREE
,
1688 convert (type
, integer_zero_node
),
1689 build_real (type
, value
));
1691 yylval
.ttype
= build_real (type
, value
);
1695 tree traditional_type
, ansi_type
, type
;
1696 HOST_WIDE_INT high
, low
;
1697 int spec_unsigned
= 0;
1699 int spec_long_long
= 0;
1703 traditional_type
= ansi_type
= type
= NULL_TREE
;
1706 if (c
== 'u' || c
== 'U')
1709 error ("two `u's in integer constant");
1712 else if (c
== 'l' || c
== 'L')
1717 error ("three `l's in integer constant");
1719 pedwarn ("ANSI C forbids long long integer constants");
1724 else if (c
== 'i' || c
== 'j' || c
== 'I' || c
== 'J')
1727 error ("more than one `i' or `j' in numeric constant");
1729 pedwarn ("ANSI C forbids imaginary numeric constants");
1734 if (p
>= token_buffer
+ maxtoken
- 3)
1735 p
= extend_token_buffer (p
);
1740 /* If the constant won't fit in an unsigned long long,
1741 then warn that the constant is out of range. */
1743 /* ??? This assumes that long long and long integer types are
1744 a multiple of 8 bits. This better than the original code
1745 though which assumed that long was exactly 32 bits and long
1746 long was exactly 64 bits. */
1748 bytes
= TYPE_PRECISION (long_long_integer_type_node
) / 8;
1751 for (i
= bytes
; i
< TOTAL_PARTS
; i
++)
1755 pedwarn ("integer constant out of range");
1757 /* This is simplified by the fact that our constant
1758 is always positive. */
1762 for (i
= 0; i
< HOST_BITS_PER_WIDE_INT
/ HOST_BITS_PER_CHAR
; i
++)
1764 high
|= ((HOST_WIDE_INT
) parts
[i
+ (HOST_BITS_PER_WIDE_INT
1765 / HOST_BITS_PER_CHAR
)]
1766 << (i
* HOST_BITS_PER_CHAR
));
1767 low
|= (HOST_WIDE_INT
) parts
[i
] << (i
* HOST_BITS_PER_CHAR
);
1770 yylval
.ttype
= build_int_2 (low
, high
);
1771 TREE_TYPE (yylval
.ttype
) = long_long_unsigned_type_node
;
1773 /* If warn_traditional, calculate both the ANSI type and the
1774 traditional type, then see if they disagree.
1775 Otherwise, calculate only the type for the dialect in use. */
1776 if (warn_traditional
|| flag_traditional
)
1778 /* Calculate the traditional type. */
1779 /* Traditionally, any constant is signed;
1780 but if unsigned is specified explicitly, obey that.
1781 Use the smallest size with the right number of bits,
1782 except for one special case with decimal constants. */
1783 if (! spec_long
&& base
!= 10
1784 && int_fits_type_p (yylval
.ttype
, unsigned_type_node
))
1785 traditional_type
= (spec_unsigned
? unsigned_type_node
1786 : integer_type_node
);
1787 /* A decimal constant must be long
1788 if it does not fit in type int.
1789 I think this is independent of whether
1790 the constant is signed. */
1791 else if (! spec_long
&& base
== 10
1792 && int_fits_type_p (yylval
.ttype
, integer_type_node
))
1793 traditional_type
= (spec_unsigned
? unsigned_type_node
1794 : integer_type_node
);
1795 else if (! spec_long_long
)
1796 traditional_type
= (spec_unsigned
? long_unsigned_type_node
1797 : long_integer_type_node
);
1799 traditional_type
= (spec_unsigned
1800 ? long_long_unsigned_type_node
1801 : long_long_integer_type_node
);
1803 if (warn_traditional
|| ! flag_traditional
)
1805 /* Calculate the ANSI type. */
1806 if (! spec_long
&& ! spec_unsigned
1807 && int_fits_type_p (yylval
.ttype
, integer_type_node
))
1808 ansi_type
= integer_type_node
;
1809 else if (! spec_long
&& (base
!= 10 || spec_unsigned
)
1810 && int_fits_type_p (yylval
.ttype
, unsigned_type_node
))
1811 ansi_type
= unsigned_type_node
;
1812 else if (! spec_unsigned
&& !spec_long_long
1813 && int_fits_type_p (yylval
.ttype
, long_integer_type_node
))
1814 ansi_type
= long_integer_type_node
;
1815 else if (! spec_long_long
1816 && int_fits_type_p (yylval
.ttype
,
1817 long_unsigned_type_node
))
1818 ansi_type
= long_unsigned_type_node
;
1819 else if (! spec_unsigned
1820 && int_fits_type_p (yylval
.ttype
,
1821 long_long_integer_type_node
))
1822 ansi_type
= long_long_integer_type_node
;
1824 ansi_type
= long_long_unsigned_type_node
;
1827 type
= flag_traditional
? traditional_type
: ansi_type
;
1829 if (warn_traditional
&& traditional_type
!= ansi_type
)
1831 if (TYPE_PRECISION (traditional_type
)
1832 != TYPE_PRECISION (ansi_type
))
1833 warning ("width of integer constant changes with -traditional");
1834 else if (TREE_UNSIGNED (traditional_type
)
1835 != TREE_UNSIGNED (ansi_type
))
1836 warning ("integer constant is unsigned in ANSI C, signed with -traditional");
1838 warning ("width of integer constant may change on other systems with -traditional");
1841 if (pedantic
&& !flag_traditional
&& !spec_long_long
&& !warn
1842 && (TYPE_PRECISION (long_integer_type_node
)
1843 < TYPE_PRECISION (type
)))
1844 pedwarn ("integer constant out of range");
1846 if (base
== 10 && ! spec_unsigned
&& TREE_UNSIGNED (type
))
1847 warning ("decimal constant is so large that it is unsigned");
1851 if (TYPE_PRECISION (type
)
1852 <= TYPE_PRECISION (integer_type_node
))
1854 = build_complex (NULL_TREE
, integer_zero_node
,
1855 convert (integer_type_node
,
1858 error ("complex integer constant is too wide for `complex int'");
1860 else if (flag_traditional
&& !int_fits_type_p (yylval
.ttype
, type
))
1861 /* The traditional constant 0x80000000 is signed
1862 but doesn't fit in the range of int.
1863 This will change it to -0x80000000, which does fit. */
1865 TREE_TYPE (yylval
.ttype
) = unsigned_type (type
);
1866 yylval
.ttype
= convert (type
, yylval
.ttype
);
1867 TREE_OVERFLOW (yylval
.ttype
)
1868 = TREE_CONSTANT_OVERFLOW (yylval
.ttype
) = 0;
1871 TREE_TYPE (yylval
.ttype
) = type
;
1877 if (isalnum (c
) || c
== '.' || c
== '_' || c
== '$'
1878 || (!flag_traditional
&& (c
== '-' || c
== '+')
1879 && (p
[-1] == 'e' || p
[-1] == 'E')))
1880 error ("missing white space after number `%s'", token_buffer
);
1882 value
= CONSTANT
; break;
1888 register int result
= 0;
1889 register int num_chars
= 0;
1890 unsigned width
= TYPE_PRECISION (char_type_node
);
1895 width
= WCHAR_TYPE_SIZE
;
1896 #ifdef MULTIBYTE_CHARS
1897 max_chars
= MB_CUR_MAX
;
1903 max_chars
= TYPE_PRECISION (integer_type_node
) / width
;
1911 if (c
== '\'' || c
== EOF
)
1917 c
= readescape (&ignore
);
1920 if (width
< HOST_BITS_PER_INT
1921 && (unsigned) c
>= (1 << width
))
1922 pedwarn ("escape sequence out of range for character");
1923 #ifdef MAP_CHARACTER
1925 c
= MAP_CHARACTER (c
);
1931 pedwarn ("ANSI C forbids newline in character constant");
1934 #ifdef MAP_CHARACTER
1936 c
= MAP_CHARACTER (c
);
1940 if (num_chars
> maxtoken
- 4)
1941 extend_token_buffer (token_buffer
);
1943 token_buffer
[num_chars
] = c
;
1945 /* Merge character into result; ignore excess chars. */
1946 if (num_chars
< max_chars
+ 1)
1948 if (width
< HOST_BITS_PER_INT
)
1949 result
= (result
<< width
) | (c
& ((1 << width
) - 1));
1955 token_buffer
[num_chars
+ 1] = '\'';
1956 token_buffer
[num_chars
+ 2] = 0;
1959 error ("malformatted character constant");
1960 else if (num_chars
== 0)
1961 error ("empty character constant");
1962 else if (num_chars
> max_chars
)
1964 num_chars
= max_chars
;
1965 error ("character constant too long");
1967 else if (num_chars
!= 1 && ! flag_traditional
)
1968 warning ("multi-character character constant");
1970 /* If char type is signed, sign-extend the constant. */
1973 int num_bits
= num_chars
* width
;
1975 /* We already got an error; avoid invalid shift. */
1976 yylval
.ttype
= build_int_2 (0, 0);
1977 else if (TREE_UNSIGNED (char_type_node
)
1978 || ((result
>> (num_bits
- 1)) & 1) == 0)
1980 = build_int_2 (result
& (~(unsigned HOST_WIDE_INT
) 0
1981 >> (HOST_BITS_PER_WIDE_INT
- num_bits
)),
1985 = build_int_2 (result
| ~(~(unsigned HOST_WIDE_INT
) 0
1986 >> (HOST_BITS_PER_WIDE_INT
- num_bits
)),
1988 TREE_TYPE (yylval
.ttype
) = integer_type_node
;
1992 #ifdef MULTIBYTE_CHARS
1993 /* Set the initial shift state and convert the next sequence. */
1995 /* In all locales L'\0' is zero and mbtowc will return zero,
1998 || (num_chars
== 1 && token_buffer
[1] != '\0'))
2001 (void) mbtowc (NULL_PTR
, NULL_PTR
, 0);
2002 if (mbtowc (& wc
, token_buffer
+ 1, num_chars
) == num_chars
)
2005 warning ("Ignoring invalid multibyte character");
2008 yylval
.ttype
= build_int_2 (result
, 0);
2009 TREE_TYPE (yylval
.ttype
) = wchar_type_node
;
2020 p
= token_buffer
+ 1;
2022 while (c
!= '"' && c
>= 0)
2027 c
= readescape (&ignore
);
2031 && TYPE_PRECISION (char_type_node
) < HOST_BITS_PER_INT
2032 && c
>= (1 << TYPE_PRECISION (char_type_node
)))
2033 pedwarn ("escape sequence out of range for character");
2038 pedwarn ("ANSI C forbids newline in string constant");
2042 if (p
== token_buffer
+ maxtoken
)
2043 p
= extend_token_buffer (p
);
2052 error ("Unterminated string constant");
2054 /* We have read the entire constant.
2055 Construct a STRING_CST for the result. */
2059 /* If this is a L"..." wide-string, convert the multibyte string
2060 to a wide character string. */
2061 char *widep
= (char *) alloca ((p
- token_buffer
) * WCHAR_BYTES
);
2064 #ifdef MULTIBYTE_CHARS
2065 len
= mbstowcs ((wchar_t *) widep
, token_buffer
+ 1, p
- token_buffer
);
2066 if (len
< 0 || len
>= (p
- token_buffer
))
2068 warning ("Ignoring invalid multibyte string");
2071 bzero (widep
+ (len
* WCHAR_BYTES
), WCHAR_BYTES
);
2076 wp
= widep
+ (BYTES_BIG_ENDIAN
? WCHAR_BYTES
- 1 : 0);
2077 bzero (widep
, (p
- token_buffer
) * WCHAR_BYTES
);
2078 for (cp
= token_buffer
+ 1; cp
< p
; cp
++)
2079 *wp
= *cp
, wp
+= WCHAR_BYTES
;
2080 len
= p
- token_buffer
- 1;
2083 yylval
.ttype
= build_string ((len
+ 1) * WCHAR_BYTES
, widep
);
2084 TREE_TYPE (yylval
.ttype
) = wchar_array_type_node
;
2089 extern tree
build_objc_string();
2090 /* Return an Objective-C @"..." constant string object. */
2091 yylval
.ttype
= build_objc_string (p
- token_buffer
,
2093 TREE_TYPE (yylval
.ttype
) = char_array_type_node
;
2094 value
= OBJC_STRING
;
2098 yylval
.ttype
= build_string (p
- token_buffer
, token_buffer
+ 1);
2099 TREE_TYPE (yylval
.ttype
) = char_array_type_node
;
2130 yylval
.code
= PLUS_EXPR
; break;
2132 yylval
.code
= MINUS_EXPR
; break;
2134 yylval
.code
= BIT_AND_EXPR
; break;
2136 yylval
.code
= BIT_IOR_EXPR
; break;
2138 yylval
.code
= MULT_EXPR
; break;
2140 yylval
.code
= TRUNC_DIV_EXPR
; break;
2142 yylval
.code
= TRUNC_MOD_EXPR
; break;
2144 yylval
.code
= BIT_XOR_EXPR
; break;
2146 yylval
.code
= LSHIFT_EXPR
; break;
2148 yylval
.code
= RSHIFT_EXPR
; break;
2150 yylval
.code
= LT_EXPR
; break;
2152 yylval
.code
= GT_EXPR
; break;
2155 token_buffer
[1] = c1
= GETC();
2156 token_buffer
[2] = 0;
2163 value
= ARITHCOMPARE
; yylval
.code
= LE_EXPR
; goto done
;
2165 value
= ARITHCOMPARE
; yylval
.code
= GE_EXPR
; goto done
;
2167 value
= EQCOMPARE
; yylval
.code
= NE_EXPR
; goto done
;
2169 value
= EQCOMPARE
; yylval
.code
= EQ_EXPR
; goto done
;
2171 value
= ASSIGN
; goto done
;
2177 value
= PLUSPLUS
; goto done
;
2179 value
= MINUSMINUS
; goto done
;
2181 value
= ANDAND
; goto done
;
2183 value
= OROR
; goto done
;
2196 { value
= POINTSAT
; goto done
; }
2200 { value
= ']'; goto done
; }
2204 { value
= '{'; indent_level
++; goto done
; }
2206 { value
= '['; goto done
; }
2210 { value
= '}'; indent_level
--; goto done
; }
2214 token_buffer
[1] = 0;
2216 if ((c
== '<') || (c
== '>'))
2217 value
= ARITHCOMPARE
;
2223 /* Don't make yyparse think this is eof. */
2242 /* yylloc.last_line = lineno; */
2247 /* Sets the value of the 'yydebug' variable to VALUE.
2248 This is a function so we don't have to have YYDEBUG defined
2249 in order to build the compiler. */
2258 warning ("YYDEBUG not defined.");