• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/tre-0.8.0/lib/

Lines Matching refs:tags

33   Algorithms to setup tags so that submatch addressing can be done.
141 /* Adds tags to appropriate locations in the parse tree in `tree', so that
151 /* True for first pass (counting number of needed tags) */
154 int num_tags = 0; /* Total number of tags. */
155 int num_minimals = 0; /* Number of special minimal tags. */
479 /* The next two tags are reserved for markers. */
582 /* Add tags after both children, the left child gets a smaller
586 tags which must be seen for every match of that child). */
629 DPRINT(("tre_add_tags: %s complete. Number of tags %d.\n",
906 /* Remove tags from all but the last copy. */
1091 int *tags, int assertions, int *params)
1098 for (num_tags = 0; tags != NULL && tags[num_tags] >= 0; num_tags++);
1114 if (set1[s1].tags == NULL && tags == NULL)
1115 new_set[s1].tags = NULL;
1118 for (i = 0; set1[s1].tags != NULL && set1[s1].tags[i] >= 0; i++);
1124 new_tags[j] = set1[s1].tags[j];
1126 new_tags[j + i] = tags[i];
1128 new_set[s1].tags = new_tags;
1159 if (set2[s2].tags == NULL)
1160 new_set[s1 + s2].tags = NULL;
1163 for (i = 0; set2[s2].tags[i] >= 0; i++);
1168 new_tags[j] = set2[s2].tags[j];
1170 new_set[s1 + s2].tags = new_tags;
1195 taken according to POSIX.2 rules, and adds the tags on that path to
1196 `tags'. `tags' may be NULL. If `num_tags_seen' is not NULL, it is
1197 set to the number of tags seen on the path. */
1199 tre_match_empty(tre_stack_t *stack, tre_ast_node_t *node, int *tags,
1231 if (tags != NULL)
1233 /* Add the tag to `tags'. */
1234 for (i = 0; tags[i] >= 0; i++)
1235 if (tags[i] == lit->code_max)
1237 if (tags[i] < 0)
1239 tags[i] = lit->code_max;
1240 tags[i + 1] = -1;
1452 int num_tags, *tags, assertions, params_seen;
1462 with tre_match_empty() to get the number of tags and
1469 /* Allocate arrays for the tags and parameters. */
1470 tags = xmalloc(sizeof(*tags) * (num_tags + 1));
1471 if (!tags)
1473 tags[0] = -1;
1482 xfree(tags);
1487 tags and parameters. */
1488 status = tre_match_empty(stack, cat->left, tags,
1492 xfree(tags);
1497 tags, assertions, params);
1498 xfree(tags);
1511 with tre_match_empty() to get the number of tags and
1518 /* Allocate arrays for the tags and parameters. */
1519 tags = xmalloc(sizeof(int) * (num_tags + 1));
1520 if (!tags)
1522 tags[0] = -1;
1531 xfree(tags);
1536 tags and parameters. */
1537 status = tre_match_empty(stack, cat->right, tags,
1541 xfree(tags);
1546 tags, assertions, params);
1547 xfree(tags);
1652 /* Find out how many tags this transition has. */
1654 if (p1->tags != NULL)
1655 while(p1->tags[i] >= 0)
1658 if (p2->tags != NULL)
1659 while(p2->tags[j] >= 0)
1663 if (trans->tags != NULL)
1664 xfree(trans->tags);
1665 trans->tags = NULL;
1667 /* If there were any tags, allocate an array and fill it. */
1670 trans->tags = xmalloc(sizeof(*trans->tags) * (i + j + 1));
1671 if (!trans->tags)
1674 if (p1->tags != NULL)
1675 while(p1->tags[i] >= 0)
1677 trans->tags[i] = p1->tags[i];
1682 if (p2->tags != NULL)
1683 while (p2->tags[j] >= 0)
1688 if (trans->tags[k] == p2->tags[j])
1694 trans->tags[l++] = p2->tags[j];
1697 trans->tags[l] = -1;
1728 int *tags;
1734 tags = trans->tags;
1735 if (tags)
1737 DPRINT((", tags ["));
1738 while (*tags >= 0)
1740 DPRINT(("%d", *tags));
1741 tags++;
1742 if (*tags >= 0)
1921 /* Set up tags for submatch addressing. If REG_NOSUB is set and the
1925 DPRINT(("tre_compile: setting up tags\n"));
1927 /* Figure out how many tags we will need. */
2084 int *tags;
2086 tags = p->tags;
2087 if (tags != NULL)
2089 if (*tags >= 0)
2091 while (*tags >= 0)
2093 DPRINT(("%d", *tags));
2094 tags++;
2095 if (*tags >= 0)
2122 initial[i].tags = NULL;
2123 /* Copy the arrays p->tags, and p->params, they are allocated
2125 if (p->tags)
2128 for (j = 0; p->tags[j] >= 0; j++);
2129 initial[i].tags = xmalloc(sizeof(*p->tags) * (j + 1));
2130 if (!initial[i].tags)
2132 memcpy(initial[i].tags, p->tags, sizeof(*p->tags) * (j + 1));
2194 if (tnfa->transitions[i].tags)
2195 xfree(tnfa->transitions[i].tags);
2208 if (trans->tags)
2209 xfree(trans->tags);