mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-12 23:46:36 +00:00
51 lines
649 B
C
51 lines
649 B
C
|
#ifndef PARSER_H
|
||
|
#define PARSER_H
|
||
|
#include "../list.h"
|
||
|
|
||
|
struct regs_off {
|
||
|
char *reg;
|
||
|
int off; // XXX 32 bit only !? wtf?
|
||
|
};
|
||
|
|
||
|
/* token types */
|
||
|
enum {
|
||
|
GROUP_TOK = 0,
|
||
|
REG_TOK,
|
||
|
MEM_TOK
|
||
|
};
|
||
|
|
||
|
/* token structure */
|
||
|
struct tok {
|
||
|
ut64 off;
|
||
|
int type;
|
||
|
int op, log_op;
|
||
|
char *val;
|
||
|
int len;
|
||
|
|
||
|
struct list_head list;
|
||
|
struct list_head next;
|
||
|
};
|
||
|
|
||
|
/* arithmetical operations */
|
||
|
enum {
|
||
|
_OP_LT = 1,
|
||
|
_OP_LE,
|
||
|
_OP_EQ,
|
||
|
_OP_NE,
|
||
|
_OP_GE,
|
||
|
_OP_GT
|
||
|
};
|
||
|
|
||
|
/* logical operations */
|
||
|
enum {
|
||
|
LOG_OR = 1,
|
||
|
LOG_AND
|
||
|
};
|
||
|
|
||
|
char skip_chars(const char **c);
|
||
|
struct tok* parse_cond(const char *cond);
|
||
|
int eval_cond(struct tok *group);
|
||
|
void free_cond(struct tok *group);
|
||
|
|
||
|
#endif
|