c2->jmp_dst_flag = 1;
break;
}
-
+#if 0
if (SCF_OP_GOTO == c->op->type) {
c->op = c2->op;
l2 = &dst1->code->list;
continue;
}
-
+#endif
scf_logw("c: %s, c2: %s\n", c->op->name, c2->op->name);
dst0 = c->dsts->data[0];
dst0->code = c2;
--- /dev/null
+//第5章/setcc.c
+
+int printf(const char* fmt, ...);
+
+int main()
+{
+ int a = 1, b = 2, c = 3, d = 4;
+
+ int ret = a > b && b < c || c < d;
+
+ printf("ret: %d\n", ret);
+ return 0;
+}
dfa_parse_data_t* d = data;
dfa_identity_t* id = NULL;
+ d->var_semicolon_flag = 0;
+
if (_var_add_var(dfa, d) < 0) {
scf_loge("add var error\n");
return SCF_DFA_ERROR;
d->expr = e;
d->expr_local_flag++;
- SCF_DFA_PUSH_HOOK(scf_dfa_find_node(dfa, "var_semicolon"), SCF_DFA_HOOK_POST);
+ if (!d->var_semicolon_flag) {
+ SCF_DFA_PUSH_HOOK(scf_dfa_find_node(dfa, "var_semicolon"), SCF_DFA_HOOK_POST);
+ d->var_semicolon_flag = 1;
+ }
+
SCF_DFA_PUSH_HOOK(scf_dfa_find_node(dfa, "var_comma"), SCF_DFA_HOOK_POST);
scf_logd("d->expr: %p\n", d->expr);