/[pcre]/code/tags/pcre-8.10/pcre_printint.src
ViewVC logotype

Diff of /code/tags/pcre-8.10/pcre_printint.src

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 391 by ph10, Tue Mar 17 21:16:01 2009 UTC revision 498 by ph10, Wed Mar 3 19:29:38 2010 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2009 University of Cambridge             Copyright (c) 1997-2010 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 43  internal form of a compiled regular expr Line 43  internal form of a compiled regular expr
43  local functions. This source file is used in two places:  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  (1) It is #included by pcre_compile.c when it is compiled in debugging mode
46  (DEBUG defined in pcre_internal.h). It is not included in production compiles.  (PCRE_DEBUG defined in pcre_internal.h). It is not included in production
47    compiles.
48    
49  (2) It is always #included by pcretest.c, which can be asked to print out a  (2) It is always #included by pcretest.c, which can be asked to print out a
50  compiled regex for debugging purposes. */  compiled regex for debugging purposes. */
# Line 189  for(;;) Line 190  for(;;)
190    
191    switch(*code)    switch(*code)
192      {      {
193    /* ========================================================================== */
194          /* These cases are never obeyed. This is a fudge that causes a compile-
195          time error if the vectors OP_names or _pcre_OP_lengths, which are indexed
196          by opcode, are not the correct length. It seems to be the only way to do
197          such a check at compile time, as the sizeof() operator does not work in
198          the C preprocessor. We do this while compiling pcretest, because that
199          #includes pcre_tables.c, which holds _pcre_OP_lengths. We can't do this
200          when building pcre_compile.c with PCRE_DEBUG set, because it doesn't then
201          know the size of _pcre_OP_lengths. */
202    
203    #ifdef COMPILING_PCRETEST
204          case OP_TABLE_LENGTH:
205          case OP_TABLE_LENGTH +
206            ((sizeof(OP_names)/sizeof(const char *) == OP_TABLE_LENGTH) &&
207            (sizeof(_pcre_OP_lengths) == OP_TABLE_LENGTH)):
208          break;
209    #endif
210    /* ========================================================================== */
211    
212      case OP_END:      case OP_END:
213      fprintf(f, "    %s\n", OP_names[*code]);      fprintf(f, "    %s\n", OP_names[*code]);
214      fprintf(f, "------------------------------------------------------------------\n");      fprintf(f, "------------------------------------------------------------------\n");
# Line 246  for(;;) Line 266  for(;;)
266      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
267      break;      break;
268    
269        case OP_CLOSE:
270        fprintf(f, "    %s %d", OP_names[*code], GET2(code, 1));
271        break;
272    
273      case OP_CREF:      case OP_CREF:
274        case OP_NCREF:
275      fprintf(f, "%3d %s", GET2(code,1), OP_names[*code]);      fprintf(f, "%3d %s", GET2(code,1), OP_names[*code]);
276      break;      break;
277    
# Line 258  for(;;) Line 283  for(;;)
283        fprintf(f, "    Cond recurse %d", c);        fprintf(f, "    Cond recurse %d", c);
284      break;      break;
285    
286        case OP_NRREF:
287        c = GET2(code, 1);
288        if (c == RREF_ANY)
289          fprintf(f, "    Cond nrecurse any");
290        else
291          fprintf(f, "    Cond nrecurse %d", c);
292        break;
293    
294      case OP_DEF:      case OP_DEF:
295      fprintf(f, "    Cond def");      fprintf(f, "    Cond def");
296      break;      break;

Legend:
Removed from v.391  
changed lines
  Added in v.498

  ViewVC Help
Powered by ViewVC 1.1.5