103a104,106 > /* Global variable denoting whether we are only interested in scope, not value */ > int check_scope = 0; > 203a207,208 > /* $in_scope opperator */ > %left IN_SCOPE 246a252,256 > exp : IN_SCOPE > { check_scope = 1; } > '(' exp ')' > ; > 586c596,602 < error ("No symbol \"%s\" in specified context.", --- > { > /* Case for scope checking. If scope is being checked and > the symbol is not in scope, return an expresison of > value 0. */ > if(check_scope == 0) > { > error ("No symbol \"%s\" in specified context.", 587a604,614 > } > else > { > YYSTYPE val; > parse_number ("0", 1, 0, &val); > write_exp_elt_opcode (OP_LONG); > write_exp_elt_type (val.typed_val_int.type); > write_exp_elt_longcst ((LONGEST)val.typed_val_int.val); > write_exp_elt_opcode (OP_LONG); > } > } 666,667c693,708 < error ("No symbol \"%s\" in current context.", name); < } --- > { > if(check_scope == 0) > { > error ("No symbol \"%s\" in current context.", name); > } > else > { > YYSTYPE val; > parse_number ("0", 1, 0, &val); > write_exp_elt_opcode (OP_LONG); > write_exp_elt_type (val.typed_val_int.type); > write_exp_elt_longcst ((LONGEST)val.typed_val_int.val); > write_exp_elt_opcode (OP_LONG); > } > } > } 721,722c762,774 < error ("No symbol \"%s\" in current context.", < copy_name ($1.stoken)); --- > { > if(check_scope == 0) > error ("No symbol \"%s\" in current context.", copy_name ($1.stoken)); > else > { > YYSTYPE val; > parse_number ("0", 1, 0, &val); > write_exp_elt_opcode (OP_LONG); > write_exp_elt_type (val.typed_val_int.type); > write_exp_elt_longcst ((LONGEST)val.typed_val_int.val); > write_exp_elt_opcode (OP_LONG); > } > } 1260a1313,1317 > static const struct token tokentab9[] = > { > {"$in_scope", IN_SCOPE, BINOP_END} > }; > 1322a1380,1388 > /* Code for recognising the $in_scope token. */ > /* See if it is a special token of length 9. */ > for (i = 0; i < sizeof tokentab9 / sizeof tokentab9[0]; i++) > if (strncmp (tokstart, tokentab9[i].operator, 9) == 0) > { > lexptr += 9; > yylval.opcode = tokentab9[i].opcode; > return tokentab9[i].token; > }