1 /* YACC grammar for Modula-2 expressions, for GDB.
2 Copyright (C) 1986, 1989, 1990, 1991 Free Software Foundation, Inc.
3 Generated from expread.y (now c-exp.y) and contributed by the Department
4 of Computer Science at the State University of New York at Buffalo, 1991.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
22 /* Parse a Modula-2 expression from text in a string,
23 and return the result as a struct expression pointer.
24 That structure contains arithmetic operations in reverse polish,
25 with constants represented by operations that are followed by special data.
26 See expression.h for the details of the format.
27 What is important here is that it can be built up sequentially
28 during the process of parsing; the lower levels of the tree always
29 come first in the result.
31 Note that malloc's and realloc's in this file are transformed to
32 xmalloc and xrealloc respectively by the same sed command in the
33 makefile that remaps any other malloc/realloc inserted by the parser
34 generator. Doing this with #defines and trying to control the interaction
35 with include files (<malloc.h> and <stdlib.h> for example) just became
36 too messy, particularly when such includes can be inserted at random
37 times by the parser generator. */
42 #include "expression.h"
45 #include "parser-defs.h"
47 #include "bfd.h" /* Required by objfiles.h. */
48 #include "symfile.h" /* Required by objfiles.h. */
49 #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
51 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
52 as well as gratuitiously global symbol names, so we can have multiple
53 yacc generated parsers in gdb. Note that these are only the variables
54 produced by yacc. If other parser generators (bison, byacc, etc) produce
55 additional global names that conflict at link time, then those parser
56 generators need to be fixed instead of adding those names to this list. */
58 #define yymaxdepth m2_maxdepth
59 #define yyparse m2_parse
61 #define yyerror m2_error
62 #define yylval m2_lval
63 #define yychar m2_char
64 #define yydebug m2_debug
65 #define yypact m2_pact
72 #define yyexca m2_exca
73 #define yyerrflag m2_errflag
74 #define yynerrs m2_nerrs
79 #define yystate m2_state
84 #define yylloc m2_lloc
85 #define yyreds m2_reds /* With YYDEBUG defined */
86 #define yytoks m2_toks /* With YYDEBUG defined */
89 #define YYDEBUG 0 /* Default to no yydebug support */
93 yyparse PARAMS ((void));
96 yylex PARAMS ((void));
99 yyerror PARAMS ((char *));
103 make_qualname PARAMS ((char *, char *));
107 parse_number PARAMS ((int));
109 /* The sign of the number being parsed. */
110 static int number_sign = 1;
112 /* The block that the module specified by the qualifer on an identifer is
115 static struct block *modblock=0;
120 /* Although the yacc "value" of an expression is not used,
121 since the result is stored in the structure being created,
122 other node types do have values. */
127 unsigned LONGEST ulval;
134 enum exp_opcode opcode;
135 struct internalvar *ivar;
141 %type <voidval> exp type_exp start set
142 %type <voidval> variable
147 %token <lval> INT HEX ERROR
148 %token <ulval> UINT M2_TRUE M2_FALSE CHAR
151 /* Both NAME and TYPENAME tokens represent symbols in the input,
152 and both convey their data as strings.
153 But a TYPENAME is a string that happens to be defined as a typedef
154 or builtin type name (such as int or char)
155 and a NAME is any other symbol.
157 Contexts where this distinction is not important can use the
158 nonterminal "name", which matches either NAME or TYPENAME. */
161 %token <sval> NAME BLOCKNAME IDENT VARNAME
162 %token <sval> TYPENAME
164 %token SIZE CAP ORD HIGH ABS MIN_FUNC MAX_FUNC FLOAT_FUNC VAL CHR ODD TRUNC
165 %token INC DEC INCL EXCL
167 /* The GDB scope operator */
170 %token <lval> LAST REGNAME
172 %token <ivar> INTERNAL_VAR
178 %left '<' '>' LEQ GEQ '=' NOTEQUAL '#' IN
180 %left LOGICAL_AND '&'
183 %left '*' '/' DIV MOD
185 %right '^' DOT '[' '('
188 /* This is not an actual token ; it is used for precedence.
200 { write_exp_elt_opcode(OP_TYPE);
201 write_exp_elt_type($1);
202 write_exp_elt_opcode(OP_TYPE);
208 exp : exp '^' %prec UNARY
209 { write_exp_elt_opcode (UNOP_IND); }
212 { number_sign = -1; }
215 write_exp_elt_opcode (UNOP_NEG); }
218 exp : '+' exp %prec UNARY
219 { write_exp_elt_opcode(UNOP_PLUS); }
222 exp : not_exp exp %prec UNARY
223 { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
230 exp : CAP '(' exp ')'
231 { write_exp_elt_opcode (UNOP_CAP); }
234 exp : ORD '(' exp ')'
235 { write_exp_elt_opcode (UNOP_ORD); }
238 exp : ABS '(' exp ')'
239 { write_exp_elt_opcode (UNOP_ABS); }
242 exp : HIGH '(' exp ')'
243 { write_exp_elt_opcode (UNOP_HIGH); }
246 exp : MIN_FUNC '(' type ')'
247 { write_exp_elt_opcode (UNOP_MIN);
248 write_exp_elt_type ($3);
249 write_exp_elt_opcode (UNOP_MIN); }
252 exp : MAX_FUNC '(' type ')'
253 { write_exp_elt_opcode (UNOP_MAX);
254 write_exp_elt_type ($3);
255 write_exp_elt_opcode (UNOP_MIN); }
258 exp : FLOAT_FUNC '(' exp ')'
259 { write_exp_elt_opcode (UNOP_FLOAT); }
262 exp : VAL '(' type ',' exp ')'
263 { write_exp_elt_opcode (BINOP_VAL);
264 write_exp_elt_type ($3);
265 write_exp_elt_opcode (BINOP_VAL); }
268 exp : CHR '(' exp ')'
269 { write_exp_elt_opcode (UNOP_CHR); }
272 exp : ODD '(' exp ')'
273 { write_exp_elt_opcode (UNOP_ODD); }
276 exp : TRUNC '(' exp ')'
277 { write_exp_elt_opcode (UNOP_TRUNC); }
280 exp : SIZE exp %prec UNARY
281 { write_exp_elt_opcode (UNOP_SIZEOF); }
285 exp : INC '(' exp ')'
286 { write_exp_elt_opcode(UNOP_PREINCREMENT); }
289 exp : INC '(' exp ',' exp ')'
290 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
291 write_exp_elt_opcode(BINOP_ADD);
292 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
295 exp : DEC '(' exp ')'
296 { write_exp_elt_opcode(UNOP_PREDECREMENT);}
299 exp : DEC '(' exp ',' exp ')'
300 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
301 write_exp_elt_opcode(BINOP_SUB);
302 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
306 { write_exp_elt_opcode (STRUCTOP_STRUCT);
307 write_exp_string ($3);
308 write_exp_elt_opcode (STRUCTOP_STRUCT); }
315 { error("Sets are not implemented.");}
318 exp : INCL '(' exp ',' exp ')'
319 { error("Sets are not implemented.");}
322 exp : EXCL '(' exp ',' exp ')'
323 { error("Sets are not implemented.");}
325 set : '{' arglist '}'
326 { error("Sets are not implemented.");}
327 | type '{' arglist '}'
328 { error("Sets are not implemented.");}
332 /* Modula-2 array subscript notation [a,b,c...] */
334 /* This function just saves the number of arguments
335 that follow in the list. It is *not* specific to
338 non_empty_arglist ']' %prec DOT
339 { write_exp_elt_opcode (MULTI_SUBSCRIPT);
340 write_exp_elt_longcst ((LONGEST) end_arglist());
341 write_exp_elt_opcode (MULTI_SUBSCRIPT); }
345 /* This is to save the value of arglist_len
346 being accumulated by an outer function call. */
347 { start_arglist (); }
348 arglist ')' %prec DOT
349 { write_exp_elt_opcode (OP_FUNCALL);
350 write_exp_elt_longcst ((LONGEST) end_arglist ());
351 write_exp_elt_opcode (OP_FUNCALL); }
361 arglist : arglist ',' exp %prec ABOVE_COMMA
371 : non_empty_arglist ',' exp %prec ABOVE_COMMA
376 exp : '{' type '}' exp %prec UNARY
377 { write_exp_elt_opcode (UNOP_MEMVAL);
378 write_exp_elt_type ($2);
379 write_exp_elt_opcode (UNOP_MEMVAL); }
382 exp : type '(' exp ')' %prec UNARY
383 { write_exp_elt_opcode (UNOP_CAST);
384 write_exp_elt_type ($1);
385 write_exp_elt_opcode (UNOP_CAST); }
392 /* Binary operators in order of decreasing precedence. Note that some
393 of these operators are overloaded! (ie. sets) */
397 { write_exp_elt_opcode (BINOP_REPEAT); }
401 { write_exp_elt_opcode (BINOP_MUL); }
405 { write_exp_elt_opcode (BINOP_DIV); }
409 { write_exp_elt_opcode (BINOP_INTDIV); }
413 { write_exp_elt_opcode (BINOP_REM); }
417 { write_exp_elt_opcode (BINOP_ADD); }
421 { write_exp_elt_opcode (BINOP_SUB); }
425 { write_exp_elt_opcode (BINOP_EQUAL); }
428 exp : exp NOTEQUAL exp
429 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
431 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
435 { write_exp_elt_opcode (BINOP_LEQ); }
439 { write_exp_elt_opcode (BINOP_GEQ); }
443 { write_exp_elt_opcode (BINOP_LESS); }
447 { write_exp_elt_opcode (BINOP_GTR); }
450 exp : exp LOGICAL_AND exp
451 { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
455 { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
459 { write_exp_elt_opcode (BINOP_ASSIGN); }
466 { write_exp_elt_opcode (OP_BOOL);
467 write_exp_elt_longcst ((LONGEST) $1);
468 write_exp_elt_opcode (OP_BOOL); }
472 { write_exp_elt_opcode (OP_BOOL);
473 write_exp_elt_longcst ((LONGEST) $1);
474 write_exp_elt_opcode (OP_BOOL); }
478 { write_exp_elt_opcode (OP_LONG);
479 write_exp_elt_type (builtin_type_m2_int);
480 write_exp_elt_longcst ((LONGEST) $1);
481 write_exp_elt_opcode (OP_LONG); }
486 write_exp_elt_opcode (OP_LONG);
487 write_exp_elt_type (builtin_type_m2_card);
488 write_exp_elt_longcst ((LONGEST) $1);
489 write_exp_elt_opcode (OP_LONG);
494 { write_exp_elt_opcode (OP_LONG);
495 write_exp_elt_type (builtin_type_m2_char);
496 write_exp_elt_longcst ((LONGEST) $1);
497 write_exp_elt_opcode (OP_LONG); }
502 { write_exp_elt_opcode (OP_DOUBLE);
503 write_exp_elt_type (builtin_type_m2_real);
504 write_exp_elt_dblcst ($1);
505 write_exp_elt_opcode (OP_DOUBLE); }
511 /* The GDB internal variable $$, et al. */
513 { write_exp_elt_opcode (OP_LAST);
514 write_exp_elt_longcst ((LONGEST) $1);
515 write_exp_elt_opcode (OP_LAST); }
519 { write_exp_elt_opcode (OP_REGISTER);
520 write_exp_elt_longcst ((LONGEST) $1);
521 write_exp_elt_opcode (OP_REGISTER); }
524 exp : SIZE '(' type ')' %prec UNARY
525 { write_exp_elt_opcode (OP_LONG);
526 write_exp_elt_type (builtin_type_int);
527 write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
528 write_exp_elt_opcode (OP_LONG); }
532 { write_exp_elt_opcode (OP_M2_STRING);
533 write_exp_string ($1);
534 write_exp_elt_opcode (OP_M2_STRING); }
537 /* This will be used for extensions later. Like adding modules. */
539 { $$ = SYMBOL_BLOCK_VALUE($1); }
544 = lookup_symbol (copy_name ($1), expression_context_block,
545 VAR_NAMESPACE, 0, NULL);
550 /* GDB scope operator */
551 fblock : block COLONCOLON BLOCKNAME
553 = lookup_symbol (copy_name ($3), $1,
554 VAR_NAMESPACE, 0, NULL);
555 if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
556 error ("No function \"%s\" in specified context.",
562 /* Useful for assigning to PROCEDURE variables */
564 { write_exp_elt_opcode(OP_VAR_VALUE);
565 write_exp_elt_block (NULL);
566 write_exp_elt_sym ($1);
567 write_exp_elt_opcode (OP_VAR_VALUE); }
570 /* GDB internal ($foo) variable */
571 variable: INTERNAL_VAR
572 { write_exp_elt_opcode (OP_INTERNALVAR);
573 write_exp_elt_intern ($1);
574 write_exp_elt_opcode (OP_INTERNALVAR); }
577 /* GDB scope operator */
578 variable: block COLONCOLON NAME
579 { struct symbol *sym;
580 sym = lookup_symbol (copy_name ($3), $1,
581 VAR_NAMESPACE, 0, NULL);
583 error ("No symbol \"%s\" in specified context.",
586 write_exp_elt_opcode (OP_VAR_VALUE);
587 /* block_found is set by lookup_symbol. */
588 write_exp_elt_block (block_found);
589 write_exp_elt_sym (sym);
590 write_exp_elt_opcode (OP_VAR_VALUE); }
593 /* Base case for variables. */
595 { struct symbol *sym;
596 int is_a_field_of_this;
598 sym = lookup_symbol (copy_name ($1),
599 expression_context_block,
605 if (symbol_read_needs_frame (sym))
607 if (innermost_block == 0 ||
608 contained_in (block_found,
610 innermost_block = block_found;
613 write_exp_elt_opcode (OP_VAR_VALUE);
614 /* We want to use the selected frame, not
615 another more inner frame which happens to
616 be in the same block. */
617 write_exp_elt_block (NULL);
618 write_exp_elt_sym (sym);
619 write_exp_elt_opcode (OP_VAR_VALUE);
623 struct minimal_symbol *msymbol;
624 register char *arg = copy_name ($1);
626 msymbol = lookup_minimal_symbol (arg,
627 (struct objfile *) NULL);
630 write_exp_elt_opcode (OP_LONG);
631 write_exp_elt_type (builtin_type_long);
632 write_exp_elt_longcst ((LONGEST) SYMBOL_VALUE_ADDRESS (msymbol));
633 write_exp_elt_opcode (OP_LONG);
634 write_exp_elt_opcode (UNOP_MEMVAL);
635 if (msymbol -> type == mst_data ||
636 msymbol -> type == mst_bss)
637 write_exp_elt_type (builtin_type_int);
638 else if (msymbol -> type == mst_text)
639 write_exp_elt_type (lookup_function_type (builtin_type_int));
641 write_exp_elt_type (builtin_type_char);
642 write_exp_elt_opcode (UNOP_MEMVAL);
644 else if (!have_full_symbols () && !have_partial_symbols ())
645 error ("No symbol table is loaded. Use the \"symbol-file\" command.");
647 error ("No symbol \"%s\" in current context.",
655 { $$ = lookup_typename (copy_name ($1),
656 expression_context_block, 0); }
667 return (MAX_OF_TYPE(builtin_type_m2_int) - b) < a;
674 return (MAX_OF_TYPE(builtin_type_m2_card) - b) < a;
678 /* Take care of parsing a number (anything that starts with a digit).
679 Set yylval and return the token type; update lexptr.
680 LEN is the number of characters in it. */
682 /*** Needs some error checking for the float case ***/
688 register char *p = lexptr;
689 register LONGEST n = 0;
690 register LONGEST prevn = 0;
691 register int c,i,ischar=0;
692 register int base = input_radix;
693 register int len = olen;
694 int unsigned_p = number_sign == 1 ? 1 : 0;
701 else if(p[len-1] == 'C' || p[len-1] == 'B')
704 ischar = p[len-1] == 'C';
708 /* Scan the number */
709 for (c = 0; c < len; c++)
711 if (p[c] == '.' && base == 10)
713 /* It's a float since it contains a point. */
714 yylval.dval = atof (p);
718 if (p[c] == '.' && base != 10)
719 error("Floating point numbers must be base 10.");
720 if (base == 10 && (p[c] < '0' || p[c] > '9'))
721 error("Invalid digit \'%c\' in number.",p[c]);
728 if( base == 8 && (c == '8' || c == '9'))
729 error("Invalid digit \'%c\' in octal number.",c);
730 if (c >= '0' && c <= '9')
734 if (base == 16 && c >= 'A' && c <= 'F')
742 if(!unsigned_p && number_sign == 1 && (prevn >= n))
743 unsigned_p=1; /* Try something unsigned */
744 /* Don't do the range check if n==i and i==0, since that special
745 case will give an overflow error. */
746 if(RANGE_CHECK && n!=i && i)
748 if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
749 ((!unsigned_p && number_sign==-1) && -prevn <= -n))
750 range_error("Overflow on numeric constant.");
756 if(*p == 'B' || *p == 'C' || *p == 'H')
757 lexptr++; /* Advance past B,C or H */
764 else if ( unsigned_p && number_sign == 1)
769 else if((unsigned_p && (n<0))) {
770 range_error("Overflow on numeric constant -- number too large.");
771 /* But, this can return if range_check == range_warn. */
786 { {'<', '>'}, NOTEQUAL },
787 { {':', '='}, ASSIGN },
790 { {':', ':'}, COLONCOLON },
794 /* Some specific keywords */
801 static struct keyword keytab[] =
804 {"IN", IN },/* Note space after IN */
805 {"AND", LOGICAL_AND},
823 {"FLOAT", FLOAT_FUNC },
828 /* Read one token, getting characters through lexptr. */
830 /* This is where we will check to make sure that the language and the operators used are
837 register int namelen;
839 register char *tokstart;
847 /* See if it is a special token of length 2 */
848 for( i = 0 ; i < sizeof tokentab2 / sizeof tokentab2[0] ; i++)
849 if(STREQN(tokentab2[i].name, tokstart, 2))
852 return tokentab2[i].token;
855 switch (c = *tokstart)
872 if (paren_depth == 0)
879 if (comma_terminates && paren_depth == 0)
885 /* Might be a floating point number. */
886 if (lexptr[1] >= '0' && lexptr[1] <= '9')
887 break; /* Falls into number code. */
894 /* These are character tokens that appear as-is in the YACC grammar */
917 for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
920 c = tokstart[++namelen];
921 if (c >= '0' && c <= '9')
923 c = tokstart[++namelen];
924 if (c >= '0' && c <= '9')
925 c = tokstart[++namelen];
929 error("Unterminated string or character constant.");
930 yylval.sval.ptr = tokstart + 1;
931 yylval.sval.length = namelen - 1;
932 lexptr += namelen + 1;
934 if(namelen == 2) /* Single character */
936 yylval.ulval = tokstart[1];
943 /* Is it a number? */
944 /* Note: We have already dealt with the case of the token '.'.
945 See case '.' above. */
946 if ((c >= '0' && c <= '9'))
949 int got_dot = 0, got_e = 0;
950 register char *p = tokstart;
955 if (!got_e && (*p == 'e' || *p == 'E'))
957 else if (!got_dot && *p == '.')
959 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
960 && (*p == '-' || *p == '+'))
961 /* This is the sign of the exponent, not the end of the
964 else if ((*p < '0' || *p > '9') &&
965 (*p < 'A' || *p > 'F') &&
966 (*p != 'H')) /* Modula-2 hexadecimal number */
969 toktype = parse_number (p - tokstart);
970 if (toktype == ERROR)
972 char *err_copy = (char *) alloca (p - tokstart + 1);
974 memcpy (err_copy, tokstart, p - tokstart);
975 err_copy[p - tokstart] = 0;
976 error ("Invalid number \"%s\".", err_copy);
982 if (!(c == '_' || c == '$'
983 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
984 /* We must have come across a bad character (e.g. ';'). */
985 error ("Invalid character '%c' in expression.", c);
987 /* It's a name. See how long it is. */
989 for (c = tokstart[namelen];
990 (c == '_' || c == '$' || (c >= '0' && c <= '9')
991 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
992 c = tokstart[++namelen])
995 /* The token "if" terminates the expression and is NOT
996 removed from the input stream. */
997 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
1004 /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
1005 and $$digits (equivalent to $<-digits> if you could type that).
1006 Make token type LAST, and put the number (the digits) in yylval. */
1008 if (*tokstart == '$')
1010 register int negate = 0;
1012 /* Double dollar means negate the number and add -1 as well.
1013 Thus $$ alone means -1. */
1014 if (namelen >= 2 && tokstart[1] == '$')
1021 /* Just dollars (one or two) */
1022 yylval.lval = - negate;
1025 /* Is the rest of the token digits? */
1026 for (; c < namelen; c++)
1027 if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
1031 yylval.lval = atoi (tokstart + 1 + negate);
1033 yylval.lval = - yylval.lval;
1038 /* Handle tokens that refer to machine registers:
1039 $ followed by a register name. */
1041 if (*tokstart == '$') {
1042 for (c = 0; c < NUM_REGS; c++)
1043 if (namelen - 1 == strlen (reg_names[c])
1044 && STREQN (tokstart + 1, reg_names[c], namelen - 1))
1049 for (c = 0; c < num_std_regs; c++)
1050 if (namelen - 1 == strlen (std_regs[c].name)
1051 && STREQN (tokstart + 1, std_regs[c].name, namelen - 1))
1053 yylval.lval = std_regs[c].regnum;
1059 /* Lookup special keywords */
1060 for(i = 0 ; i < sizeof(keytab) / sizeof(keytab[0]) ; i++)
1061 if(namelen == strlen(keytab[i].keyw) && STREQN(tokstart,keytab[i].keyw,namelen))
1062 return keytab[i].token;
1064 yylval.sval.ptr = tokstart;
1065 yylval.sval.length = namelen;
1067 /* Any other names starting in $ are debugger internal variables. */
1069 if (*tokstart == '$')
1071 yylval.ivar = (struct internalvar *) lookup_internalvar (copy_name (yylval.sval) + 1);
1072 return INTERNAL_VAR;
1076 /* Use token-type BLOCKNAME for symbols that happen to be defined as
1077 functions. If this is not so, then ...
1078 Use token-type TYPENAME for symbols that happen to be defined
1079 currently as names of types; NAME for other symbols.
1080 The caller is not constrained to care about the distinction. */
1084 char *tmp = copy_name (yylval.sval);
1087 if (lookup_partial_symtab (tmp))
1089 sym = lookup_symbol (tmp, expression_context_block,
1090 VAR_NAMESPACE, 0, NULL);
1091 if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
1093 if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))
1105 case LOC_REGPARM_ADDR:
1109 case LOC_BASEREG_ARG:
1111 case LOC_CONST_BYTES:
1112 case LOC_OPTIMIZED_OUT:
1122 error("internal: Undefined class in m2lex()");
1125 error("internal: Unforseen case in m2lex()");
1130 /* Built-in BOOLEAN type. This is sort of a hack. */
1131 if(STREQN(tokstart,"TRUE",4))
1136 else if(STREQN(tokstart,"FALSE",5))
1143 /* Must be another type of name... */
1150 make_qualname(mod,ident)
1153 char *new = malloc(strlen(mod)+strlen(ident)+2);
1164 char *msg; /* unused */
1166 printf("Parsing: %s\n",lexptr);
1168 error("Invalid syntax in expression near character '%c'.",yychar);
1170 error("Invalid syntax in expression");