(TRAP_REMOVE_SYSCALL_FLAG): New macro.
[deliverable/binutils-gdb.git] / gdb / c-exp.y
index fc41bfd0d6b704410bf9ec9361a6d1f6a468e905..f5abacf37828f67a139e9aaf925641eb10d8c233 100644 (file)
@@ -703,6 +703,7 @@ variable:   block COLONCOLON name
 qualified_name:        typebase COLONCOLON name
                        {
                          struct type *type = $1;
+                         CHECK_TYPEDEF (type);
                          if (TYPE_CODE (type) != TYPE_CODE_STRUCT
                              && TYPE_CODE (type) != TYPE_CODE_UNION
                              && TYPE_CODE (type) != TYPE_CODE_NAMESPACE)
@@ -718,6 +719,7 @@ qualified_name:     typebase COLONCOLON name
                        {
                          struct type *type = $1;
                          struct stoken tmp_token;
+                         CHECK_TYPEDEF (type);
                          if (TYPE_CODE (type) != TYPE_CODE_STRUCT
                              && TYPE_CODE (type) != TYPE_CODE_UNION
                              && TYPE_CODE (type) != TYPE_CODE_NAMESPACE)
@@ -1683,6 +1685,8 @@ static const struct token tokentab2[] =
     {"->", ARROW, BINOP_END, 0},
     {"&&", ANDAND, BINOP_END, 0},
     {"||", OROR, BINOP_END, 0},
+    /* "::" is *not* only C++: gdb overrides its meaning in several
+       different ways, e.g., 'filename'::func, function::variable.  */
     {"::", COLONCOLON, BINOP_END, 0},
     {"<<", LSH, BINOP_END, 0},
     {">>", RSH, BINOP_END, 0},
@@ -1690,7 +1694,7 @@ static const struct token tokentab2[] =
     {"!=", NOTEQUAL, BINOP_END, 0},
     {"<=", LEQ, BINOP_END, 0},
     {">=", GEQ, BINOP_END, 0},
-    {".*", DOT_STAR, BINOP_END, 0}
+    {".*", DOT_STAR, BINOP_END, 1}
   };
 
 /* Identifier-like tokens.  */
@@ -1849,6 +1853,10 @@ yylex (void)
   for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
     if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
       {
+       if (tokentab3[i].cxx_only
+           && parse_language->la_language != language_cplus)
+         break;
+
        lexptr += 3;
        yylval.opcode = tokentab3[i].opcode;
        return tokentab3[i].token;
@@ -1858,6 +1866,10 @@ yylex (void)
   for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
     if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
       {
+       if (tokentab2[i].cxx_only
+           && parse_language->la_language != language_cplus)
+         break;
+
        lexptr += 2;
        yylval.opcode = tokentab2[i].opcode;
        if (in_parse_field && tokentab2[i].token == ARROW)
This page took 0.025067 seconds and 4 git commands to generate.