OLD | NEW |
1 /* YACC parser for C expressions, for GDB. | 1 /* YACC parser for C expressions, for GDB. |
2 Copyright (C) 1986, 1989-2000, 2003-2004, 2006-2012 Free Software | 2 Copyright (C) 1986, 1989-2000, 2003-2004, 2006-2012 Free Software |
3 Foundation, Inc. | 3 Foundation, Inc. |
4 | 4 |
5 This file is part of GDB. | 5 This file is part of GDB. |
6 | 6 |
7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 #define yyrule c_rule /* With YYDEBUG defined */ | 96 #define yyrule c_rule /* With YYDEBUG defined */ |
97 #define yylhs c_yylhs | 97 #define yylhs c_yylhs |
98 #define yylen c_yylen | 98 #define yylen c_yylen |
99 #define yydefred c_yydefred | 99 #define yydefred c_yydefred |
100 #define yydgoto c_yydgoto | 100 #define yydgoto c_yydgoto |
101 #define yysindex c_yysindex | 101 #define yysindex c_yysindex |
102 #define yyrindex c_yyrindex | 102 #define yyrindex c_yyrindex |
103 #define yygindex c_yygindex | 103 #define yygindex c_yygindex |
104 #define yytable c_yytable | 104 #define yytable c_yytable |
105 #define yycheck c_yycheck | 105 #define yycheck c_yycheck |
| 106 #define yyss c_yyss |
| 107 #define yysslim c_yysslim |
| 108 #define yyssp c_yyssp |
| 109 #define yystacksize c_yystacksize |
| 110 #define yyvs c_yyvs |
| 111 #define yyvsp c_yyvsp |
106 | 112 |
107 #ifndef YYDEBUG | 113 #ifndef YYDEBUG |
108 #define YYDEBUG 1 /* Default to yydebug support */ | 114 #define YYDEBUG 1 /* Default to yydebug support */ |
109 #endif | 115 #endif |
110 | 116 |
111 #define YYFPRINTF parser_fprintf | 117 #define YYFPRINTF parser_fprintf |
112 | 118 |
113 int yyparse (void); | 119 int yyparse (void); |
114 | 120 |
115 static int yylex (void); | 121 static int yylex (void); |
(...skipping 26 matching lines...) Expand all Loading... |
142 struct stoken sval; | 148 struct stoken sval; |
143 struct typed_stoken tsval; | 149 struct typed_stoken tsval; |
144 struct ttype tsym; | 150 struct ttype tsym; |
145 struct symtoken ssym; | 151 struct symtoken ssym; |
146 int voidval; | 152 int voidval; |
147 struct block *bval; | 153 struct block *bval; |
148 enum exp_opcode opcode; | 154 enum exp_opcode opcode; |
149 struct internalvar *ivar; | 155 struct internalvar *ivar; |
150 | 156 |
151 struct stoken_vector svec; | 157 struct stoken_vector svec; |
152 struct type **tvec; | 158 VEC (type_ptr) *tvec; |
153 int *ivec; | 159 int *ivec; |
| 160 |
| 161 struct type_stack *type_stack; |
154 } | 162 } |
155 | 163 |
156 %{ | 164 %{ |
157 /* YYSTYPE gets defined by %union */ | 165 /* YYSTYPE gets defined by %union */ |
158 static int parse_number (char *, int, int, YYSTYPE *); | 166 static int parse_number (char *, int, int, YYSTYPE *); |
159 static struct stoken operator_stoken (const char *); | 167 static struct stoken operator_stoken (const char *); |
| 168 static void check_parameter_typelist (VEC (type_ptr) *); |
160 %} | 169 %} |
161 | 170 |
162 %type <voidval> exp exp1 type_exp start variable qualified_name lcurly | 171 %type <voidval> exp exp1 type_exp start variable qualified_name lcurly |
163 %type <lval> rcurly | 172 %type <lval> rcurly |
164 %type <tval> type typebase | 173 %type <tval> type typebase |
165 %type <tvec> nonempty_typelist | 174 %type <tvec> nonempty_typelist func_mod parameter_typelist |
166 /* %type <bval> block */ | 175 /* %type <bval> block */ |
167 | 176 |
168 /* Fancy type parsing. */ | 177 /* Fancy type parsing. */ |
169 %type <voidval> func_mod direct_abs_decl abs_decl | |
170 %type <tval> ptype | 178 %type <tval> ptype |
171 %type <lval> array_mod | 179 %type <lval> array_mod |
| 180 %type <tval> conversion_type_id |
| 181 |
| 182 %type <type_stack> ptr_operator_ts abs_decl direct_abs_decl |
172 | 183 |
173 %token <typed_val_int> INT | 184 %token <typed_val_int> INT |
174 %token <typed_val_float> FLOAT | 185 %token <typed_val_float> FLOAT |
175 %token <typed_val_decfloat> DECFLOAT | 186 %token <typed_val_decfloat> DECFLOAT |
176 | 187 |
177 /* Both NAME and TYPENAME tokens represent symbols in the input, | 188 /* Both NAME and TYPENAME tokens represent symbols in the input, |
178 and both convey their data as strings. | 189 and both convey their data as strings. |
179 But a TYPENAME is a string that happens to be defined as a typedef | 190 But a TYPENAME is a string that happens to be defined as a typedef |
180 or builtin type name (such as int or char) | 191 or builtin type name (such as int or char) |
181 and a NAME is any other symbol. | 192 and a NAME is any other symbol. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 %left EQUAL NOTEQUAL | 245 %left EQUAL NOTEQUAL |
235 %left '<' '>' LEQ GEQ | 246 %left '<' '>' LEQ GEQ |
236 %left LSH RSH | 247 %left LSH RSH |
237 %left '@' | 248 %left '@' |
238 %left '+' '-' | 249 %left '+' '-' |
239 %left '*' '/' '%' | 250 %left '*' '/' '%' |
240 %right UNARY INCREMENT DECREMENT | 251 %right UNARY INCREMENT DECREMENT |
241 %right ARROW ARROW_STAR '.' DOT_STAR '[' '(' | 252 %right ARROW ARROW_STAR '.' DOT_STAR '[' '(' |
242 %token <ssym> BLOCKNAME | 253 %token <ssym> BLOCKNAME |
243 %token <bval> FILENAME | 254 %token <bval> FILENAME |
error: old chunk mismatch |
None
OLD | NEW |