Share DLL code between gdb and gdbserver
[deliverable/binutils-gdb.git] / gdb / f-exp.y
index 02e35c83b051288963b50b3150dd5959b743938b..6608831a9a53807692f0225d185a30b8644363c9 100644 (file)
@@ -260,6 +260,13 @@ exp        :       UNOP_OR_BINOP_INTRINSIC '('
                              else
                                pstate->wrap2<fortran_associated_2arg> ();
                            }
+                         else if ($1 == FORTRAN_ARRAY_SIZE)
+                           {
+                             if (n == 1)
+                               pstate->wrap<fortran_array_size_1arg> ();
+                             else
+                               pstate->wrap2<fortran_array_size_2arg> ();
+                           }
                          else
                            {
                              std::vector<operation_up> args
@@ -323,6 +330,12 @@ exp        :       UNOP_INTRINSIC '(' exp ')'
                            case UNOP_FORTRAN_RANK:
                              pstate->wrap<fortran_rank_operation> ();
                              break;
+                           case UNOP_FORTRAN_SHAPE:
+                             pstate->wrap<fortran_array_shape_operation> ();
+                             break;
+                           case UNOP_FORTRAN_LOC:
+                             pstate->wrap<fortran_loc_operation> ();
+                             break;
                            default:
                              gdb_assert_not_reached ("unhandled intrinsic");
                            }
@@ -479,7 +492,7 @@ exp :       '(' type ')' exp  %prec UNARY
 
 exp     :       exp '%' name
                        {
-                         pstate->push_new<structop_operation>
+                         pstate->push_new<fortran_structop_operation>
                            (pstate->pop (), copy_name ($3));
                        }
        ;
@@ -487,8 +500,8 @@ exp     :       exp '%' name
 exp     :       exp '%' name COMPLETE
                        {
                          structop_base_operation *op
-                           = new structop_operation (pstate->pop (),
-                                                     copy_name ($3));
+                           = new fortran_structop_operation (pstate->pop (),
+                                                             copy_name ($3));
                          pstate->mark_struct_expression (op);
                          pstate->push (operation_up (op));
                        }
@@ -497,7 +510,8 @@ exp     :       exp '%' name COMPLETE
 exp     :       exp '%' COMPLETE
                        {
                          structop_base_operation *op
-                           = new structop_operation (pstate->pop (), "");
+                           = new fortran_structop_operation (pstate->pop (),
+                                                             "");
                          pstate->mark_struct_expression (op);
                          pstate->push (operation_up (op));
                        }
@@ -1143,6 +1157,9 @@ static const struct token f77_keywords[] =
   { "allocated", UNOP_INTRINSIC, UNOP_FORTRAN_ALLOCATED, false },
   { "associated", UNOP_OR_BINOP_INTRINSIC, FORTRAN_ASSOCIATED, false },
   { "rank", UNOP_INTRINSIC, UNOP_FORTRAN_RANK, false },
+  { "size", UNOP_OR_BINOP_INTRINSIC, FORTRAN_ARRAY_SIZE, false },
+  { "shape", UNOP_INTRINSIC, UNOP_FORTRAN_SHAPE, false },
+  { "loc", UNOP_INTRINSIC, UNOP_FORTRAN_LOC, false },
 };
 
 /* Implementation of a dynamically expandable buffer for processing input
This page took 0.038458 seconds and 4 git commands to generate.