$$->pt.cond.op = $2;
$$->pt.cond.type = OP_REL;
}
+ | ass_right {
+ $$ = tree_malloc(ST_COND);
+ $$->pt.cond.left = $1;
+ $$->pt.cond.type = JUST_BOOL;
+ }
;
rop: '>'
} tif;
struct {
- int op;
enum {
OP_REL,
- OP_BOOL
+ OP_BOOL,
+ JUST_BOOL /* value only in left */
} type;
+ int op;
struct tree* left;
struct tree* right;
} cond; /* binary operator */
char* cat(char* l, char* r);
/* code.c */
-#define BUFSIZE 1024
+#define BUFSIZE 4096
struct code {
struct node car;
enum {
} opcode;
union {
+ struct {
+ struct code* target;
+ } jump;
+ struct {
+ struct code* target;
+ int cond;
+ } jump_if;
+ struct {
+ struct code* target;
+ int cond;
+ } jump_unless;
struct {
int l;
int r;
} set;
-
struct {
int l;
int r;
int res; /* result */
} cat;
-
struct {
} nop;
} u;