diff options
author | Tom Tromey <tom@tromey.com> | 2019-03-24 11:20:05 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-04-04 19:55:10 -0600 |
commit | 1e58a4a4db997cf09315c22f3da725d1da7f9ee7 (patch) | |
tree | 5166626dc2cad5a02581b158edaa245045922ab9 /gdb/m2-exp.y | |
parent | 37eedb39824dc26c82a92b5515a352d7de0c9b5b (diff) | |
download | binutils-1e58a4a4db997cf09315c22f3da725d1da7f9ee7.zip binutils-1e58a4a4db997cf09315c22f3da725d1da7f9ee7.tar.gz binutils-1e58a4a4db997cf09315c22f3da725d1da7f9ee7.tar.bz2 |
Move expression_context_* globals to parser_state
This moves the expression_context_block and expression_context_pc
globals to be members of parser_state and updates the parsers.
gdb/ChangeLog
2019-04-04 Tom Tromey <tom@tromey.com>
* rust-exp.y (rust_parser::crate_name, rust_parser::super_name)
(rust_parser::convert_ast_to_type)
(rust_parser::convert_ast_to_expression, rust_lex_tests): Update.
* parser-defs.h (struct parser_state) <parser_state>: Add
parameters. Initialize new members.
<expression_context_block, expression_context_pc>: New members.
* parse.c (expression_context_block, expression_context_pc):
Remove globals.
(parse_exp_in_context): Update.
* p-exp.y: Update all rules.
(yylex): Update.
* m2-exp.y: Update all rules.
(yylex): Update.
* go-exp.y (yylex): Update.
* f-exp.y (yylex): Update.
* d-exp.y: Update all rules.
(yylex): Update.
* c-exp.y: Update all rules.
(lex_one_token, classify_name, yylex, c_parse): Update.
* ada-exp.y (write_var_or_type, write_name_assoc): Update.
Diffstat (limited to 'gdb/m2-exp.y')
-rw-r--r-- | gdb/m2-exp.y | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 611981f..c1418c7 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -508,7 +508,7 @@ block : fblock fblock : BLOCKNAME { struct symbol *sym = lookup_symbol (copy_name ($1), - expression_context_block, + pstate->expression_context_block, VAR_DOMAIN, 0).symbol; $$ = sym;} ; @@ -561,10 +561,11 @@ variable: NAME { struct block_symbol sym; struct field_of_this_result is_a_field_of_this; - sym = lookup_symbol (copy_name ($1), - expression_context_block, - VAR_DOMAIN, - &is_a_field_of_this); + sym + = lookup_symbol (copy_name ($1), + pstate->expression_context_block, + VAR_DOMAIN, + &is_a_field_of_this); if (sym.symbol) { @@ -596,10 +597,13 @@ variable: NAME type : TYPENAME - { $$ = lookup_typename (pstate->language (), - pstate->gdbarch (), - copy_name ($1), - expression_context_block, 0); } + { $$ + = lookup_typename (pstate->language (), + pstate->gdbarch (), + copy_name ($1), + pstate->expression_context_block, + 0); + } ; @@ -965,12 +969,13 @@ yylex (void) if (lookup_symtab (tmp)) return BLOCKNAME; - sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, 0).symbol; + sym = lookup_symbol (tmp, pstate->expression_context_block, + VAR_DOMAIN, 0).symbol; if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK) return BLOCKNAME; if (lookup_typename (pstate->language (), pstate->gdbarch (), copy_name (yylval.sval), - expression_context_block, 1)) + pstate->expression_context_block, 1)) return TYPENAME; if(sym) |