static void
yyerror (const char *msg)
{
- error (_("Error in expression, near `%s'."), pstate->lexptr);
+ pstate->parse_error (msg);
}
/* Emit expression to access an instance of SYM, in block BLOCK (if
static void
yyerror (const char *msg)
{
- if (pstate->prev_lexptr)
- pstate->lexptr = pstate->prev_lexptr;
-
- error (_("A %s in expression, near `%s'."), msg, pstate->lexptr);
+ pstate->parse_error (msg);
}
static void
yyerror (const char *msg)
{
- if (pstate->prev_lexptr)
- pstate->lexptr = pstate->prev_lexptr;
-
- error (_("A %s in expression, near `%s'."), msg, pstate->lexptr);
+ pstate->parse_error (msg);
}
static void
yyerror (const char *msg)
{
- if (pstate->prev_lexptr)
- pstate->lexptr = pstate->prev_lexptr;
-
- error (_("A %s in expression, near `%s'."), msg, pstate->lexptr);
+ pstate->parse_error (msg);
}
static void
yyerror (const char *msg)
{
- if (pstate->prev_lexptr)
- pstate->lexptr = pstate->prev_lexptr;
-
- error (_("A %s in expression, near `%s'."), msg, pstate->lexptr);
+ pstate->parse_error (msg);
}
static void
yyerror (const char *msg)
{
- if (pstate->prev_lexptr)
- pstate->lexptr = pstate->prev_lexptr;
-
- error (_("A %s in expression, near `%s'."), msg, pstate->lexptr);
+ pstate->parse_error (msg);
}
static void
yyerror (const char *msg)
{
- if (pstate->prev_lexptr)
- pstate->lexptr = pstate->prev_lexptr;
-
- error (_("A %s in expression, near `%s'."), msg, pstate->lexptr);
+ pstate->parse_error (msg);
}
(create_internalvar (copy.c_str () + 1));
}
+/* See parser-defs.h. */
+
+void
+parser_state::parse_error (const char *msg)
+{
+ if (this->prev_lexptr)
+ this->lexptr = this->prev_lexptr;
+
+ error (_("A %s in expression, near `%s'."), msg, this->lexptr);
+}
+
\f
const char *
push (expr::make_operation<T> (std::move (lhs), std::move (rhs)));
}
+ /* Function called from the various parsers' yyerror functions to throw
+ an error. The error will include a message identifying the location
+ of the error within the current expression. */
+ void parse_error (const char *msg);
+
/* If this is nonzero, this block is used as the lexical context for
symbol names. */