* gdb.texinfo (Continuing and Stepping): When talking about "step"
[deliverable/binutils-gdb.git] / gdb / ch-exp.y
index a6182837450f6e546e2f54c6d732b58427abd44a..ebef81326e3b877a39551351a2ddd60b8599acb0 100644 (file)
@@ -1,5 +1,5 @@
 /* YACC grammar for Chill expressions, for GDB.
-   Copyright (C) 1992 Free Software Foundation, Inc.
+   Copyright 1992, 1993 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -60,6 +60,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "value.h"
 #include "parser-defs.h"
 #include "ch-lang.h"
+#include "bfd.h" /* Required by objfiles.h.  */
+#include "symfile.h" /* Required by objfiles.h.  */
+#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 
 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
    as well as gratuitiously global symbol names, so we can have multiple
@@ -83,8 +86,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define        yypgo   chill_pgo
 #define        yyact   chill_act
 #define        yyexca  chill_exca
-#define yyerrflag chill_errflag
-#define yynerrs        chill_nerrs
+#define        yyerrflag chill_errflag
+#define        yynerrs chill_nerrs
 #define        yyps    chill_ps
 #define        yypv    chill_pv
 #define        yys     chill_s
@@ -95,8 +98,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define        yy_yyv  chill_yyv
 #define        yyval   chill_val
 #define        yylloc  chill_lloc
-#define yyreds chill_reds              /* With YYDEBUG defined */
-#define yytoks chill_toks              /* With YYDEBUG defined */
+#define        yyreds  chill_reds              /* With YYDEBUG defined */
+#define        yytoks  chill_toks              /* With YYDEBUG defined */
 
 #ifndef YYDEBUG
 #define        YYDEBUG 0               /* Default to no yydebug support */
@@ -227,8 +230,8 @@ yyerror PARAMS ((char *));
 %token <voidval>       SUCC
 %token <voidval>       ABS
 %token <voidval>       CARD
-%token <voidval>       MAX
-%token <voidval>       MIN
+%token <voidval>       MAX_TOKEN
+%token <voidval>       MIN_TOKEN
 %token <voidval>       SIZE
 %token <voidval>       UPPER
 %token <voidval>       LOWER
@@ -346,6 +349,7 @@ location    :       access_name
 access_name    :       LOCATION_NAME
                        {
                          write_exp_elt_opcode (OP_VAR_VALUE);
+                         write_exp_elt_block (NULL);
                          write_exp_elt_sym ($1.sym);
                          write_exp_elt_opcode (OP_VAR_VALUE);
                        }
@@ -477,6 +481,7 @@ value_name  :       synonym_name
                |       GENERAL_PROCEDURE_NAME
                        {
                          write_exp_elt_opcode (OP_VAR_VALUE);
+                         write_exp_elt_block (NULL);
                          write_exp_elt_sym ($1.sym);
                          write_exp_elt_opcode (OP_VAR_VALUE);
                        }
@@ -769,7 +774,7 @@ operand_2   :       operand_3
                        }
                |       operand_2 IN operand_3
                        {
-                         $$ = 0;       /* FIXME */
+                         write_exp_elt_opcode (BINOP_IN);
                        }
                ;
 
@@ -889,11 +894,11 @@ chill_value_built_in_routine_call :
                        {
                          $$ = 0;       /* FIXME */
                        }
-               |       MAX '(' expression ')'
+               |       MAX_TOKEN '(' expression ')'
                        {
                          $$ = 0;       /* FIXME */
                        }
-               |       MIN '(' expression ')'
+               |       MIN_TOKEN '(' expression ')'
                        {
                          $$ = 0;       /* FIXME */
                        }
@@ -1212,7 +1217,6 @@ match_float_literal ()
   char *tokptr = lexptr;
   char *buf;
   char *copy;
-  char ch;
   double dval;
   extern double strtod ();
   
@@ -1331,7 +1335,7 @@ match_float_literal ()
   return (0);
 }
 
-/* Recognize a string literal.  A string literal is a nonzero sequence
+/* Recognize a string literal.  A string literal is a sequence
    of characters enclosed in matching single or double quotes, except that
    a single character inside single quotes is a character literal, which
    we reject as a string literal.  To embed the terminator character inside
@@ -1359,7 +1363,6 @@ match_string_literal ()
       tempbuf[tempbufindex++] = *tokptr;
     }
   if (*tokptr == '\0'                                  /* no terminator */
-      || tempbufindex == 0                             /* no string */
       || (tempbufindex == 1 && *tokptr == '\''))       /* char literal */
     {
       return (0);
@@ -1653,7 +1656,7 @@ match_dollar_tokens ()
              && !isalnum (tokptr[namelength]))
            {
              yylval.lval = regno;
-             lexptr += namelength + 1;
+             lexptr += namelength;
              return (GDB_REGNAME);
            }
        }
@@ -1739,8 +1742,8 @@ static const struct token idtokentab[] =
     { "orif", ORIF },
     { "num", NUM },
     { "abs", ABS },
-    { "max", MAX },
-    { "min", MIN },
+    { "max", MAX_TOKEN },
+    { "min", MIN_TOKEN },
     { "mod", MOD },
     { "rem", REM },
     { "not", NOT },
@@ -1802,7 +1805,7 @@ yylex ()
       {
        case '\'':
        case '\"':
-         /* First try to match a string literal, which is any nonzero
+         /* First try to match a string literal, which is any
             sequence of characters enclosed in matching single or double
             quotes, except that a single character inside single quotes
             is a character literal, so we have to catch that case also. */
@@ -1927,8 +1930,11 @@ yylex ()
              case LOC_ARG:
              case LOC_REF_ARG:
              case LOC_REGPARM:
+             case LOC_REGPARM_ADDR:
              case LOC_LOCAL:
              case LOC_LOCAL_ARG:
+             case LOC_BASEREG:
+             case LOC_BASEREG_ARG:
                if (innermost_block == NULL
                    || contained_in (block_found, innermost_block))
                  {
@@ -1981,7 +1987,7 @@ void
 yyerror (msg)
      char *msg;        /* unused */
 {
-  printf ("Parsing:  %s\n", lexptr);
+  printf_unfiltered ("Parsing:  %s\n", lexptr);
   if (yychar < 256)
     {
       error ("Invalid syntax in expression near character '%c'.", yychar);
This page took 0.026232 seconds and 4 git commands to generate.