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
50 cpp_options parse_options
;
51 static enum cpp_token cpp_token
;
53 /* Stream for reading from the input file. */
57 /* The elements of `ridpointers' are identifier nodes
58 for the reserved type names and storage classes.
59 It is indexed by a RID_... value. */
60 tree ridpointers
[(int) RID_MAX
];
62 /* Cause the `yydebug' variable to be defined. */
66 static unsigned char *yy_cur
, *yy_lim
;
73 parse_in
.limit
= parse_in
.token_buffer
;
74 cpp_token
= cpp_get_token (&parse_in
);
75 if (cpp_token
== CPP_EOF
)
77 yy_lim
= CPP_PWRITTEN (&parse_in
);
78 yy_cur
= parse_in
.token_buffer
;
84 #define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
85 #define UNGETC(c) ((c), yy_cur--)
87 #define GETC() getc (finput)
88 #define UNGETC(c) ungetc (c, finput)
91 /* the declaration found for the last IDENTIFIER token read in.
92 yylex must look this up to detect typedefs, which get token type TYPENAME,
93 so it is left around in case the identifier is not a typedef but is
94 used in a context which makes it a reference to a variable. */
97 /* Nonzero enables objc features. */
103 /* File used for outputting assembler code. */
104 extern FILE *asm_out_file
;
106 #ifndef WCHAR_TYPE_SIZE
108 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
110 #define WCHAR_TYPE_SIZE BITS_PER_WORD
114 /* Number of bytes in a wide character. */
115 #define WCHAR_BYTES (WCHAR_TYPE_SIZE / BITS_PER_UNIT)
117 static int maxtoken
; /* Current nominal length of token buffer. */
118 char *token_buffer
; /* Pointer to token buffer.
119 Actual allocated length is maxtoken + 2.
120 This is not static because objc-parse.y uses it. */
122 static int indent_level
= 0; /* Number of { minus number of }. */
124 /* Nonzero if end-of-file has been seen on input. */
125 static int end_of_file
;
128 /* Buffered-back input character; faster than using ungetc. */
129 static int nextchar
= -1;
132 #ifdef HANDLE_SYSV_PRAGMA
133 static int handle_sysv_pragma
PROTO((int));
134 #endif /* HANDLE_SYSV_PRAGMA */
135 static int whitespace_cr
PROTO((int));
136 static int skip_white_space
PROTO((int));
137 static int skip_white_space_on_line
PROTO((void));
138 static char *extend_token_buffer
PROTO((char *));
139 static int readescape
PROTO((int *));
140 int check_newline ();
142 /* Do not insert generated code into the source, instead, include it.
143 This allows us to build gcc automatically even for targets that
144 need to add or modify the reserved keyword lists. */
147 /* Return something to represent absolute declarators containing a *.
148 TARGET is the absolute declarator that the * contains.
149 TYPE_QUALS is a list of modifiers such as const or volatile
150 to apply to the pointer type, represented as identifiers.
152 We return an INDIRECT_REF whose "contents" are TARGET
153 and whose type is the modifier list. */
156 make_pointer_declarator (type_quals
, target
)
157 tree type_quals
, target
;
159 return build1 (INDIRECT_REF
, type_quals
, target
);
163 forget_protocol_qualifiers ()
165 int i
, n
= sizeof wordlist
/ sizeof (struct resword
);
167 for (i
= 0; i
< n
; i
++)
168 if ((int) wordlist
[i
].rid
>= (int) RID_IN
169 && (int) wordlist
[i
].rid
<= (int) RID_ONEWAY
)
170 wordlist
[i
].name
= "";
174 remember_protocol_qualifiers ()
176 int i
, n
= sizeof wordlist
/ sizeof (struct resword
);
178 for (i
= 0; i
< n
; i
++)
179 if (wordlist
[i
].rid
== RID_IN
)
180 wordlist
[i
].name
= "in";
181 else if (wordlist
[i
].rid
== RID_OUT
)
182 wordlist
[i
].name
= "out";
183 else if (wordlist
[i
].rid
== RID_INOUT
)
184 wordlist
[i
].name
= "inout";
185 else if (wordlist
[i
].rid
== RID_BYCOPY
)
186 wordlist
[i
].name
= "bycopy";
187 else if (wordlist
[i
].rid
== RID_ONEWAY
)
188 wordlist
[i
].name
= "oneway";
192 init_parse (filename
)
196 /* Open input file. */
197 if (filename
== 0 || !strcmp (filename
, "-"))
203 finput
= fopen (filename
, "r");
205 pfatal_with_name (filename
);
207 #ifdef IO_BUFFER_SIZE
208 setvbuf (finput
, (char *) xmalloc (IO_BUFFER_SIZE
), _IOFBF
, IO_BUFFER_SIZE
);
210 #endif /* !USE_CPPLIB */
218 cpp_reader_init (&parse_in
);
219 parse_in
.data
= &parse_options
;
220 cpp_options_init (&parse_options
);
221 cpp_handle_options (&parse_in
, 0, NULL
); /* FIXME */
222 parse_in
.show_column
= 1;
223 if (! cpp_start_read (&parse_in
, filename
))
234 cpp_finish (&parse_in
);
243 /* Make identifier nodes long enough for the language-specific slots. */
244 set_identifier_size (sizeof (struct lang_identifier
));
246 /* Start it at 0, because check_newline is called at the very beginning
247 and will increment it to 1. */
250 #ifdef MULTIBYTE_CHARS
251 /* Change to the native locale for multibyte conversions. */
252 setlocale (LC_CTYPE
, "");
256 token_buffer
= (char *) xmalloc (maxtoken
+ 2);
258 ridpointers
[(int) RID_INT
] = get_identifier ("int");
259 ridpointers
[(int) RID_CHAR
] = get_identifier ("char");
260 ridpointers
[(int) RID_VOID
] = get_identifier ("void");
261 ridpointers
[(int) RID_FLOAT
] = get_identifier ("float");
262 ridpointers
[(int) RID_DOUBLE
] = get_identifier ("double");
263 ridpointers
[(int) RID_SHORT
] = get_identifier ("short");
264 ridpointers
[(int) RID_LONG
] = get_identifier ("long");
265 ridpointers
[(int) RID_UNSIGNED
] = get_identifier ("unsigned");
266 ridpointers
[(int) RID_SIGNED
] = get_identifier ("signed");
267 ridpointers
[(int) RID_INLINE
] = get_identifier ("inline");
268 ridpointers
[(int) RID_CONST
] = get_identifier ("const");
269 ridpointers
[(int) RID_VOLATILE
] = get_identifier ("volatile");
270 ridpointers
[(int) RID_AUTO
] = get_identifier ("auto");
271 ridpointers
[(int) RID_STATIC
] = get_identifier ("static");
272 ridpointers
[(int) RID_EXTERN
] = get_identifier ("extern");
273 ridpointers
[(int) RID_TYPEDEF
] = get_identifier ("typedef");
274 ridpointers
[(int) RID_REGISTER
] = get_identifier ("register");
275 ridpointers
[(int) RID_ITERATOR
] = get_identifier ("iterator");
276 ridpointers
[(int) RID_COMPLEX
] = get_identifier ("complex");
277 ridpointers
[(int) RID_ID
] = get_identifier ("id");
278 ridpointers
[(int) RID_IN
] = get_identifier ("in");
279 ridpointers
[(int) RID_OUT
] = get_identifier ("out");
280 ridpointers
[(int) RID_INOUT
] = get_identifier ("inout");
281 ridpointers
[(int) RID_BYCOPY
] = get_identifier ("bycopy");
282 ridpointers
[(int) RID_ONEWAY
] = get_identifier ("oneway");
283 forget_protocol_qualifiers();
285 /* Some options inhibit certain reserved words.
286 Clear those words out of the hash table so they won't be recognized. */
287 #define UNSET_RESERVED_WORD(STRING) \
288 do { struct resword *s = is_reserved_word (STRING, sizeof (STRING) - 1); \
289 if (s) s->name = ""; } while (0)
291 if (! doing_objc_thang
)
292 UNSET_RESERVED_WORD ("id");
294 if (flag_traditional
)
296 UNSET_RESERVED_WORD ("const");
297 UNSET_RESERVED_WORD ("volatile");
298 UNSET_RESERVED_WORD ("typeof");
299 UNSET_RESERVED_WORD ("signed");
300 UNSET_RESERVED_WORD ("inline");
301 UNSET_RESERVED_WORD ("iterator");
302 UNSET_RESERVED_WORD ("complex");
306 UNSET_RESERVED_WORD ("asm");
307 UNSET_RESERVED_WORD ("typeof");
308 UNSET_RESERVED_WORD ("inline");
309 UNSET_RESERVED_WORD ("iterator");
310 UNSET_RESERVED_WORD ("complex");
315 reinit_parse_for_function ()
319 /* Function used when yydebug is set, to print a token in more detail. */
322 yyprint (file
, yychar
, yylval
)
334 if (IDENTIFIER_POINTER (t
))
335 fprintf (file
, " `%s'", IDENTIFIER_POINTER (t
));
340 if (TREE_CODE (t
) == INTEGER_CST
)
342 #if HOST_BITS_PER_WIDE_INT == 64
343 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
346 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
353 #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
359 TREE_INT_CST_HIGH (t
), TREE_INT_CST_LOW (t
));
364 /* Iff C is a carriage return, warn about it - if appropriate -
365 and return nonzero. */
370 static int newline_warning
= 0;
374 /* ANSI C says the effects of a carriage return in a source file
376 if (pedantic
&& !newline_warning
)
378 warning ("carriage return in source file");
379 warning ("(we only warn about the first carriage return)");
387 /* If C is not whitespace, return C.
388 Otherwise skip whitespace and return first nonwhite char read. */
398 /* We don't recognize comments here, because
399 cpp output can include / and * consecutively as operators.
400 Also, there's no need, since cpp removes all comments. */
403 c
= check_newline ();
424 error ("stray '\\' in program");
434 /* Skips all of the white space at the current location in the input file.
435 Must use and reset nextchar if it has the next character. */
438 position_after_white_space ()
444 c
= nextchar
, nextchar
= -1;
449 UNGETC (skip_white_space (c
));
452 /* Like skip_white_space, but don't advance beyond the end of line.
453 Moreover, we don't get passed a character to start with. */
455 skip_white_space_on_line ()
484 /* Make the token buffer longer, preserving the data in it.
485 P should point to just beyond the last valid character in the old buffer.
486 The value we return is a pointer to the new buffer
487 at a place corresponding to P. */
490 extend_token_buffer (p
)
493 int offset
= p
- token_buffer
;
495 maxtoken
= maxtoken
* 2 + 10;
496 token_buffer
= (char *) xrealloc (token_buffer
, maxtoken
+ 2);
498 return token_buffer
+ offset
;
502 #define GET_DIRECTIVE_LINE() get_directive_line (finput)
503 #else /* USE_CPPLIB */
504 /* Read the rest of a #-directive from input stream FINPUT.
505 In normal use, the directive name and the white space after it
506 have already been read, so they won't be included in the result.
507 We allow for the fact that the directive line may contain
508 a newline embedded within a character or string literal which forms
509 a part of the directive.
511 The value is a string in a reusable buffer. It remains valid
512 only until the next time this function is called. */
515 GET_DIRECTIVE_LINE ()
517 static char *directive_buffer
= NULL
;
518 static unsigned buffer_length
= 0;
520 register char *buffer_limit
;
521 register int looking_for
= 0;
522 register int char_escaped
= 0;
524 if (buffer_length
== 0)
526 directive_buffer
= (char *)xmalloc (128);
530 buffer_limit
= &directive_buffer
[buffer_length
];
532 for (p
= directive_buffer
; ; )
536 /* Make buffer bigger if it is full. */
537 if (p
>= buffer_limit
)
539 register unsigned bytes_used
= (p
- directive_buffer
);
543 = (char *)xrealloc (directive_buffer
, buffer_length
);
544 p
= &directive_buffer
[bytes_used
];
545 buffer_limit
= &directive_buffer
[buffer_length
];
550 /* Discard initial whitespace. */
551 if ((c
== ' ' || c
== '\t') && p
== directive_buffer
)
554 /* Detect the end of the directive. */
555 if (c
== '\n' && looking_for
== 0)
564 return directive_buffer
;
566 /* Handle string and character constant syntax. */
569 if (looking_for
== c
&& !char_escaped
)
570 looking_for
= 0; /* Found terminator... stop looking. */
573 if (c
== '\'' || c
== '"')
574 looking_for
= c
; /* Don't stop buffering until we see another
575 one of these (or an EOF). */
577 /* Handle backslash. */
578 char_escaped
= (c
== '\\' && ! char_escaped
);
581 #endif /* USE_CPPLIB */
583 /* At the beginning of a line, increment the line number
584 and process any #-directive on this line.
585 If the line is a #-directive, read the entire line and return a newline.
586 Otherwise, return the line's first non-whitespace character. */
596 /* Read first nonwhite char on the line. */
599 while (c
== ' ' || c
== '\t')
604 /* If not #, return it so caller will use it. */
608 /* Read first nonwhite char after the `#'. */
611 while (c
== ' ' || c
== '\t')
614 /* If a letter follows, then if the word here is `line', skip
615 it and ignore it; otherwise, ignore the line, with an error
616 if the word isn't `pragma', `ident', `define', or `undef'. */
618 if ((c
>= 'a' && c
<= 'z') || (c
>= 'A' && c
<= 'Z'))
627 && ((c
= GETC()) == ' ' || c
== '\t' || c
== '\n'
628 || whitespace_cr (c
) ))
630 while (c
== ' ' || c
== '\t' || whitespace_cr (c
))
634 #ifdef HANDLE_SYSV_PRAGMA
637 if (token
!= IDENTIFIER
)
639 return handle_sysv_pragma (token
);
640 #else /* !HANDLE_SYSV_PRAGMA */
645 if (token
!= IDENTIFIER
)
647 if (HANDLE_PRAGMA (finput
, yylval
.ttype
))
653 ??? do not know what to
do ???;
654 #endif /* !USE_CPPLIB */
655 #endif /* HANDLE_PRAGMA */
656 #endif /* !HANDLE_SYSV_PRAGMA */
668 && ((c
= GETC()) == ' ' || c
== '\t' || c
== '\n'))
671 debug_define (lineno
, GET_DIRECTIVE_LINE ());
681 && ((c
= GETC()) == ' ' || c
== '\t' || c
== '\n'))
684 debug_undef (lineno
, GET_DIRECTIVE_LINE ());
693 && ((c
= GETC()) == ' ' || c
== '\t'))
702 && ((c
= GETC()) == ' ' || c
== '\t'))
704 /* #ident. The pedantic warning is now in cccp.c. */
706 /* Here we have just seen `#ident '.
707 A string constant should follow. */
709 c
= skip_white_space_on_line ();
711 /* If no argument, ignore the line. */
718 || TREE_CODE (yylval
.ttype
) != STRING_CST
)
720 error ("invalid #ident");
726 #ifdef ASM_OUTPUT_IDENT
727 ASM_OUTPUT_IDENT (asm_out_file
, TREE_STRING_POINTER (yylval
.ttype
));
731 /* Skip the rest of this line. */
736 error ("undefined or invalid # directive");
741 /* Here we have either `#line' or `# <nonletter>'.
742 In either case, it should be a line number; a digit should follow. */
744 /* Can't use skip_white_space here, but must handle all whitespace
745 that is not '\n', lest we get a recursion for '\r' '\n' when
748 c
= skip_white_space_on_line ();
750 /* If the # is the only nonwhite char on the line,
751 just ignore it. Check the new newline. */
755 /* Something follows the #; read a token. */
760 if (token
== CONSTANT
761 && TREE_CODE (yylval
.ttype
) == INTEGER_CST
)
763 int old_lineno
= lineno
;
765 /* subtract one, because it is the following line that
766 gets the specified number */
768 int l
= TREE_INT_CST_LOW (yylval
.ttype
) - 1;
770 /* Is this the last nonwhite stuff on the line? */
771 c
= skip_white_space_on_line ();
774 /* No more: store the line number and check following line. */
780 /* More follows: it must be a string constant (filename). */
782 /* Read the string constant. */
785 if (token
!= STRING
|| TREE_CODE (yylval
.ttype
) != STRING_CST
)
787 error ("invalid #line");
792 = (char *) permalloc (TREE_STRING_LENGTH (yylval
.ttype
) + 1);
793 strcpy (input_filename
, TREE_STRING_POINTER (yylval
.ttype
));
796 /* Each change of file name
797 reinitializes whether we are now in a system header. */
798 in_system_header
= 0;
800 if (main_input_filename
== 0)
801 main_input_filename
= input_filename
;
803 /* Is this the last nonwhite stuff on the line? */
804 c
= skip_white_space_on_line ();
807 /* Update the name in the top element of input_file_stack. */
808 if (input_file_stack
)
809 input_file_stack
->name
= input_filename
;
818 /* `1' after file name means entering new file.
819 `2' after file name means just left a file. */
821 if (token
== CONSTANT
822 && TREE_CODE (yylval
.ttype
) == INTEGER_CST
)
824 if (TREE_INT_CST_LOW (yylval
.ttype
) == 1)
826 /* Pushing to a new file. */
828 = (struct file_stack
*) xmalloc (sizeof (struct file_stack
));
829 input_file_stack
->line
= old_lineno
;
830 p
->next
= input_file_stack
;
831 p
->name
= input_filename
;
832 p
->indent_level
= indent_level
;
833 input_file_stack
= p
;
834 input_file_stack_tick
++;
835 debug_start_source_file (input_filename
);
838 else if (TREE_INT_CST_LOW (yylval
.ttype
) == 2)
840 /* Popping out of a file. */
841 if (input_file_stack
->next
)
843 struct file_stack
*p
= input_file_stack
;
844 if (indent_level
!= p
->indent_level
)
846 warning_with_file_and_line
847 (p
->name
, old_lineno
,
848 "This file contains more `%c's than `%c's.",
849 indent_level
> p
->indent_level
? '{' : '}',
850 indent_level
> p
->indent_level
? '}' : '{');
852 input_file_stack
= p
->next
;
854 input_file_stack_tick
++;
855 debug_end_source_file (input_file_stack
->line
);
858 error ("#-lines for entering and leaving files don't match");
864 /* Now that we've pushed or popped the input stack,
865 update the name in the top element. */
866 if (input_file_stack
)
867 input_file_stack
->name
= input_filename
;
869 /* If we have handled a `1' or a `2',
870 see if there is another number to read. */
873 /* Is this the last nonwhite stuff on the line? */
874 c
= skip_white_space_on_line ();
883 /* `3' after file name means this is a system header file. */
885 if (token
== CONSTANT
886 && TREE_CODE (yylval
.ttype
) == INTEGER_CST
887 && TREE_INT_CST_LOW (yylval
.ttype
) == 3)
888 in_system_header
= 1, used_up
= 1;
892 /* Is this the last nonwhite stuff on the line? */
893 c
= skip_white_space_on_line ();
899 warning ("unrecognized text at end of #line");
902 error ("invalid #-line");
904 /* skip the rest of this line. */
907 if (c
!= '\n' && c
!= EOF
&& nextchar
>= 0)
908 c
= nextchar
, nextchar
= -1;
910 while (c
!= '\n' && c
!= EOF
)
915 #ifdef HANDLE_SYSV_PRAGMA
917 /* Handle a #pragma directive.
918 TOKEN is the token we read after `#pragma'. Processes the entire input
919 line and returns a character for the caller to reread: either \n or EOF. */
921 /* This function has to be in this file, in order to get at
925 handle_sysv_pragma (token
)
938 handle_pragma_token (token_buffer
, yylval
.ttype
);
941 handle_pragma_token (token_buffer
, 0);
945 c
= nextchar
, nextchar
= -1;
950 while (c
== ' ' || c
== '\t')
952 if (c
== '\n' || c
== EOF
)
954 handle_pragma_token (0, 0);
962 #endif /* HANDLE_SYSV_PRAGMA */
964 #define ENDFILE -1 /* token that represents end-of-file */
966 /* Read an escape sequence, returning its equivalent as a character,
967 or store 1 in *ignore_ptr if it is backslash-newline. */
970 readescape (ignore_ptr
)
973 register int c
= GETC();
975 register unsigned count
;
976 unsigned firstdig
= 0;
982 if (warn_traditional
)
983 warning ("the meaning of `\\x' varies with -traditional");
985 if (flag_traditional
)
994 if (!(c
>= 'a' && c
<= 'f')
995 && !(c
>= 'A' && c
<= 'F')
996 && !(c
>= '0' && c
<= '9'))
1002 if (c
>= 'a' && c
<= 'f')
1003 code
+= c
- 'a' + 10;
1004 if (c
>= 'A' && c
<= 'F')
1005 code
+= c
- 'A' + 10;
1006 if (c
>= '0' && c
<= '9')
1008 if (code
!= 0 || count
!= 0)
1017 error ("\\x used with no following hex digits");
1018 else if (count
== 0)
1019 /* Digits are all 0's. Ok. */
1021 else if ((count
- 1) * 4 >= TYPE_PRECISION (integer_type_node
)
1023 && ((1 << (TYPE_PRECISION (integer_type_node
) - (count
- 1) * 4))
1025 pedwarn ("hex escape out of range");
1028 case '0': case '1': case '2': case '3': case '4':
1029 case '5': case '6': case '7':
1032 while ((c
<= '7') && (c
>= '0') && (count
++ < 3))
1034 code
= (code
* 8) + (c
- '0');
1040 case '\\': case '\'': case '"':
1049 return TARGET_NEWLINE
;
1064 if (warn_traditional
)
1065 warning ("the meaning of `\\a' varies with -traditional");
1067 if (flag_traditional
)
1072 #if 0 /* Vertical tab is present in common usage compilers. */
1073 if (flag_traditional
)
1081 pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c
);
1087 /* `\(', etc, are used at beginning of line to avoid confusing Emacs. */
1091 /* `\%' is used to prevent SCCS from getting confused. */
1094 pedwarn ("non-ANSI escape sequence `\\%c'", c
);
1097 if (c
>= 040 && c
< 0177)
1098 pedwarn ("unknown escape sequence `\\%c'", c
);
1100 pedwarn ("unknown escape sequence: `\\' followed by char code 0x%x", c
);
1110 strcpy (buf
, string
);
1112 /* We can't print string and character constants well
1113 because the token_buffer contains the result of processing escapes. */
1115 strcat (buf
, " at end of input");
1116 else if (token_buffer
[0] == 0)
1117 strcat (buf
, " at null character");
1118 else if (token_buffer
[0] == '"')
1119 strcat (buf
, " before string constant");
1120 else if (token_buffer
[0] == '\'')
1121 strcat (buf
, " before character constant");
1122 else if (token_buffer
[0] < 040 || (unsigned char) token_buffer
[0] >= 0177)
1123 sprintf (buf
+ strlen (buf
), " before character 0%o",
1124 (unsigned char) token_buffer
[0]);
1126 strcat (buf
, " before `%s'");
1128 error (buf
, token_buffer
);
1138 char long_long_flag
;
1141 struct try_type type_sequence
[] =
1143 { &integer_type_node
, 0, 0, 0},
1144 { &unsigned_type_node
, 1, 0, 0},
1145 { &long_integer_type_node
, 0, 1, 0},
1146 { &long_unsigned_type_node
, 1, 1, 0},
1147 { &long_long_integer_type_node
, 0, 1, 1},
1148 { &long_long_unsigned_type_node
, 1, 1, 1}
1163 c
= nextchar
, nextchar
= -1;
1168 /* Effectively do c = skip_white_space (c)
1169 but do it faster in the usual cases. */
1182 /* Call skip_white_space so we can warn if appropriate. */
1187 c
= skip_white_space (c
);
1189 goto found_nonwhite
;
1193 token_buffer
[0] = c
;
1194 token_buffer
[1] = 0;
1196 /* yylloc.first_line = lineno; */
1202 token_buffer
[0] = 0;
1207 /* Capital L may start a wide-string or wide-character constant. */
1209 register int c
= GETC();
1218 goto string_constant
;
1225 if (!doing_objc_thang
)
1232 /* '@' may start a constant string object. */
1233 register int c
= GETC ();
1237 goto string_constant
;
1240 /* Fall through to treat '@' as the start of an identifier. */
1243 case 'A': case 'B': case 'C': case 'D': case 'E':
1244 case 'F': case 'G': case 'H': case 'I': case 'J':
1245 case 'K': case 'M': case 'N': case 'O':
1246 case 'P': case 'Q': case 'R': case 'S': case 'T':
1247 case 'U': case 'V': case 'W': case 'X': case 'Y':
1249 case 'a': case 'b': case 'c': case 'd': case 'e':
1250 case 'f': case 'g': case 'h': case 'i': case 'j':
1251 case 'k': case 'l': case 'm': case 'n': case 'o':
1252 case 'p': case 'q': case 'r': case 's': case 't':
1253 case 'u': case 'v': case 'w': case 'x': case 'y':
1259 while (ISALNUM (c
) || c
== '_' || c
== '$' || c
== '@')
1261 /* Make sure this char really belongs in an identifier. */
1262 if (c
== '@' && ! doing_objc_thang
)
1266 if (! dollars_in_ident
)
1267 error ("`$' in identifier");
1269 pedwarn ("`$' in identifier");
1272 if (p
>= token_buffer
+ maxtoken
)
1273 p
= extend_token_buffer (p
);
1289 /* Try to recognize a keyword. Uses minimum-perfect hash function */
1292 register struct resword
*ptr
;
1294 if ((ptr
= is_reserved_word (token_buffer
, p
- token_buffer
)))
1297 yylval
.ttype
= ridpointers
[(int) ptr
->rid
];
1298 value
= (int) ptr
->token
;
1300 /* Only return OBJECTNAME if it is a typedef. */
1301 if (doing_objc_thang
&& value
== OBJECTNAME
)
1303 lastiddecl
= lookup_name(yylval
.ttype
);
1305 if (lastiddecl
== NULL_TREE
1306 || TREE_CODE (lastiddecl
) != TYPE_DECL
)
1310 /* Even if we decided to recognize asm, still perhaps warn. */
1312 && (value
== ASM_KEYWORD
|| value
== TYPEOF
1313 || ptr
->rid
== RID_INLINE
)
1314 && token_buffer
[0] != '_')
1315 pedwarn ("ANSI does not permit the keyword `%s'",
1320 /* If we did not find a keyword, look for an identifier
1323 if (value
== IDENTIFIER
)
1325 if (token_buffer
[0] == '@')
1326 error("invalid identifier `%s'", token_buffer
);
1328 yylval
.ttype
= get_identifier (token_buffer
);
1329 lastiddecl
= lookup_name (yylval
.ttype
);
1331 if (lastiddecl
!= 0 && TREE_CODE (lastiddecl
) == TYPE_DECL
)
1333 /* A user-invisible read-only initialized variable
1334 should be replaced by its value.
1335 We handle only strings since that's the only case used in C. */
1336 else if (lastiddecl
!= 0 && TREE_CODE (lastiddecl
) == VAR_DECL
1337 && DECL_IGNORED_P (lastiddecl
)
1338 && TREE_READONLY (lastiddecl
)
1339 && DECL_INITIAL (lastiddecl
) != 0
1340 && TREE_CODE (DECL_INITIAL (lastiddecl
)) == STRING_CST
)
1342 tree stringval
= DECL_INITIAL (lastiddecl
);
1344 /* Copy the string value so that we won't clobber anything
1345 if we put something in the TREE_CHAIN of this one. */
1346 yylval
.ttype
= build_string (TREE_STRING_LENGTH (stringval
),
1347 TREE_STRING_POINTER (stringval
));
1350 else if (doing_objc_thang
)
1352 tree objc_interface_decl
= is_class_name (yylval
.ttype
);
1354 if (objc_interface_decl
)
1357 yylval
.ttype
= objc_interface_decl
;
1367 /* Check first for common special case: single-digit 0 or 1. */
1370 UNGETC (next_c
); /* Always undo this lookahead. */
1371 if (!ISALNUM (next_c
) && next_c
!= '.')
1373 token_buffer
[0] = (char)c
, token_buffer
[1] = '\0';
1374 yylval
.ttype
= (c
== '0') ? integer_zero_node
: integer_one_node
;
1380 case '2': case '3': case '4':
1381 case '5': case '6': case '7': case '8': case '9':
1386 int largest_digit
= 0;
1388 /* for multi-precision arithmetic,
1389 we actually store only HOST_BITS_PER_CHAR bits in each part.
1390 The number of parts is chosen so as to be sufficient to hold
1391 the enough bits to fit into the two HOST_WIDE_INTs that contain
1392 the integer value (this is always at least as many bits as are
1393 in a target `long long' value, but may be wider). */
1394 #define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2 + 2)
1395 int parts
[TOTAL_PARTS
];
1398 enum anon1
{ NOT_FLOAT
, AFTER_POINT
, TOO_MANY_POINTS
} floatflag
1401 for (count
= 0; count
< TOTAL_PARTS
; count
++)
1409 *p
++ = (c
= GETC());
1410 if ((c
== 'x') || (c
== 'X'))
1413 *p
++ = (c
= GETC());
1415 /* Leading 0 forces octal unless the 0 is the only digit. */
1416 else if (c
>= '0' && c
<= '9')
1425 /* Read all the digits-and-decimal-points. */
1428 || (ISALNUM (c
) && c
!= 'l' && c
!= 'L'
1429 && c
!= 'u' && c
!= 'U'
1430 && c
!= 'i' && c
!= 'I' && c
!= 'j' && c
!= 'J'
1431 && (floatflag
== NOT_FLOAT
|| ((c
!= 'f') && (c
!= 'F')))))
1436 error ("floating constant may not be in radix 16");
1437 if (floatflag
== TOO_MANY_POINTS
)
1438 /* We have already emitted an error. Don't need another. */
1440 else if (floatflag
== AFTER_POINT
)
1442 error ("malformed floating constant");
1443 floatflag
= TOO_MANY_POINTS
;
1444 /* Avoid another error from atof by forcing all characters
1445 from here on to be ignored. */
1449 floatflag
= AFTER_POINT
;
1453 /* Accept '.' as the start of a floating-point number
1454 only when it is followed by a digit.
1455 Otherwise, unread the following non-digit
1456 and use the '.' as a structural token. */
1457 if (p
== token_buffer
+ 2 && !ISDIGIT (c
))
1468 error ("parse error at `..'");
1471 token_buffer
[1] = 0;
1478 /* It is not a decimal point.
1479 It should be a digit (perhaps a hex digit). */
1485 else if (base
<= 10)
1487 if (c
== 'e' || c
== 'E')
1490 floatflag
= AFTER_POINT
;
1491 break; /* start of exponent */
1493 error ("nondigits in number and not hexadecimal");
1504 if (c
>= largest_digit
)
1508 for (count
= 0; count
< TOTAL_PARTS
; count
++)
1510 parts
[count
] *= base
;
1514 += (parts
[count
-1] >> HOST_BITS_PER_CHAR
);
1516 &= (1 << HOST_BITS_PER_CHAR
) - 1;
1522 /* If the extra highest-order part ever gets anything in it,
1523 the number is certainly too big. */
1524 if (parts
[TOTAL_PARTS
- 1] != 0)
1527 if (p
>= token_buffer
+ maxtoken
- 3)
1528 p
= extend_token_buffer (p
);
1529 *p
++ = (c
= GETC());
1534 error ("numeric constant with no digits");
1536 if (largest_digit
>= base
)
1537 error ("numeric constant contains digits beyond the radix");
1539 /* Remove terminating char from the token buffer and delimit the string */
1542 if (floatflag
!= NOT_FLOAT
)
1544 tree type
= double_type_node
;
1546 int conversion_errno
= 0;
1547 REAL_VALUE_TYPE value
;
1550 /* Read explicit exponent if any, and put it in tokenbuf. */
1552 if ((c
== 'e') || (c
== 'E'))
1554 if (p
>= token_buffer
+ maxtoken
- 3)
1555 p
= extend_token_buffer (p
);
1558 if ((c
== '+') || (c
== '-'))
1564 error ("floating constant exponent has no digits");
1567 if (p
>= token_buffer
+ maxtoken
- 3)
1568 p
= extend_token_buffer (p
);
1576 /* Convert string to a double, checking for overflow. */
1577 if (setjmp (handler
))
1579 error ("floating constant out of range");
1584 int fflag
= 0, lflag
= 0;
1585 /* Copy token_buffer now, while it has just the number
1586 and not the suffixes; once we add `f' or `i',
1587 REAL_VALUE_ATOF may not work any more. */
1588 char *copy
= (char *) alloca (p
- token_buffer
+ 1);
1589 bcopy (token_buffer
, copy
, p
- token_buffer
+ 1);
1591 set_float_handler (handler
);
1597 /* Read the suffixes to choose a data type. */
1602 error ("more than one `f' in numeric constant");
1608 error ("more than one `l' in numeric constant");
1614 error ("more than one `i' or `j' in numeric constant");
1616 pedwarn ("ANSI C forbids imaginary numeric constants");
1627 if (p
>= token_buffer
+ maxtoken
- 3)
1628 p
= extend_token_buffer (p
);
1634 /* The second argument, machine_mode, of REAL_VALUE_ATOF
1635 tells the desired precision of the binary result
1636 of decimal-to-binary conversion. */
1641 error ("both `f' and `l' in floating constant");
1643 type
= float_type_node
;
1645 value
= REAL_VALUE_ATOF (copy
, TYPE_MODE (type
));
1646 conversion_errno
= errno
;
1647 /* A diagnostic is required here by some ANSI C testsuites.
1648 This is not pedwarn, become some people don't want
1649 an error for this. */
1650 if (REAL_VALUE_ISINF (value
) && pedantic
)
1651 warning ("floating point number exceeds range of `float'");
1655 type
= long_double_type_node
;
1657 value
= REAL_VALUE_ATOF (copy
, TYPE_MODE (type
));
1658 conversion_errno
= errno
;
1659 if (REAL_VALUE_ISINF (value
) && pedantic
)
1660 warning ("floating point number exceeds range of `long double'");
1665 value
= REAL_VALUE_ATOF (copy
, TYPE_MODE (type
));
1666 conversion_errno
= errno
;
1667 if (REAL_VALUE_ISINF (value
) && pedantic
)
1668 warning ("floating point number exceeds range of `double'");
1671 set_float_handler (NULL_PTR
);
1674 /* ERANGE is also reported for underflow,
1675 so test the value to distinguish overflow from that. */
1676 if (conversion_errno
== ERANGE
&& !flag_traditional
&& pedantic
1677 && (REAL_VALUES_LESS (dconst1
, value
)
1678 || REAL_VALUES_LESS (value
, dconstm1
)))
1679 warning ("floating point number exceeds range of `double'");
1682 /* If the result is not a number, assume it must have been
1683 due to some error message above, so silently convert
1685 if (REAL_VALUE_ISNAN (value
))
1688 /* Create a node with determined type and value. */
1690 yylval
.ttype
= build_complex (NULL_TREE
,
1691 convert (type
, integer_zero_node
),
1692 build_real (type
, value
));
1694 yylval
.ttype
= build_real (type
, value
);
1698 tree traditional_type
, ansi_type
, type
;
1699 HOST_WIDE_INT high
, low
;
1700 int spec_unsigned
= 0;
1702 int spec_long_long
= 0;
1706 traditional_type
= ansi_type
= type
= NULL_TREE
;
1709 if (c
== 'u' || c
== 'U')
1712 error ("two `u's in integer constant");
1715 else if (c
== 'l' || c
== 'L')
1720 error ("three `l's in integer constant");
1722 pedwarn ("ANSI C forbids long long integer constants");
1727 else if (c
== 'i' || c
== 'j' || c
== 'I' || c
== 'J')
1730 error ("more than one `i' or `j' in numeric constant");
1732 pedwarn ("ANSI C forbids imaginary numeric constants");
1737 if (p
>= token_buffer
+ maxtoken
- 3)
1738 p
= extend_token_buffer (p
);
1743 /* If the constant won't fit in an unsigned long long,
1744 then warn that the constant is out of range. */
1746 /* ??? This assumes that long long and long integer types are
1747 a multiple of 8 bits. This better than the original code
1748 though which assumed that long was exactly 32 bits and long
1749 long was exactly 64 bits. */
1751 bytes
= TYPE_PRECISION (long_long_integer_type_node
) / 8;
1754 for (i
= bytes
; i
< TOTAL_PARTS
; i
++)
1758 pedwarn ("integer constant out of range");
1760 /* This is simplified by the fact that our constant
1761 is always positive. */
1765 for (i
= 0; i
< HOST_BITS_PER_WIDE_INT
/ HOST_BITS_PER_CHAR
; i
++)
1767 high
|= ((HOST_WIDE_INT
) parts
[i
+ (HOST_BITS_PER_WIDE_INT
1768 / HOST_BITS_PER_CHAR
)]
1769 << (i
* HOST_BITS_PER_CHAR
));
1770 low
|= (HOST_WIDE_INT
) parts
[i
] << (i
* HOST_BITS_PER_CHAR
);
1773 yylval
.ttype
= build_int_2 (low
, high
);
1774 TREE_TYPE (yylval
.ttype
) = long_long_unsigned_type_node
;
1776 /* If warn_traditional, calculate both the ANSI type and the
1777 traditional type, then see if they disagree.
1778 Otherwise, calculate only the type for the dialect in use. */
1779 if (warn_traditional
|| flag_traditional
)
1781 /* Calculate the traditional type. */
1782 /* Traditionally, any constant is signed;
1783 but if unsigned is specified explicitly, obey that.
1784 Use the smallest size with the right number of bits,
1785 except for one special case with decimal constants. */
1786 if (! spec_long
&& base
!= 10
1787 && int_fits_type_p (yylval
.ttype
, unsigned_type_node
))
1788 traditional_type
= (spec_unsigned
? unsigned_type_node
1789 : integer_type_node
);
1790 /* A decimal constant must be long
1791 if it does not fit in type int.
1792 I think this is independent of whether
1793 the constant is signed. */
1794 else if (! spec_long
&& base
== 10
1795 && int_fits_type_p (yylval
.ttype
, integer_type_node
))
1796 traditional_type
= (spec_unsigned
? unsigned_type_node
1797 : integer_type_node
);
1798 else if (! spec_long_long
)
1799 traditional_type
= (spec_unsigned
? long_unsigned_type_node
1800 : long_integer_type_node
);
1802 traditional_type
= (spec_unsigned
1803 ? long_long_unsigned_type_node
1804 : long_long_integer_type_node
);
1806 if (warn_traditional
|| ! flag_traditional
)
1808 /* Calculate the ANSI type. */
1809 if (! spec_long
&& ! spec_unsigned
1810 && int_fits_type_p (yylval
.ttype
, integer_type_node
))
1811 ansi_type
= integer_type_node
;
1812 else if (! spec_long
&& (base
!= 10 || spec_unsigned
)
1813 && int_fits_type_p (yylval
.ttype
, unsigned_type_node
))
1814 ansi_type
= unsigned_type_node
;
1815 else if (! spec_unsigned
&& !spec_long_long
1816 && int_fits_type_p (yylval
.ttype
, long_integer_type_node
))
1817 ansi_type
= long_integer_type_node
;
1818 else if (! spec_long_long
1819 && int_fits_type_p (yylval
.ttype
,
1820 long_unsigned_type_node
))
1821 ansi_type
= long_unsigned_type_node
;
1822 else if (! spec_unsigned
1823 && int_fits_type_p (yylval
.ttype
,
1824 long_long_integer_type_node
))
1825 ansi_type
= long_long_integer_type_node
;
1827 ansi_type
= long_long_unsigned_type_node
;
1830 type
= flag_traditional
? traditional_type
: ansi_type
;
1832 if (warn_traditional
&& traditional_type
!= ansi_type
)
1834 if (TYPE_PRECISION (traditional_type
)
1835 != TYPE_PRECISION (ansi_type
))
1836 warning ("width of integer constant changes with -traditional");
1837 else if (TREE_UNSIGNED (traditional_type
)
1838 != TREE_UNSIGNED (ansi_type
))
1839 warning ("integer constant is unsigned in ANSI C, signed with -traditional");
1841 warning ("width of integer constant may change on other systems with -traditional");
1844 if (pedantic
&& !flag_traditional
&& !spec_long_long
&& !warn
1845 && (TYPE_PRECISION (long_integer_type_node
)
1846 < TYPE_PRECISION (type
)))
1847 pedwarn ("integer constant out of range");
1849 if (base
== 10 && ! spec_unsigned
&& TREE_UNSIGNED (type
))
1850 warning ("decimal constant is so large that it is unsigned");
1854 if (TYPE_PRECISION (type
)
1855 <= TYPE_PRECISION (integer_type_node
))
1857 = build_complex (NULL_TREE
, integer_zero_node
,
1858 convert (integer_type_node
,
1861 error ("complex integer constant is too wide for `complex int'");
1863 else if (flag_traditional
&& !int_fits_type_p (yylval
.ttype
, type
))
1864 /* The traditional constant 0x80000000 is signed
1865 but doesn't fit in the range of int.
1866 This will change it to -0x80000000, which does fit. */
1868 TREE_TYPE (yylval
.ttype
) = unsigned_type (type
);
1869 yylval
.ttype
= convert (type
, yylval
.ttype
);
1870 TREE_OVERFLOW (yylval
.ttype
)
1871 = TREE_CONSTANT_OVERFLOW (yylval
.ttype
) = 0;
1874 TREE_TYPE (yylval
.ttype
) = type
;
1880 if (ISALNUM (c
) || c
== '.' || c
== '_' || c
== '$'
1881 || (!flag_traditional
&& (c
== '-' || c
== '+')
1882 && (p
[-1] == 'e' || p
[-1] == 'E')))
1883 error ("missing white space after number `%s'", token_buffer
);
1885 value
= CONSTANT
; break;
1891 register int result
= 0;
1892 register int num_chars
= 0;
1893 unsigned width
= TYPE_PRECISION (char_type_node
);
1898 width
= WCHAR_TYPE_SIZE
;
1899 #ifdef MULTIBYTE_CHARS
1900 max_chars
= MB_CUR_MAX
;
1906 max_chars
= TYPE_PRECISION (integer_type_node
) / width
;
1914 if (c
== '\'' || c
== EOF
)
1920 c
= readescape (&ignore
);
1923 if (width
< HOST_BITS_PER_INT
1924 && (unsigned) c
>= (1 << width
))
1925 pedwarn ("escape sequence out of range for character");
1926 #ifdef MAP_CHARACTER
1928 c
= MAP_CHARACTER (c
);
1934 pedwarn ("ANSI C forbids newline in character constant");
1937 #ifdef MAP_CHARACTER
1939 c
= MAP_CHARACTER (c
);
1943 if (num_chars
> maxtoken
- 4)
1944 extend_token_buffer (token_buffer
);
1946 token_buffer
[num_chars
] = c
;
1948 /* Merge character into result; ignore excess chars. */
1949 if (num_chars
< max_chars
+ 1)
1951 if (width
< HOST_BITS_PER_INT
)
1952 result
= (result
<< width
) | (c
& ((1 << width
) - 1));
1958 token_buffer
[num_chars
+ 1] = '\'';
1959 token_buffer
[num_chars
+ 2] = 0;
1962 error ("malformatted character constant");
1963 else if (num_chars
== 0)
1964 error ("empty character constant");
1965 else if (num_chars
> max_chars
)
1967 num_chars
= max_chars
;
1968 error ("character constant too long");
1970 else if (num_chars
!= 1 && ! flag_traditional
)
1971 warning ("multi-character character constant");
1973 /* If char type is signed, sign-extend the constant. */
1976 int num_bits
= num_chars
* width
;
1978 /* We already got an error; avoid invalid shift. */
1979 yylval
.ttype
= build_int_2 (0, 0);
1980 else if (TREE_UNSIGNED (char_type_node
)
1981 || ((result
>> (num_bits
- 1)) & 1) == 0)
1983 = build_int_2 (result
& (~(unsigned HOST_WIDE_INT
) 0
1984 >> (HOST_BITS_PER_WIDE_INT
- num_bits
)),
1988 = build_int_2 (result
| ~(~(unsigned HOST_WIDE_INT
) 0
1989 >> (HOST_BITS_PER_WIDE_INT
- num_bits
)),
1991 TREE_TYPE (yylval
.ttype
) = integer_type_node
;
1995 #ifdef MULTIBYTE_CHARS
1996 /* Set the initial shift state and convert the next sequence. */
1998 /* In all locales L'\0' is zero and mbtowc will return zero,
2001 || (num_chars
== 1 && token_buffer
[1] != '\0'))
2004 (void) mbtowc (NULL_PTR
, NULL_PTR
, 0);
2005 if (mbtowc (& wc
, token_buffer
+ 1, num_chars
) == num_chars
)
2008 warning ("Ignoring invalid multibyte character");
2011 yylval
.ttype
= build_int_2 (result
, 0);
2012 TREE_TYPE (yylval
.ttype
) = wchar_type_node
;
2023 p
= token_buffer
+ 1;
2025 while (c
!= '"' && c
>= 0)
2030 c
= readescape (&ignore
);
2034 && TYPE_PRECISION (char_type_node
) < HOST_BITS_PER_INT
2035 && c
>= (1 << TYPE_PRECISION (char_type_node
)))
2036 pedwarn ("escape sequence out of range for character");
2041 pedwarn ("ANSI C forbids newline in string constant");
2045 if (p
== token_buffer
+ maxtoken
)
2046 p
= extend_token_buffer (p
);
2055 error ("Unterminated string constant");
2057 /* We have read the entire constant.
2058 Construct a STRING_CST for the result. */
2062 /* If this is a L"..." wide-string, convert the multibyte string
2063 to a wide character string. */
2064 char *widep
= (char *) alloca ((p
- token_buffer
) * WCHAR_BYTES
);
2067 #ifdef MULTIBYTE_CHARS
2068 len
= mbstowcs ((wchar_t *) widep
, token_buffer
+ 1, p
- token_buffer
);
2069 if (len
< 0 || len
>= (p
- token_buffer
))
2071 warning ("Ignoring invalid multibyte string");
2074 bzero (widep
+ (len
* WCHAR_BYTES
), WCHAR_BYTES
);
2079 wp
= widep
+ (BYTES_BIG_ENDIAN
? WCHAR_BYTES
- 1 : 0);
2080 bzero (widep
, (p
- token_buffer
) * WCHAR_BYTES
);
2081 for (cp
= token_buffer
+ 1; cp
< p
; cp
++)
2082 *wp
= *cp
, wp
+= WCHAR_BYTES
;
2083 len
= p
- token_buffer
- 1;
2086 yylval
.ttype
= build_string ((len
+ 1) * WCHAR_BYTES
, widep
);
2087 TREE_TYPE (yylval
.ttype
) = wchar_array_type_node
;
2092 extern tree
build_objc_string();
2093 /* Return an Objective-C @"..." constant string object. */
2094 yylval
.ttype
= build_objc_string (p
- token_buffer
,
2096 TREE_TYPE (yylval
.ttype
) = char_array_type_node
;
2097 value
= OBJC_STRING
;
2101 yylval
.ttype
= build_string (p
- token_buffer
, token_buffer
+ 1);
2102 TREE_TYPE (yylval
.ttype
) = char_array_type_node
;
2133 yylval
.code
= PLUS_EXPR
; break;
2135 yylval
.code
= MINUS_EXPR
; break;
2137 yylval
.code
= BIT_AND_EXPR
; break;
2139 yylval
.code
= BIT_IOR_EXPR
; break;
2141 yylval
.code
= MULT_EXPR
; break;
2143 yylval
.code
= TRUNC_DIV_EXPR
; break;
2145 yylval
.code
= TRUNC_MOD_EXPR
; break;
2147 yylval
.code
= BIT_XOR_EXPR
; break;
2149 yylval
.code
= LSHIFT_EXPR
; break;
2151 yylval
.code
= RSHIFT_EXPR
; break;
2153 yylval
.code
= LT_EXPR
; break;
2155 yylval
.code
= GT_EXPR
; break;
2158 token_buffer
[1] = c1
= GETC();
2159 token_buffer
[2] = 0;
2166 value
= ARITHCOMPARE
; yylval
.code
= LE_EXPR
; goto done
;
2168 value
= ARITHCOMPARE
; yylval
.code
= GE_EXPR
; goto done
;
2170 value
= EQCOMPARE
; yylval
.code
= NE_EXPR
; goto done
;
2172 value
= EQCOMPARE
; yylval
.code
= EQ_EXPR
; goto done
;
2174 value
= ASSIGN
; goto done
;
2180 value
= PLUSPLUS
; goto done
;
2182 value
= MINUSMINUS
; goto done
;
2184 value
= ANDAND
; goto done
;
2186 value
= OROR
; goto done
;
2199 { value
= POINTSAT
; goto done
; }
2203 { value
= ']'; goto done
; }
2207 { value
= '{'; indent_level
++; goto done
; }
2209 { value
= '['; goto done
; }
2213 { value
= '}'; indent_level
--; goto done
; }
2217 token_buffer
[1] = 0;
2219 if ((c
== '<') || (c
== '>'))
2220 value
= ARITHCOMPARE
;
2226 /* Don't make yyparse think this is eof. */
2245 /* yylloc.last_line = lineno; */
2250 /* Sets the value of the 'yydebug' variable to VALUE.
2251 This is a function so we don't have to have YYDEBUG defined
2252 in order to build the compiler. */
2261 warning ("YYDEBUG not defined.");