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"
48 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
49 as well as gratuitiously global symbol names, so we can have multiple
50 yacc generated parsers in gdb. Note that these are only the variables
51 produced by yacc. If other parser generators (bison, byacc, etc) produce
52 additional global names that conflict at link time, then those parser
53 generators need to be fixed instead of adding those names to this list. */
55 #define yymaxdepth m2_maxdepth
56 #define yyparse m2_parse
58 #define yyerror m2_error
59 #define yylval m2_lval
60 #define yychar m2_char
61 #define yycheck m2_yycheck
62 #define yydebug m2_debug
63 #define yydefred m2_yydefred
64 #define yydgoto m2_yydgoto
65 #define yygindex m2_yygindex
66 #define yylen m2_yylen
67 #define yylhs m2_yylhs
68 #define yyrindex m2_yyrindex
69 #define yysccsid m2_yysccsid
70 #define yysindex m2_yysindex
71 #define yypact m2_pact
78 #define yyexca m2_exca
79 #define yyerrflag m2_errflag
80 #define yynerrs m2_nerrs
85 #define yyssp m2_yyssp
87 #define yystate m2_state
88 #define yytable m2_yytable
95 #define yylloc m2_lloc
96 #define yyreds m2_reds /* With YYDEBUG defined */
97 #define yytoks m2_toks /* With YYDEBUG defined */
100 #define YYDEBUG 0 /* Default to no yydebug support */
104 yyparse PARAMS ((void));
107 yylex PARAMS ((void));
110 yyerror PARAMS ((char *));
114 make_qualname PARAMS ((char *, char *));
118 parse_number PARAMS ((int));
120 /* The sign of the number being parsed. */
121 static int number_sign = 1;
123 /* The block that the module specified by the qualifer on an identifer is
126 static struct block *modblock=0;
131 /* Although the yacc "value" of an expression is not used,
132 since the result is stored in the structure being created,
133 other node types do have values. */
138 unsigned LONGEST ulval;
145 enum exp_opcode opcode;
146 struct internalvar *ivar;
152 %type <voidval> exp type_exp start set
153 %type <voidval> variable
158 %token <lval> INT HEX ERROR
159 %token <ulval> UINT M2_TRUE M2_FALSE CHAR
162 /* Both NAME and TYPENAME tokens represent symbols in the input,
163 and both convey their data as strings.
164 But a TYPENAME is a string that happens to be defined as a typedef
165 or builtin type name (such as int or char)
166 and a NAME is any other symbol.
168 Contexts where this distinction is not important can use the
169 nonterminal "name", which matches either NAME or TYPENAME. */
172 %token <sval> NAME BLOCKNAME IDENT VARNAME
173 %token <sval> TYPENAME
175 %token SIZE CAP ORD HIGH ABS MIN_FUNC MAX_FUNC FLOAT_FUNC VAL CHR ODD TRUNC
176 %token INC DEC INCL EXCL
178 /* The GDB scope operator */
181 %token <lval> LAST REGNAME
183 %token <ivar> INTERNAL_VAR
189 %left '<' '>' LEQ GEQ '=' NOTEQUAL '#' IN
191 %left LOGICAL_AND '&'
194 %left '*' '/' DIV MOD
196 %right '^' DOT '[' '('
199 /* This is not an actual token ; it is used for precedence.
211 { write_exp_elt_opcode(OP_TYPE);
212 write_exp_elt_type($1);
213 write_exp_elt_opcode(OP_TYPE);
219 exp : exp '^' %prec UNARY
220 { write_exp_elt_opcode (UNOP_IND); }
223 { number_sign = -1; }
226 write_exp_elt_opcode (UNOP_NEG); }
229 exp : '+' exp %prec UNARY
230 { write_exp_elt_opcode(UNOP_PLUS); }
233 exp : not_exp exp %prec UNARY
234 { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
241 exp : CAP '(' exp ')'
242 { write_exp_elt_opcode (UNOP_CAP); }
245 exp : ORD '(' exp ')'
246 { write_exp_elt_opcode (UNOP_ORD); }
249 exp : ABS '(' exp ')'
250 { write_exp_elt_opcode (UNOP_ABS); }
253 exp : HIGH '(' exp ')'
254 { write_exp_elt_opcode (UNOP_HIGH); }
257 exp : MIN_FUNC '(' type ')'
258 { write_exp_elt_opcode (UNOP_MIN);
259 write_exp_elt_type ($3);
260 write_exp_elt_opcode (UNOP_MIN); }
263 exp : MAX_FUNC '(' type ')'
264 { write_exp_elt_opcode (UNOP_MAX);
265 write_exp_elt_type ($3);
266 write_exp_elt_opcode (UNOP_MIN); }
269 exp : FLOAT_FUNC '(' exp ')'
270 { write_exp_elt_opcode (UNOP_FLOAT); }
273 exp : VAL '(' type ',' exp ')'
274 { write_exp_elt_opcode (BINOP_VAL);
275 write_exp_elt_type ($3);
276 write_exp_elt_opcode (BINOP_VAL); }
279 exp : CHR '(' exp ')'
280 { write_exp_elt_opcode (UNOP_CHR); }
283 exp : ODD '(' exp ')'
284 { write_exp_elt_opcode (UNOP_ODD); }
287 exp : TRUNC '(' exp ')'
288 { write_exp_elt_opcode (UNOP_TRUNC); }
291 exp : SIZE exp %prec UNARY
292 { write_exp_elt_opcode (UNOP_SIZEOF); }
296 exp : INC '(' exp ')'
297 { write_exp_elt_opcode(UNOP_PREINCREMENT); }
300 exp : INC '(' exp ',' exp ')'
301 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
302 write_exp_elt_opcode(BINOP_ADD);
303 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
306 exp : DEC '(' exp ')'
307 { write_exp_elt_opcode(UNOP_PREDECREMENT);}
310 exp : DEC '(' exp ',' exp ')'
311 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
312 write_exp_elt_opcode(BINOP_SUB);
313 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
317 { write_exp_elt_opcode (STRUCTOP_STRUCT);
318 write_exp_string ($3);
319 write_exp_elt_opcode (STRUCTOP_STRUCT); }
326 { error("Sets are not implemented.");}
329 exp : INCL '(' exp ',' exp ')'
330 { error("Sets are not implemented.");}
333 exp : EXCL '(' exp ',' exp ')'
334 { error("Sets are not implemented.");}
336 set : '{' arglist '}'
337 { error("Sets are not implemented.");}
338 | type '{' arglist '}'
339 { error("Sets are not implemented.");}
343 /* Modula-2 array subscript notation [a,b,c...] */
345 /* This function just saves the number of arguments
346 that follow in the list. It is *not* specific to
349 non_empty_arglist ']' %prec DOT
350 { write_exp_elt_opcode (MULTI_SUBSCRIPT);
351 write_exp_elt_longcst ((LONGEST) end_arglist());
352 write_exp_elt_opcode (MULTI_SUBSCRIPT); }
356 /* This is to save the value of arglist_len
357 being accumulated by an outer function call. */
358 { start_arglist (); }
359 arglist ')' %prec DOT
360 { write_exp_elt_opcode (OP_FUNCALL);
361 write_exp_elt_longcst ((LONGEST) end_arglist ());
362 write_exp_elt_opcode (OP_FUNCALL); }
372 arglist : arglist ',' exp %prec ABOVE_COMMA
382 : non_empty_arglist ',' exp %prec ABOVE_COMMA
387 exp : '{' type '}' exp %prec UNARY
388 { write_exp_elt_opcode (UNOP_MEMVAL);
389 write_exp_elt_type ($2);
390 write_exp_elt_opcode (UNOP_MEMVAL); }
393 exp : type '(' exp ')' %prec UNARY
394 { write_exp_elt_opcode (UNOP_CAST);
395 write_exp_elt_type ($1);
396 write_exp_elt_opcode (UNOP_CAST); }
403 /* Binary operators in order of decreasing precedence. Note that some
404 of these operators are overloaded! (ie. sets) */
408 { write_exp_elt_opcode (BINOP_REPEAT); }
412 { write_exp_elt_opcode (BINOP_MUL); }
416 { write_exp_elt_opcode (BINOP_DIV); }
420 { write_exp_elt_opcode (BINOP_INTDIV); }
424 { write_exp_elt_opcode (BINOP_REM); }
428 { write_exp_elt_opcode (BINOP_ADD); }
432 { write_exp_elt_opcode (BINOP_SUB); }
436 { write_exp_elt_opcode (BINOP_EQUAL); }
439 exp : exp NOTEQUAL exp
440 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
442 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
446 { write_exp_elt_opcode (BINOP_LEQ); }
450 { write_exp_elt_opcode (BINOP_GEQ); }
454 { write_exp_elt_opcode (BINOP_LESS); }
458 { write_exp_elt_opcode (BINOP_GTR); }
461 exp : exp LOGICAL_AND exp
462 { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
466 { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
470 { write_exp_elt_opcode (BINOP_ASSIGN); }
477 { write_exp_elt_opcode (OP_BOOL);
478 write_exp_elt_longcst ((LONGEST) $1);
479 write_exp_elt_opcode (OP_BOOL); }
483 { write_exp_elt_opcode (OP_BOOL);
484 write_exp_elt_longcst ((LONGEST) $1);
485 write_exp_elt_opcode (OP_BOOL); }
489 { write_exp_elt_opcode (OP_LONG);
490 write_exp_elt_type (builtin_type_m2_int);
491 write_exp_elt_longcst ((LONGEST) $1);
492 write_exp_elt_opcode (OP_LONG); }
497 write_exp_elt_opcode (OP_LONG);
498 write_exp_elt_type (builtin_type_m2_card);
499 write_exp_elt_longcst ((LONGEST) $1);
500 write_exp_elt_opcode (OP_LONG);
505 { write_exp_elt_opcode (OP_LONG);
506 write_exp_elt_type (builtin_type_m2_char);
507 write_exp_elt_longcst ((LONGEST) $1);
508 write_exp_elt_opcode (OP_LONG); }
513 { write_exp_elt_opcode (OP_DOUBLE);
514 write_exp_elt_type (builtin_type_m2_real);
515 write_exp_elt_dblcst ($1);
516 write_exp_elt_opcode (OP_DOUBLE); }
522 /* The GDB internal variable $$, et al. */
524 { write_exp_elt_opcode (OP_LAST);
525 write_exp_elt_longcst ((LONGEST) $1);
526 write_exp_elt_opcode (OP_LAST); }
530 { write_exp_elt_opcode (OP_REGISTER);
531 write_exp_elt_longcst ((LONGEST) $1);
532 write_exp_elt_opcode (OP_REGISTER); }
535 exp : SIZE '(' type ')' %prec UNARY
536 { write_exp_elt_opcode (OP_LONG);
537 write_exp_elt_type (builtin_type_int);
538 write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
539 write_exp_elt_opcode (OP_LONG); }
543 { write_exp_elt_opcode (OP_M2_STRING);
544 write_exp_string ($1);
545 write_exp_elt_opcode (OP_M2_STRING); }
548 /* This will be used for extensions later. Like adding modules. */
550 { $$ = SYMBOL_BLOCK_VALUE($1); }
555 = lookup_symbol (copy_name ($1), expression_context_block,
556 VAR_NAMESPACE, 0, NULL);
561 /* GDB scope operator */
562 fblock : block COLONCOLON BLOCKNAME
564 = lookup_symbol (copy_name ($3), $1,
565 VAR_NAMESPACE, 0, NULL);
566 if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
567 error ("No function \"%s\" in specified context.",
573 /* Useful for assigning to PROCEDURE variables */
575 { write_exp_elt_opcode(OP_VAR_VALUE);
576 write_exp_elt_sym ($1);
577 write_exp_elt_opcode (OP_VAR_VALUE); }
580 /* GDB internal ($foo) variable */
581 variable: INTERNAL_VAR
582 { write_exp_elt_opcode (OP_INTERNALVAR);
583 write_exp_elt_intern ($1);
584 write_exp_elt_opcode (OP_INTERNALVAR); }
587 /* GDB scope operator */
588 variable: block COLONCOLON NAME
589 { struct symbol *sym;
590 sym = lookup_symbol (copy_name ($3), $1,
591 VAR_NAMESPACE, 0, NULL);
593 error ("No symbol \"%s\" in specified context.",
596 write_exp_elt_opcode (OP_VAR_VALUE);
597 write_exp_elt_sym (sym);
598 write_exp_elt_opcode (OP_VAR_VALUE); }
601 /* Base case for variables. */
603 { struct symbol *sym;
604 int is_a_field_of_this;
606 sym = lookup_symbol (copy_name ($1),
607 expression_context_block,
621 if (innermost_block == 0 ||
622 contained_in (block_found,
624 innermost_block = block_found;
631 case LOC_LABEL: /* maybe should go above? */
633 case LOC_CONST_BYTES:
634 case LOC_OPTIMIZED_OUT:
635 /* These are listed so gcc -Wall will reveal
639 write_exp_elt_opcode (OP_VAR_VALUE);
640 write_exp_elt_sym (sym);
641 write_exp_elt_opcode (OP_VAR_VALUE);
645 struct minimal_symbol *msymbol;
646 register char *arg = copy_name ($1);
648 msymbol = lookup_minimal_symbol (arg,
649 (struct objfile *) NULL);
652 write_exp_elt_opcode (OP_LONG);
653 write_exp_elt_type (builtin_type_int);
654 write_exp_elt_longcst ((LONGEST) SYMBOL_VALUE_ADDRESS (msymbol));
655 write_exp_elt_opcode (OP_LONG);
656 write_exp_elt_opcode (UNOP_MEMVAL);
657 if (msymbol -> type == mst_data ||
658 msymbol -> type == mst_bss)
659 write_exp_elt_type (builtin_type_int);
660 else if (msymbol -> type == mst_text)
661 write_exp_elt_type (lookup_function_type (builtin_type_int));
663 write_exp_elt_type (builtin_type_char);
664 write_exp_elt_opcode (UNOP_MEMVAL);
666 else if (!have_full_symbols () && !have_partial_symbols ())
667 error ("No symbol table is loaded. Use the \"symbol-file\" command.");
669 error ("No symbol \"%s\" in current context.",
677 { $$ = lookup_typename (copy_name ($1),
678 expression_context_block, 0); }
689 return (MAX_OF_TYPE(builtin_type_m2_int) - b) < a;
696 return (MAX_OF_TYPE(builtin_type_m2_card) - b) < a;
700 /* Take care of parsing a number (anything that starts with a digit).
701 Set yylval and return the token type; update lexptr.
702 LEN is the number of characters in it. */
704 /*** Needs some error checking for the float case ***/
710 register char *p = lexptr;
711 register LONGEST n = 0;
712 register LONGEST prevn = 0;
713 register int c,i,ischar=0;
714 register int base = input_radix;
715 register int len = olen;
716 int unsigned_p = number_sign == 1 ? 1 : 0;
723 else if(p[len-1] == 'C' || p[len-1] == 'B')
726 ischar = p[len-1] == 'C';
730 /* Scan the number */
731 for (c = 0; c < len; c++)
733 if (p[c] == '.' && base == 10)
735 /* It's a float since it contains a point. */
736 yylval.dval = atof (p);
740 if (p[c] == '.' && base != 10)
741 error("Floating point numbers must be base 10.");
742 if (base == 10 && (p[c] < '0' || p[c] > '9'))
743 error("Invalid digit \'%c\' in number.",p[c]);
750 if( base == 8 && (c == '8' || c == '9'))
751 error("Invalid digit \'%c\' in octal number.",c);
752 if (c >= '0' && c <= '9')
756 if (base == 16 && c >= 'A' && c <= 'F')
764 if(!unsigned_p && number_sign == 1 && (prevn >= n))
765 unsigned_p=1; /* Try something unsigned */
766 /* Don't do the range check if n==i and i==0, since that special
767 case will give an overflow error. */
768 if(RANGE_CHECK && n!=i && i)
770 if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
771 ((!unsigned_p && number_sign==-1) && -prevn <= -n))
772 range_error("Overflow on numeric constant.");
778 if(*p == 'B' || *p == 'C' || *p == 'H')
779 lexptr++; /* Advance past B,C or H */
786 else if ( unsigned_p && number_sign == 1)
791 else if((unsigned_p && (n<0))) {
792 range_error("Overflow on numeric constant -- number too large.");
793 /* But, this can return if range_check == range_warn. */
808 { {'<', '>'}, NOTEQUAL },
809 { {':', '='}, ASSIGN },
812 { {':', ':'}, COLONCOLON },
816 /* Some specific keywords */
823 static struct keyword keytab[] =
826 {"IN", IN },/* Note space after IN */
827 {"AND", LOGICAL_AND},
845 {"FLOAT", FLOAT_FUNC },
850 /* Read one token, getting characters through lexptr. */
852 /* This is where we will check to make sure that the language and the operators used are
859 register int namelen;
861 register char *tokstart;
869 /* See if it is a special token of length 2 */
870 for( i = 0 ; i < sizeof tokentab2 / sizeof tokentab2[0] ; i++)
871 if(STREQN(tokentab2[i].name, tokstart, 2))
874 return tokentab2[i].token;
877 switch (c = *tokstart)
894 if (paren_depth == 0)
901 if (comma_terminates && paren_depth == 0)
907 /* Might be a floating point number. */
908 if (lexptr[1] >= '0' && lexptr[1] <= '9')
909 break; /* Falls into number code. */
916 /* These are character tokens that appear as-is in the YACC grammar */
939 for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
942 c = tokstart[++namelen];
943 if (c >= '0' && c <= '9')
945 c = tokstart[++namelen];
946 if (c >= '0' && c <= '9')
947 c = tokstart[++namelen];
951 error("Unterminated string or character constant.");
952 yylval.sval.ptr = tokstart + 1;
953 yylval.sval.length = namelen - 1;
954 lexptr += namelen + 1;
956 if(namelen == 2) /* Single character */
958 yylval.ulval = tokstart[1];
965 /* Is it a number? */
966 /* Note: We have already dealt with the case of the token '.'.
967 See case '.' above. */
968 if ((c >= '0' && c <= '9'))
971 int got_dot = 0, got_e = 0;
972 register char *p = tokstart;
977 if (!got_e && (*p == 'e' || *p == 'E'))
979 else if (!got_dot && *p == '.')
981 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
982 && (*p == '-' || *p == '+'))
983 /* This is the sign of the exponent, not the end of the
986 else if ((*p < '0' || *p > '9') &&
987 (*p < 'A' || *p > 'F') &&
988 (*p != 'H')) /* Modula-2 hexadecimal number */
991 toktype = parse_number (p - tokstart);
992 if (toktype == ERROR)
994 char *err_copy = (char *) alloca (p - tokstart + 1);
996 memcpy (err_copy, tokstart, p - tokstart);
997 err_copy[p - tokstart] = 0;
998 error ("Invalid number \"%s\".", err_copy);
1004 if (!(c == '_' || c == '$'
1005 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
1006 /* We must have come across a bad character (e.g. ';'). */
1007 error ("Invalid character '%c' in expression.", c);
1009 /* It's a name. See how long it is. */
1011 for (c = tokstart[namelen];
1012 (c == '_' || c == '$' || (c >= '0' && c <= '9')
1013 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
1014 c = tokstart[++namelen])
1017 /* The token "if" terminates the expression and is NOT
1018 removed from the input stream. */
1019 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
1026 /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
1027 and $$digits (equivalent to $<-digits> if you could type that).
1028 Make token type LAST, and put the number (the digits) in yylval. */
1030 if (*tokstart == '$')
1032 register int negate = 0;
1034 /* Double dollar means negate the number and add -1 as well.
1035 Thus $$ alone means -1. */
1036 if (namelen >= 2 && tokstart[1] == '$')
1043 /* Just dollars (one or two) */
1044 yylval.lval = - negate;
1047 /* Is the rest of the token digits? */
1048 for (; c < namelen; c++)
1049 if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
1053 yylval.lval = atoi (tokstart + 1 + negate);
1055 yylval.lval = - yylval.lval;
1060 /* Handle tokens that refer to machine registers:
1061 $ followed by a register name. */
1063 if (*tokstart == '$') {
1064 for (c = 0; c < NUM_REGS; c++)
1065 if (namelen - 1 == strlen (reg_names[c])
1066 && STREQN (tokstart + 1, reg_names[c], namelen - 1))
1071 for (c = 0; c < num_std_regs; c++)
1072 if (namelen - 1 == strlen (std_regs[c].name)
1073 && STREQN (tokstart + 1, std_regs[c].name, namelen - 1))
1075 yylval.lval = std_regs[c].regnum;
1081 /* Lookup special keywords */
1082 for(i = 0 ; i < sizeof(keytab) / sizeof(keytab[0]) ; i++)
1083 if(namelen == strlen(keytab[i].keyw) && STREQN(tokstart,keytab[i].keyw,namelen))
1084 return keytab[i].token;
1086 yylval.sval.ptr = tokstart;
1087 yylval.sval.length = namelen;
1089 /* Any other names starting in $ are debugger internal variables. */
1091 if (*tokstart == '$')
1093 yylval.ivar = (struct internalvar *) lookup_internalvar (copy_name (yylval.sval) + 1);
1094 return INTERNAL_VAR;
1098 /* Use token-type BLOCKNAME for symbols that happen to be defined as
1099 functions. If this is not so, then ...
1100 Use token-type TYPENAME for symbols that happen to be defined
1101 currently as names of types; NAME for other symbols.
1102 The caller is not constrained to care about the distinction. */
1106 char *tmp = copy_name (yylval.sval);
1109 if (lookup_partial_symtab (tmp))
1111 sym = lookup_symbol (tmp, expression_context_block,
1112 VAR_NAMESPACE, 0, NULL);
1113 if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
1115 if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))
1130 case LOC_CONST_BYTES:
1140 error("internal: Undefined class in m2lex()");
1143 error("internal: Unforseen case in m2lex()");
1148 /* Built-in BOOLEAN type. This is sort of a hack. */
1149 if(STREQN(tokstart,"TRUE",4))
1154 else if(STREQN(tokstart,"FALSE",5))
1161 /* Must be another type of name... */
1168 make_qualname(mod,ident)
1171 char *new = malloc(strlen(mod)+strlen(ident)+2);
1182 char *msg; /* unused */
1184 printf("Parsing: %s\n",lexptr);
1186 error("Invalid syntax in expression near character '%c'.",yychar);
1188 error("Invalid syntax in expression");