Alien-TinyCCx

 view release on metacpan or  search on metacpan

src/tccexsymtab.c  view on Meta::CPAN

    }
}

/*****************************************************************************/
/*                      copy extended symbol into local                      */
/*****************************************************************************/

/* Provide a mechanism for turning the local_stack off and back on outside of
 * the current static file scope. */

ST_DATA Sym * local_stack_backup;
void local_stack_off() {
    local_stack_backup = local_stack;
    local_stack = NULL;
}
void local_stack_on() {
    local_stack = local_stack_backup;
}

/* The define token stream is a series of bytes. They are collections of
 * integer => data pairs, where the integer indicates the type (and thus size)
 * of the data that follows. For example, if we encounter types TOK_PPNUM,
 * TOK_STR, or TOK_LSTR, then the next few bytes are a CString struct (mostly
 * filled with NULLs) followed by the associated character string. It gets
 * complicated, but has only a handful of special cases to handle. The formats
 * of the stream are codified in tok_str_add2, which is defined in tccpp.c.
 * 

src/tccpp.c  view on Meta::CPAN

/* #ifdef CONFIG_TCC_EXSYMTAB */
            /* If we are here, it's because we didn't find the token in our
             * current symbol table. It may, however, exist in the extended
             * symbol table. If we find it there, copy its contents into the
             * just-created TokenSym. */
            if (tcc_state->symtab_name_callback) {
                extended_symtab* containing_symtab;
                TokenSym * extended_ts = tcc_state->symtab_name_callback(
                        p1, len, tcc_state->symtab_callback_data, &containing_symtab);
                if (extended_ts) {
                    local_stack_off(); /* backup */
                    copy_extended_tokensym(containing_symtab, extended_ts, ts);
                    local_stack_on();  /* restore */
                }
            }
/* #endif */
        token_found: ;
        } else {
            /* slower case */
            cstr_reset(&tokcstr);
            cstr_cat(&tokcstr, p1, len);



( run in 0.526 second using v1.01-cache-2.11-cpan-49f99fa48dc )