rem: symbol_def_type = SN_GLOB_VAR_DEF;
context: void emit_var_access(Token *tok, VarAccess acc) {  char* varname = tok->strval;  SearchEntry entry;  int ref_to_symbol_type, ref_to_symbol_scope, symbol_def_type;  int line_start, line_end, column_start, column_end;  line_start = tok->start_line;  column_start = tok->start_column;  line_end = tok->end_line;  column_end = tok->end_column;  /*   * If we are not in a function or the variable is in the   * function's global table then it is a global.   */  entry.key = varname;  entry.key_len = -1;  if ((current_function == NULL) ||      (global_var_table &&        (global_var_table->search( &global_var_table, entry ) != NULL))) {    ref_to_symbol_type = SN_REF_TO_GLOB_VAR;    ref_to_symbol_scope = SN_REF_SCOPE_GLOBAL;    symbol_def_type = SN_GLOB_VAR_DEF;#ifdef TOKEN_DEBUG    fprintf(tokenout, "global var \"%s\"\n", varname);#endif  } else {    ref_to_symbol_type = SN_REF_TO_LOCAL_VAR;    ref_to_symbol_scope = SN_REF_SCOPE_LOCAL;    symbol_def_type = SN_LOCAL_VAR_DEF;#ifdef TOKEN_DEBUG    fprintf(tokenout, "local var \"%s\"\n", varname);#endif  }  if ((acc == VAR_WRITE) || (acc == VAR_READWRITE)) {    /*     I think setting a global variable should emit     a symbol declaration. I am not really     sure if we should emit just one symbol     declaration, or multiple ones. Multiple     ones breaks xref but it does present     the symbol multiple times in the     file's symbol list which would be     nice if it worked correctly.     */    result = sn_insert_symbol(symbol_def_type,                            NULL,			    varname,			    sn_current_file(),			    line_start, column_start,			    line_end, column_end,			    0,			    NULL,			    NULL,			    NULL,			    NULL,			    line_start, column_start,			    line_end, column_end                            );    assert(result == 0);  }  /* FIXME: The second argument to sn_insert_xref must be one of SN_FUNC_DEF,   * SN_MBR_FUNC_DEF, or SN_SUBR_DEF. This is too restrictive, there   * needs to be an option to pass when not in a function. Currently,   * we just pretend to be in a function named "GLOBAL".   */  if ((ref_to_symbol_type == SN_REF_TO_GLOB_VAR) ||      ((ref_to_symbol_type == SN_REF_TO_LOCAL_VAR) &&          ((int) sn_getopt(SN_OPT_LOCAL_VARS) != 0))) {    if ((acc == VAR_READ) || (acc == VAR_READWRITE)) {        result = sn_insert_xref(ref_to_symbol_type,                 SN_FUNC_DEF, /* Not really in a function definition */                 ref_to_symbol_scope,                 NULL,                 (current_function == NULL) ? "GLOBAL" : current_function,                 NULL,                 NULL,                 varname,                 NULL,                 sn_current_file(),                 line_start,                 SN_REF_READ);        assert(result == 0);    }    if ((acc == VAR_WRITE) || (acc == VAR_READWRITE)) {        result = sn_insert_xref(ref_to_symbol_type,                 SN_FUNC_DEF, /* Not really in a function definition */                 ref_to_symbol_scope,                 NULL,                 (current_function == NULL) ? "GLOBAL" : current_function,                 NULL,                 NULL,                 varname,                 NULL,                 sn_current_file(),                 line_start,                 SN_REF_WRITE);        assert(result == 0);    }  }  if (ref_to_symbol_type == SN_REF_TO_GLOB_VAR) {      sn_highlight(SN_HIGH_VAR_GLOBAL,          line_start, column_start-1,          line_end, column_end);  } else {      sn_highlight(SN_HIGH_VAR_LOCAL,          line_start, column_start-1,          line_end, column_end);  }}