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 yydebug m2_debug
62 #define yypact m2_pact
69 #define yyexca m2_exca
70 #define yyerrflag m2_errflag
71 #define yynerrs m2_nerrs
76 #define yystate m2_state
81 #define yylloc m2_lloc
82 #define yyreds m2_reds /* With YYDEBUG defined */
83 #define yytoks m2_toks /* With YYDEBUG defined */
86 #define YYDEBUG 0 /* Default to no yydebug support */
90 yyparse PARAMS ((void));
93 yylex PARAMS ((void));
96 yyerror PARAMS ((char *));
100 make_qualname PARAMS ((char *, char *));
104 parse_number PARAMS ((int));
106 /* The sign of the number being parsed. */
107 static int number_sign = 1;
109 /* The block that the module specified by the qualifer on an identifer is
112 static struct block *modblock=0;
117 /* Although the yacc "value" of an expression is not used,
118 since the result is stored in the structure being created,
119 other node types do have values. */
124 unsigned LONGEST ulval;
131 enum exp_opcode opcode;
132 struct internalvar *ivar;
138 %type <voidval> exp type_exp start set
139 %type <voidval> variable
144 %token <lval> INT HEX ERROR
145 %token <ulval> UINT M2_TRUE M2_FALSE CHAR
148 /* Both NAME and TYPENAME tokens represent symbols in the input,
149 and both convey their data as strings.
150 But a TYPENAME is a string that happens to be defined as a typedef
151 or builtin type name (such as int or char)
152 and a NAME is any other symbol.
154 Contexts where this distinction is not important can use the
155 nonterminal "name", which matches either NAME or TYPENAME. */
158 %token <sval> NAME BLOCKNAME IDENT VARNAME
159 %token <sval> TYPENAME
161 %token SIZE CAP ORD HIGH ABS MIN_FUNC MAX_FUNC FLOAT_FUNC VAL CHR ODD TRUNC
162 %token INC DEC INCL EXCL
164 /* The GDB scope operator */
167 %token <lval> LAST REGNAME
169 %token <ivar> INTERNAL_VAR
175 %left '<' '>' LEQ GEQ '=' NOTEQUAL '#' IN
177 %left LOGICAL_AND '&'
180 %left '*' '/' DIV MOD
182 %right '^' DOT '[' '('
185 /* This is not an actual token ; it is used for precedence.
197 { write_exp_elt_opcode(OP_TYPE);
198 write_exp_elt_type($1);
199 write_exp_elt_opcode(OP_TYPE);
205 exp : exp '^' %prec UNARY
206 { write_exp_elt_opcode (UNOP_IND); }
209 { number_sign = -1; }
212 write_exp_elt_opcode (UNOP_NEG); }
215 exp : '+' exp %prec UNARY
216 { write_exp_elt_opcode(UNOP_PLUS); }
219 exp : not_exp exp %prec UNARY
220 { write_exp_elt_opcode (UNOP_LOGICAL_NOT); }
227 exp : CAP '(' exp ')'
228 { write_exp_elt_opcode (UNOP_CAP); }
231 exp : ORD '(' exp ')'
232 { write_exp_elt_opcode (UNOP_ORD); }
235 exp : ABS '(' exp ')'
236 { write_exp_elt_opcode (UNOP_ABS); }
239 exp : HIGH '(' exp ')'
240 { write_exp_elt_opcode (UNOP_HIGH); }
243 exp : MIN_FUNC '(' type ')'
244 { write_exp_elt_opcode (UNOP_MIN);
245 write_exp_elt_type ($3);
246 write_exp_elt_opcode (UNOP_MIN); }
249 exp : MAX_FUNC '(' type ')'
250 { write_exp_elt_opcode (UNOP_MAX);
251 write_exp_elt_type ($3);
252 write_exp_elt_opcode (UNOP_MIN); }
255 exp : FLOAT_FUNC '(' exp ')'
256 { write_exp_elt_opcode (UNOP_FLOAT); }
259 exp : VAL '(' type ',' exp ')'
260 { write_exp_elt_opcode (BINOP_VAL);
261 write_exp_elt_type ($3);
262 write_exp_elt_opcode (BINOP_VAL); }
265 exp : CHR '(' exp ')'
266 { write_exp_elt_opcode (UNOP_CHR); }
269 exp : ODD '(' exp ')'
270 { write_exp_elt_opcode (UNOP_ODD); }
273 exp : TRUNC '(' exp ')'
274 { write_exp_elt_opcode (UNOP_TRUNC); }
277 exp : SIZE exp %prec UNARY
278 { write_exp_elt_opcode (UNOP_SIZEOF); }
282 exp : INC '(' exp ')'
283 { write_exp_elt_opcode(UNOP_PREINCREMENT); }
286 exp : INC '(' exp ',' exp ')'
287 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
288 write_exp_elt_opcode(BINOP_ADD);
289 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
292 exp : DEC '(' exp ')'
293 { write_exp_elt_opcode(UNOP_PREDECREMENT);}
296 exp : DEC '(' exp ',' exp ')'
297 { write_exp_elt_opcode(BINOP_ASSIGN_MODIFY);
298 write_exp_elt_opcode(BINOP_SUB);
299 write_exp_elt_opcode(BINOP_ASSIGN_MODIFY); }
303 { write_exp_elt_opcode (STRUCTOP_STRUCT);
304 write_exp_string ($3);
305 write_exp_elt_opcode (STRUCTOP_STRUCT); }
312 { error("Sets are not implemented.");}
315 exp : INCL '(' exp ',' exp ')'
316 { error("Sets are not implemented.");}
319 exp : EXCL '(' exp ',' exp ')'
320 { error("Sets are not implemented.");}
322 set : '{' arglist '}'
323 { error("Sets are not implemented.");}
324 | type '{' arglist '}'
325 { error("Sets are not implemented.");}
329 /* Modula-2 array subscript notation [a,b,c...] */
331 /* This function just saves the number of arguments
332 that follow in the list. It is *not* specific to
335 non_empty_arglist ']' %prec DOT
336 { write_exp_elt_opcode (MULTI_SUBSCRIPT);
337 write_exp_elt_longcst ((LONGEST) end_arglist());
338 write_exp_elt_opcode (MULTI_SUBSCRIPT); }
342 /* This is to save the value of arglist_len
343 being accumulated by an outer function call. */
344 { start_arglist (); }
345 arglist ')' %prec DOT
346 { write_exp_elt_opcode (OP_FUNCALL);
347 write_exp_elt_longcst ((LONGEST) end_arglist ());
348 write_exp_elt_opcode (OP_FUNCALL); }
358 arglist : arglist ',' exp %prec ABOVE_COMMA
368 : non_empty_arglist ',' exp %prec ABOVE_COMMA
373 exp : '{' type '}' exp %prec UNARY
374 { write_exp_elt_opcode (UNOP_MEMVAL);
375 write_exp_elt_type ($2);
376 write_exp_elt_opcode (UNOP_MEMVAL); }
379 exp : type '(' exp ')' %prec UNARY
380 { write_exp_elt_opcode (UNOP_CAST);
381 write_exp_elt_type ($1);
382 write_exp_elt_opcode (UNOP_CAST); }
389 /* Binary operators in order of decreasing precedence. Note that some
390 of these operators are overloaded! (ie. sets) */
394 { write_exp_elt_opcode (BINOP_REPEAT); }
398 { write_exp_elt_opcode (BINOP_MUL); }
402 { write_exp_elt_opcode (BINOP_DIV); }
406 { write_exp_elt_opcode (BINOP_INTDIV); }
410 { write_exp_elt_opcode (BINOP_REM); }
414 { write_exp_elt_opcode (BINOP_ADD); }
418 { write_exp_elt_opcode (BINOP_SUB); }
422 { write_exp_elt_opcode (BINOP_EQUAL); }
425 exp : exp NOTEQUAL exp
426 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
428 { write_exp_elt_opcode (BINOP_NOTEQUAL); }
432 { write_exp_elt_opcode (BINOP_LEQ); }
436 { write_exp_elt_opcode (BINOP_GEQ); }
440 { write_exp_elt_opcode (BINOP_LESS); }
444 { write_exp_elt_opcode (BINOP_GTR); }
447 exp : exp LOGICAL_AND exp
448 { write_exp_elt_opcode (BINOP_LOGICAL_AND); }
452 { write_exp_elt_opcode (BINOP_LOGICAL_OR); }
456 { write_exp_elt_opcode (BINOP_ASSIGN); }
463 { write_exp_elt_opcode (OP_BOOL);
464 write_exp_elt_longcst ((LONGEST) $1);
465 write_exp_elt_opcode (OP_BOOL); }
469 { write_exp_elt_opcode (OP_BOOL);
470 write_exp_elt_longcst ((LONGEST) $1);
471 write_exp_elt_opcode (OP_BOOL); }
475 { write_exp_elt_opcode (OP_LONG);
476 write_exp_elt_type (builtin_type_m2_int);
477 write_exp_elt_longcst ((LONGEST) $1);
478 write_exp_elt_opcode (OP_LONG); }
483 write_exp_elt_opcode (OP_LONG);
484 write_exp_elt_type (builtin_type_m2_card);
485 write_exp_elt_longcst ((LONGEST) $1);
486 write_exp_elt_opcode (OP_LONG);
491 { write_exp_elt_opcode (OP_LONG);
492 write_exp_elt_type (builtin_type_m2_char);
493 write_exp_elt_longcst ((LONGEST) $1);
494 write_exp_elt_opcode (OP_LONG); }
499 { write_exp_elt_opcode (OP_DOUBLE);
500 write_exp_elt_type (builtin_type_m2_real);
501 write_exp_elt_dblcst ($1);
502 write_exp_elt_opcode (OP_DOUBLE); }
508 /* The GDB internal variable $$, et al. */
510 { write_exp_elt_opcode (OP_LAST);
511 write_exp_elt_longcst ((LONGEST) $1);
512 write_exp_elt_opcode (OP_LAST); }
516 { write_exp_elt_opcode (OP_REGISTER);
517 write_exp_elt_longcst ((LONGEST) $1);
518 write_exp_elt_opcode (OP_REGISTER); }
521 exp : SIZE '(' type ')' %prec UNARY
522 { write_exp_elt_opcode (OP_LONG);
523 write_exp_elt_type (builtin_type_int);
524 write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
525 write_exp_elt_opcode (OP_LONG); }
529 { write_exp_elt_opcode (OP_M2_STRING);
530 write_exp_string ($1);
531 write_exp_elt_opcode (OP_M2_STRING); }
534 /* This will be used for extensions later. Like adding modules. */
536 { $$ = SYMBOL_BLOCK_VALUE($1); }
541 = lookup_symbol (copy_name ($1), expression_context_block,
542 VAR_NAMESPACE, 0, NULL);
547 /* GDB scope operator */
548 fblock : block COLONCOLON BLOCKNAME
550 = lookup_symbol (copy_name ($3), $1,
551 VAR_NAMESPACE, 0, NULL);
552 if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
553 error ("No function \"%s\" in specified context.",
559 /* Useful for assigning to PROCEDURE variables */
561 { write_exp_elt_opcode(OP_VAR_VALUE);
562 write_exp_elt_block (NULL);
563 write_exp_elt_sym ($1);
564 write_exp_elt_opcode (OP_VAR_VALUE); }
567 /* GDB internal ($foo) variable */
568 variable: INTERNAL_VAR
569 { write_exp_elt_opcode (OP_INTERNALVAR);
570 write_exp_elt_intern ($1);
571 write_exp_elt_opcode (OP_INTERNALVAR); }
574 /* GDB scope operator */
575 variable: block COLONCOLON NAME
576 { struct symbol *sym;
577 sym = lookup_symbol (copy_name ($3), $1,
578 VAR_NAMESPACE, 0, NULL);
580 error ("No symbol \"%s\" in specified context.",
583 write_exp_elt_opcode (OP_VAR_VALUE);
584 /* block_found is set by lookup_symbol. */
585 write_exp_elt_block (block_found);
586 write_exp_elt_sym (sym);
587 write_exp_elt_opcode (OP_VAR_VALUE); }
590 /* Base case for variables. */
592 { struct symbol *sym;
593 int is_a_field_of_this;
595 sym = lookup_symbol (copy_name ($1),
596 expression_context_block,
610 if (innermost_block == 0 ||
611 contained_in (block_found,
613 innermost_block = block_found;
620 case LOC_LABEL: /* maybe should go above? */
622 case LOC_CONST_BYTES:
623 case LOC_OPTIMIZED_OUT:
624 /* These are listed so gcc -Wall will reveal
628 write_exp_elt_opcode (OP_VAR_VALUE);
629 /* We want to use the selected frame, not
630 another more inner frame which happens to
631 be in the same block. */
632 write_exp_elt_block (NULL);
633 write_exp_elt_sym (sym);
634 write_exp_elt_opcode (OP_VAR_VALUE);
638 struct minimal_symbol *msymbol;
639 register char *arg = copy_name ($1);
641 msymbol = lookup_minimal_symbol (arg,
642 (struct objfile *) NULL);
645 write_exp_elt_opcode (OP_LONG);
646 write_exp_elt_type (builtin_type_int);
647 write_exp_elt_longcst ((LONGEST) SYMBOL_VALUE_ADDRESS (msymbol));
648 write_exp_elt_opcode (OP_LONG);
649 write_exp_elt_opcode (UNOP_MEMVAL);
650 if (msymbol -> type == mst_data ||
651 msymbol -> type == mst_bss)
652 write_exp_elt_type (builtin_type_int);
653 else if (msymbol -> type == mst_text)
654 write_exp_elt_type (lookup_function_type (builtin_type_int));
656 write_exp_elt_type (builtin_type_char);
657 write_exp_elt_opcode (UNOP_MEMVAL);
659 else if (!have_full_symbols () && !have_partial_symbols ())
660 error ("No symbol table is loaded. Use the \"symbol-file\" command.");
662 error ("No symbol \"%s\" in current context.",
670 { $$ = lookup_typename (copy_name ($1),
671 expression_context_block, 0); }
682 return (MAX_OF_TYPE(builtin_type_m2_int) - b) < a;
689 return (MAX_OF_TYPE(builtin_type_m2_card) - b) < a;
693 /* Take care of parsing a number (anything that starts with a digit).
694 Set yylval and return the token type; update lexptr.
695 LEN is the number of characters in it. */
697 /*** Needs some error checking for the float case ***/
703 register char *p = lexptr;
704 register LONGEST n = 0;
705 register LONGEST prevn = 0;
706 register int c,i,ischar=0;
707 register int base = input_radix;
708 register int len = olen;
709 int unsigned_p = number_sign == 1 ? 1 : 0;
716 else if(p[len-1] == 'C' || p[len-1] == 'B')
719 ischar = p[len-1] == 'C';
723 /* Scan the number */
724 for (c = 0; c < len; c++)
726 if (p[c] == '.' && base == 10)
728 /* It's a float since it contains a point. */
729 yylval.dval = atof (p);
733 if (p[c] == '.' && base != 10)
734 error("Floating point numbers must be base 10.");
735 if (base == 10 && (p[c] < '0' || p[c] > '9'))
736 error("Invalid digit \'%c\' in number.",p[c]);
743 if( base == 8 && (c == '8' || c == '9'))
744 error("Invalid digit \'%c\' in octal number.",c);
745 if (c >= '0' && c <= '9')
749 if (base == 16 && c >= 'A' && c <= 'F')
757 if(!unsigned_p && number_sign == 1 && (prevn >= n))
758 unsigned_p=1; /* Try something unsigned */
759 /* Don't do the range check if n==i and i==0, since that special
760 case will give an overflow error. */
761 if(RANGE_CHECK && n!=i && i)
763 if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
764 ((!unsigned_p && number_sign==-1) && -prevn <= -n))
765 range_error("Overflow on numeric constant.");
771 if(*p == 'B' || *p == 'C' || *p == 'H')
772 lexptr++; /* Advance past B,C or H */
779 else if ( unsigned_p && number_sign == 1)
784 else if((unsigned_p && (n<0))) {
785 range_error("Overflow on numeric constant -- number too large.");
786 /* But, this can return if range_check == range_warn. */
801 { {'<', '>'}, NOTEQUAL },
802 { {':', '='}, ASSIGN },
805 { {':', ':'}, COLONCOLON },
809 /* Some specific keywords */
816 static struct keyword keytab[] =
819 {"IN", IN },/* Note space after IN */
820 {"AND", LOGICAL_AND},
838 {"FLOAT", FLOAT_FUNC },
843 /* Read one token, getting characters through lexptr. */
845 /* This is where we will check to make sure that the language and the operators used are
852 register int namelen;
854 register char *tokstart;
862 /* See if it is a special token of length 2 */
863 for( i = 0 ; i < sizeof tokentab2 / sizeof tokentab2[0] ; i++)
864 if(STREQN(tokentab2[i].name, tokstart, 2))
867 return tokentab2[i].token;
870 switch (c = *tokstart)
887 if (paren_depth == 0)
894 if (comma_terminates && paren_depth == 0)
900 /* Might be a floating point number. */
901 if (lexptr[1] >= '0' && lexptr[1] <= '9')
902 break; /* Falls into number code. */
909 /* These are character tokens that appear as-is in the YACC grammar */
932 for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
935 c = tokstart[++namelen];
936 if (c >= '0' && c <= '9')
938 c = tokstart[++namelen];
939 if (c >= '0' && c <= '9')
940 c = tokstart[++namelen];
944 error("Unterminated string or character constant.");
945 yylval.sval.ptr = tokstart + 1;
946 yylval.sval.length = namelen - 1;
947 lexptr += namelen + 1;
949 if(namelen == 2) /* Single character */
951 yylval.ulval = tokstart[1];
958 /* Is it a number? */
959 /* Note: We have already dealt with the case of the token '.'.
960 See case '.' above. */
961 if ((c >= '0' && c <= '9'))
964 int got_dot = 0, got_e = 0;
965 register char *p = tokstart;
970 if (!got_e && (*p == 'e' || *p == 'E'))
972 else if (!got_dot && *p == '.')
974 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
975 && (*p == '-' || *p == '+'))
976 /* This is the sign of the exponent, not the end of the
979 else if ((*p < '0' || *p > '9') &&
980 (*p < 'A' || *p > 'F') &&
981 (*p != 'H')) /* Modula-2 hexadecimal number */
984 toktype = parse_number (p - tokstart);
985 if (toktype == ERROR)
987 char *err_copy = (char *) alloca (p - tokstart + 1);
989 memcpy (err_copy, tokstart, p - tokstart);
990 err_copy[p - tokstart] = 0;
991 error ("Invalid number \"%s\".", err_copy);
997 if (!(c == '_' || c == '$'
998 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
999 /* We must have come across a bad character (e.g. ';'). */
1000 error ("Invalid character '%c' in expression.", c);
1002 /* It's a name. See how long it is. */
1004 for (c = tokstart[namelen];
1005 (c == '_' || c == '$' || (c >= '0' && c <= '9')
1006 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
1007 c = tokstart[++namelen])
1010 /* The token "if" terminates the expression and is NOT
1011 removed from the input stream. */
1012 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
1019 /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
1020 and $$digits (equivalent to $<-digits> if you could type that).
1021 Make token type LAST, and put the number (the digits) in yylval. */
1023 if (*tokstart == '$')
1025 register int negate = 0;
1027 /* Double dollar means negate the number and add -1 as well.
1028 Thus $$ alone means -1. */
1029 if (namelen >= 2 && tokstart[1] == '$')
1036 /* Just dollars (one or two) */
1037 yylval.lval = - negate;
1040 /* Is the rest of the token digits? */
1041 for (; c < namelen; c++)
1042 if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
1046 yylval.lval = atoi (tokstart + 1 + negate);
1048 yylval.lval = - yylval.lval;
1053 /* Handle tokens that refer to machine registers:
1054 $ followed by a register name. */
1056 if (*tokstart == '$') {
1057 for (c = 0; c < NUM_REGS; c++)
1058 if (namelen - 1 == strlen (reg_names[c])
1059 && STREQN (tokstart + 1, reg_names[c], namelen - 1))
1064 for (c = 0; c < num_std_regs; c++)
1065 if (namelen - 1 == strlen (std_regs[c].name)
1066 && STREQN (tokstart + 1, std_regs[c].name, namelen - 1))
1068 yylval.lval = std_regs[c].regnum;
1074 /* Lookup special keywords */
1075 for(i = 0 ; i < sizeof(keytab) / sizeof(keytab[0]) ; i++)
1076 if(namelen == strlen(keytab[i].keyw) && STREQN(tokstart,keytab[i].keyw,namelen))
1077 return keytab[i].token;
1079 yylval.sval.ptr = tokstart;
1080 yylval.sval.length = namelen;
1082 /* Any other names starting in $ are debugger internal variables. */
1084 if (*tokstart == '$')
1086 yylval.ivar = (struct internalvar *) lookup_internalvar (copy_name (yylval.sval) + 1);
1087 return INTERNAL_VAR;
1091 /* Use token-type BLOCKNAME for symbols that happen to be defined as
1092 functions. If this is not so, then ...
1093 Use token-type TYPENAME for symbols that happen to be defined
1094 currently as names of types; NAME for other symbols.
1095 The caller is not constrained to care about the distinction. */
1099 char *tmp = copy_name (yylval.sval);
1102 if (lookup_partial_symtab (tmp))
1104 sym = lookup_symbol (tmp, expression_context_block,
1105 VAR_NAMESPACE, 0, NULL);
1106 if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
1108 if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))
1123 case LOC_CONST_BYTES:
1133 error("internal: Undefined class in m2lex()");
1136 error("internal: Unforseen case in m2lex()");
1141 /* Built-in BOOLEAN type. This is sort of a hack. */
1142 if(STREQN(tokstart,"TRUE",4))
1147 else if(STREQN(tokstart,"FALSE",5))
1154 /* Must be another type of name... */
1161 make_qualname(mod,ident)
1164 char *new = malloc(strlen(mod)+strlen(ident)+2);
1175 char *msg; /* unused */
1177 printf("Parsing: %s\n",lexptr);
1179 error("Invalid syntax in expression near character '%c'.",yychar);
1181 error("Invalid syntax in expression");