gdb: Convert language la_word_break_characters field to a method
[deliverable/binutils-gdb.git] / gdb / f-lang.c
index 90a794ef4bab10a3c940e767777bd4e5d6e72147..27495cf63f109171bcd5e0049740ddb65aa41a61 100644 (file)
@@ -165,30 +165,6 @@ enum f_primitive_types {
   nr_f_primitive_types
 };
 
-/* Remove the modules separator :: from the default break list.  */
-
-static const char *
-f_word_break_characters (void)
-{
-  static char *retval;
-
-  if (!retval)
-    {
-      char *s;
-
-      retval = xstrdup (default_word_break_characters ());
-      s = strchr (retval, ':');
-      if (s)
-       {
-         char *last_char = &s[strlen (s) - 1];
-
-         *s = *last_char;
-         *last_char = 0;
-       }
-    }
-  return retval;
-}
-
 /* Consider the modules separator :: as a valid symbol name character
    class.  */
 
@@ -614,17 +590,12 @@ extern const struct language_data f_language_data =
   NULL,                        /* name_of_this */
   false,                       /* la_store_sym_names_in_linkage_form_p */
   cp_lookup_symbol_nonlocal,   /* lookup_symbol_nonlocal */
-  NULL,                                /* Language specific
-                                  class_name_from_physname */
   f_op_print_tab,              /* expression operators for printing */
   0,                           /* arrays are first-class (not c-style) */
   1,                           /* String lower bound */
-  f_word_break_characters,
   f_collect_symbol_completion_matches,
   c_watch_location_expression,
-  cp_get_symbol_name_matcher,  /* la_get_symbol_name_matcher */
   &default_varobj_ops,
-  NULL,
   f_is_string_type_p,
   "(...)"                      /* la_struct_too_deep_ellipsis */
 };
@@ -702,6 +673,40 @@ public:
   {
     f_print_type (type, varstring, stream, show, level, flags);
   }
+
+  /* See language.h.  This just returns default set of word break
+     characters but with the modules separator `::' removed.  */
+
+  const char *word_break_characters (void) const override
+  {
+    static char *retval;
+
+    if (!retval)
+      {
+       char *s;
+
+       retval = xstrdup (language_defn::word_break_characters ());
+       s = strchr (retval, ':');
+       if (s)
+         {
+           char *last_char = &s[strlen (s) - 1];
+
+           *s = *last_char;
+           *last_char = 0;
+         }
+      }
+    return retval;
+  }
+
+protected:
+
+  /* See language.h.  */
+
+  symbol_name_matcher_ftype *get_symbol_name_matcher_inner
+       (const lookup_name_info &lookup_name) const override
+  {
+    return cp_get_symbol_name_matcher (lookup_name);
+  }
 };
 
 /* Single instance of the Fortran language class.  */
This page took 0.024218 seconds and 4 git commands to generate.