Lines Matching refs:parent

543 eqn_box_alloc(struct eqn_node *ep, struct eqn_box *parent)  in eqn_box_alloc()  argument
548 bp->parent = parent; in eqn_box_alloc()
549 bp->parent->args++; in eqn_box_alloc()
553 if (NULL != parent->first) { in eqn_box_alloc()
554 parent->last->next = bp; in eqn_box_alloc()
555 bp->prev = parent->last; in eqn_box_alloc()
557 parent->first = bp; in eqn_box_alloc()
559 parent->last = bp; in eqn_box_alloc()
571 enum eqn_post pos, struct eqn_box *parent) in eqn_box_makebinary() argument
575 assert(NULL != parent->last); in eqn_box_makebinary()
576 b = parent->last; in eqn_box_makebinary()
577 if (parent->last == parent->first) in eqn_box_makebinary()
578 parent->first = NULL; in eqn_box_makebinary()
579 parent->args--; in eqn_box_makebinary()
580 parent->last = b->prev; in eqn_box_makebinary()
582 newb = eqn_box_alloc(ep, parent); in eqn_box_makebinary()
589 b->parent = newb; in eqn_box_makebinary()
696 eqn_parse(struct eqn_node *ep, struct eqn_box *parent) in eqn_parse() argument
707 assert(parent != NULL); in eqn_parse()
755 if (parent->last == NULL) { in eqn_parse()
758 cur = eqn_box_alloc(ep, parent); in eqn_parse()
762 parent = eqn_box_makebinary(ep, EQNPOS_NONE, parent); in eqn_parse()
763 parent->type = EQN_LISTONE; in eqn_parse()
764 parent->expectargs = 1; in eqn_parse()
802 parent->top = mandoc_strdup(sym); in eqn_parse()
805 parent->bottom = mandoc_strdup(sym); in eqn_parse()
810 parent = parent->parent; in eqn_parse()
828 while (parent->args == parent->expectargs) in eqn_parse()
829 parent = parent->parent; in eqn_parse()
835 parent = eqn_box_alloc(ep, parent); in eqn_parse()
836 parent->type = EQN_LISTONE; in eqn_parse()
837 parent->expectargs = 1; in eqn_parse()
840 parent->font = EQNFONT_FAT; in eqn_parse()
843 parent->font = EQNFONT_ROMAN; in eqn_parse()
846 parent->font = EQNFONT_ITALIC; in eqn_parse()
849 parent->font = EQNFONT_BOLD; in eqn_parse()
873 parent = eqn_box_alloc(ep, parent); in eqn_parse()
874 parent->type = EQN_LISTONE; in eqn_parse()
875 parent->expectargs = 1; in eqn_parse()
876 parent->size = size; in eqn_parse()
887 if (parent->last == NULL) { in eqn_parse()
890 cur = eqn_box_alloc(ep, parent); in eqn_parse()
895 if (EQN_TOK_SUP == tok && parent->pos == EQNPOS_SUB) { in eqn_parse()
896 parent->expectargs = 3; in eqn_parse()
897 parent->pos = EQNPOS_SUBSUP; in eqn_parse()
900 if (EQN_TOK_TO == tok && parent->pos == EQNPOS_FROM) { in eqn_parse()
901 parent->expectargs = 3; in eqn_parse()
902 parent->pos = EQNPOS_FROMTO; in eqn_parse()
921 parent = eqn_box_makebinary(ep, pos, parent); in eqn_parse()
924 while (parent->args == parent->expectargs) in eqn_parse()
925 parent = parent->parent; in eqn_parse()
931 parent = eqn_box_alloc(ep, parent); in eqn_parse()
932 parent->type = EQN_SUBEXPR; in eqn_parse()
933 parent->pos = EQNPOS_SQRT; in eqn_parse()
934 parent->expectargs = 1; in eqn_parse()
942 if (parent->last == NULL) { in eqn_parse()
945 cur = eqn_box_alloc(ep, parent); in eqn_parse()
949 while (EQN_SUBEXPR == parent->type) in eqn_parse()
950 parent = parent->parent; in eqn_parse()
951 parent = eqn_box_makebinary(ep, EQNPOS_OVER, parent); in eqn_parse()
960 for (cur = parent; cur != NULL; cur = cur->parent) in eqn_parse()
970 parent = cur; in eqn_parse()
981 parent->right = mandoc_strdup(sym); in eqn_parse()
984 parent->right = mandoc_strdup(sym); in eqn_parse()
986 parent->right = mandoc_strndup(start, sz); in eqn_parse()
988 parent = parent->parent; in eqn_parse()
989 if (EQN_TOK_BRACE_CLOSE == tok && parent && in eqn_parse()
990 (parent->type == EQN_PILE || in eqn_parse()
991 parent->type == EQN_MATRIX)) in eqn_parse()
992 parent = parent->parent; in eqn_parse()
994 while (parent->type == EQN_LISTONE && in eqn_parse()
995 parent->args == parent->expectargs) in eqn_parse()
996 parent = parent->parent; in eqn_parse()
1005 while (parent->args == parent->expectargs) in eqn_parse()
1006 parent = parent->parent; in eqn_parse()
1013 parent = eqn_box_alloc(ep, parent); in eqn_parse()
1014 parent->type = EQN_LIST; in eqn_parse()
1018 parent->left = mandoc_strdup(sym); in eqn_parse()
1021 parent->left = mandoc_strdup(sym); in eqn_parse()
1023 parent->left = mandoc_strndup(start, sz); in eqn_parse()
1033 while (parent->args == parent->expectargs) in eqn_parse()
1034 parent = parent->parent; in eqn_parse()
1035 parent = eqn_box_alloc(ep, parent); in eqn_parse()
1036 parent->type = EQN_PILE; in eqn_parse()
1037 parent->expectargs = 1; in eqn_parse()
1040 for (cur = parent; cur != NULL; cur = cur->parent) in eqn_parse()
1048 parent = eqn_box_alloc(ep, cur); in eqn_parse()
1049 parent->type = EQN_LIST; in eqn_parse()
1052 while (parent->args == parent->expectargs) in eqn_parse()
1053 parent = parent->parent; in eqn_parse()
1054 parent = eqn_box_alloc(ep, parent); in eqn_parse()
1055 parent->type = EQN_MATRIX; in eqn_parse()
1056 parent->expectargs = 1; in eqn_parse()
1071 while (parent->args == parent->expectargs) in eqn_parse()
1072 parent = parent->parent; in eqn_parse()
1073 cur = eqn_box_alloc(ep, parent); in eqn_parse()
1089 while (parent->type == EQN_LISTONE && in eqn_parse()
1090 parent->args == parent->expectargs) in eqn_parse()
1091 parent = parent->parent; in eqn_parse()