• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/libxml2-2.7.2/

Lines Matching defs:atom

212     xmlRegAtomPtr atom;
247 xmlRegAtomPtr atom;
350 static void xmlRegFreeAtom(xmlRegAtomPtr atom);
352 static int xmlRegCheckCharacter(xmlRegAtomPtr atom, int codepoint);
460 * 3/ build a table state x atom for the transitions
563 if ((trans->to == -1) || (trans->atom == NULL))
565 atomno = stringRemap[trans->atom->no];
566 if ((trans->atom->data != NULL) && (transdata == NULL)) {
579 * if the same atom can generate transitions to 2 different
588 printf("Indet: state %d trans %d, atom %d to %d : %d to %d\n",
589 i, j, trans->atom->no, trans->to, atomno, targetno);
604 printf("State %d trans %d: atom %d to %d : %d to %d\n",
605 i, j, trans->atom->no, trans->to, atomno, targetno);
611 trans->atom->data;
769 * @type: the type of atom
771 * Allocate a new atom
773 * Returns the new atom or NULL in case of error
781 xmlRegexpErrMemory(ctxt, "allocating atom");
794 * @atom: the regexp atom
796 * Free a regexp atom
799 xmlRegFreeAtom(xmlRegAtomPtr atom) {
802 if (atom == NULL)
805 for (i = 0;i < atom->nbRanges;i++)
806 xmlRegFreeRange(atom->ranges[i]);
807 if (atom->ranges != NULL)
808 xmlFree(atom->ranges);
809 if ((atom->type == XML_REGEXP_STRING) && (atom->valuep != NULL))
810 xmlFree(atom->valuep);
811 if ((atom->type == XML_REGEXP_STRING) && (atom->valuep2 != NULL))
812 xmlFree(atom->valuep2);
813 if ((atom->type == XML_REGEXP_BLOCK_NAME) && (atom->valuep != NULL))
814 xmlFree(atom->valuep);
815 xmlFree(atom);
821 * @atom: the oiginal atom
825 * Returns the new atom or NULL in case of error
828 xmlRegCopyAtom(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) {
833 xmlRegexpErrMemory(ctxt, "copying atom");
837 ret->type = atom->type;
838 ret->quant = atom->quant;
839 ret->min = atom->min;
840 ret->max = atom->max;
841 if (atom->nbRanges > 0) {
845 atom->nbRanges);
847 xmlRegexpErrMemory(ctxt, "copying atom");
850 for (i = 0;i < atom->nbRanges;i++) {
851 ret->ranges[i] = xmlRegCopyRange(ctxt, atom->ranges[i]);
1075 xmlRegPrintAtom(FILE *output, xmlRegAtomPtr atom) {
1076 fprintf(output, " atom: ");
1077 if (atom == NULL) {
1081 if (atom->neg)
1083 xmlRegPrintAtomType(output, atom->type);
1084 xmlRegPrintQuantType(output, atom->quant);
1085 if (atom->quant == XML_REGEXP_QUANT_RANGE)
1086 fprintf(output, "%d-%d ", atom->min, atom->max);
1087 if (atom->type == XML_REGEXP_STRING)
1088 fprintf(output, "'%s' ", (char *) atom->valuep);
1089 if (atom->type == XML_REGEXP_CHARVAL)
1090 fprintf(output, "char %c\n", atom->codepoint);
1091 else if (atom->type == XML_REGEXP_RANGES) {
1093 fprintf(output, "%d entries\n", atom->nbRanges);
1094 for (i = 0; i < atom->nbRanges;i++)
1095 xmlRegPrintRange(output, atom->ranges[i]);
1096 } else if (atom->type == XML_REGEXP_SUBREG) {
1097 fprintf(output, "start %d end %d\n", atom->start->no, atom->stop->no);
1128 if (trans->atom == NULL) {
1132 if (trans->atom->type == XML_REGEXP_CHARVAL)
1133 fprintf(output, "char %c ", trans->atom->codepoint);
1134 fprintf(output, "atom %d, to %d\n", trans->atom->no, trans->to);
1178 if (ctxt->atom != NULL) {
1179 fprintf(output, "current atom:\n");
1180 xmlRegPrintAtom(output, ctxt->atom);
1206 xmlRegAtomAddRange(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom,
1211 if (atom == NULL) {
1212 ERROR("add range: atom is NULL");
1215 if (atom->type != XML_REGEXP_RANGES) {
1216 ERROR("add range: atom is not ranges");
1219 if (atom->maxRanges == 0) {
1220 atom->maxRanges = 4;
1221 atom->ranges = (xmlRegRangePtr *) xmlMalloc(atom->maxRanges *
1223 if (atom->ranges == NULL) {
1225 atom->maxRanges = 0;
1228 } else if (atom->nbRanges >= atom->maxRanges) {
1230 atom->maxRanges *= 2;
1231 tmp = (xmlRegRangePtr *) xmlRealloc(atom->ranges, atom->maxRanges *
1235 atom->maxRanges /= 2;
1238 atom->ranges = tmp;
1244 atom->ranges[atom->nbRanges++] = range;
1277 xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) {
1278 if (atom == NULL) {
1279 ERROR("atom push: atom is NULL");
1287 xmlRegexpErrMemory(ctxt, "pushing atom");
1303 atom->no = ctxt->nbAtoms;
1304 ctxt->atoms[ctxt->nbAtoms++] = atom;
1338 xmlRegAtomPtr atom, xmlRegStatePtr target,
1359 if ((trans->atom == atom) &&
1400 else if (atom == NULL)
1402 else if (atom != NULL)
1403 xmlRegPrintAtom(stdout, atom);
1406 state->trans[state->nbTrans].atom = atom;
1528 * @atom: the atom generating the transition
1534 xmlRegStatePtr to, xmlRegAtomPtr atom) {
1537 if (atom == NULL) {
1538 ERROR("genrate transition: atom == NULL");
1541 if (atom->type == XML_REGEXP_SUBREG) {
1546 if (xmlRegAtomPush(ctxt, atom) < 0) {
1549 if ((to != NULL) && (atom->stop != to) &&
1550 (atom->quant != XML_REGEXP_QUANT_RANGE)) {
1554 xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
1556 } else if ((to == NULL) && (atom->quant != XML_REGEXP_QUANT_RANGE) &&
1557 (atom->quant != XML_REGEXP_QUANT_ONCE)) {
1561 xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
1564 switch (atom->quant) {
1566 atom->quant = XML_REGEXP_QUANT_ONCE;
1568 * transition done to the state after end of atom.
1569 * 1. set transition from atom start to new state
1570 * 2. set transition from atom end to this state.
1572 xmlFAGenerateEpsilonTransition(ctxt, atom->start, 0);
1573 xmlFAGenerateEpsilonTransition(ctxt, atom->stop, ctxt->state);
1576 atom->quant = XML_REGEXP_QUANT_ONCE;
1577 xmlFAGenerateEpsilonTransition(ctxt, atom->start, atom->stop);
1578 xmlFAGenerateEpsilonTransition(ctxt, atom->stop, atom->start);
1581 atom->quant = XML_REGEXP_QUANT_ONCE;
1582 xmlFAGenerateEpsilonTransition(ctxt, atom->stop, atom->start);
1604 if ((atom->min == 0) && (atom->start0 == NULL)) {
1607 * duplicate a transition based on atom to count next
1608 * occurences after 1. We cannot loop to atom->start
1615 copy = xmlRegCopyAtom(ctxt, atom);
1622 if (xmlFAGenerateTransitions(ctxt, atom->start, NULL, copy)
1627 ctxt->counters[counter].min = atom->min - 1;
1628 ctxt->counters[counter].max = atom->max - 1;
1631 atom->stop, counter);
1636 xmlFAGenerateEpsilonTransition(ctxt, atom->start,
1640 * either we need the atom at least once or there
1641 * is an atom->start0 allowing to easilly plug the
1645 ctxt->counters[counter].min = atom->min - 1;
1646 ctxt->counters[counter].max = atom->max - 1;
1648 xmlFAGenerateCountedEpsilonTransition(ctxt, atom->stop,
1649 atom->start, counter);
1651 xmlFAGenerateCountedTransition(ctxt, atom->stop,
1654 if (atom->min == 0)
1655 xmlFAGenerateEpsilonTransition(ctxt, atom->start0,
1659 atom->min = 0;
1660 atom->max = 0;
1661 atom->quant = XML_REGEXP_QUANT_ONCE;
1669 if ((atom->min == 0) && (atom->max == 0) &&
1670 (atom->quant == XML_REGEXP_QUANT_RANGE)) {
1672 * we can discard the atom and generate an epsilon transition instead
1684 xmlRegFreeAtom(atom);
1696 if ((atom->quant == XML_REGEXP_QUANT_MULT) ||
1697 (atom->quant == XML_REGEXP_QUANT_PLUS)) {
1714 if (xmlRegAtomPush(ctxt, atom) < 0) {
1717 xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1);
1719 switch (atom->quant) {
1721 atom->quant = XML_REGEXP_QUANT_ONCE;
1725 atom->quant = XML_REGEXP_QUANT_ONCE;
1727 xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1);
1730 atom->quant = XML_REGEXP_QUANT_ONCE;
1731 xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1);
1735 if (atom->min == 0) {
1784 if (to->trans[transnr].atom == NULL) {
1816 xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom,
1820 xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom,
1857 if ((state->trans[0].atom == NULL) &&
1883 xmlRegStateAddTrans(ctxt, tmp, tmp->trans[j].atom,
1950 if ((state->trans[transnr].atom == NULL) &&
1990 if ((trans->atom == NULL) &&
2018 ((state->trans[transnr].atom != NULL) ||
2223 * @type1: an atom type
2224 * @type2: an atom type
2424 * @atom1: an atom
2425 * @atom2: an atom
2465 * @atom1: an atom
2466 * @atom2: an atom
2559 int to, xmlRegAtomPtr atom) {
2577 if (t1->atom == NULL) {
2581 to, atom);
2590 if (xmlFACompareAtoms(t1->atom, atom)) {
2637 if (t1->atom == NULL) {
2647 if (t2->atom != NULL) {
2649 if (xmlFAEqualAtoms(t1->atom, t2->atom))
2659 * with the same atom and a different target.
2674 if (t1->atom == NULL) {
2683 if (t2->atom != NULL) {
2685 if (xmlFACompareAtoms(t1->atom, t2->atom)) {
2698 t2->to, t2->atom);
2913 xmlRegCheckCharacter(xmlRegAtomPtr atom, int codepoint) {
2917 if ((atom == NULL) || (!IS_CHAR(codepoint)))
2920 switch (atom->type) {
2925 return(codepoint == atom->codepoint);
2929 for (i = 0;i < atom->nbRanges;i++) {
2930 range = atom->ranges[i];
3006 ret = xmlRegCheckCharacterRange(atom->type, codepoint, 0, 0, 0,
3007 (const xmlChar *)atom->valuep);
3008 if (atom->neg)
3168 xmlRegAtomPtr atom;
3181 * atom allows minOccurs of 0
3186 atom = trans->atom;
3187 if (!((atom->min == 0) && (atom->max > 0)))
3199 atom = trans->atom;
3223 } else if (atom == NULL) {
3229 ret = xmlRegCheckCharacter(atom, codepoint);
3230 if ((ret == 1) && (atom->min >= 0) && (atom->max > 0)) {
3266 if (exec->transcount == atom->max) {
3277 if (exec->transcount >= atom->min) {
3292 ret = xmlRegCheckCharacter(atom, codepoint);
3295 if (exec->transcount < atom->min)
3317 } else if ((ret == 0) && (atom->min == 0) && (atom->max > 0)) {
3327 } else if ((atom->min == 0) && (atom->max > 0)) {
3339 printf("Saving on nd transition atom %d for %c at %d\n",
3340 trans->atom->no, codepoint, exec->index);
3382 if (trans->atom != NULL) {
3431 * Progressive interface to the verifier one atom at a time *
3725 xmlRegAtomPtr atom;
3780 atom = trans->atom;
3806 (t->atom != NULL) &&
3807 (xmlStrEqual(value, t->atom->valuep))) {
3813 (t->atom != NULL) &&
3814 (xmlStrEqual(value, t->atom->valuep))) {
3860 } else if (atom == NULL) {
3865 ret = xmlRegStrEqualWildcard(atom->valuep, value);
3866 if (atom->neg) {
3881 if ((ret == 1) && (atom->min > 0) && (atom->max > 0)) {
3898 if (exec->transcount == atom->max) {
3915 if (exec->transcount >= atom->min) {
3931 ret = xmlStrEqual(value, atom->valuep);
3934 if (exec->transcount < atom->min)
3949 if ((exec->callback != NULL) && (atom != NULL) &&
3951 exec->callback(exec->data, atom->valuep,
3952 atom->data, data);
3993 if (trans->atom != NULL) {
4210 xmlRegAtomPtr atom;
4233 atom = trans->atom;
4234 if ((atom == NULL) || (atom->valuep == NULL))
4253 if (atom->neg)
4254 values[nb++] = (xmlChar *) atom->valuep2;
4256 values[nb++] = (xmlChar *) atom->valuep;
4263 if (atom->neg)
4264 values[nb++] = (xmlChar *) atom->valuep2;
4266 values[nb++] = (xmlChar *) atom->valuep;
4277 atom = trans->atom;
4278 if ((atom == NULL) || (atom->valuep == NULL))
4290 if (atom->neg)
4291 values[nb++] = (xmlChar *) atom->valuep2;
4293 values[nb++] = (xmlChar *) atom->valuep;
4373 xmlRegAtomPtr atom;
4399 atom = trans->atom;
4416 } else if (atom == NULL) {
4422 ret = xmlRegCheckCharacter(atom, codepoint);
4423 if ((ret == 1) && (atom->min > 0) && (atom->max > 0)) {
4437 if (exec->transcount == atom->max) {
4448 if (exec->transcount >= atom->min) {
4463 ret = xmlRegCheckCharacter(atom, codepoint);
4466 if (exec->transcount < atom->min)
4504 if (trans->atom != NULL) {
4766 if (ctxt->atom == NULL) {
4767 ctxt->atom = xmlRegNewAtom(ctxt, type);
4768 if (ctxt->atom != NULL)
4769 ctxt->atom->valuep = blockName;
4770 } else if (ctxt->atom->type == XML_REGEXP_RANGES) {
4771 xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
4791 if (ctxt->atom == NULL) {
4792 ctxt->atom = xmlRegNewAtom(ctxt, XML_REGEXP_ANYCHAR);
4793 } else if (ctxt->atom->type == XML_REGEXP_RANGES) {
4794 xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
4827 ctxt->atom->neg = 1;
4838 if (ctxt->atom == NULL) {
4839 ctxt->atom = xmlRegNewAtom(ctxt, XML_REGEXP_CHARVAL);
4840 if (ctxt->atom != NULL) {
4843 ctxt->atom->codepoint = '\n';
4846 ctxt->atom->codepoint = '\r';
4849 ctxt->atom->codepoint = '\t';
4852 ctxt->atom->codepoint = cur;
4855 } else if (ctxt->atom->type == XML_REGEXP_RANGES) {
4856 xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
4898 if (ctxt->atom == NULL) {
4899 ctxt->atom = xmlRegNewAtom(ctxt, type);
4900 } else if (ctxt->atom->type == XML_REGEXP_RANGES) {
4901 xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
4965 xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
4998 xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
5074 ctxt->atom = xmlRegNewAtom(ctxt, XML_REGEXP_RANGES);
5075 if (ctxt->atom == NULL)
5128 if (ctxt->atom != NULL) {
5130 ctxt->atom->quant = XML_REGEXP_QUANT_OPT;
5132 ctxt->atom->quant = XML_REGEXP_QUANT_MULT;
5134 ctxt->atom->quant = XML_REGEXP_QUANT_PLUS;
5166 if (ctxt->atom != NULL) {
5167 ctxt->atom->quant = XML_REGEXP_QUANT_RANGE;
5168 ctxt->atom->min = min;
5169 ctxt->atom->max = max;
5180 * [9] atom ::= Char | charClass | ( '(' regExp ')' )
5188 ctxt->atom = xmlRegNewAtom(ctxt, XML_REGEXP_CHARVAL);
5189 if (ctxt->atom == NULL)
5192 ctxt->atom->codepoint = codepoint;
5215 ctxt->atom = NULL;
5222 ctxt->atom = xmlRegNewAtom(ctxt, XML_REGEXP_SUBREG);
5223 if (ctxt->atom == NULL)
5225 ctxt->atom->start = start;
5226 ctxt->atom->start0 = start0;
5227 ctxt->atom->stop = ctxt->state;
5241 * [3] piece ::= atom quantifier?
5247 ctxt->atom = NULL;
5251 if (ctxt->atom == NULL) {
5252 ERROR("internal: no atom generated");
5277 (CUR=='|' || CUR==')') ? to : NULL, ctxt->atom) < 0)
5280 ctxt->atom = NULL;
5286 (CUR=='|' || CUR==')') ? to : NULL, ctxt->atom) < 0)
5289 ctxt->atom = NULL;
5621 xmlRegAtomPtr atom;
5625 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5626 if (atom == NULL)
5628 atom->data = data;
5629 if (atom == NULL)
5631 atom->valuep = xmlStrdup(token);
5633 if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
5634 xmlRegFreeAtom(atom);
5661 xmlRegAtomPtr atom;
5665 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5666 if (atom == NULL)
5668 atom->data = data;
5670 atom->valuep = xmlStrdup(token);
5680 xmlRegFreeAtom(atom);
5688 atom->valuep = str;
5691 if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
5692 xmlRegFreeAtom(atom);
5721 xmlRegAtomPtr atom;
5726 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5727 if (atom == NULL)
5729 atom->data = data;
5730 atom->neg = 1;
5732 atom->valuep = xmlStrdup(token);
5742 xmlRegFreeAtom(atom);
5750 atom->valuep = str;
5752 snprintf((char *) err_msg, 199, "not %s", (const char *) atom->valuep);
5754 atom->valuep2 = xmlStrdup(err_msg);
5756 if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
5757 xmlRegFreeAtom(atom);
5789 xmlRegAtomPtr atom;
5798 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5799 if (atom == NULL)
5802 atom->valuep = xmlStrdup(token);
5812 xmlRegFreeAtom(atom);
5820 atom->valuep = str;
5822 atom->data = data;
5824 atom->min = 1;
5826 atom->min = min;
5827 atom->max = max;
5836 /* xmlFAGenerateTransitions(am, from, to, atom); */
5841 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
5842 xmlRegAtomPush(am, atom);
5875 xmlRegAtomPtr atom;
5884 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5885 if (atom == NULL)
5887 atom->valuep = xmlStrdup(token);
5888 atom->data = data;
5890 atom->min = 1;
5892 atom->min = min;
5893 atom->max = max;
5902 /* xmlFAGenerateTransitions(am, from, to, atom); */
5907 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
5908 xmlRegAtomPush(am, atom);
5944 xmlRegAtomPtr atom;
5953 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5954 if (atom == NULL)
5957 atom->valuep = xmlStrdup(token);
5967 xmlRegFreeAtom(atom);
5975 atom->valuep = str;
5977 atom->data = data;
5978 atom->quant = XML_REGEXP_QUANT_ONCEONLY;
5979 atom->min = min;
5980 atom->max = max;
5988 /* xmlFAGenerateTransitions(am, from, to, atom); */
5993 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
5994 xmlRegAtomPush(am, atom);
6023 xmlRegAtomPtr atom;
6032 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
6033 if (atom == NULL)
6035 atom->valuep = xmlStrdup(token);
6036 atom->data = data;
6037 atom->quant = XML_REGEXP_QUANT_ONCEONLY;
6038 atom->min = min;
6039 atom->max = max;
6047 /* xmlFAGenerateTransitions(am, from, to, atom); */
6052 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
6053 xmlRegAtomPush(am, atom);
6757 * @name: the atom name
6758 * @len: the atom name lenght in byte (or -1);
6760 * Get the atom associated to this name from that context
6780 * Get the atom associated to the choice @left | @right
6805 * Get the atom associated to the sequence @left , @right
6831 * Get the atom associated to the range (@subset){@min, @max}
7006 printf("deriv atom: equal => Empty\n");
7011 printf("deriv atom: mismatch => forbid\n");