00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef PLINT_PARSE_MYGRM_H
00026 #define PLINT_PARSE_MYGRM_H
00027
00028 #ifndef YYBISON
00029 #include "data/type.h"
00030 #include "plugin/types.h"
00031 #include "grammar.h"
00032 #endif
00033
00034
00035 #define IF_RUN if (plint->run)
00036
00037 #define IF_PRS if (!plint->run)
00038
00039 #define IF_VAL if (PLINT_CTRL_NONE)
00040
00041 #define IF_NUL
00042
00043
00044
00045 #define PLINT_xxx_PUSH(__typ__) \
00046 ({ \
00047 PLINT_STACK_PUSH(__typ__, plint->reg.__typ__); \
00048 plint_clean_##__typ__(); \
00049 })
00050
00051 #define PLINT_xxx_POP(__typ__) \
00052 ({ \
00053 plint->reg.__typ__ = PLINT_STACK_TOP(__typ__); \
00054 PLINT_STACK_POP(__typ__); \
00055 })
00056
00057 #define PLINT_xxx_ABRT(__typ__) PLINT_xxx_POP(__typ__), plint_free_##__typ__()
00058
00059
00060 #define PLINT_var_PUSH PLINT_xxx_PUSH(var)
00061 #define PLINT_var_POP PLINT_xxx_POP(var)
00062 #define PLINT_var_ABRT PLINT_xxx_ABRT(var)
00063
00064 #define PLINT_ref_PUSH PLINT_xxx_PUSH(ref)
00065 #define PLINT_ref_POP PLINT_xxx_POP(ref)
00066 #define PLINT_ref_ABRT PLINT_ref_POP
00067
00068 #define PLINT_mem_PUSH { plint_mem_dup(plint->reg.mem); PLINT_STACK_PUSH(mem, plint->reg.mem); }
00069 #define PLINT_mem_POP { PLINT_xxx_POP(mem); plint_mem_fre(plint->reg.mem); }
00070 #define PLINT_mem_ABRT PLINT_mem_POP
00071
00072 #define PLINT_tab_PUSH PLINT_xxx_PUSH(tab)
00073 #define PLINT_tab_POP PLINT_xxx_POP(tab)
00074 #define PLINT_tab_ABRT PLINT_xxx_ABRT(tab)
00075
00076 #define PLINT_hsh_PUSH PLINT_xxx_PUSH(hsh)
00077 #define PLINT_hsh_POP PLINT_xxx_POP(hsh)
00078 #define PLINT_hsh_ABRT PLINT_xxx_ABRT(hsh)
00079
00080 #define PLINT_str_PUSH PLINT_xxx_PUSH(str)
00081 #define PLINT_str_POP PLINT_xxx_POP(str)
00082 #define PLINT_str_ABRT PLINT_xxx_ABRT(str)
00083
00084 #define PLINT_idx_PUSH PLINT_STACK_PUSH(idx, plint_index_new())
00085 #define PLINT_idx_ADD(__idx__...) plint_index_add(PLINT_STACK_TOP(idx), ({ plint_idx_t _tmp = __idx__; _tmp; }))
00086 #define PLINT_idx_TIP plint_index_tip(PLINT_STACK_TOP(idx))
00087 #define PLINT_idx_REM { plint_idx_t _tmp = plint_index_rem(PLINT_STACK_TOP(idx)); plint_val_fre(&_tmp.val, _tmp.typ); }
00088 #define PLINT_idx_SIZE plint_index_count(PLINT_STACK_TOP(idx))
00089 #define PLINT_idx_EMPTY plint_index_empty(PLINT_STACK_TOP(idx))
00090 #define PLINT_idx_POP plint_index_free(PLINT_STACK_TOP(idx)), PLINT_STACK_POP(idx)
00091 #define PLINT_idx_ABRT PLINT_idx_POP
00092
00093 #endif