void
start_arglist (void)
{
- struct funcall *new;
+ struct funcall *newobj;
- new = (struct funcall *) xmalloc (sizeof (struct funcall));
- new->next = funcall_chain;
- new->arglist_len = arglist_len;
+ newobj = XNEW (struct funcall);
+ newobj->next = funcall_chain;
+ newobj->arglist_len = arglist_len;
arglist_len = 0;
- funcall_chain = new;
+ funcall_chain = newobj;
}
/* Return the number of arguments in a function call just terminated,
void
write_dollar_variable (struct parser_state *ps, struct stoken str)
{
- struct symbol *sym = NULL;
+ struct block_symbol sym;
struct bound_minimal_symbol msym;
struct internalvar *isym = NULL;
sym = lookup_symbol (copy_name (str), (struct block *) NULL,
VAR_DOMAIN, NULL);
- if (sym)
+ if (sym.symbol)
{
write_exp_elt_opcode (ps, OP_VAR_VALUE);
- write_exp_elt_block (ps, block_found); /* set by lookup_symbol */
- write_exp_elt_sym (ps, sym);
+ write_exp_elt_block (ps, sym.block);
+ write_exp_elt_sym (ps, sym.symbol);
write_exp_elt_opcode (ps, OP_VAR_VALUE);
return;
}
case OP_F90_RANGE:
oplen = 3;
+ range_type = (enum f90_range_type)
+ longest_to_int (expr->elts[endpos - 2].longconst);
- range_type = longest_to_int (expr->elts[endpos - 2].longconst);
switch (range_type)
{
case LOW_BOUND_DEFAULT:
const struct block *block,
int comma, int void_context_p, int *out_subexp)
{
- volatile struct gdb_exception except;
struct cleanup *old_chain, *inner_chain;
const struct language_defn *lang = NULL;
struct parser_state ps;
inner_chain = make_cleanup_restore_current_language ();
set_language (lang->la_language);
- TRY_CATCH (except, RETURN_MASK_ALL)
+ TRY
{
if (lang->la_parser (&ps))
lang->la_error (NULL);
}
- if (except.reason < 0)
+ CATCH (except, RETURN_MASK_ALL)
{
if (! parse_completion)
{
throw_exception (except);
}
}
+ END_CATCH
reallocate_expout (&ps);
return exp;
}
+/* Same as parse_expression, but using the given language (LANG)
+ to parse the expression. */
+
+struct expression *
+parse_expression_with_language (const char *string, enum language lang)
+{
+ struct cleanup *old_chain = NULL;
+ struct expression *expr;
+
+ if (current_language->la_language != lang)
+ {
+ old_chain = make_cleanup_restore_current_language ();
+ set_language (lang);
+ }
+
+ expr = parse_expression (string);
+
+ if (old_chain != NULL)
+ do_cleanups (old_chain);
+ return expr;
+}
+
/* Parse STRING as an expression. If parsing ends in the middle of a
field reference, return the type of the left-hand-side of the
reference; furthermore, if the parsing ends in the field name,
struct expression *exp = NULL;
struct value *val;
int subexp;
- volatile struct gdb_exception except;
- TRY_CATCH (except, RETURN_MASK_ERROR)
+ TRY
{
parse_completion = 1;
exp = parse_exp_in_context (&string, 0, 0, 0, 0, &subexp);
}
+ CATCH (except, RETURN_MASK_ERROR)
+ {
+ /* Nothing, EXP remains NULL. */
+ }
+ END_CATCH
+
parse_completion = 0;
- if (except.reason < 0 || ! exp)
+ if (exp == NULL)
return NULL;
if (expout_tag_completion_type != TYPE_CODE_UNDEF)