/[pcre]/code/branches/pcre16/pcre_printint.c
ViewVC logotype

Contents of /code/branches/pcre16/pcre_printint.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 805 - (hide annotations) (download)
Wed Dec 14 16:49:20 2011 UTC (3 years ago) by ph10
File MIME type: text/plain
File size: 19498 byte(s)
Preliminary work on pcretest for 16-bit (not complete by any means).

1 ph10 805 /*************************************************
2     * Perl-Compatible Regular Expressions *
3     *************************************************/
4    
5     /* PCRE is a library of functions to support regular expressions whose syntax
6     and semantics are as close as possible to those of the Perl 5 language.
7    
8     Written by Philip Hazel
9     Copyright (c) 1997-2010 University of Cambridge
10    
11     -----------------------------------------------------------------------------
12     Redistribution and use in source and binary forms, with or without
13     modification, are permitted provided that the following conditions are met:
14    
15     * Redistributions of source code must retain the above copyright notice,
16     this list of conditions and the following disclaimer.
17    
18     * Redistributions in binary form must reproduce the above copyright
19     notice, this list of conditions and the following disclaimer in the
20     documentation and/or other materials provided with the distribution.
21    
22     * Neither the name of the University of Cambridge nor the names of its
23     contributors may be used to endorse or promote products derived from
24     this software without specific prior written permission.
25    
26     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36     POSSIBILITY OF SUCH DAMAGE.
37     -----------------------------------------------------------------------------
38     */
39    
40    
41     /* This module contains a PCRE private debugging function for printing out the
42     internal form of a compiled regular expression, along with some supporting
43     local functions. This source file is used in two places:
44    
45     (1) It is #included by pcre_compile.c when it is compiled in debugging mode
46     (PCRE_DEBUG defined in pcre_internal.h). It is not included in production
47     compiles.
48    
49     (2) It is also compiled separately and linked with pcretest.c, which can be
50     asked to print out a compiled regex for debugging purposes. */
51    
52     #ifdef HAVE_CONFIG_H
53     #include "config.h"
54     #endif
55    
56     /* We have to include pcre_internal.h because we need the internal info for
57     displaying the results of pcre_study() and we also need to know about the
58     internal macros, structures, and other internal data values; pcretest has
59     "inside information" compared to a program that strictly follows the PCRE API.
60    
61     Although pcre_internal.h does itself include pcre.h, we explicitly include it
62     here before pcre_internal.h so that the PCRE_EXP_xxx macros get set
63     appropriately for an application, not for building PCRE. */
64    
65     #include "pcre.h"
66     #include "pcre_internal.h"
67    
68     /* These are the funtions that are contained within. It doesn't seem worth
69     having a separate .h file just for this. */
70    
71     #ifdef COMPILE_PCRE8
72     void pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths);
73     #endif
74     #ifdef COMPILE_PCRE16
75     void pcre16_printint(pcre *external_re, FILE *f, BOOL print_lengths);
76     #endif
77    
78     /* Macro that decides whether a character should be output as a literal or in
79     hexadecimal. We don't use isprint() because that can vary from system to system
80     (even without the use of locales) and we want the output always to be the same,
81     for testing purposes. */
82    
83     #ifdef EBCDIC
84     #define PRINTABLE(c) ((c) >= 64 && (c) < 255)
85     #else
86     #define PRINTABLE(c) ((c) >= 32 && (c) < 127)
87     #endif
88    
89     /* The table of operator names. */
90    
91     static const char *OP_names[] = { OP_NAME_LIST };
92    
93     /* This table of operator lengths is not actually used by the working code,
94     but its size is needed for a check that ensures it is the correct size for the
95     number of opcodes (thus catching update omissions). */
96    
97     static const pcre_uint8 OP_lengths[] = { OP_LENGTHS };
98    
99    
100    
101     /*************************************************
102     * Print single- or multi-byte character *
103     *************************************************/
104    
105     static int
106     print_char(FILE *f, pcre_uchar *ptr, BOOL utf)
107     {
108     int c = *ptr;
109    
110     #ifndef SUPPORT_UTF
111     (void)utf; /* Avoid compiler warning */
112     if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c);
113     return 0;
114    
115     #else
116    
117     #ifdef COMPILE_PCRE8
118    
119     if (!utf || (c & 0xc0) != 0xc0)
120     {
121     if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c);
122     return 0;
123     }
124     else
125     {
126     int i;
127     int a = PRIV(utf8_table4)[c & 0x3f]; /* Number of additional bytes */
128     int s = 6*a;
129     c = (c & PRIV(utf8_table3)[a]) << s;
130     for (i = 1; i <= a; i++)
131     {
132     /* This is a check for malformed UTF-8; it should only occur if the sanity
133     check has been turned off. Rather than swallow random bytes, just stop if
134     we hit a bad one. Print it with \X instead of \x as an indication. */
135    
136     if ((ptr[i] & 0xc0) != 0x80)
137     {
138     fprintf(f, "\\X{%x}", c);
139     return i - 1;
140     }
141    
142     /* The byte is OK */
143    
144     s -= 6;
145     c |= (ptr[i] & 0x3f) << s;
146     }
147     fprintf(f, "\\x{%x}", c);
148     return a;
149     }
150    
151     #else
152    
153     #ifdef COMPILE_PCRE16
154    
155     if (!utf || (c & 0xfc00) != 0xd800)
156     {
157     if (PRINTABLE(c)) fprintf(f, "%c", c);
158     else if (c <= 0xff) fprintf(f, "\\x%02x", c);
159     else fprintf(f, "\\x{%x}", c);
160     return 0;
161     }
162     else
163     {
164     /* This is a check for malformed UTF-16; it should only occur if the sanity
165     check has been turned off. Rather than swallow a low surrogate, just stop if
166     we hit a bad one. Print it with \X instead of \x as an indication. */
167    
168     if ((ptr[1] & 0xfc00) != 0xdc00)
169     {
170     fprintf(f, "\\X{%x}", c);
171     return 0;
172     }
173    
174     c = (((c & 0x3ff) << 10) | (ptr[1] & 0x3ff)) + 0x10000;
175     fprintf(f, "\\x{%x}", c);
176     return 1;
177     }
178    
179     #endif /* COMPILE_PCRE16 */
180    
181     #endif /* COMPILE_PCRE8 */
182    
183     #endif /* SUPPORT_UTF */
184     }
185    
186     /*************************************************
187     * Print uchar string (regardless of utf) *
188     *************************************************/
189    
190     static void
191     print_puchar(FILE *f, PCRE_PUCHAR ptr)
192     {
193     while (*ptr != '\0')
194     {
195     register int c = *ptr++;
196     if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x{%x}", c);
197     }
198     }
199    
200     /*************************************************
201     * Find Unicode property name *
202     *************************************************/
203    
204     static const char *
205     get_ucpname(int ptype, int pvalue)
206     {
207     #ifdef SUPPORT_UCP
208     int i;
209     for (i = PRIV(utt_size) - 1; i >= 0; i--)
210     {
211     if (ptype == PRIV(utt)[i].type && pvalue == PRIV(utt)[i].value) break;
212     }
213     return (i >= 0)? PRIV(utt_names) + PRIV(utt)[i].name_offset : "??";
214     #else
215     /* It gets harder and harder to shut off unwanted compiler warnings. */
216     ptype = ptype * pvalue;
217     return (ptype == pvalue)? "??" : "??";
218     #endif
219     }
220    
221    
222    
223     /*************************************************
224     * Print compiled regex *
225     *************************************************/
226    
227     /* Make this function work for a regex with integers either byte order.
228     However, we assume that what we are passed is a compiled regex. The
229     print_lengths flag controls whether offsets and lengths of items are printed.
230     They can be turned off from pcretest so that automatic tests on bytecode can be
231     written that do not depend on the value of LINK_SIZE. */
232    
233     #ifdef COMPILE_PCRE8
234     void
235     pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths)
236     #else
237     void
238     pcre16_printint(pcre *external_re, FILE *f, BOOL print_lengths)
239     #endif
240     {
241     real_pcre *re = (real_pcre *)external_re;
242     pcre_uchar *codestart, *code;
243     BOOL utf;
244    
245     unsigned int options = re->options;
246     int offset = re->name_table_offset;
247     int count = re->name_count;
248     int size = re->name_entry_size;
249    
250     if (re->magic_number != MAGIC_NUMBER)
251     {
252     offset = ((offset << 8) & 0xff00) | ((offset >> 8) & 0xff);
253     count = ((count << 8) & 0xff00) | ((count >> 8) & 0xff);
254     size = ((size << 8) & 0xff00) | ((size >> 8) & 0xff);
255     options = ((options << 24) & 0xff000000) |
256     ((options << 8) & 0x00ff0000) |
257     ((options >> 8) & 0x0000ff00) |
258     ((options >> 24) & 0x000000ff);
259     }
260    
261     code = codestart = (pcre_uchar *)re + offset + count * size;
262     /* PCRE_UTF16 has the same value as PCRE_UTF8. */
263     utf = (options & PCRE_UTF8) != 0;
264    
265     for(;;)
266     {
267     pcre_uchar *ccode;
268     const char *flag = " ";
269     int c;
270     int extra = 0;
271    
272     if (print_lengths)
273     fprintf(f, "%3d ", (int)(code - codestart));
274     else
275     fprintf(f, " ");
276    
277     switch(*code)
278     {
279     /* ========================================================================== */
280     /* These cases are never obeyed. This is a fudge that causes a compile-
281     time error if the vectors OP_names or OP_lengths, which are indexed
282     by opcode, are not the correct length. It seems to be the only way to do
283     such a check at compile time, as the sizeof() operator does not work in
284     the C preprocessor. */
285    
286     case OP_TABLE_LENGTH:
287     case OP_TABLE_LENGTH +
288     ((sizeof(OP_names)/sizeof(const char *) == OP_TABLE_LENGTH) &&
289     (sizeof(OP_lengths) == OP_TABLE_LENGTH)):
290     break;
291     /* ========================================================================== */
292    
293     case OP_END:
294     fprintf(f, " %s\n", OP_names[*code]);
295     fprintf(f, "------------------------------------------------------------------\n");
296     return;
297    
298     case OP_CHAR:
299     fprintf(f, " ");
300     do
301     {
302     code++;
303     code += 1 + print_char(f, code, utf);
304     }
305     while (*code == OP_CHAR);
306     fprintf(f, "\n");
307     continue;
308    
309     case OP_CHARI:
310     fprintf(f, " /i ");
311     do
312     {
313     code++;
314     code += 1 + print_char(f, code, utf);
315     }
316     while (*code == OP_CHARI);
317     fprintf(f, "\n");
318     continue;
319    
320     case OP_CBRA:
321     case OP_CBRAPOS:
322     case OP_SCBRA:
323     case OP_SCBRAPOS:
324     if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
325     else fprintf(f, " ");
326     fprintf(f, "%s %d", OP_names[*code], GET2(code, 1+LINK_SIZE));
327     break;
328    
329     case OP_BRA:
330     case OP_BRAPOS:
331     case OP_SBRA:
332     case OP_SBRAPOS:
333     case OP_KETRMAX:
334     case OP_KETRMIN:
335     case OP_KETRPOS:
336     case OP_ALT:
337     case OP_KET:
338     case OP_ASSERT:
339     case OP_ASSERT_NOT:
340     case OP_ASSERTBACK:
341     case OP_ASSERTBACK_NOT:
342     case OP_ONCE:
343     case OP_ONCE_NC:
344     case OP_COND:
345     case OP_SCOND:
346     case OP_REVERSE:
347     if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
348     else fprintf(f, " ");
349     fprintf(f, "%s", OP_names[*code]);
350     break;
351    
352     case OP_CLOSE:
353     fprintf(f, " %s %d", OP_names[*code], GET2(code, 1));
354     break;
355    
356     case OP_CREF:
357     case OP_NCREF:
358     fprintf(f, "%3d %s", GET2(code,1), OP_names[*code]);
359     break;
360    
361     case OP_RREF:
362     c = GET2(code, 1);
363     if (c == RREF_ANY)
364     fprintf(f, " Cond recurse any");
365     else
366     fprintf(f, " Cond recurse %d", c);
367     break;
368    
369     case OP_NRREF:
370     c = GET2(code, 1);
371     if (c == RREF_ANY)
372     fprintf(f, " Cond nrecurse any");
373     else
374     fprintf(f, " Cond nrecurse %d", c);
375     break;
376    
377     case OP_DEF:
378     fprintf(f, " Cond def");
379     break;
380    
381     case OP_STARI:
382     case OP_MINSTARI:
383     case OP_POSSTARI:
384     case OP_PLUSI:
385     case OP_MINPLUSI:
386     case OP_POSPLUSI:
387     case OP_QUERYI:
388     case OP_MINQUERYI:
389     case OP_POSQUERYI:
390     flag = "/i";
391     /* Fall through */
392     case OP_STAR:
393     case OP_MINSTAR:
394     case OP_POSSTAR:
395     case OP_PLUS:
396     case OP_MINPLUS:
397     case OP_POSPLUS:
398     case OP_QUERY:
399     case OP_MINQUERY:
400     case OP_POSQUERY:
401     case OP_TYPESTAR:
402     case OP_TYPEMINSTAR:
403     case OP_TYPEPOSSTAR:
404     case OP_TYPEPLUS:
405     case OP_TYPEMINPLUS:
406     case OP_TYPEPOSPLUS:
407     case OP_TYPEQUERY:
408     case OP_TYPEMINQUERY:
409     case OP_TYPEPOSQUERY:
410     fprintf(f, " %s ", flag);
411     if (*code >= OP_TYPESTAR)
412     {
413     fprintf(f, "%s", OP_names[code[1]]);
414     if (code[1] == OP_PROP || code[1] == OP_NOTPROP)
415     {
416     fprintf(f, " %s ", get_ucpname(code[2], code[3]));
417     extra = 2;
418     }
419     }
420     else extra = print_char(f, code+1, utf);
421     fprintf(f, "%s", OP_names[*code]);
422     break;
423    
424     case OP_EXACTI:
425     case OP_UPTOI:
426     case OP_MINUPTOI:
427     case OP_POSUPTOI:
428     flag = "/i";
429     /* Fall through */
430     case OP_EXACT:
431     case OP_UPTO:
432     case OP_MINUPTO:
433     case OP_POSUPTO:
434     fprintf(f, " %s ", flag);
435     extra = print_char(f, code + 1 + IMM2_SIZE, utf);
436     fprintf(f, "{");
437     if (*code != OP_EXACT && *code != OP_EXACTI) fprintf(f, "0,");
438     fprintf(f, "%d}", GET2(code,1));
439     if (*code == OP_MINUPTO || *code == OP_MINUPTOI) fprintf(f, "?");
440     else if (*code == OP_POSUPTO || *code == OP_POSUPTOI) fprintf(f, "+");
441     break;
442    
443     case OP_TYPEEXACT:
444     case OP_TYPEUPTO:
445     case OP_TYPEMINUPTO:
446     case OP_TYPEPOSUPTO:
447     fprintf(f, " %s", OP_names[code[1 + IMM2_SIZE]]);
448     if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
449     {
450     fprintf(f, " %s ", get_ucpname(code[1 + IMM2_SIZE + 1],
451     code[1 + IMM2_SIZE + 2]));
452     extra = 2;
453     }
454     fprintf(f, "{");
455     if (*code != OP_TYPEEXACT) fprintf(f, "0,");
456     fprintf(f, "%d}", GET2(code,1));
457     if (*code == OP_TYPEMINUPTO) fprintf(f, "?");
458     else if (*code == OP_TYPEPOSUPTO) fprintf(f, "+");
459     break;
460    
461     case OP_NOTI:
462     flag = "/i";
463     /* Fall through */
464     case OP_NOT:
465     c = code[1];
466     if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);
467     else fprintf(f, " %s [^\\x%02x]", flag, c);
468     break;
469    
470     case OP_NOTSTARI:
471     case OP_NOTMINSTARI:
472     case OP_NOTPOSSTARI:
473     case OP_NOTPLUSI:
474     case OP_NOTMINPLUSI:
475     case OP_NOTPOSPLUSI:
476     case OP_NOTQUERYI:
477     case OP_NOTMINQUERYI:
478     case OP_NOTPOSQUERYI:
479     flag = "/i";
480     /* Fall through */
481    
482     case OP_NOTSTAR:
483     case OP_NOTMINSTAR:
484     case OP_NOTPOSSTAR:
485     case OP_NOTPLUS:
486     case OP_NOTMINPLUS:
487     case OP_NOTPOSPLUS:
488     case OP_NOTQUERY:
489     case OP_NOTMINQUERY:
490     case OP_NOTPOSQUERY:
491     c = code[1];
492     if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);
493     else fprintf(f, " %s [^\\x%02x]", flag, c);
494     fprintf(f, "%s", OP_names[*code]);
495     break;
496    
497     case OP_NOTEXACTI:
498     case OP_NOTUPTOI:
499     case OP_NOTMINUPTOI:
500     case OP_NOTPOSUPTOI:
501     flag = "/i";
502     /* Fall through */
503    
504     case OP_NOTEXACT:
505     case OP_NOTUPTO:
506     case OP_NOTMINUPTO:
507     case OP_NOTPOSUPTO:
508     c = code[1 + IMM2_SIZE];
509     if (PRINTABLE(c)) fprintf(f, " %s [^%c]{", flag, c);
510     else fprintf(f, " %s [^\\x%02x]{", flag, c);
511     if (*code != OP_NOTEXACT && *code != OP_NOTEXACTI) fprintf(f, "0,");
512     fprintf(f, "%d}", GET2(code,1));
513     if (*code == OP_NOTMINUPTO || *code == OP_NOTMINUPTOI) fprintf(f, "?");
514     else
515     if (*code == OP_NOTPOSUPTO || *code == OP_NOTPOSUPTOI) fprintf(f, "+");
516     break;
517    
518     case OP_RECURSE:
519     if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
520     else fprintf(f, " ");
521     fprintf(f, "%s", OP_names[*code]);
522     break;
523    
524     case OP_REFI:
525     flag = "/i";
526     /* Fall through */
527     case OP_REF:
528     fprintf(f, " %s \\%d", flag, GET2(code,1));
529     ccode = code + PRIV(OP_lengths)[*code];
530     goto CLASS_REF_REPEAT;
531    
532     case OP_CALLOUT:
533     fprintf(f, " %s %d %d %d", OP_names[*code], code[1], GET(code,2),
534     GET(code, 2 + LINK_SIZE));
535     break;
536    
537     case OP_PROP:
538     case OP_NOTPROP:
539     fprintf(f, " %s %s", OP_names[*code], get_ucpname(code[1], code[2]));
540     break;
541    
542     /* OP_XCLASS can only occur in UTF or PCRE16 modes. However, there's no
543     harm in having this code always here, and it makes it less messy without
544     all those #ifdefs. */
545    
546     case OP_CLASS:
547     case OP_NCLASS:
548     case OP_XCLASS:
549     {
550     int i, min, max;
551     BOOL printmap;
552     pcre_uint8 *map;
553    
554     fprintf(f, " [");
555    
556     if (*code == OP_XCLASS)
557     {
558     extra = GET(code, 1);
559     ccode = code + LINK_SIZE + 1;
560     printmap = (*ccode & XCL_MAP) != 0;
561     if ((*ccode++ & XCL_NOT) != 0) fprintf(f, "^");
562     }
563     else
564     {
565     printmap = TRUE;
566     ccode = code + 1;
567     }
568    
569     /* Print a bit map */
570    
571     if (printmap)
572     {
573     map = (pcre_uint8 *)ccode;
574     for (i = 0; i < 256; i++)
575     {
576     if ((map[i/8] & (1 << (i&7))) != 0)
577     {
578     int j;
579     for (j = i+1; j < 256; j++)
580     if ((map[j/8] & (1 << (j&7))) == 0) break;
581     if (i == '-' || i == ']') fprintf(f, "\\");
582     if (PRINTABLE(i)) fprintf(f, "%c", i);
583     else fprintf(f, "\\x%02x", i);
584     if (--j > i)
585     {
586     if (j != i + 1) fprintf(f, "-");
587     if (j == '-' || j == ']') fprintf(f, "\\");
588     if (PRINTABLE(j)) fprintf(f, "%c", j);
589     else fprintf(f, "\\x%02x", j);
590     }
591     i = j;
592     }
593     }
594     ccode += 32 / sizeof(pcre_uchar);
595     }
596    
597     /* For an XCLASS there is always some additional data */
598    
599     if (*code == OP_XCLASS)
600     {
601     int ch;
602     while ((ch = *ccode++) != XCL_END)
603     {
604     if (ch == XCL_PROP)
605     {
606     int ptype = *ccode++;
607     int pvalue = *ccode++;
608     fprintf(f, "\\p{%s}", get_ucpname(ptype, pvalue));
609     }
610     else if (ch == XCL_NOTPROP)
611     {
612     int ptype = *ccode++;
613     int pvalue = *ccode++;
614     fprintf(f, "\\P{%s}", get_ucpname(ptype, pvalue));
615     }
616     else
617     {
618     ccode += 1 + print_char(f, ccode, TRUE);
619     if (ch == XCL_RANGE)
620     {
621     fprintf(f, "-");
622     ccode += 1 + print_char(f, ccode, TRUE);
623     }
624     }
625     }
626     }
627    
628     /* Indicate a non-UTF class which was created by negation */
629    
630     fprintf(f, "]%s", (*code == OP_NCLASS)? " (neg)" : "");
631    
632     /* Handle repeats after a class or a back reference */
633    
634     CLASS_REF_REPEAT:
635     switch(*ccode)
636     {
637     case OP_CRSTAR:
638     case OP_CRMINSTAR:
639     case OP_CRPLUS:
640     case OP_CRMINPLUS:
641     case OP_CRQUERY:
642     case OP_CRMINQUERY:
643     fprintf(f, "%s", OP_names[*ccode]);
644     extra += PRIV(OP_lengths)[*ccode];
645     break;
646    
647     case OP_CRRANGE:
648     case OP_CRMINRANGE:
649     min = GET2(ccode,1);
650     max = GET2(ccode,1 + IMM2_SIZE);
651     if (max == 0) fprintf(f, "{%d,}", min);
652     else fprintf(f, "{%d,%d}", min, max);
653     if (*ccode == OP_CRMINRANGE) fprintf(f, "?");
654     extra += PRIV(OP_lengths)[*ccode];
655     break;
656    
657     /* Do nothing if it's not a repeat; this code stops picky compilers
658     warning about the lack of a default code path. */
659    
660     default:
661     break;
662     }
663     }
664     break;
665    
666     case OP_MARK:
667     case OP_PRUNE_ARG:
668     case OP_SKIP_ARG:
669     case OP_THEN_ARG:
670     fprintf(f, " %s ", OP_names[*code]);
671     print_puchar(f, code + 2);
672     extra += code[1];
673     break;
674    
675     case OP_THEN:
676     fprintf(f, " %s", OP_names[*code]);
677     break;
678    
679     case OP_CIRCM:
680     case OP_DOLLM:
681     flag = "/m";
682     /* Fall through */
683    
684     /* Anything else is just an item with no data, but possibly a flag. */
685    
686     default:
687     fprintf(f, " %s %s", flag, OP_names[*code]);
688     break;
689     }
690    
691     code += PRIV(OP_lengths)[*code] + extra;
692     fprintf(f, "\n");
693     }
694     }
695    
696     /* End of pcre_printint.src */

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12