annotate paper/src/insertCase2.c @ 71:b0cfef1cd89f

Add sample source
author atton <atton@cr.ie.u-ryukyu.ac.jp>
date Mon, 06 Feb 2017 10:15:16 +0900
parents 5510bb043a74
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 __code insertCase2(struct Context* context, struct Node* current) {
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 struct Node* parent;
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 stack_pop(context->node_stack, &parent);
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 if (parent->color == Black) {
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 stack_pop(context->code_stack, &context->next);
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 goto meta(context, context->next);
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 }
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 stack_push(context->node_stack, &parent);
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 goto meta(context, InsertCase3);
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 }
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 __code insert2_stub(struct Context* context) {
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 goto insertCase2(context, context->data[Tree]->tree.current);
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 }
5510bb043a74 Add rbtree description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17