static int shift(stack *s, int type, char *str, int newstate, int lineno, int col_offset) { int err; assert(!s_empty(s)); err = PyNode_AddChild(s->s_top->s_parent, type, str, lineno, col_offset); if (err) return err; s->s_top->s_state = newstate; return 0; }
static int push(stack *s, int type, dfa *d, int newstate, int lineno, int col_offset) { int err; node *n; n = s->s_top->s_parent; assert(!s_empty(s)); err = PyNode_AddChild(n, type, (char *)NULL, lineno, col_offset); if (err) return err; s->s_top->s_state = newstate; return s_push(s, d, CHILD(n, NCH(n)-1)); }
static int shift(register stack *s, int type, char *str, int newstate, int lineno, int col_offset) { int err; assert(!s_empty(s)); err = PyNode_AddChild(s->s_top->s_parent, type, str, lineno, col_offset); // pgbovine //printf("shift->PyNode_AddChild: '%s' L:%d,C:%d\n", str, lineno, col_offset); if (err) return err; s->s_top->s_state = newstate; return 0; }