Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_egg.h>
Go to the source code of this file.
Macros | |
#define | CTX egg->context |
#define | SYNTAX_ATT 0 |
#define | FRAME_FMT "__%d_%d_frame%d" |
#define | FRAME_END_FMT "__%d_%d_end_frame%d" |
Enumerations | |
enum | { NORMAL = 0 , ALIAS , INCLUDE , DATA , INLINE , NAKED , SYSCALL , SYSCALLBODY , GOTO , LAST } |
Functions | |
static int | is_var (char *x) |
static int | is_space (char c) |
static const char * | skipspaces (const char *s) |
static int | is_op (char x) |
static int | get_op (char **pos) |
static char * | trim (char *s) |
static void | rcc_pushstr (RzEgg *egg, char *str, int filter) |
static void | rcc_context (RzEgg *egg, int delta) |
static char * | find_include (const char *prefix, const char *file) |
RZ_API void | rz_egg_lang_init (RzEgg *egg) |
RZ_API void | rz_egg_lang_free (RzEgg *egg) |
RZ_API void | rz_egg_lang_include_path (RzEgg *egg, const char *path) |
RZ_API void | rz_egg_lang_include_init (RzEgg *egg) |
static void | rcc_set_callname (RzEgg *egg, const char *s) |
static void | rcc_reset_callname (RzEgg *egg) |
static const char * | find_alias (RzEgg *egg, const char *str) |
static void | rcc_internal_mathop (RzEgg *egg, const char *ptr, char *ep, char op) |
static void | rcc_mathop (RzEgg *egg, char **pos, int level) |
static void | rcc_pusharg (RzEgg *egg, char *str) |
static void | rcc_element (RzEgg *egg, char *str) |
RZ_API char * | rz_egg_mkvar (RzEgg *egg, char *out, const char *_str, int delta) |
static void | rcc_fun (RzEgg *egg, const char *str) |
static void | set_nested (RzEgg *egg, const char *s) |
static int | parsedatachar (RzEgg *egg, char c) |
static int | parseinlinechar (RzEgg *egg, char c) |
static void | rcc_next (RzEgg *egg) |
RZ_API int | rz_egg_lang_parsechar (RzEgg *egg, char c) |
#define CTX egg->context |
Definition at line 6 of file egg_lang.c.
#define FRAME_END_FMT "__%d_%d_end_frame%d" |
Definition at line 190 of file egg_lang.c.
#define FRAME_FMT "__%d_%d_frame%d" |
Definition at line 189 of file egg_lang.c.
#define SYNTAX_ATT 0 |
Definition at line 184 of file egg_lang.c.
anonymous enum |
Enumerator | |
---|---|
NORMAL | |
ALIAS | |
INCLUDE | |
DATA | |
INLINE | |
NAKED | |
SYSCALL | |
SYSCALLBODY | |
GOTO | |
LAST |
Definition at line 62 of file egg_lang.c.
Definition at line 222 of file egg_lang.c.
References rz_egg_lang_t::aliases, rz_egg_lang_t::content, i, is_space(), rz_egg_t::lang, rz_egg_lang_t::nalias, rz_egg_lang_t::name, NULL, p, cmd_descs_generate::str, and strdup().
Referenced by rcc_element().
Definition at line 75 of file egg_lang.c.
References env, free(), NULL, out, prefix, RZ_EGG_INCDIR_ENV, rz_file_exists(), rz_str_appendf(), rz_sys_getenv(), cmd_descs_generate::str, and strdup().
Referenced by rcc_next().
|
inlinestatic |
Definition at line 40 of file egg_lang.c.
References is_op(), is_var(), and pos.
Referenced by rcc_internal_mathop(), and rcc_mathop().
|
inlinestatic |
|
inlinestatic |
Definition at line 12 of file egg_lang.c.
References c.
Referenced by find_alias(), parsedatachar(), rcc_fun(), rcc_internal_mathop(), rcc_mathop(), rz_egg_lang_parsechar(), skipspaces(), and trim().
|
inlinestatic |
Definition at line 8 of file egg_lang.c.
References x.
Referenced by ds_show_functions(), ds_show_functions_argvar(), get_op(), rcc_internal_mathop(), rcc_mathop(), and rcc_next().
Definition at line 870 of file egg_lang.c.
References c, rz_egg_emit_t::comment, CTX, rz_egg_lang_t::dstval, rz_egg_lang_t::dstvar, i, rz_egg_lang_t::inlinectr, is_space(), rz_egg_t::lang, rz_egg_lang_t::mode, rz_egg_lang_t::ndstval, NORMAL, rcc_context(), rz_egg_t::remit, rz_egg_printf(), RZ_FREE, rz_egg_lang_t::slurp, rz_egg_lang_t::stackframe, and cmd_descs_generate::str.
Referenced by rz_egg_lang_parsechar().
Definition at line 934 of file egg_lang.c.
References rz_egg_lang_t::body, c, CTX, rz_egg_lang_t::dstval, rz_egg_lang_t::dstvar, eprintf, rz_egg_lang_t::inlinectr, rz_egg_lang_t::inlines, rz_egg_t::lang, rz_egg_lang_t::mode, rz_egg_lang_t::name, rz_egg_lang_t::ndstval, rz_egg_lang_t::ninlines, NORMAL, NULL, rcc_context(), RZ_FREE, skipspaces(), rz_egg_lang_t::slurp, strdup(), and rz_egg_lang_t::syscallbody.
Referenced by rz_egg_lang_parsechar().
Definition at line 764 of file egg_lang.c.
References b, rz_egg_lang_t::callname, rz_egg_lang_t::conditionstr, CTX, rz_egg_lang_t::ctxpush, delta, e, rz_egg_lang_t::elem, emit, eprintf, g, rz_egg_t::lang, rz_egg_lang_t::lastctxdelta, rz_egg_lang_t::mode, n, NAKED, rz_egg_lang_t::nbrackets, rz_egg_lang_t::nested, rz_egg_lang_t::nested_callname, rz_egg_lang_t::nestedi, rz_egg_lang_t::nfunctions, NORMAL, NULL, rcc_reset_callname(), rcc_set_callname(), rz_egg_t::remit, RZ_FREE, set_nested(), skipspaces(), sprintf, rz_egg_lang_t::stackfixed, rz_egg_lang_t::stackframe, cmd_descs_generate::str, strdup(), and rz_egg_lang_t::varsize.
Referenced by parsedatachar(), parseinlinechar(), and rz_egg_lang_parsechar().
|
static |
Definition at line 345 of file egg_lang.c.
References ALIAS, rz_egg_lang_t::aliases, rz_egg_lang_t::arg, rz_egg_lang_t::callname, rz_egg_lang_t::conditionstr, rz_egg_lang_t::content, CTX, rz_egg_lang_t::dstvar, e, rz_egg_lang_t::elem, rz_egg_lang_t::elem_n, eprintf, find_alias(), found, GOTO, i, setup::idx, INCLUDE, rz_egg_lang_t::includedir, rz_egg_t::lang, rz_egg_lang_t::mode, NAKED, rz_egg_lang_t::nalias, rz_egg_lang_t::name, rz_egg_lang_t::nargs, NORMAL, rz_egg_lang_t::nsyscalls, NULL, num, p, rcc_pusharg(), rcc_pushstr(), rz_egg_t::remit, RZ_FREE, skipspaces(), rz_egg_lang_t::slurp, rz_egg_lang_t::stackfixed, rz_egg_lang_t::stackframe, cmd_descs_generate::str, strdup(), SYSCALL, and rz_egg_lang_t::syscalls.
Referenced by rz_egg_lang_parsechar().
Definition at line 634 of file egg_lang.c.
References ALIAS, rz_egg_lang_t::callname, rz_egg_emit_t::comment, CTX, DATA, rz_egg_lang_t::dstval, rz_egg_lang_t::dstvar, e, eprintf, free(), GOTO, INCLUDE, rz_egg_lang_t::includefile, INLINE, is_space(), rz_egg_t::lang, malloc(), rz_egg_lang_t::mode, NAKED, rz_egg_lang_t::ndstval, NORMAL, rcc_set_callname(), rz_egg_t::remit, rz_egg_printf(), RZ_FREE, rz_egg_lang_t::setenviron, skipspaces(), rz_egg_lang_t::slurp, cmd_descs_generate::str, strdup(), SYSCALL, and rz_egg_lang_t::syscallbody.
Referenced by rz_egg_lang_parsechar().
Definition at line 243 of file egg_lang.c.
References e, get_op(), is_space(), is_var(), rz_egg_t::lang, p, rz_egg_t::remit, rz_egg_mkvar(), RZ_FREE, strdup(), type, rz_egg_lang_t::varsize, and rz_egg_lang_t::varxs.
Referenced by rcc_mathop().
Definition at line 287 of file egg_lang.c.
References e, get_op(), is_op(), is_space(), is_var(), level, op, pos, rcc_internal_mathop(), rz_egg_t::remit, and strdup().
Referenced by rcc_next().
|
static |
Definition at line 978 of file egg_lang.c.
References rz_egg_lang_t::body, rz_egg_lang_t::callname, CTX, rz_egg_lang_t::ctxpush, rz_egg_lang_t::docall, rz_egg_lang_t::dstvar, e, rz_egg_lang_t::elem, rz_egg_lang_t::elem_n, eprintf, eq, find_include(), free(), i, rz_egg_lang_t::includedir, rz_egg_lang_t::includefile, rz_egg_lang_t::inlines, is_var(), rz_egg_t::lang, rz_egg_lang_t::lastctxdelta, rz_egg_lang_t::line, rz_egg_lang_t::mathline, rz_egg_lang_t::mode, rz_egg_lang_t::name, rz_egg_lang_t::nargs, rz_egg_lang_t::nestedi, rz_egg_lang_t::nfunctions, rz_egg_lang_t::ninlines, rz_egg_lang_t::nsyscalls, NULL, p, path, rcc_mathop(), rcc_reset_callname(), rz_egg_t::remit, rz_egg_lang_parsechar(), rz_egg_mkvar(), rz_file_slurp(), RZ_FREE, rz_sys_setenv(), s, rz_egg_lang_t::setenviron, skipspaces(), sprintf, cmd_descs_generate::str, strdup(), rz_egg_lang_t::syscallbody, rz_egg_lang_t::syscalls, autogen_x86imm::tmp, type, rz_egg_lang_t::varsize, and rz_egg_lang_t::varxs.
Referenced by rz_egg_lang_parsechar().
|
static |
Definition at line 329 of file egg_lang.c.
References CTX, rz_egg_lang_t::ctxpush, e, free(), rz_egg_t::lang, rz_egg_lang_t::nargs, p, rz_egg_lang_t::pushargs, rz_egg_t::remit, rz_egg_mkvar(), RZ_FREE, cmd_descs_generate::str, strdup(), and rz_egg_lang_t::varxs.
Referenced by rcc_element().
Definition at line 485 of file egg_lang.c.
References rz_egg_lang_t::callname, rz_egg_lang_t::dstvar, e, eprintf, rz_egg_lang_t::file, i, rz_egg_t::lang, len, rz_egg_lang_t::line, rz_egg_t::remit, RZ_FREE, rz_hex_pair2bin(), and cmd_descs_generate::str.
Referenced by rcc_element(), and rz_egg_mkvar().
|
static |
Definition at line 179 of file egg_lang.c.
References rz_egg_lang_t::callname, rz_egg_t::lang, rz_egg_lang_t::nargs, and RZ_FREE.
Referenced by rcc_context(), and rcc_next().
Definition at line 172 of file egg_lang.c.
References rz_egg_lang_t::callname, rz_egg_t::lang, rz_egg_lang_t::nargs, rz_egg_lang_t::pushargs, RZ_FREE, s, skipspaces(), strdup(), and trim().
Referenced by rcc_context(), and rcc_fun().
Definition at line 136 of file egg_lang.c.
References rz_egg_lang_t::arg, rz_egg_lang_t::ctxpush, i, rz_egg_t::lang, len, rz_egg_lang_t::name, rz_egg_lang_t::nsyscalls, RZ_FREE, and rz_egg_lang_t::syscalls.
Referenced by rz_egg_free().
Definition at line 164 of file egg_lang.c.
References free(), NULL, prefix, RZ_EGG_INCDIR_ENV, RZ_EGG_INCDIR_PATH, rz_path_prefix(), rz_str_newf(), rz_sys_setenv(), and s.
Referenced by rz_egg_lang_include_path(), and rz_egg_reset().
Definition at line 149 of file egg_lang.c.
References env, free(), NULL, path, RZ_EGG_INCDIR_ENV, rz_egg_lang_include_init(), rz_str_appendf(), rz_sys_getenv(), and rz_sys_setenv().
Referenced by rz_main_rz_gg().
Definition at line 126 of file egg_lang.c.
References rz_egg_lang_t::docall, rz_egg_lang_t::file, rz_egg_t::lang, rz_egg_lang_t::line, rz_egg_lang_t::mode, NORMAL, rz_egg_lang_t::oc, and rz_egg_lang_t::varsize.
Referenced by rz_egg_compile().
Definition at line 1235 of file egg_lang.c.
References c, rz_egg_lang_t::commentmode, CTX, DATA, e, rz_egg_lang_t::elem, rz_egg_lang_t::elem_n, rz_egg_lang_t::endframe, eprintf, rz_egg_lang_t::file, free(), i, rz_egg_lang_t::ifelse_table, INLINE, is_space(), rz_egg_t::lang, rz_egg_lang_t::line, rz_egg_lang_t::mode, rz_egg_lang_t::nbrackets, rz_egg_lang_t::nested, rz_egg_lang_t::nested_callname, rz_egg_lang_t::nestedi, rz_egg_lang_t::nfunctions, NULL, rz_egg_lang_t::oc, parsedatachar(), parseinlinechar(), rz_egg_lang_t::quoteline, rz_egg_lang_t::quotelinevar, rcc_context(), rcc_element(), rcc_fun(), rcc_next(), rz_egg_t::remit, rz_egg_mkvar(), rz_egg_printf(), RZ_FREE, rz_str_newf(), rz_egg_lang_t::skipline, rz_egg_lang_t::slurp, rz_egg_lang_t::slurpin, and cmd_descs_generate::str.
Referenced by rcc_next(), and rz_egg_compile().
Definition at line 538 of file egg_lang.c.
References rz_egg_lang_t::arg, rz_egg_lang_t::attsyntax, rz_egg_lang_t::callname, delta, rz_egg_lang_t::dstvar, e, eprintf, foo, free(), i, setup::idx, int, rz_egg_t::lang, len, rz_egg_lang_t::name, rz_egg_lang_t::nargs, rz_egg_lang_t::nsyscalls, NULL, out, rcc_pushstr(), rz_egg_t::remit, rz_num_math(), skipspaces(), snprintf, rz_egg_lang_t::stackfixed, rz_egg_lang_t::stackframe, cmd_descs_generate::str, strdup(), rz_egg_lang_t::syscalls, rz_egg_lang_t::varsize, and rz_egg_lang_t::varxs.
Referenced by emit_branch(), emit_set_string(), emit_string(), rcc_internal_mathop(), rcc_next(), rcc_pusharg(), and rz_egg_lang_parsechar().
clear inner levels
Definition at line 748 of file egg_lang.c.
References CTX, free(), i, rz_egg_t::lang, rz_egg_lang_t::nested, RZ_FREE, s, and strdup().
Referenced by rcc_context().
Definition at line 16 of file egg_lang.c.
References is_space(), and s.
Referenced by parseinlinechar(), rcc_context(), rcc_element(), rcc_fun(), rcc_next(), rcc_set_callname(), and rz_egg_mkvar().
|
static |
Definition at line 49 of file egg_lang.c.
References is_space(), and s.
Referenced by rcc_set_callname().