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 #ifdef MULTIBYTE_CHARS
39 #endif /* MULTIBYTE_CHARS */
43 extern cpp_reader parse_in
;
44 extern cpp_options parse_options
;
46 /* Stream for reading from the input file. */
50 extern void yyprint
PROTO((FILE *, int, YYSTYPE
));
52 /* The elements of `ridpointers' are identifier nodes
53 for the reserved type names and storage classes.
54 It is indexed by a RID_... value. */
55 tree ridpointers
[(int) RID_MAX
];
57 /* Cause the `yydebug' variable to be defined. */
61 extern unsigned char *yy_cur
, *yy_lim
;
63 extern int yy_get_token ();
65 #define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
66 #define UNGETC(c) ((c), yy_cur--)
68 #define GETC() getc (finput)
69 #define UNGETC(c) ungetc (c, finput)
72 /* the declaration found for the last IDENTIFIER token read in.
73 yylex must look this up to detect typedefs, which get token type TYPENAME,
74 so it is left around in case the identifier is not a typedef but is
75 used in a context which makes it a reference to a variable. */
78 /* Nonzero enables objc features. */
84 /* File used for outputting assembler code. */
85 extern FILE *asm_out_file
;
87 #ifndef WCHAR_TYPE_SIZE
89 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
91 #define WCHAR_TYPE_SIZE BITS_PER_WORD
95 /* Number of bytes in a wide character. */
96 #define WCHAR_BYTES (WCHAR_TYPE_SIZE / BITS_PER_UNIT)
98 static int maxtoken
; /* Current nominal length of token buffer. */
99 char *token_buffer
; /* Pointer to token buffer.
100 Actual allocated length is maxtoken + 2.
101 This is not static because objc-parse.y uses it. */
103 static int indent_level
= 0; /* Number of { minus number of }. */
105 /* Nonzero if end-of-file has been seen on input. */
106 static int end_of_file
;
109 /* Buffered-back input character; faster than using ungetc. */
110 static int nextchar
= -1;
113 #ifdef HANDLE_GENERIC_PRAGMAS
114 static int handle_generic_pragma
PROTO((int));
115 #endif /* HANDLE_GENERIC_PRAGMAS */
116 static int whitespace_cr
PROTO((int));
117 static int skip_white_space
PROTO((int));
118 static int skip_white_space_on_line
PROTO((void));
119 static char *extend_token_buffer
PROTO((char *));
120 static int readescape
PROTO((int *));
122 /* Do not insert generated code into the source, instead, include it.
123 This allows us to build gcc automatically even for targets that
124 need to add or modify the reserved keyword lists. */
127 /* Return something to represent absolute declarators containing a *.
128 TARGET is the absolute declarator that the * contains.
129 TYPE_QUALS is a list of modifiers such as const or volatile
130 to apply to the pointer type, represented as identifiers.
132 We return an INDIRECT_REF whose "contents" are TARGET
133 and whose type is the modifier list. */
136 make_pointer_declarator (type_quals
, target
)
137 tree type_quals
, target
;
139 return build1 (INDIRECT_REF
, type_quals
, target
);
143 forget_protocol_qualifiers ()
145 int i
, n
= sizeof wordlist
/ sizeof (struct resword
);
147 for (i
= 0; i
< n
; i
++)
148 if ((int) wordlist
[i
].rid
>= (int) RID_IN
149 && (int) wordlist
[i
].rid
<= (int) RID_ONEWAY
)
150 wordlist
[i
].name
= "";
154 remember_protocol_qualifiers ()
156 int i
, n
= sizeof wordlist
/ sizeof (struct resword
);
158 for (i
= 0; i
< n
; i
++)
159 if (wordlist
[i
].rid
== RID_IN
)
160 wordlist
[i
].name
= "in";
161 else if (wordlist
[i
].rid
== RID_OUT
)
162 wordlist
[i
].name
= "out";
163 else if (wordlist
[i
].rid
== RID_INOUT
)
164 wordlist
[i
].name
= "inout";
165 else if (wordlist
[i
].rid
== RID_BYCOPY
)
166 wordlist
[i
].name
= "bycopy";
167 else if (wordlist
[i
].rid
== RID_BYREF
)
168 wordlist
[i
].name
= "byref";
169 else if (wordlist
[i
].rid
== RID_ONEWAY
)
170 wordlist
[i
].name
= "oneway";
174 init_parse (filename
)
178 /* Open input file. */
179 if (filename
== 0 || !strcmp (filename
, "-"))
185 finput
= fopen (filename
, "r");
187 pfatal_with_name (filename
);
189 #ifdef IO_BUFFER_SIZE
190 setvbuf (finput
, (char *) xmalloc (IO_BUFFER_SIZE
), _IOFBF
, IO_BUFFER_SIZE
);
192 #endif /* !USE_CPPLIB */
200 parse_in
.show_column
= 1;
201 if (! cpp_start_read (&parse_in
, filename
))
212 cpp_finish (&parse_in
);
221 /* Make identifier nodes long enough for the language-specific slots. */
222 set_identifier_size (sizeof (struct lang_identifier
));
224 /* Start it at 0, because check_newline is called at the very beginning
225 and will increment it to 1. */
228 #ifdef MULTIBYTE_CHARS
229 /* Change to the native locale for multibyte conversions. */
230 setlocale (LC_CTYPE
, "");
231 literal_codeset
= getenv ("LANG");
235 token_buffer
= (char *) xmalloc (maxtoken
+ 2);
237 ridpointers
[(int) RID_INT
] = get_identifier ("int");
238 ridpointers
[(int) RID_CHAR
] = get_identifier ("char");
239 ridpointers
[(int) RID_VOID
] = get_identifier ("void");
240 ridpointers
[(int) RID_FLOAT
] = get_identifier ("float");
241 ridpointers
[(int) RID_DOUBLE
] = get_identifier ("double");
242 ridpointers
[(int) RID_SHORT
] = get_identifier ("short");
243 ridpointers
[(int) RID_LONG
] = get_identifier ("long");
244 ridpointers
[(int) RID_UNSIGNED
] = get_identifier ("unsigned");
245 ridpointers
[(int) RID_SIGNED
] = get_identifier ("signed");
246 ridpointers
[(int) RID_INLINE
] = get_identifier ("inline");
247 ridpointers
[(int) RID_CONST
] = get_identifier ("const");
248 ridpointers
[(int) RID_VOLATILE
] = get_identifier ("volatile");
249 ridpointers
[(int) RID_AUTO
] = get_identifier ("auto");
250 ridpointers
[(int) RID_STATIC
] = get_identifier ("static");
251 ridpointers
[(int) RID_EXTERN
] = get_identifier ("extern");
252 ridpointers
[(int) RID_TYPEDEF
] = get_identifier ("typedef");
253 ridpointers
[(int) RID_REGISTER
] = get_identifier ("register");
254 ridpointers
[(int) RID_ITERATOR
] = get_identifier ("iterator");
255 ridpointers
[(int) RID_COMPLEX
] = get_identifier ("complex");
256 ridpointers
[(int) RID_ID
] = get_identifier ("id");
257 ridpointers
[(int) RID_IN
] = get_identifier ("in");
258 ridpointers
[(int) RID_OUT
] = get_identifier ("out");
259 ridpointers
[(int) RID_INOUT
] = get_identifier ("inout");
260 ridpointers
[(int) RID_BYCOPY
] = get_identifier ("bycopy");
261 ridpointers
[(int) RID_BYREF
] = get_identifier ("byref");
262 ridpointers
[(int) RID_ONEWAY
] = get_identifier ("oneway");
263 forget_protocol_qualifiers();
265 /* Some options inhibit certain reserved words.
266 Clear those words out of the hash table so they won't be recognized. */
267 #define UNSET_RESERVED_WORD(STRING) \
268 do { struct resword *s = is_reserved_word (STRING, sizeof (STRING) - 1); \
269 if (s) s->name = ""; } while (0)
271 if (! doing_objc_thang
)
272 UNSET_RESERVED_WORD ("id");
274 if (flag_traditional
)
276 UNSET_RESERVED_WORD ("const");
277 UNSET_RESERVED_WORD ("volatile");
278 UNSET_RESERVED_WORD ("typeof");
279 UNSET_RESERVED_WORD ("signed");
280 UNSET_RESERVED_WORD ("inline");
281 UNSET_RESERVED_WORD ("iterator");
282 UNSET_RESERVED_WORD ("complex");
286 UNSET_RESERVED_WORD ("asm");
287 UNSET_RESERVED_WORD ("typeof");
288 UNSET_RESERVED_WORD ("inline");
289 UNSET_RESERVED_WORD ("iterator");
290 UNSET_RESERVED_WORD ("complex");
295 reinit_parse_for_function ()
299 /* Function used when yydebug is set, to print a token in more detail. */
302 yyprint (file
, yychar
, yylval
)
314 if (IDENTIFIER_POINTER (t
))
315 fprintf (file
, " `%s'", IDENTIFIER_POINTER (t
));
320 if (TREE_CODE (t
) == INTEGER_CST
)
322 #if HOST_BITS_PER_WIDE_INT == 64
323 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
326 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
333 #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
339 TREE_INT_CST_HIGH (t
), TREE_INT_CST_LOW (t
));
344 /* Iff C is a carriage return, warn about it - if appropriate -
345 and return nonzero. */
350 static int newline_warning
= 0;
354 /* ANSI C says the effects of a carriage return in a source file
356 if (pedantic
&& !newline_warning
)
358 warning ("carriage return in source file");
359 warning ("(we only warn about the first carriage return)");
367 /* If C is not whitespace, return C.
368 Otherwise skip whitespace and return first nonwhite char read. */
378 /* We don't recognize comments here, because
379 cpp output can include / and * consecutively as operators.
380 Also, there's no need, since cpp removes all comments. */
383 c
= check_newline ();
404 error ("stray '\\' in program");
414 /* Skips all of the white space at the current location in the input file.
415 Must use and reset nextchar if it has the next character. */
418 position_after_white_space ()
424 c
= nextchar
, nextchar
= -1;
429 UNGETC (skip_white_space (c
));
432 /* Like skip_white_space, but don't advance beyond the end of line.
433 Moreover, we don't get passed a character to start with. */
435 skip_white_space_on_line ()
464 /* Make the token buffer longer, preserving the data in it.
465 P should point to just beyond the last valid character in the old buffer.
466 The value we return is a pointer to the new buffer
467 at a place corresponding to P. */
470 extend_token_buffer (p
)
473 int offset
= p
- token_buffer
;
475 maxtoken
= maxtoken
* 2 + 10;
476 token_buffer
= (char *) xrealloc (token_buffer
, maxtoken
+ 2);
478 return token_buffer
+ offset
;
481 #if defined HANDLE_PRAGMA
482 /* Local versions of these macros, that can be passed as function pointers. */
497 /* At the beginning of a line, increment the line number
498 and process any #-directive on this line.
499 If the line is a #-directive, read the entire line and return a newline.
500 Otherwise, return the line's first non-whitespace character. */
510 /* Read first nonwhite char on the line. */
513 while (c
== ' ' || c
== '\t')
518 /* If not #, return it so caller will use it. */
522 /* Read first nonwhite char after the `#'. */
525 while (c
== ' ' || c
== '\t')
528 /* If a letter follows, then if the word here is `line', skip
529 it and ignore it; otherwise, ignore the line, with an error
530 if the word isn't `pragma', `ident', `define', or `undef'. */
532 if ((c
>= 'a' && c
<= 'z') || (c
>= 'A' && c
<= 'Z'))
541 && ((c
= GETC()) == ' ' || c
== '\t' || c
== '\n'
542 || whitespace_cr (c
) ))
544 while (c
== ' ' || c
== '\t' || whitespace_cr (c
))
549 #if defined HANDLE_PRAGMA || defined HANDLE_GENERIC_PRAGMAS
552 if (token
!= IDENTIFIER
)
554 #endif /* HANDLE_PRAGMA || HANDLE_GENERIC_PRAGMAS */
557 /* We invoke HANDLE_PRAGMA before HANDLE_GENERIC_PRAGMAS (if
558 both are defined), in order to give the back end a chance to
559 override the interpretation of generic style pragmas. */
563 c
= nextchar
, nextchar
= -1;
566 #endif /* !USE_CPPLIB */
568 if (TREE_CODE (yylval
.ttype
) != IDENTIFIER_NODE
)
571 if (HANDLE_PRAGMA (pragma_getc
, pragma_ungetc
,
572 IDENTIFIER_POINTER (yylval
.ttype
)))
574 #endif /* HANDLE_PRAGMA */
576 #ifdef HANDLE_GENERIC_PRAGMAS
577 if (handle_generic_pragma (token
))
579 #endif /* HANDLE_GENERIC_PRAGMAS */
581 /* Issue a warning message if we have been asked to do so.
582 Ignoring unknown pragmas in system header file unless
583 an explcit -Wunknown-pragmas has been given. */
584 if (warn_unknown_pragmas
> 1
585 || (warn_unknown_pragmas
&& ! in_system_header
))
586 warning ("ignoring pragma: %s", token_buffer
);
599 && ((c
= GETC()) == ' ' || c
== '\t' || c
== '\n'))
602 debug_define (lineno
, GET_DIRECTIVE_LINE ());
612 && ((c
= GETC()) == ' ' || c
== '\t' || c
== '\n'))
615 debug_undef (lineno
, GET_DIRECTIVE_LINE ());
624 && ((c
= GETC()) == ' ' || c
== '\t'))
633 && ((c
= GETC()) == ' ' || c
== '\t'))
635 /* #ident. The pedantic warning is now in cccp.c. */
637 /* Here we have just seen `#ident '.
638 A string constant should follow. */
640 c
= skip_white_space_on_line ();
642 /* If no argument, ignore the line. */
649 || TREE_CODE (yylval
.ttype
) != STRING_CST
)
651 error ("invalid #ident");
657 #ifdef ASM_OUTPUT_IDENT
658 ASM_OUTPUT_IDENT (asm_out_file
, TREE_STRING_POINTER (yylval
.ttype
));
662 /* Skip the rest of this line. */
667 error ("undefined or invalid # directive");
672 /* Here we have either `#line' or `# <nonletter>'.
673 In either case, it should be a line number; a digit should follow. */
675 /* Can't use skip_white_space here, but must handle all whitespace
676 that is not '\n', lest we get a recursion for '\r' '\n' when
679 c
= skip_white_space_on_line ();
681 /* If the # is the only nonwhite char on the line,
682 just ignore it. Check the new newline. */
686 /* Something follows the #; read a token. */
691 if (token
== CONSTANT
692 && TREE_CODE (yylval
.ttype
) == INTEGER_CST
)
694 int old_lineno
= lineno
;
696 /* subtract one, because it is the following line that
697 gets the specified number */
699 int l
= TREE_INT_CST_LOW (yylval
.ttype
) - 1;
701 /* Is this the last nonwhite stuff on the line? */
702 c
= skip_white_space_on_line ();
705 /* No more: store the line number and check following line. */
711 /* More follows: it must be a string constant (filename). */
713 /* Read the string constant. */
716 if (token
!= STRING
|| TREE_CODE (yylval
.ttype
) != STRING_CST
)
718 error ("invalid #line");
723 = (char *) permalloc (TREE_STRING_LENGTH (yylval
.ttype
) + 1);
724 strcpy (input_filename
, TREE_STRING_POINTER (yylval
.ttype
));
727 /* Each change of file name
728 reinitializes whether we are now in a system header. */
729 in_system_header
= 0;
731 if (main_input_filename
== 0)
732 main_input_filename
= input_filename
;
734 /* Is this the last nonwhite stuff on the line? */
735 c
= skip_white_space_on_line ();
738 /* Update the name in the top element of input_file_stack. */
739 if (input_file_stack
)
740 input_file_stack
->name
= input_filename
;
749 /* `1' after file name means entering new file.
750 `2' after file name means just left a file. */
752 if (token
== CONSTANT
753 && TREE_CODE (yylval
.ttype
) == INTEGER_CST
)
755 if (TREE_INT_CST_LOW (yylval
.ttype
) == 1)
757 /* Pushing to a new file. */
759 = (struct file_stack
*) xmalloc (sizeof (struct file_stack
));
760 input_file_stack
->line
= old_lineno
;
761 p
->next
= input_file_stack
;
762 p
->name
= input_filename
;
763 p
->indent_level
= indent_level
;
764 input_file_stack
= p
;
765 input_file_stack_tick
++;
766 debug_start_source_file (input_filename
);
769 else if (TREE_INT_CST_LOW (yylval
.ttype
) == 2)
771 /* Popping out of a file. */
772 if (input_file_stack
->next
)
774 struct file_stack
*p
= input_file_stack
;
775 if (indent_level
!= p
->indent_level
)
777 warning_with_file_and_line
778 (p
->name
, old_lineno
,
779 "This file contains more `%c's than `%c's.",
780 indent_level
> p
->indent_level
? '{' : '}',
781 indent_level
> p
->indent_level
? '}' : '{');
783 input_file_stack
= p
->next
;
785 input_file_stack_tick
++;
786 debug_end_source_file (input_file_stack
->line
);
789 error ("#-lines for entering and leaving files don't match");
795 /* Now that we've pushed or popped the input stack,
796 update the name in the top element. */
797 if (input_file_stack
)
798 input_file_stack
->name
= input_filename
;
800 /* If we have handled a `1' or a `2',
801 see if there is another number to read. */
804 /* Is this the last nonwhite stuff on the line? */
805 c
= skip_white_space_on_line ();
814 /* `3' after file name means this is a system header file. */
816 if (token
== CONSTANT
817 && TREE_CODE (yylval
.ttype
) == INTEGER_CST
818 && TREE_INT_CST_LOW (yylval
.ttype
) == 3)
819 in_system_header
= 1, used_up
= 1;
823 /* Is this the last nonwhite stuff on the line? */
824 c
= skip_white_space_on_line ();
830 warning ("unrecognized text at end of #line");
833 error ("invalid #-line");
835 /* skip the rest of this line. */
838 if (c
!= '\n' && c
!= EOF
&& nextchar
>= 0)
839 c
= nextchar
, nextchar
= -1;
841 while (c
!= '\n' && c
!= EOF
)
846 #ifdef HANDLE_GENERIC_PRAGMAS
848 /* Handle a #pragma directive.
849 TOKEN is the token we read after `#pragma'. Processes the entire input
850 line and return non-zero iff the pragma has been successfully parsed. */
852 /* This function has to be in this file, in order to get at
856 handle_generic_pragma (token
)
869 handle_pragma_token (token_buffer
, yylval
.ttype
);
872 handle_pragma_token (token_buffer
, NULL
);
876 c
= nextchar
, nextchar
= -1;
881 while (c
== ' ' || c
== '\t')
885 if (c
== '\n' || c
== EOF
)
886 return handle_pragma_token (NULL
, NULL
);
892 #endif /* HANDLE_GENERIC_PRAGMAS */
894 #define ENDFILE -1 /* token that represents end-of-file */
896 /* Read an escape sequence, returning its equivalent as a character,
897 or store 1 in *ignore_ptr if it is backslash-newline. */
900 readescape (ignore_ptr
)
903 register int c
= GETC();
905 register unsigned count
;
906 unsigned firstdig
= 0;
912 if (warn_traditional
)
913 warning ("the meaning of `\\x' varies with -traditional");
915 if (flag_traditional
)
924 if (!(c
>= 'a' && c
<= 'f')
925 && !(c
>= 'A' && c
<= 'F')
926 && !(c
>= '0' && c
<= '9'))
932 if (c
>= 'a' && c
<= 'f')
933 code
+= c
- 'a' + 10;
934 if (c
>= 'A' && c
<= 'F')
935 code
+= c
- 'A' + 10;
936 if (c
>= '0' && c
<= '9')
938 if (code
!= 0 || count
!= 0)
947 error ("\\x used with no following hex digits");
949 /* Digits are all 0's. Ok. */
951 else if ((count
- 1) * 4 >= TYPE_PRECISION (integer_type_node
)
953 && (((unsigned)1 << (TYPE_PRECISION (integer_type_node
) - (count
- 1) * 4))
955 pedwarn ("hex escape out of range");
958 case '0': case '1': case '2': case '3': case '4':
959 case '5': case '6': case '7':
962 while ((c
<= '7') && (c
>= '0') && (count
++ < 3))
964 code
= (code
* 8) + (c
- '0');
970 case '\\': case '\'': case '"':
979 return TARGET_NEWLINE
;
994 if (warn_traditional
)
995 warning ("the meaning of `\\a' varies with -traditional");
997 if (flag_traditional
)
1002 #if 0 /* Vertical tab is present in common usage compilers. */
1003 if (flag_traditional
)
1011 pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c
);
1017 /* `\(', etc, are used at beginning of line to avoid confusing Emacs. */
1021 /* `\%' is used to prevent SCCS from getting confused. */
1024 pedwarn ("non-ANSI escape sequence `\\%c'", c
);
1027 if (c
>= 040 && c
< 0177)
1028 pedwarn ("unknown escape sequence `\\%c'", c
);
1030 pedwarn ("unknown escape sequence: `\\' followed by char code 0x%x", c
);
1040 strcpy (buf
, string
);
1042 /* We can't print string and character constants well
1043 because the token_buffer contains the result of processing escapes. */
1045 strcat (buf
, " at end of input");
1046 else if (token_buffer
[0] == 0)
1047 strcat (buf
, " at null character");
1048 else if (token_buffer
[0] == '"')
1049 strcat (buf
, " before string constant");
1050 else if (token_buffer
[0] == '\'')
1051 strcat (buf
, " before character constant");
1052 else if (token_buffer
[0] < 040 || (unsigned char) token_buffer
[0] >= 0177)
1053 sprintf (buf
+ strlen (buf
), " before character 0%o",
1054 (unsigned char) token_buffer
[0]);
1056 strcat (buf
, " before `%s'");
1058 error (buf
, token_buffer
);
1068 char long_long_flag
;
1071 struct try_type type_sequence
[] =
1073 { &integer_type_node
, 0, 0, 0},
1074 { &unsigned_type_node
, 1, 0, 0},
1075 { &long_integer_type_node
, 0, 1, 0},
1076 { &long_unsigned_type_node
, 1, 1, 0},
1077 { &long_long_integer_type_node
, 0, 1, 1},
1078 { &long_long_unsigned_type_node
, 1, 1, 1}
1093 c
= nextchar
, nextchar
= -1;
1098 /* Effectively do c = skip_white_space (c)
1099 but do it faster in the usual cases. */
1112 /* Call skip_white_space so we can warn if appropriate. */
1117 c
= skip_white_space (c
);
1119 goto found_nonwhite
;
1123 token_buffer
[0] = c
;
1124 token_buffer
[1] = 0;
1126 /* yylloc.first_line = lineno; */
1132 token_buffer
[0] = 0;
1137 /* Capital L may start a wide-string or wide-character constant. */
1139 register int c
= GETC();
1148 goto string_constant
;
1155 if (!doing_objc_thang
)
1162 /* '@' may start a constant string object. */
1163 register int c
= GETC ();
1167 goto string_constant
;
1170 /* Fall through to treat '@' as the start of an identifier. */
1173 case 'A': case 'B': case 'C': case 'D': case 'E':
1174 case 'F': case 'G': case 'H': case 'I': case 'J':
1175 case 'K': case 'M': case 'N': case 'O':
1176 case 'P': case 'Q': case 'R': case 'S': case 'T':
1177 case 'U': case 'V': case 'W': case 'X': case 'Y':
1179 case 'a': case 'b': case 'c': case 'd': case 'e':
1180 case 'f': case 'g': case 'h': case 'i': case 'j':
1181 case 'k': case 'l': case 'm': case 'n': case 'o':
1182 case 'p': case 'q': case 'r': case 's': case 't':
1183 case 'u': case 'v': case 'w': case 'x': case 'y':
1189 while (ISALNUM (c
) || c
== '_' || c
== '$' || c
== '@')
1191 /* Make sure this char really belongs in an identifier. */
1192 if (c
== '@' && ! doing_objc_thang
)
1196 if (! dollars_in_ident
)
1197 error ("`$' in identifier");
1199 pedwarn ("`$' in identifier");
1202 if (p
>= token_buffer
+ maxtoken
)
1203 p
= extend_token_buffer (p
);
1219 /* Try to recognize a keyword. Uses minimum-perfect hash function */
1222 register struct resword
*ptr
;
1224 if ((ptr
= is_reserved_word (token_buffer
, p
- token_buffer
)))
1227 yylval
.ttype
= ridpointers
[(int) ptr
->rid
];
1228 value
= (int) ptr
->token
;
1230 /* Only return OBJECTNAME if it is a typedef. */
1231 if (doing_objc_thang
&& value
== OBJECTNAME
)
1233 lastiddecl
= lookup_name(yylval
.ttype
);
1235 if (lastiddecl
== NULL_TREE
1236 || TREE_CODE (lastiddecl
) != TYPE_DECL
)
1240 /* Even if we decided to recognize asm, still perhaps warn. */
1242 && (value
== ASM_KEYWORD
|| value
== TYPEOF
1243 || ptr
->rid
== RID_INLINE
)
1244 && token_buffer
[0] != '_')
1245 pedwarn ("ANSI does not permit the keyword `%s'",
1250 /* If we did not find a keyword, look for an identifier
1253 if (value
== IDENTIFIER
)
1255 if (token_buffer
[0] == '@')
1256 error("invalid identifier `%s'", token_buffer
);
1258 yylval
.ttype
= get_identifier (token_buffer
);
1259 lastiddecl
= lookup_name (yylval
.ttype
);
1261 if (lastiddecl
!= 0 && TREE_CODE (lastiddecl
) == TYPE_DECL
)
1263 /* A user-invisible read-only initialized variable
1264 should be replaced by its value.
1265 We handle only strings since that's the only case used in C. */
1266 else if (lastiddecl
!= 0 && TREE_CODE (lastiddecl
) == VAR_DECL
1267 && DECL_IGNORED_P (lastiddecl
)
1268 && TREE_READONLY (lastiddecl
)
1269 && DECL_INITIAL (lastiddecl
) != 0
1270 && TREE_CODE (DECL_INITIAL (lastiddecl
)) == STRING_CST
)
1272 tree stringval
= DECL_INITIAL (lastiddecl
);
1274 /* Copy the string value so that we won't clobber anything
1275 if we put something in the TREE_CHAIN of this one. */
1276 yylval
.ttype
= build_string (TREE_STRING_LENGTH (stringval
),
1277 TREE_STRING_POINTER (stringval
));
1280 else if (doing_objc_thang
)
1282 tree objc_interface_decl
= is_class_name (yylval
.ttype
);
1284 if (objc_interface_decl
)
1287 yylval
.ttype
= objc_interface_decl
;
1297 /* Check first for common special case: single-digit 0 or 1. */
1300 UNGETC (next_c
); /* Always undo this lookahead. */
1301 if (!ISALNUM (next_c
) && next_c
!= '.')
1303 token_buffer
[0] = (char)c
, token_buffer
[1] = '\0';
1304 yylval
.ttype
= (c
== '0') ? integer_zero_node
: integer_one_node
;
1310 case '2': case '3': case '4':
1311 case '5': case '6': case '7': case '8': case '9':
1316 int largest_digit
= 0;
1318 /* for multi-precision arithmetic,
1319 we actually store only HOST_BITS_PER_CHAR bits in each part.
1320 The number of parts is chosen so as to be sufficient to hold
1321 the enough bits to fit into the two HOST_WIDE_INTs that contain
1322 the integer value (this is always at least as many bits as are
1323 in a target `long long' value, but may be wider). */
1324 #define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2 + 2)
1325 int parts
[TOTAL_PARTS
];
1328 enum anon1
{ NOT_FLOAT
, AFTER_POINT
, TOO_MANY_POINTS
} floatflag
1331 for (count
= 0; count
< TOTAL_PARTS
; count
++)
1339 *p
++ = (c
= GETC());
1340 if ((c
== 'x') || (c
== 'X'))
1343 *p
++ = (c
= GETC());
1345 /* Leading 0 forces octal unless the 0 is the only digit. */
1346 else if (c
>= '0' && c
<= '9')
1355 /* Read all the digits-and-decimal-points. */
1358 || (ISALNUM (c
) && c
!= 'l' && c
!= 'L'
1359 && c
!= 'u' && c
!= 'U'
1360 && c
!= 'i' && c
!= 'I' && c
!= 'j' && c
!= 'J'
1361 && (floatflag
== NOT_FLOAT
|| ((c
!= 'f') && (c
!= 'F')))))
1366 error ("floating constant may not be in radix 16");
1367 if (floatflag
== TOO_MANY_POINTS
)
1368 /* We have already emitted an error. Don't need another. */
1370 else if (floatflag
== AFTER_POINT
)
1372 error ("malformed floating constant");
1373 floatflag
= TOO_MANY_POINTS
;
1374 /* Avoid another error from atof by forcing all characters
1375 from here on to be ignored. */
1379 floatflag
= AFTER_POINT
;
1383 /* Accept '.' as the start of a floating-point number
1384 only when it is followed by a digit.
1385 Otherwise, unread the following non-digit
1386 and use the '.' as a structural token. */
1387 if (p
== token_buffer
+ 2 && !ISDIGIT (c
))
1398 error ("parse error at `..'");
1401 token_buffer
[1] = 0;
1408 /* It is not a decimal point.
1409 It should be a digit (perhaps a hex digit). */
1415 else if (base
<= 10)
1417 if (c
== 'e' || c
== 'E')
1420 floatflag
= AFTER_POINT
;
1421 break; /* start of exponent */
1423 error ("nondigits in number and not hexadecimal");
1434 if (c
>= largest_digit
)
1438 for (count
= 0; count
< TOTAL_PARTS
; count
++)
1440 parts
[count
] *= base
;
1444 += (parts
[count
-1] >> HOST_BITS_PER_CHAR
);
1446 &= (1 << HOST_BITS_PER_CHAR
) - 1;
1452 /* If the extra highest-order part ever gets anything in it,
1453 the number is certainly too big. */
1454 if (parts
[TOTAL_PARTS
- 1] != 0)
1457 if (p
>= token_buffer
+ maxtoken
- 3)
1458 p
= extend_token_buffer (p
);
1459 *p
++ = (c
= GETC());
1464 error ("numeric constant with no digits");
1466 if (largest_digit
>= base
)
1467 error ("numeric constant contains digits beyond the radix");
1469 /* Remove terminating char from the token buffer and delimit the string */
1472 if (floatflag
!= NOT_FLOAT
)
1474 tree type
= double_type_node
;
1476 int conversion_errno
= 0;
1477 REAL_VALUE_TYPE value
;
1480 /* Read explicit exponent if any, and put it in tokenbuf. */
1482 if ((c
== 'e') || (c
== 'E'))
1484 if (p
>= token_buffer
+ maxtoken
- 3)
1485 p
= extend_token_buffer (p
);
1488 if ((c
== '+') || (c
== '-'))
1494 error ("floating constant exponent has no digits");
1497 if (p
>= token_buffer
+ maxtoken
- 3)
1498 p
= extend_token_buffer (p
);
1506 /* Convert string to a double, checking for overflow. */
1507 if (setjmp (handler
))
1509 error ("floating constant out of range");
1514 int fflag
= 0, lflag
= 0;
1515 /* Copy token_buffer now, while it has just the number
1516 and not the suffixes; once we add `f' or `i',
1517 REAL_VALUE_ATOF may not work any more. */
1518 char *copy
= (char *) alloca (p
- token_buffer
+ 1);
1519 bcopy (token_buffer
, copy
, p
- token_buffer
+ 1);
1521 set_float_handler (handler
);
1527 /* Read the suffixes to choose a data type. */
1532 error ("more than one `f' in numeric constant");
1538 error ("more than one `l' in numeric constant");
1544 error ("more than one `i' or `j' in numeric constant");
1546 pedwarn ("ANSI C forbids imaginary numeric constants");
1557 if (p
>= token_buffer
+ maxtoken
- 3)
1558 p
= extend_token_buffer (p
);
1564 /* The second argument, machine_mode, of REAL_VALUE_ATOF
1565 tells the desired precision of the binary result
1566 of decimal-to-binary conversion. */
1571 error ("both `f' and `l' in floating constant");
1573 type
= float_type_node
;
1575 value
= REAL_VALUE_ATOF (copy
, TYPE_MODE (type
));
1576 conversion_errno
= errno
;
1577 /* A diagnostic is required here by some ANSI C testsuites.
1578 This is not pedwarn, become some people don't want
1579 an error for this. */
1580 if (REAL_VALUE_ISINF (value
) && pedantic
)
1581 warning ("floating point number exceeds range of `float'");
1585 type
= long_double_type_node
;
1587 value
= REAL_VALUE_ATOF (copy
, TYPE_MODE (type
));
1588 conversion_errno
= errno
;
1589 if (REAL_VALUE_ISINF (value
) && pedantic
)
1590 warning ("floating point number exceeds range of `long double'");
1595 value
= REAL_VALUE_ATOF (copy
, TYPE_MODE (type
));
1596 conversion_errno
= errno
;
1597 if (REAL_VALUE_ISINF (value
) && pedantic
)
1598 warning ("floating point number exceeds range of `double'");
1601 set_float_handler (NULL_PTR
);
1604 /* ERANGE is also reported for underflow,
1605 so test the value to distinguish overflow from that. */
1606 if (conversion_errno
== ERANGE
&& !flag_traditional
&& pedantic
1607 && (REAL_VALUES_LESS (dconst1
, value
)
1608 || REAL_VALUES_LESS (value
, dconstm1
)))
1609 warning ("floating point number exceeds range of `double'");
1612 /* If the result is not a number, assume it must have been
1613 due to some error message above, so silently convert
1615 if (REAL_VALUE_ISNAN (value
))
1618 /* Create a node with determined type and value. */
1620 yylval
.ttype
= build_complex (NULL_TREE
,
1621 convert (type
, integer_zero_node
),
1622 build_real (type
, value
));
1624 yylval
.ttype
= build_real (type
, value
);
1628 tree traditional_type
, ansi_type
, type
;
1629 HOST_WIDE_INT high
, low
;
1630 int spec_unsigned
= 0;
1632 int spec_long_long
= 0;
1636 traditional_type
= ansi_type
= type
= NULL_TREE
;
1639 if (c
== 'u' || c
== 'U')
1642 error ("two `u's in integer constant");
1645 else if (c
== 'l' || c
== 'L')
1650 error ("three `l's in integer constant");
1651 else if (pedantic
&& ! in_system_header
&& warn_long_long
)
1652 pedwarn ("ANSI C forbids long long integer constants");
1657 else if (c
== 'i' || c
== 'j' || c
== 'I' || c
== 'J')
1660 error ("more than one `i' or `j' in numeric constant");
1662 pedwarn ("ANSI C forbids imaginary numeric constants");
1667 if (p
>= token_buffer
+ maxtoken
- 3)
1668 p
= extend_token_buffer (p
);
1673 /* If the constant won't fit in an unsigned long long,
1674 then warn that the constant is out of range. */
1676 /* ??? This assumes that long long and long integer types are
1677 a multiple of 8 bits. This better than the original code
1678 though which assumed that long was exactly 32 bits and long
1679 long was exactly 64 bits. */
1681 bytes
= TYPE_PRECISION (long_long_integer_type_node
) / 8;
1684 for (i
= bytes
; i
< TOTAL_PARTS
; i
++)
1688 pedwarn ("integer constant out of range");
1690 /* This is simplified by the fact that our constant
1691 is always positive. */
1695 for (i
= 0; i
< HOST_BITS_PER_WIDE_INT
/ HOST_BITS_PER_CHAR
; i
++)
1697 high
|= ((HOST_WIDE_INT
) parts
[i
+ (HOST_BITS_PER_WIDE_INT
1698 / HOST_BITS_PER_CHAR
)]
1699 << (i
* HOST_BITS_PER_CHAR
));
1700 low
|= (HOST_WIDE_INT
) parts
[i
] << (i
* HOST_BITS_PER_CHAR
);
1703 yylval
.ttype
= build_int_2 (low
, high
);
1704 TREE_TYPE (yylval
.ttype
) = long_long_unsigned_type_node
;
1706 /* If warn_traditional, calculate both the ANSI type and the
1707 traditional type, then see if they disagree.
1708 Otherwise, calculate only the type for the dialect in use. */
1709 if (warn_traditional
|| flag_traditional
)
1711 /* Calculate the traditional type. */
1712 /* Traditionally, any constant is signed;
1713 but if unsigned is specified explicitly, obey that.
1714 Use the smallest size with the right number of bits,
1715 except for one special case with decimal constants. */
1716 if (! spec_long
&& base
!= 10
1717 && int_fits_type_p (yylval
.ttype
, unsigned_type_node
))
1718 traditional_type
= (spec_unsigned
? unsigned_type_node
1719 : integer_type_node
);
1720 /* A decimal constant must be long
1721 if it does not fit in type int.
1722 I think this is independent of whether
1723 the constant is signed. */
1724 else if (! spec_long
&& base
== 10
1725 && int_fits_type_p (yylval
.ttype
, integer_type_node
))
1726 traditional_type
= (spec_unsigned
? unsigned_type_node
1727 : integer_type_node
);
1728 else if (! spec_long_long
)
1729 traditional_type
= (spec_unsigned
? long_unsigned_type_node
1730 : long_integer_type_node
);
1732 traditional_type
= (spec_unsigned
1733 ? long_long_unsigned_type_node
1734 : long_long_integer_type_node
);
1736 if (warn_traditional
|| ! flag_traditional
)
1738 /* Calculate the ANSI type. */
1739 if (! spec_long
&& ! spec_unsigned
1740 && int_fits_type_p (yylval
.ttype
, integer_type_node
))
1741 ansi_type
= integer_type_node
;
1742 else if (! spec_long
&& (base
!= 10 || spec_unsigned
)
1743 && int_fits_type_p (yylval
.ttype
, unsigned_type_node
))
1744 ansi_type
= unsigned_type_node
;
1745 else if (! spec_unsigned
&& !spec_long_long
1746 && int_fits_type_p (yylval
.ttype
, long_integer_type_node
))
1747 ansi_type
= long_integer_type_node
;
1748 else if (! spec_long_long
1749 && int_fits_type_p (yylval
.ttype
,
1750 long_unsigned_type_node
))
1751 ansi_type
= long_unsigned_type_node
;
1752 else if (! spec_unsigned
1753 && int_fits_type_p (yylval
.ttype
,
1754 long_long_integer_type_node
))
1755 ansi_type
= long_long_integer_type_node
;
1757 ansi_type
= long_long_unsigned_type_node
;
1760 type
= flag_traditional
? traditional_type
: ansi_type
;
1762 if (warn_traditional
&& traditional_type
!= ansi_type
)
1764 if (TYPE_PRECISION (traditional_type
)
1765 != TYPE_PRECISION (ansi_type
))
1766 warning ("width of integer constant changes with -traditional");
1767 else if (TREE_UNSIGNED (traditional_type
)
1768 != TREE_UNSIGNED (ansi_type
))
1769 warning ("integer constant is unsigned in ANSI C, signed with -traditional");
1771 warning ("width of integer constant may change on other systems with -traditional");
1774 if (pedantic
&& !flag_traditional
&& !spec_long_long
&& !warn
1775 && (TYPE_PRECISION (long_integer_type_node
)
1776 < TYPE_PRECISION (type
)))
1777 pedwarn ("integer constant out of range");
1779 if (base
== 10 && ! spec_unsigned
&& TREE_UNSIGNED (type
))
1780 warning ("decimal constant is so large that it is unsigned");
1784 if (TYPE_PRECISION (type
)
1785 <= TYPE_PRECISION (integer_type_node
))
1787 = build_complex (NULL_TREE
, integer_zero_node
,
1788 convert (integer_type_node
,
1791 error ("complex integer constant is too wide for `complex int'");
1793 else if (flag_traditional
&& !int_fits_type_p (yylval
.ttype
, type
))
1794 /* The traditional constant 0x80000000 is signed
1795 but doesn't fit in the range of int.
1796 This will change it to -0x80000000, which does fit. */
1798 TREE_TYPE (yylval
.ttype
) = unsigned_type (type
);
1799 yylval
.ttype
= convert (type
, yylval
.ttype
);
1800 TREE_OVERFLOW (yylval
.ttype
)
1801 = TREE_CONSTANT_OVERFLOW (yylval
.ttype
) = 0;
1804 TREE_TYPE (yylval
.ttype
) = type
;
1810 if (ISALNUM (c
) || c
== '.' || c
== '_' || c
== '$'
1811 || (!flag_traditional
&& (c
== '-' || c
== '+')
1812 && (p
[-1] == 'e' || p
[-1] == 'E')))
1813 error ("missing white space after number `%s'", token_buffer
);
1815 value
= CONSTANT
; break;
1821 register int result
= 0;
1822 register int num_chars
= 0;
1824 unsigned width
= TYPE_PRECISION (char_type_node
);
1826 #ifdef MULTIBYTE_CHARS
1827 int longest_char
= local_mb_cur_max ();
1828 (void) local_mbtowc (NULL_PTR
, NULL_PTR
, 0);
1831 max_chars
= TYPE_PRECISION (integer_type_node
) / width
;
1833 width
= WCHAR_TYPE_SIZE
;
1840 if (c
== '\'' || c
== EOF
)
1847 c
= readescape (&ignore
);
1850 if (width
< HOST_BITS_PER_INT
1851 && (unsigned) c
>= ((unsigned)1 << width
))
1852 pedwarn ("escape sequence out of range for character");
1853 #ifdef MAP_CHARACTER
1855 c
= MAP_CHARACTER (c
);
1861 pedwarn ("ANSI C forbids newline in character constant");
1866 #ifdef MULTIBYTE_CHARS
1870 for (i
= 1; i
<= longest_char
; ++i
)
1872 if (i
> maxtoken
- 4)
1873 extend_token_buffer (token_buffer
);
1875 token_buffer
[i
] = c
;
1876 char_len
= local_mbtowc (& wc
,
1885 /* mbtowc sometimes needs an extra char before accepting */
1890 /* Merge character into result; ignore excess chars. */
1891 for (i
= 1; i
<= char_len
; ++i
)
1895 if (width
< HOST_BITS_PER_INT
)
1896 result
= (result
<< width
)
1898 & ((1 << width
) - 1));
1900 result
= token_buffer
[i
];
1902 num_chars
+= char_len
;
1910 warning ("Ignoring invalid multibyte character");
1913 #ifdef MAP_CHARACTER
1915 c
= MAP_CHARACTER (c
);
1918 #else /* ! MULTIBYTE_CHARS */
1919 #ifdef MAP_CHARACTER
1920 c
= MAP_CHARACTER (c
);
1922 #endif /* ! MULTIBYTE_CHARS */
1927 if (chars_seen
== 1) /* only keep the first one */
1932 /* Merge character into result; ignore excess chars. */
1933 num_chars
+= (width
/ TYPE_PRECISION (char_type_node
));
1934 if (num_chars
< max_chars
+ 1)
1936 if (width
< HOST_BITS_PER_INT
)
1937 result
= (result
<< width
) | (c
& ((1 << width
) - 1));
1944 error ("malformatted character constant");
1945 else if (chars_seen
== 0)
1946 error ("empty character constant");
1947 else if (num_chars
> max_chars
)
1949 num_chars
= max_chars
;
1950 error ("character constant too long");
1952 else if (chars_seen
!= 1 && ! flag_traditional
&& warn_multichar
)
1953 warning ("multi-character character constant");
1955 /* If char type is signed, sign-extend the constant. */
1958 int num_bits
= num_chars
* width
;
1960 /* We already got an error; avoid invalid shift. */
1961 yylval
.ttype
= build_int_2 (0, 0);
1962 else if (TREE_UNSIGNED (char_type_node
)
1963 || ((result
>> (num_bits
- 1)) & 1) == 0)
1965 = build_int_2 (result
& (~(unsigned HOST_WIDE_INT
) 0
1966 >> (HOST_BITS_PER_WIDE_INT
- num_bits
)),
1970 = build_int_2 (result
| ~(~(unsigned HOST_WIDE_INT
) 0
1971 >> (HOST_BITS_PER_WIDE_INT
- num_bits
)),
1973 TREE_TYPE (yylval
.ttype
) = integer_type_node
;
1977 yylval
.ttype
= build_int_2 (result
, 0);
1978 TREE_TYPE (yylval
.ttype
) = wchar_type_node
;
1988 unsigned width
= wide_flag
? WCHAR_TYPE_SIZE
1989 : TYPE_PRECISION (char_type_node
);
1990 #ifdef MULTIBYTE_CHARS
1991 int longest_char
= local_mb_cur_max ();
1992 (void) local_mbtowc (NULL_PTR
, NULL_PTR
, 0);
1995 p
= token_buffer
+ 1;
1997 while (c
!= '"' && c
>= 0)
2002 c
= readescape (&ignore
);
2005 if (width
< HOST_BITS_PER_INT
2006 && (unsigned) c
>= ((unsigned)1 << width
))
2007 pedwarn ("escape sequence out of range for character");
2012 pedwarn ("ANSI C forbids newline in string constant");
2017 #ifdef MULTIBYTE_CHARS
2021 for (i
= 0; i
< longest_char
; ++i
)
2023 if (p
+ i
>= token_buffer
+ maxtoken
)
2024 p
= extend_token_buffer (p
);
2027 char_len
= local_mbtowc (& wc
, p
, i
+ 1);
2033 warning ("Ignoring invalid multibyte character");
2036 /* mbtowc sometimes needs an extra char before accepting */
2047 #endif /* MULTIBYTE_CHARS */
2050 /* Add this single character into the buffer either as a wchar_t
2051 or as a single byte. */
2054 unsigned width
= TYPE_PRECISION (char_type_node
);
2055 unsigned bytemask
= (1 << width
) - 1;
2058 if (p
+ WCHAR_BYTES
> token_buffer
+ maxtoken
)
2059 p
= extend_token_buffer (p
);
2061 for (byte
= 0; byte
< WCHAR_BYTES
; ++byte
)
2064 if (byte
>= (int) sizeof (c
))
2067 value
= (c
>> (byte
* width
)) & bytemask
;
2068 if (BYTES_BIG_ENDIAN
)
2069 p
[WCHAR_BYTES
- byte
- 1] = value
;
2077 if (p
>= token_buffer
+ maxtoken
)
2078 p
= extend_token_buffer (p
);
2086 /* Terminate the string value, either with a single byte zero
2087 or with a wide zero. */
2090 if (p
+ WCHAR_BYTES
> token_buffer
+ maxtoken
)
2091 p
= extend_token_buffer (p
);
2092 bzero (p
, WCHAR_BYTES
);
2097 if (p
>= token_buffer
+ maxtoken
)
2098 p
= extend_token_buffer (p
);
2103 error ("Unterminated string constant");
2105 /* We have read the entire constant.
2106 Construct a STRING_CST for the result. */
2110 yylval
.ttype
= build_string (p
- (token_buffer
+ 1),
2112 TREE_TYPE (yylval
.ttype
) = wchar_array_type_node
;
2117 /* Return an Objective-C @"..." constant string object. */
2118 yylval
.ttype
= build_objc_string (p
- (token_buffer
+ 1),
2120 TREE_TYPE (yylval
.ttype
) = char_array_type_node
;
2121 value
= OBJC_STRING
;
2125 yylval
.ttype
= build_string (p
- (token_buffer
+ 1),
2127 TREE_TYPE (yylval
.ttype
) = char_array_type_node
;
2155 yylval
.code
= PLUS_EXPR
; break;
2157 yylval
.code
= MINUS_EXPR
; break;
2159 yylval
.code
= BIT_AND_EXPR
; break;
2161 yylval
.code
= BIT_IOR_EXPR
; break;
2163 yylval
.code
= MULT_EXPR
; break;
2165 yylval
.code
= TRUNC_DIV_EXPR
; break;
2167 yylval
.code
= TRUNC_MOD_EXPR
; break;
2169 yylval
.code
= BIT_XOR_EXPR
; break;
2171 yylval
.code
= LSHIFT_EXPR
; break;
2173 yylval
.code
= RSHIFT_EXPR
; break;
2175 yylval
.code
= LT_EXPR
; break;
2177 yylval
.code
= GT_EXPR
; break;
2180 token_buffer
[1] = c1
= GETC();
2181 token_buffer
[2] = 0;
2188 value
= ARITHCOMPARE
; yylval
.code
= LE_EXPR
; goto done
;
2190 value
= ARITHCOMPARE
; yylval
.code
= GE_EXPR
; goto done
;
2192 value
= EQCOMPARE
; yylval
.code
= NE_EXPR
; goto done
;
2194 value
= EQCOMPARE
; yylval
.code
= EQ_EXPR
; goto done
;
2196 value
= ASSIGN
; goto done
;
2202 value
= PLUSPLUS
; goto done
;
2204 value
= MINUSMINUS
; goto done
;
2206 value
= ANDAND
; goto done
;
2208 value
= OROR
; goto done
;
2221 { value
= POINTSAT
; goto done
; }
2225 { value
= ']'; goto done
; }
2229 { value
= '{'; indent_level
++; goto done
; }
2231 { value
= '['; goto done
; }
2235 { value
= '}'; indent_level
--; goto done
; }
2239 token_buffer
[1] = 0;
2241 if ((c
== '<') || (c
== '>'))
2242 value
= ARITHCOMPARE
;
2248 /* Don't make yyparse think this is eof. */
2267 /* yylloc.last_line = lineno; */
2272 /* Sets the value of the 'yydebug' variable to VALUE.
2273 This is a function so we don't have to have YYDEBUG defined
2274 in order to build the compiler. */
2283 warning ("YYDEBUG not defined.");