1 /* YACC parser for Ada expressions, for GDB.
2 Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1997, 2000, 2003,
3 2004 Free Software Foundation, Inc.
5 This file is part of GDB.
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
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21 /* Parse an Ada expression from text in a string,
22 and return the result as a struct expression pointer.
23 That structure contains arithmetic operations in reverse polish,
24 with constants represented by operations that are followed by special data.
25 See expression.h for the details of the format.
26 What is important here is that it can be built up sequentially
27 during the process of parsing; the lower levels of the tree always
28 come first in the result.
30 malloc's and realloc's in this file are transformed to
31 xmalloc and xrealloc respectively by the same sed command in the
32 makefile that remaps any other malloc/realloc inserted by the parser
33 generator. Doing this with #defines and trying to control the interaction
34 with include files (<malloc.h> and <stdlib.h> for example) just became
35 too messy, particularly when such includes can be inserted at random
36 times by the parser generator. */
43 #include "expression.h"
45 #include "parser-defs.h"
48 #include "bfd.h" /* Required by objfiles.h. */
49 #include "symfile.h" /* Required by objfiles.h. */
50 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
54 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
55 as well as gratuitiously global symbol names, so we can have multiple
56 yacc generated parsers in gdb. These are only the variables
57 produced by yacc. If other parser generators (bison, byacc, etc) produce
58 additional global names that conflict at link time, then those parser
59 generators need to be fixed instead of adding those names to this list. */
61 /* NOTE: This is clumsy, especially since BISON and FLEX provide --prefix
62 options. I presume we are maintaining it to accommodate systems
63 without BISON? (PNH) */
65 #define yymaxdepth ada_maxdepth
66 #define yyparse _ada_parse /* ada_parse calls this after initialization */
68 #define yyerror ada_error
69 #define yylval ada_lval
70 #define yychar ada_char
71 #define yydebug ada_debug
72 #define yypact ada_pact
79 #define yyexca ada_exca
80 #define yyerrflag ada_errflag
81 #define yynerrs ada_nerrs
85 #define yy_yys ada_yys
86 #define yystate ada_state
89 #define yy_yyv ada_yyv
91 #define yylloc ada_lloc
92 #define yyreds ada_reds /* With YYDEBUG defined */
93 #define yytoks ada_toks /* With YYDEBUG defined */
94 #define yyname ada_name /* With YYDEBUG defined */
95 #define yyrule ada_rule /* With YYDEBUG defined */
98 #define YYDEBUG 1 /* Default to yydebug support */
101 #define YYFPRINTF parser_fprintf
105 struct minimal_symbol *msym;
107 struct stoken stoken;
110 /* If expression is in the context of TYPE'(...), then TYPE, else
112 static struct type *type_qualifier;
116 static int yylex (void);
118 void yyerror (char *);
120 static struct stoken string_to_operator (struct stoken);
122 static void write_int (LONGEST, struct type *);
124 static void write_object_renaming (struct block *, struct symbol *, int);
126 static void write_var_from_name (struct block *, struct name_info);
129 convert_char_literal (struct type *, LONGEST);
145 struct name_info ssym;
148 struct internalvar *ivar;
152 %type <voidval> exp exp1 simple_exp start variable
155 %token <typed_val> INT NULL_PTR CHARLIT
156 %token <typed_val_float> FLOAT
157 %token <tval> TYPENAME
158 %token <bval> BLOCKNAME
160 /* Both NAME and TYPENAME tokens represent symbols in the input,
161 and both convey their data as strings.
162 But a TYPENAME is a string that happens to be defined as a typedef
163 or builtin type name (such as int or char)
164 and a NAME is any other symbol.
165 Contexts where this distinction is not important can use the
166 nonterminal "name", which matches either NAME or TYPENAME. */
169 %token <ssym> NAME DOT_ID OBJECT_RENAMING
171 %type <lval> arglist tick_arglist
173 %type <tval> save_qualifier
177 /* Special type cases, put in to allow the parser to distinguish different
179 %token <sval> SPECIAL_VARIABLE
182 %left _AND_ OR XOR THEN ELSE
183 %left '=' NOTEQUAL '<' '>' LEQ GEQ IN DOTDOT
187 %left '*' '/' MOD REM
188 %right STARSTAR ABS NOT
189 /* The following are right-associative only so that reductions at this
190 precedence have lower precedence than '.' and '('. The syntax still
191 forces a.b.c, e.g., to be LEFT-associated. */
192 %right TICK_ACCESS TICK_ADDRESS TICK_FIRST TICK_LAST TICK_LENGTH
193 %right TICK_MAX TICK_MIN TICK_MODULUS
194 %right TICK_POS TICK_RANGE TICK_SIZE TICK_TAG TICK_VAL
195 %right '.' '(' '[' DOT_ID DOT_ALL
203 | type { write_exp_elt_opcode (OP_TYPE);
204 write_exp_elt_type ($1);
205 write_exp_elt_opcode (OP_TYPE); }
208 /* Expressions, including the sequencing operator. */
211 { write_exp_elt_opcode (BINOP_COMMA); }
214 /* Expressions, not including the sequencing operator. */
215 simple_exp : simple_exp DOT_ALL
216 { write_exp_elt_opcode (UNOP_IND); }
219 simple_exp : simple_exp DOT_ID
220 { write_exp_elt_opcode (STRUCTOP_STRUCT);
221 write_exp_string ($2.stoken);
222 write_exp_elt_opcode (STRUCTOP_STRUCT);
226 simple_exp : simple_exp '(' arglist ')'
228 write_exp_elt_opcode (OP_FUNCALL);
229 write_exp_elt_longcst ($3);
230 write_exp_elt_opcode (OP_FUNCALL);
234 simple_exp : type '(' exp ')'
236 write_exp_elt_opcode (UNOP_CAST);
237 write_exp_elt_type ($1);
238 write_exp_elt_opcode (UNOP_CAST);
242 simple_exp : type '\'' save_qualifier { type_qualifier = $1; } '(' exp ')'
244 write_exp_elt_opcode (UNOP_QUAL);
245 write_exp_elt_type ($1);
246 write_exp_elt_opcode (UNOP_QUAL);
251 save_qualifier : { $$ = type_qualifier; }
255 simple_exp '(' exp DOTDOT exp ')'
256 { write_exp_elt_opcode (TERNOP_SLICE); }
259 simple_exp : '(' exp1 ')' { }
262 simple_exp : variable
265 simple_exp: SPECIAL_VARIABLE /* Various GDB extensions */
266 { write_dollar_variable ($1); }
272 exp : exp ASSIGN exp /* Extension for convenience */
273 { write_exp_elt_opcode (BINOP_ASSIGN); }
276 exp : '-' exp %prec UNARY
277 { write_exp_elt_opcode (UNOP_NEG); }
280 exp : '+' exp %prec UNARY
281 { write_exp_elt_opcode (UNOP_PLUS); }
284 exp : NOT exp %prec UNARY
285 { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
288 exp : ABS exp %prec UNARY
289 { write_exp_elt_opcode (UNOP_ABS); }
292 arglist : { $$ = 0; }
301 | arglist ',' any_name ARROW exp
305 exp : '{' type '}' exp %prec '.'
307 { write_exp_elt_opcode (UNOP_MEMVAL);
308 write_exp_elt_type ($2);
309 write_exp_elt_opcode (UNOP_MEMVAL);
313 /* Binary operators in order of decreasing precedence. */
315 exp : exp STARSTAR exp
316 { write_exp_elt_opcode (BINOP_EXP); }
320 { write_exp_elt_opcode (BINOP_MUL); }
324 { write_exp_elt_opcode (BINOP_DIV); }
327 exp : exp REM exp /* May need to be fixed to give correct Ada REM */
328 { write_exp_elt_opcode (BINOP_REM); }
332 { write_exp_elt_opcode (BINOP_MOD); }
335 exp : exp '@' exp /* GDB extension */
336 { write_exp_elt_opcode (BINOP_REPEAT); }
340 { write_exp_elt_opcode (BINOP_ADD); }
344 { write_exp_elt_opcode (BINOP_CONCAT); }
348 { write_exp_elt_opcode (BINOP_SUB); }
352 { write_exp_elt_opcode (BINOP_EQUAL); }
355 exp : exp NOTEQUAL exp
356 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
360 { write_exp_elt_opcode (BINOP_LEQ); }
363 exp : exp IN exp DOTDOT exp
364 { write_exp_elt_opcode (TERNOP_IN_RANGE); }
365 | exp IN exp TICK_RANGE tick_arglist
366 { write_exp_elt_opcode (BINOP_IN_BOUNDS);
367 write_exp_elt_longcst ((LONGEST) $5);
368 write_exp_elt_opcode (BINOP_IN_BOUNDS);
370 | exp IN TYPENAME %prec TICK_ACCESS
371 { write_exp_elt_opcode (UNOP_IN_RANGE);
372 write_exp_elt_type ($3);
373 write_exp_elt_opcode (UNOP_IN_RANGE);
375 | exp NOT IN exp DOTDOT exp
376 { write_exp_elt_opcode (TERNOP_IN_RANGE);
377 write_exp_elt_opcode (UNOP_LOGICAL_NOT);
379 | exp NOT IN exp TICK_RANGE tick_arglist
380 { write_exp_elt_opcode (BINOP_IN_BOUNDS);
381 write_exp_elt_longcst ((LONGEST) $6);
382 write_exp_elt_opcode (BINOP_IN_BOUNDS);
383 write_exp_elt_opcode (UNOP_LOGICAL_NOT);
385 | exp NOT IN TYPENAME %prec TICK_ACCESS
386 { write_exp_elt_opcode (UNOP_IN_RANGE);
387 write_exp_elt_type ($4);
388 write_exp_elt_opcode (UNOP_IN_RANGE);
389 write_exp_elt_opcode (UNOP_LOGICAL_NOT);
394 { write_exp_elt_opcode (BINOP_GEQ); }
398 { write_exp_elt_opcode (BINOP_LESS); }
402 { write_exp_elt_opcode (BINOP_GTR); }
405 exp : exp _AND_ exp /* Fix for Ada elementwise AND. */
406 { write_exp_elt_opcode (BINOP_BITWISE_AND); }
409 exp : exp _AND_ THEN exp %prec _AND_
410 { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
413 exp : exp OR exp /* Fix for Ada elementwise OR */
414 { write_exp_elt_opcode (BINOP_BITWISE_IOR); }
417 exp : exp OR ELSE exp
418 { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
421 exp : exp XOR exp /* Fix for Ada elementwise XOR */
422 { write_exp_elt_opcode (BINOP_BITWISE_XOR); }
425 simple_exp : simple_exp TICK_ACCESS
426 { write_exp_elt_opcode (UNOP_ADDR); }
427 | simple_exp TICK_ADDRESS
428 { write_exp_elt_opcode (UNOP_ADDR);
429 write_exp_elt_opcode (UNOP_CAST);
430 write_exp_elt_type (builtin_type_ada_system_address);
431 write_exp_elt_opcode (UNOP_CAST);
433 | simple_exp TICK_FIRST tick_arglist
434 { write_int ($3, builtin_type_int);
435 write_exp_elt_opcode (OP_ATR_FIRST); }
436 | simple_exp TICK_LAST tick_arglist
437 { write_int ($3, builtin_type_int);
438 write_exp_elt_opcode (OP_ATR_LAST); }
439 | simple_exp TICK_LENGTH tick_arglist
440 { write_int ($3, builtin_type_int);
441 write_exp_elt_opcode (OP_ATR_LENGTH); }
442 | simple_exp TICK_SIZE
443 { write_exp_elt_opcode (OP_ATR_SIZE); }
444 | simple_exp TICK_TAG
445 { write_exp_elt_opcode (OP_ATR_TAG); }
446 | opt_type_prefix TICK_MIN '(' exp ',' exp ')'
447 { write_exp_elt_opcode (OP_ATR_MIN); }
448 | opt_type_prefix TICK_MAX '(' exp ',' exp ')'
449 { write_exp_elt_opcode (OP_ATR_MAX); }
450 | opt_type_prefix TICK_POS '(' exp ')'
451 { write_exp_elt_opcode (OP_ATR_POS); }
452 | type_prefix TICK_FIRST tick_arglist
453 { write_int ($3, builtin_type_int);
454 write_exp_elt_opcode (OP_ATR_FIRST); }
455 | type_prefix TICK_LAST tick_arglist
456 { write_int ($3, builtin_type_int);
457 write_exp_elt_opcode (OP_ATR_LAST); }
458 | type_prefix TICK_LENGTH tick_arglist
459 { write_int ($3, builtin_type_int);
460 write_exp_elt_opcode (OP_ATR_LENGTH); }
461 | type_prefix TICK_VAL '(' exp ')'
462 { write_exp_elt_opcode (OP_ATR_VAL); }
463 | type_prefix TICK_MODULUS
464 { write_exp_elt_opcode (OP_ATR_MODULUS); }
467 tick_arglist : %prec '('
475 { write_exp_elt_opcode (OP_TYPE);
476 write_exp_elt_type ($1);
477 write_exp_elt_opcode (OP_TYPE); }
483 { write_exp_elt_opcode (OP_TYPE);
484 write_exp_elt_type (builtin_type_void);
485 write_exp_elt_opcode (OP_TYPE); }
490 { write_int ((LONGEST) $1.val, $1.type); }
494 { write_int (convert_char_literal (type_qualifier, $1.val),
495 (type_qualifier == NULL)
496 ? $1.type : type_qualifier);
501 { write_exp_elt_opcode (OP_DOUBLE);
502 write_exp_elt_type ($1.type);
503 write_exp_elt_dblcst ($1.dval);
504 write_exp_elt_opcode (OP_DOUBLE);
509 { write_int (0, builtin_type_int); }
514 write_exp_elt_opcode (OP_STRING);
515 write_exp_string ($1);
516 write_exp_elt_opcode (OP_STRING);
521 { error ("NEW not implemented."); }
524 variable: NAME { write_var_from_name (NULL, $1); }
525 | block NAME /* GDB extension */
526 { write_var_from_name ($1, $2); }
528 { write_object_renaming (NULL, $1.sym,
529 MAX_RENAMING_CHAIN_LENGTH); }
530 | block OBJECT_RENAMING
531 { write_object_renaming ($1, $2.sym,
532 MAX_RENAMING_CHAIN_LENGTH); }
537 | OBJECT_RENAMING { }
540 block : BLOCKNAME /* GDB extension */
542 | block BLOCKNAME /* GDB extension */
547 type : TYPENAME { $$ = $1; }
548 | block TYPENAME { $$ = $2; }
549 | TYPENAME TICK_ACCESS
550 { $$ = lookup_pointer_type ($1); }
551 | block TYPENAME TICK_ACCESS
552 { $$ = lookup_pointer_type ($2); }
555 /* Some extensions borrowed from C, for the benefit of those who find they
556 can't get used to Ada notation in GDB. */
558 exp : '*' exp %prec '.'
559 { write_exp_elt_opcode (UNOP_IND); }
561 { write_exp_elt_opcode (UNOP_ADDR); }
563 { write_exp_elt_opcode (BINOP_SUBSCRIPT); }
568 /* yylex defined in ada-lex.c: Reads one token, getting characters */
569 /* through lexptr. */
571 /* Remap normal flex interface names (yylex) as well as gratuitiously */
572 /* global symbol names, so we can have multiple flex-generated parsers */
575 /* (See note above on previous definitions for YACC.) */
577 #define yy_create_buffer ada_yy_create_buffer
578 #define yy_delete_buffer ada_yy_delete_buffer
579 #define yy_init_buffer ada_yy_init_buffer
580 #define yy_load_buffer_state ada_yy_load_buffer_state
581 #define yy_switch_to_buffer ada_yy_switch_to_buffer
582 #define yyrestart ada_yyrestart
583 #define yytext ada_yytext
584 #define yywrap ada_yywrap
586 static struct obstack temp_parse_space;
588 /* The following kludge was found necessary to prevent conflicts between */
589 /* defs.h and non-standard stdlib.h files. */
590 #define qsort __qsort__dummy
596 lexer_init (yyin); /* (Re-)initialize lexer. */
597 left_block_context = NULL;
598 type_qualifier = NULL;
599 obstack_free (&temp_parse_space, NULL);
600 obstack_init (&temp_parse_space);
602 return _ada_parse ();
608 error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
611 /* The operator name corresponding to operator symbol STRING (adds
612 quotes and maps to lower-case). Destroys the previous contents of
613 the array pointed to by STRING.ptr. Error if STRING does not match
614 a valid Ada operator. Assumes that STRING.ptr points to a
615 null-terminated string and that, if STRING is a valid operator
616 symbol, the array pointed to by STRING.ptr contains at least
617 STRING.length+3 characters. */
620 string_to_operator (struct stoken string)
624 for (i = 0; ada_opname_table[i].encoded != NULL; i += 1)
626 if (string.length == strlen (ada_opname_table[i].decoded)-2
627 && strncasecmp (string.ptr, ada_opname_table[i].decoded+1,
630 strncpy (string.ptr, ada_opname_table[i].decoded,
636 error ("Invalid operator symbol `%s'", string.ptr);
639 /* Emit expression to access an instance of SYM, in block BLOCK (if
640 * non-NULL), and with :: qualification ORIG_LEFT_CONTEXT. */
642 write_var_from_sym (struct block *orig_left_context,
646 if (orig_left_context == NULL && symbol_read_needs_frame (sym))
648 if (innermost_block == 0 ||
649 contained_in (block, innermost_block))
650 innermost_block = block;
653 write_exp_elt_opcode (OP_VAR_VALUE);
654 write_exp_elt_block (block);
655 write_exp_elt_sym (sym);
656 write_exp_elt_opcode (OP_VAR_VALUE);
659 /* Emit expression to access an instance of NAME in :: context
660 * ORIG_LEFT_CONTEXT. If no unique symbol for NAME has been found,
661 * output a dummy symbol (good to the next call of ada_parse) for NAME
662 * in the UNDEF_DOMAIN, for later resolution by ada_resolve. */
664 write_var_from_name (struct block *orig_left_context,
665 struct name_info name)
667 if (name.msym != NULL)
669 write_exp_msymbol (name.msym,
670 lookup_function_type (builtin_type_int),
673 else if (name.sym == NULL)
675 /* Multiple matches: record name and starting block for later
676 resolution by ada_resolve. */
677 char *encoded_name = ada_encode (name.stoken.ptr);
679 obstack_alloc (&temp_parse_space, sizeof (struct symbol));
680 memset (sym, 0, sizeof (struct symbol));
681 SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
682 SYMBOL_LINKAGE_NAME (sym)
683 = obsavestring (encoded_name, strlen (encoded_name), &temp_parse_space);
684 SYMBOL_LANGUAGE (sym) = language_ada;
686 write_exp_elt_opcode (OP_VAR_VALUE);
687 write_exp_elt_block (name.block);
688 write_exp_elt_sym (sym);
689 write_exp_elt_opcode (OP_VAR_VALUE);
692 write_var_from_sym (orig_left_context, name.block, name.sym);
695 /* Write integer constant ARG of type TYPE. */
698 write_int (LONGEST arg, struct type *type)
700 write_exp_elt_opcode (OP_LONG);
701 write_exp_elt_type (type);
702 write_exp_elt_longcst (arg);
703 write_exp_elt_opcode (OP_LONG);
706 /* Emit expression corresponding to the renamed object designated by
707 * the type RENAMING, which must be the referent of an object renaming
708 * type, in the context of ORIG_LEFT_CONTEXT. MAX_DEPTH is the maximum
709 * number of cascaded renamings to allow. */
711 write_object_renaming (struct block *orig_left_context,
712 struct symbol *renaming, int max_depth)
714 const char *qualification = SYMBOL_LINKAGE_NAME (renaming);
715 const char *simple_tail;
716 const char *expr = TYPE_FIELD_NAME (SYMBOL_TYPE (renaming), 0);
720 enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
723 error ("Could not find renamed symbol");
725 /* if orig_left_context is null, then use the currently selected
726 block; otherwise we might fail our symbol lookup below. */
727 if (orig_left_context == NULL)
728 orig_left_context = get_selected_block (NULL);
730 for (simple_tail = qualification + strlen (qualification);
731 simple_tail != qualification; simple_tail -= 1)
733 if (*simple_tail == '.')
738 else if (strncmp (simple_tail, "__", 2) == 0)
745 suffix = strstr (expr, "___XE");
749 name = (char *) obstack_alloc (&temp_parse_space, suffix - expr + 1);
750 strncpy (name, expr, suffix-expr);
751 name[suffix-expr] = '\000';
752 sym = lookup_symbol (name, orig_left_context, VAR_DOMAIN, 0, NULL);
754 error ("Could not find renamed variable: %s", ada_decode (name));
755 if (ada_is_object_renaming (sym))
756 write_object_renaming (orig_left_context, sym, max_depth-1);
758 write_var_from_sym (orig_left_context, block_found, sym);
761 slice_state = SIMPLE_INDEX;
762 while (*suffix == 'X')
769 write_exp_elt_opcode (UNOP_IND);
772 slice_state = LOWER_BOUND;
775 if (isdigit (*suffix))
778 long val = strtol (suffix, &next, 10);
782 write_exp_elt_opcode (OP_LONG);
783 write_exp_elt_type (builtin_type_ada_int);
784 write_exp_elt_longcst ((LONGEST) val);
785 write_exp_elt_opcode (OP_LONG);
792 struct symbol *index_sym;
794 end = strchr (suffix, 'X');
796 end = suffix + strlen (suffix);
798 index_len = simple_tail - qualification + 2 + (suffix - end) + 1;
800 = (char *) obstack_alloc (&temp_parse_space, index_len);
801 memset (index_name, '\000', index_len);
802 strncpy (index_name, qualification, simple_tail - qualification);
803 index_name[simple_tail - qualification] = '\000';
804 strncat (index_name, suffix, suffix-end);
808 lookup_symbol (index_name, NULL, VAR_DOMAIN, 0, NULL);
809 if (index_sym == NULL)
810 error ("Could not find %s", index_name);
811 write_var_from_sym (NULL, block_found, sym);
813 if (slice_state == SIMPLE_INDEX)
815 write_exp_elt_opcode (OP_FUNCALL);
816 write_exp_elt_longcst ((LONGEST) 1);
817 write_exp_elt_opcode (OP_FUNCALL);
819 else if (slice_state == LOWER_BOUND)
820 slice_state = UPPER_BOUND;
821 else if (slice_state == UPPER_BOUND)
823 write_exp_elt_opcode (TERNOP_SLICE);
824 slice_state = SIMPLE_INDEX;
830 struct stoken field_name;
834 if (slice_state != SIMPLE_INDEX)
836 end = strchr (suffix, 'X');
838 end = suffix + strlen (suffix);
839 field_name.length = end - suffix;
840 field_name.ptr = (char *) malloc (end - suffix + 1);
841 strncpy (field_name.ptr, suffix, end - suffix);
842 field_name.ptr[end - suffix] = '\000';
844 write_exp_elt_opcode (STRUCTOP_STRUCT);
845 write_exp_string (field_name);
846 write_exp_elt_opcode (STRUCTOP_STRUCT);
854 if (slice_state == SIMPLE_INDEX)
858 error ("Internal error in encoding of renaming declaration: %s",
859 SYMBOL_LINKAGE_NAME (renaming));
862 /* Convert the character literal whose ASCII value would be VAL to the
863 appropriate value of type TYPE, if there is a translation.
864 Otherwise return VAL. Hence, in an enumeration type ('A', 'B'),
865 the literal 'A' (VAL == 65), returns 0. */
867 convert_char_literal (struct type *type, LONGEST val)
872 if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM)
874 sprintf (name, "QU%02x", (int) val);
875 for (f = 0; f < TYPE_NFIELDS (type); f += 1)
877 if (strcmp (name, TYPE_FIELD_NAME (type, f)) == 0)
878 return TYPE_FIELD_BITPOS (type, f);
884 _initialize_ada_exp (void)
886 obstack_init (&temp_parse_space);