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, NULL);
631 lookup_function_type (builtin_type_int),
634 else if (!have_full_symbols () && !have_partial_symbols ())
635 error ("No symbol table is loaded. Use the \"symbol-file\" command.");
637 error ("No symbol \"%s\" in current context.",
645 { $$ = lookup_typename (copy_name ($1),
646 expression_context_block, 0); }
657 return (MAX_OF_TYPE(builtin_type_m2_int) - b) < a;
664 return (MAX_OF_TYPE(builtin_type_m2_card) - b) < a;
668 /* Take care of parsing a number (anything that starts with a digit).
669 Set yylval and return the token type; update lexptr.
670 LEN is the number of characters in it. */
672 /*** Needs some error checking for the float case ***/
678 register char *p = lexptr;
679 register LONGEST n = 0;
680 register LONGEST prevn = 0;
681 register int c,i,ischar=0;
682 register int base = input_radix;
683 register int len = olen;
684 int unsigned_p = number_sign == 1 ? 1 : 0;
691 else if(p[len-1] == 'C' || p[len-1] == 'B')
694 ischar = p[len-1] == 'C';
698 /* Scan the number */
699 for (c = 0; c < len; c++)
701 if (p[c] == '.' && base == 10)
703 /* It's a float since it contains a point. */
704 yylval.dval = atof (p);
708 if (p[c] == '.' && base != 10)
709 error("Floating point numbers must be base 10.");
710 if (base == 10 && (p[c] < '0' || p[c] > '9'))
711 error("Invalid digit \'%c\' in number.",p[c]);
718 if( base == 8 && (c == '8' || c == '9'))
719 error("Invalid digit \'%c\' in octal number.",c);
720 if (c >= '0' && c <= '9')
724 if (base == 16 && c >= 'A' && c <= 'F')
732 if(!unsigned_p && number_sign == 1 && (prevn >= n))
733 unsigned_p=1; /* Try something unsigned */
734 /* Don't do the range check if n==i and i==0, since that special
735 case will give an overflow error. */
736 if(RANGE_CHECK && n!=i && i)
738 if((unsigned_p && (unsigned)prevn >= (unsigned)n) ||
739 ((!unsigned_p && number_sign==-1) && -prevn <= -n))
740 range_error("Overflow on numeric constant.");
746 if(*p == 'B' || *p == 'C' || *p == 'H')
747 lexptr++; /* Advance past B,C or H */
754 else if ( unsigned_p && number_sign == 1)
759 else if((unsigned_p && (n<0))) {
760 range_error("Overflow on numeric constant -- number too large.");
761 /* But, this can return if range_check == range_warn. */
776 { {'<', '>'}, NOTEQUAL },
777 { {':', '='}, ASSIGN },
780 { {':', ':'}, COLONCOLON },
784 /* Some specific keywords */
791 static struct keyword keytab[] =
794 {"IN", IN },/* Note space after IN */
795 {"AND", LOGICAL_AND},
813 {"FLOAT", FLOAT_FUNC },
818 /* Read one token, getting characters through lexptr. */
820 /* This is where we will check to make sure that the language and the operators used are
827 register int namelen;
829 register char *tokstart;
837 /* See if it is a special token of length 2 */
838 for( i = 0 ; i < sizeof tokentab2 / sizeof tokentab2[0] ; i++)
839 if(STREQN(tokentab2[i].name, tokstart, 2))
842 return tokentab2[i].token;
845 switch (c = *tokstart)
862 if (paren_depth == 0)
869 if (comma_terminates && paren_depth == 0)
875 /* Might be a floating point number. */
876 if (lexptr[1] >= '0' && lexptr[1] <= '9')
877 break; /* Falls into number code. */
884 /* These are character tokens that appear as-is in the YACC grammar */
907 for (namelen = 1; (c = tokstart[namelen]) != quote && c != '\0'; namelen++)
910 c = tokstart[++namelen];
911 if (c >= '0' && c <= '9')
913 c = tokstart[++namelen];
914 if (c >= '0' && c <= '9')
915 c = tokstart[++namelen];
919 error("Unterminated string or character constant.");
920 yylval.sval.ptr = tokstart + 1;
921 yylval.sval.length = namelen - 1;
922 lexptr += namelen + 1;
924 if(namelen == 2) /* Single character */
926 yylval.ulval = tokstart[1];
933 /* Is it a number? */
934 /* Note: We have already dealt with the case of the token '.'.
935 See case '.' above. */
936 if ((c >= '0' && c <= '9'))
939 int got_dot = 0, got_e = 0;
940 register char *p = tokstart;
945 if (!got_e && (*p == 'e' || *p == 'E'))
947 else if (!got_dot && *p == '.')
949 else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
950 && (*p == '-' || *p == '+'))
951 /* This is the sign of the exponent, not the end of the
954 else if ((*p < '0' || *p > '9') &&
955 (*p < 'A' || *p > 'F') &&
956 (*p != 'H')) /* Modula-2 hexadecimal number */
959 toktype = parse_number (p - tokstart);
960 if (toktype == ERROR)
962 char *err_copy = (char *) alloca (p - tokstart + 1);
964 memcpy (err_copy, tokstart, p - tokstart);
965 err_copy[p - tokstart] = 0;
966 error ("Invalid number \"%s\".", err_copy);
972 if (!(c == '_' || c == '$'
973 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
974 /* We must have come across a bad character (e.g. ';'). */
975 error ("Invalid character '%c' in expression.", c);
977 /* It's a name. See how long it is. */
979 for (c = tokstart[namelen];
980 (c == '_' || c == '$' || (c >= '0' && c <= '9')
981 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
982 c = tokstart[++namelen])
985 /* The token "if" terminates the expression and is NOT
986 removed from the input stream. */
987 if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
994 /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
995 and $$digits (equivalent to $<-digits> if you could type that).
996 Make token type LAST, and put the number (the digits) in yylval. */
998 if (*tokstart == '$')
1000 register int negate = 0;
1002 /* Double dollar means negate the number and add -1 as well.
1003 Thus $$ alone means -1. */
1004 if (namelen >= 2 && tokstart[1] == '$')
1011 /* Just dollars (one or two) */
1012 yylval.lval = - negate;
1015 /* Is the rest of the token digits? */
1016 for (; c < namelen; c++)
1017 if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
1021 yylval.lval = atoi (tokstart + 1 + negate);
1023 yylval.lval = - yylval.lval;
1028 /* Handle tokens that refer to machine registers:
1029 $ followed by a register name. */
1031 if (*tokstart == '$') {
1032 for (c = 0; c < NUM_REGS; c++)
1033 if (namelen - 1 == strlen (reg_names[c])
1034 && STREQN (tokstart + 1, reg_names[c], namelen - 1))
1039 for (c = 0; c < num_std_regs; c++)
1040 if (namelen - 1 == strlen (std_regs[c].name)
1041 && STREQN (tokstart + 1, std_regs[c].name, namelen - 1))
1043 yylval.lval = std_regs[c].regnum;
1049 /* Lookup special keywords */
1050 for(i = 0 ; i < sizeof(keytab) / sizeof(keytab[0]) ; i++)
1051 if(namelen == strlen(keytab[i].keyw) && STREQN(tokstart,keytab[i].keyw,namelen))
1052 return keytab[i].token;
1054 yylval.sval.ptr = tokstart;
1055 yylval.sval.length = namelen;
1057 /* Any other names starting in $ are debugger internal variables. */
1059 if (*tokstart == '$')
1061 yylval.ivar = (struct internalvar *) lookup_internalvar (copy_name (yylval.sval) + 1);
1062 return INTERNAL_VAR;
1066 /* Use token-type BLOCKNAME for symbols that happen to be defined as
1067 functions. If this is not so, then ...
1068 Use token-type TYPENAME for symbols that happen to be defined
1069 currently as names of types; NAME for other symbols.
1070 The caller is not constrained to care about the distinction. */
1074 char *tmp = copy_name (yylval.sval);
1077 if (lookup_partial_symtab (tmp))
1079 sym = lookup_symbol (tmp, expression_context_block,
1080 VAR_NAMESPACE, 0, NULL);
1081 if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
1083 if (lookup_typename (copy_name (yylval.sval), expression_context_block, 1))
1095 case LOC_REGPARM_ADDR:
1099 case LOC_BASEREG_ARG:
1101 case LOC_CONST_BYTES:
1102 case LOC_OPTIMIZED_OUT:
1112 error("internal: Undefined class in m2lex()");
1115 error("internal: Unforseen case in m2lex()");
1120 /* Built-in BOOLEAN type. This is sort of a hack. */
1121 if(STREQN(tokstart,"TRUE",4))
1126 else if(STREQN(tokstart,"FALSE",5))
1133 /* Must be another type of name... */
1140 make_qualname(mod,ident)
1143 char *new = malloc(strlen(mod)+strlen(ident)+2);
1154 char *msg; /* unused */
1156 printf_unfiltered("Parsing: %s\n",lexptr);
1158 error("Invalid syntax in expression near character '%c'.",yychar);
1160 error("Invalid syntax in expression");