+2018-06-18 Tom Tromey <tom@tromey.com>
+
+ * rust-lang.h (rust_yyerror): Don't declare.
+ * rust-lang.c (rust_language_defn): Update.
+ * rust-exp.y (yyerror): Now static.
+ * parse.c (parse_exp_in_context_1): Update.
+ * p-lang.h (p_yyerror): Don't declare.
+ * p-lang.c (p_language_defn): Update.
+ * p-exp.y (yyerror): Now static.
+ * opencl-lang.c (opencl_language_defn): Update.
+ * objc-lang.c (objc_language_defn): Update.
+ * m2-lang.h (m2_yyerror): Don't declare.
+ * m2-lang.c (m2_language_defn): Update.
+ * m2-exp.y (yyerror): Now static.
+ * language.h (struct language_defn) <la_error>: Remove.
+ * language.c (unk_lang_error): Remove.
+ (unknown_language_defn, auto_language_defn): Remove.
+ * go-lang.h (go_yyerror): Don't declare.
+ * go-lang.c (go_language_defn): Update.
+ * go-exp.y (yyerror): Now static.
+ * f-lang.h (f_yyerror): Don't declare.
+ * f-lang.c (f_language_defn): Update.
+ * f-exp.y (yyerror): Now static.
+ * d-lang.h (d_yyerror): Don't declare.
+ * d-lang.c (d_language_defn): Update.
+ * d-exp.y (yyerror): Now static.
+ * c-lang.h (c_yyerror): Don't declare.
+ * c-lang.c (c_language_defn, cplus_language_defn)
+ (asm_language_defn, minimal_language_defn): Update.
+ * c-exp.y (yyerror): Now static.
+ * ada-lang.h (ada_yyerror): Don't declare.
+ * ada-lang.c (ada_language_defn): Update.
+ * ada-exp.y (yyerror): Now static.
+
2018-06-18 Alan Hayward <alan.hayward@arm.com>
* aarch64-linux-nat.c (fetch_sveregs_from_thread): New function.
static int yylex (void);
-void yyerror (const char *);
+static void yyerror (const char *);
static void write_int (struct parser_state *, LONGEST, struct type *);
return yyparse ();
}
-void
+static void
yyerror (const char *msg)
{
error (_("Error in expression, near `%s'."), lexptr);
ada_extensions,
&ada_exp_descriptor,
parse,
- ada_yyerror,
resolve,
ada_printchar, /* Print a character constant */
ada_printstr, /* Function to print string constant */
extern int ada_parse (struct parser_state *); /* Defined in ada-exp.y */
-extern void ada_yyerror (const char *); /* Defined in ada-exp.y */
-
/* Defined in ada-typeprint.c */
extern void ada_print_type (struct type *, const char *, struct ui_file *, int,
int, const struct type_print_options *);
static int yylex (void);
-void yyerror (const char *);
+static void yyerror (const char *);
static int type_aggregate_p (struct type *);
#endif
-void
+static void
yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
- error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);
+ error (_("A %s in expression, near `%s'."), msg, lexptr);
}
c_extensions,
&exp_descriptor_c,
c_parse,
- c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
cplus_extensions,
&exp_descriptor_c,
c_parse,
- c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
asm_extensions,
&exp_descriptor_c,
c_parse,
- c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
NULL,
&exp_descriptor_c,
c_parse,
- c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
extern int c_parse (struct parser_state *);
-extern void c_yyerror (const char *);
-
extern int c_parse_escape (const char **, struct obstack *);
/* Defined in c-typeprint.c */
static int yylex (void);
-void yyerror (const char *);
+static void yyerror (const char *);
static int type_aggregate_p (struct type *);
return yyparse ();
}
-void
+static void
yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
- error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);
+ error (_("A %s in expression, near `%s'."), msg, lexptr);
}
d_extensions,
&exp_descriptor_c,
d_parse,
- d_yyerror,
null_post_parser,
c_printchar, /* Print a character constant. */
c_printstr, /* Function to print string constant. */
extern int d_parse (struct parser_state *);
-extern void d_yyerror (const char *);
-
/* Defined in d-lang.c */
extern const char *d_main_name (void);
static int yylex (void);
-void yyerror (const char *);
+static void yyerror (const char *);
static void growbuf_by_size (int);
return yyparse ();
}
-void
+static void
yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
- error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);
+ error (_("A %s in expression, near `%s'."), msg, lexptr);
}
f_extensions,
&exp_descriptor_standard,
f_parse, /* parser */
- f_yyerror, /* parser error function */
null_post_parser,
f_printchar, /* Print character constant */
f_printstr, /* function to print string constant */
extern int f_parse (struct parser_state *);
-extern void f_yyerror (const char *); /* Defined in f-exp.y */
-
extern void f_print_type (struct type *, const char *, struct ui_file *, int,
int, const struct type_print_options *);
static int yylex (void);
-void yyerror (const char *);
+static void yyerror (const char *);
%}
return yyparse ();
}
-void
+static void
yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
- error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);
+ error (_("A %s in expression, near `%s'."), msg, lexptr);
}
NULL,
&exp_descriptor_c,
go_parse,
- go_yyerror,
null_post_parser,
c_printchar, /* Print a character constant. */
c_printstr, /* Function to print string constant. */
extern int go_parse (struct parser_state *);
-extern void go_yyerror (const char *);
-
/* Defined in go-lang.c. */
extern const char *go_main_name (void);
#include "c-lang.h"
#include <algorithm>
-static void unk_lang_error (const char *);
-
static int unk_lang_parser (struct parser_state *);
static void set_range_case (void);
return 1;
}
-static void
-unk_lang_error (const char *msg)
-{
- error (_("Attempted to parse an expression with unknown language"));
-}
-
static void
unk_lang_emit_char (int c, struct type *type, struct ui_file *stream,
int quoter)
NULL,
&exp_descriptor_standard,
unk_lang_parser,
- unk_lang_error,
null_post_parser,
unk_lang_printchar, /* Print character constant */
unk_lang_printstr,
NULL,
&exp_descriptor_standard,
unk_lang_parser,
- unk_lang_error,
null_post_parser,
unk_lang_printchar, /* Print character constant */
unk_lang_printstr,
int (*la_parser) (struct parser_state *);
- /* Parser error function. */
-
- void (*la_error) (const char *);
-
/* Given an expression *EXPP created by prefixifying the result of
la_parser, perform any remaining processing necessary to complete
its translation. *EXPP may change; la_post_parser is responsible
static int yylex (void);
-void yyerror (const char *);
+static void yyerror (const char *);
static int parse_number (int);
return yyparse ();
}
-void
+static void
yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
- error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);
+ error (_("A %s in expression, near `%s'."), msg, lexptr);
}
NULL,
&exp_descriptor_modula2,
m2_parse, /* parser */
- m2_yyerror, /* parser error function */
null_post_parser,
m2_printchar, /* Print character constant */
m2_printstr, /* function to print string constant */
extern int m2_parse (struct parser_state *); /* Defined in m2-exp.y */
-extern void m2_yyerror (const char *); /* Defined in m2-exp.y */
-
/* Defined in m2-typeprint.c */
extern void m2_print_type (struct type *, const char *, struct ui_file *, int,
int, const struct type_print_options *);
objc_extensions,
&exp_descriptor_standard,
c_parse,
- c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
NULL,
&exp_descriptor_opencl,
c_parse,
- c_yyerror,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
static int yylex (void);
-void yyerror (const char *);
+static void yyerror (const char *);
static char *uptok (const char *, int);
%}
return yyparse ();
}
-void
+static void
yyerror (const char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
- error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), lexptr);
+ error (_("A %s in expression, near `%s'."), msg, lexptr);
}
p_extensions,
&exp_descriptor_standard,
pascal_parse,
- pascal_yyerror,
null_post_parser,
pascal_printchar, /* Print a character constant */
pascal_printstr, /* Function to print string constant */
extern int pascal_parse (struct parser_state *); /* Defined in p-exp.y */
-extern void pascal_yyerror (const char *); /* Defined in p-exp.y */
-
/* Defined in p-typeprint.c */
extern void pascal_print_type (struct type *, const char *, struct ui_file *,
int, int, const struct type_print_options *);
TRY
{
- if (lang->la_parser (&ps))
- lang->la_error (NULL);
+ lang->la_parser (&ps);
}
CATCH (except, RETURN_MASK_ALL)
{
typedef std::vector<set_field> rust_set_vector;
static int rustyylex (void);
+static void rustyyerror (const char *msg);
static void rust_push_back (char c);
static const char *rust_copy_name (const char *, int);
static struct stoken rust_concat3 (const char *, const char *, const char *);
/* The parser error handler. */
-void
+static void
rustyyerror (const char *msg)
{
const char *where = prev_lexptr ? prev_lexptr : lexptr;
- error (_("%s in expression, near `%s'."), (msg ? msg : "Error"), where);
+ error (_("%s in expression, near `%s'."), msg, where);
}
\f
rust_extensions,
&exp_descriptor_rust,
rust_parse,
- rustyyerror,
null_post_parser,
rust_printchar, /* Print a character constant */
rust_printstr, /* Function to print string constant */
/* The la_parser implementation for Rust. */
extern int rust_parse (struct parser_state *);
-/* The la_error implementation for Rust. */
-extern void rustyyerror (const char *);
-
/* Return true if TYPE is a tuple type; otherwise false. */
extern bool rust_tuple_type_p (struct type *type);