home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / regnodes.h < prev    next >
C/C++ Source or Header  |  2000-01-27  |  13KB  |  431 lines

  1. /* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
  2.    This file is built by regcomp.pl from regcomp.sym.
  3.    Any changes made here will be lost!
  4. */
  5.  
  6. #define    END    0    /*    0 End of program. */
  7. #define    SUCCEED    1    /*  0x1 Return from a subroutine, basically. */
  8. #define    BOL    2    /*  0x2 Match "" at beginning of line. */
  9. #define    MBOL    3    /*  0x3 Same, assuming multiline. */
  10. #define    SBOL    4    /*  0x4 Same, assuming singleline. */
  11. #define    EOS    5    /*  0x5 Match "" at end of string. */
  12. #define    EOL    6    /*  0x6 Match "" at end of line. */
  13. #define    MEOL    7    /*  0x7 Same, assuming multiline. */
  14. #define    SEOL    8    /*  0x8 Same, assuming singleline. */
  15. #define    BOUND    9    /*  0x9 Match "" at any word boundary */
  16. #define    BOUNDUTF8    10    /*  0xa Match "" at any word boundary */
  17. #define    BOUNDL    11    /*  0xb Match "" at any word boundary */
  18. #define    BOUNDLUTF8    12    /*  0xc Match "" at any word boundary */
  19. #define    NBOUND    13    /*  0xd Match "" at any word non-boundary */
  20. #define    NBOUNDUTF8    14    /*  0xe Match "" at any word non-boundary */
  21. #define    NBOUNDL    15    /*  0xf Match "" at any word non-boundary */
  22. #define    NBOUNDLUTF8    16    /* 0x10 Match "" at any word non-boundary */
  23. #define    GPOS    17    /* 0x11 Matches where last m//g left off. */
  24. #define    REG_ANY    18    /* 0x12 Match any one character (except newline). */
  25. #define    ANYUTF8    19    /* 0x13 Match any one Unicode character (except newline). */
  26. #define    SANY    20    /* 0x14 Match any one character. */
  27. #define    SANYUTF8    21    /* 0x15 Match any one Unicode character. */
  28. #define    ANYOF    22    /* 0x16 Match character in (or not in) this class. */
  29. #define    ANYOFUTF8    23    /* 0x17 Match character in (or not in) this class. */
  30. #define    ALNUM    24    /* 0x18 Match any alphanumeric character */
  31. #define    ALNUMUTF8    25    /* 0x19 Match any alphanumeric character in utf8 */
  32. #define    ALNUML    26    /* 0x1a Match any alphanumeric char in locale */
  33. #define    ALNUMLUTF8    27    /* 0x1b Match any alphanumeric char in locale+utf8 */
  34. #define    NALNUM    28    /* 0x1c Match any non-alphanumeric character */
  35. #define    NALNUMUTF8    29    /* 0x1d Match any non-alphanumeric character in utf8 */
  36. #define    NALNUML    30    /* 0x1e Match any non-alphanumeric char in locale */
  37. #define    NALNUMLUTF8    31    /* 0x1f Match any non-alphanumeric char in locale+utf8 */
  38. #define    SPACE    32    /* 0x20 Match any whitespace character */
  39. #define    SPACEUTF8    33    /* 0x21 Match any whitespace character in utf8 */
  40. #define    SPACEL    34    /* 0x22 Match any whitespace char in locale */
  41. #define    SPACELUTF8    35    /* 0x23 Match any whitespace char in locale+utf8 */
  42. #define    NSPACE    36    /* 0x24 Match any non-whitespace character */
  43. #define    NSPACEUTF8    37    /* 0x25 Match any non-whitespace character in utf8 */
  44. #define    NSPACEL    38    /* 0x26 Match any non-whitespace char in locale */
  45. #define    NSPACELUTF8    39    /* 0x27 Match any non-whitespace char in locale+utf8 */
  46. #define    DIGIT    40    /* 0x28 Match any numeric character */
  47. #define    DIGITUTF8    41    /* 0x29 Match any numeric character in utf8 */
  48. #define    DIGITL    42    /* 0x2a Match any numeric character in locale */
  49. #define    DIGITLUTF8    43    /* 0x2b Match any numeric character in locale+utf8 */
  50. #define    NDIGIT    44    /* 0x2c Match any non-numeric character */
  51. #define    NDIGITUTF8    45    /* 0x2d Match any non-numeric character in utf8 */
  52. #define    NDIGITL    46    /* 0x2e Match any non-numeric character in locale */
  53. #define    NDIGITLUTF8    47    /* 0x2f Match any non-numeric character in locale+utf8 */
  54. #define    CLUMP    48    /* 0x30 Match any combining character sequence */
  55. #define    BRANCH    49    /* 0x31 Match this alternative, or the next... */
  56. #define    BACK    50    /* 0x32 Match "", "next" ptr points backward. */
  57. #define    EXACT    51    /* 0x33 Match this string (preceded by length). */
  58. #define    EXACTF    52    /* 0x34 Match this string, folded (prec. by length). */
  59. #define    EXACTFL    53    /* 0x35 Match this string, folded in locale (w/len). */
  60. #define    NOTHING    54    /* 0x36 Match empty string. */
  61. #define    TAIL    55    /* 0x37 Match empty string. Can jump here from outside. */
  62. #define    STAR    56    /* 0x38 Match this (simple) thing 0 or more times. */
  63. #define    PLUS    57    /* 0x39 Match this (simple) thing 1 or more times. */
  64. #define    CURLY    58    /* 0x3a Match this simple thing {n,m} times. */
  65. #define    CURLYN    59    /* 0x3b Match next-after-this simple thing  */
  66. #define    CURLYM    60    /* 0x3c Match this medium-complex thing {n,m} times. */
  67. #define    CURLYX    61    /* 0x3d Match this complex thing {n,m} times. */
  68. #define    WHILEM    62    /* 0x3e Do curly processing and see if rest matches. */
  69. #define    OPEN    63    /* 0x3f Mark this point in input as start of #n. */
  70. #define    CLOSE    64    /* 0x40 Analogous to OPEN. */
  71. #define    REF    65    /* 0x41 Match some already matched string */
  72. #define    REFF    66    /* 0x42 Match already matched string, folded */
  73. #define    REFFL    67    /* 0x43 Match already matched string, folded in loc. */
  74. #define    IFMATCH    68    /* 0x44 Succeeds if the following matches. */
  75. #define    UNLESSM    69    /* 0x45 Fails if the following matches. */
  76. #define    SUSPEND    70    /* 0x46 "Independent" sub-RE. */
  77. #define    IFTHEN    71    /* 0x47 Switch, should be preceeded by switcher . */
  78. #define    GROUPP    72    /* 0x48 Whether the group matched. */
  79. #define    LONGJMP    73    /* 0x49 Jump far away. */
  80. #define    BRANCHJ    74    /* 0x4a BRANCH with long offset. */
  81. #define    EVAL    75    /* 0x4b Execute some Perl code. */
  82. #define    MINMOD    76    /* 0x4c Next operator is not greedy. */
  83. #define    LOGICAL    77    /* 0x4d Next opcode should set the flag only. */
  84. #define    RENUM    78    /* 0x4e Group with independently numbered parens. */
  85. #define    OPTIMIZED    79    /* 0x4f Placeholder for dump. */
  86.  
  87. #ifndef DOINIT
  88. EXTCONST U8 PL_regkind[];
  89. #else
  90. EXTCONST U8 PL_regkind[] = {
  91.     END,        /* END */
  92.     END,        /* SUCCEED */
  93.     BOL,        /* BOL */
  94.     BOL,        /* MBOL */
  95.     BOL,        /* SBOL */
  96.     EOL,        /* EOS */
  97.     EOL,        /* EOL */
  98.     EOL,        /* MEOL */
  99.     EOL,        /* SEOL */
  100.     BOUND,        /* BOUND */
  101.     BOUND,        /* BOUNDUTF8 */
  102.     BOUND,        /* BOUNDL */
  103.     BOUND,        /* BOUNDLUTF8 */
  104.     NBOUND,        /* NBOUND */
  105.     NBOUND,        /* NBOUNDUTF8 */
  106.     NBOUND,        /* NBOUNDL */
  107.     NBOUND,        /* NBOUNDLUTF8 */
  108.     GPOS,        /* GPOS */
  109.     REG_ANY,        /* REG_ANY */
  110.     REG_ANY,        /* ANYUTF8 */
  111.     REG_ANY,        /* SANY */
  112.     REG_ANY,        /* SANYUTF8 */
  113.     ANYOF,        /* ANYOF */
  114.     ANYOF,        /* ANYOFUTF8 */
  115.     ALNUM,        /* ALNUM */
  116.     ALNUM,        /* ALNUMUTF8 */
  117.     ALNUM,        /* ALNUML */
  118.     ALNUM,        /* ALNUMLUTF8 */
  119.     NALNUM,        /* NALNUM */
  120.     NALNUM,        /* NALNUMUTF8 */
  121.     NALNUM,        /* NALNUML */
  122.     NALNUM,        /* NALNUMLUTF8 */
  123.     SPACE,        /* SPACE */
  124.     SPACE,        /* SPACEUTF8 */
  125.     SPACE,        /* SPACEL */
  126.     SPACE,        /* SPACELUTF8 */
  127.     NSPACE,        /* NSPACE */
  128.     NSPACE,        /* NSPACEUTF8 */
  129.     NSPACE,        /* NSPACEL */
  130.     NSPACE,        /* NSPACELUTF8 */
  131.     DIGIT,        /* DIGIT */
  132.     DIGIT,        /* DIGITUTF8 */
  133.     DIGIT,        /* DIGITL */
  134.     DIGIT,        /* DIGITLUTF8 */
  135.     NDIGIT,        /* NDIGIT */
  136.     NDIGIT,        /* NDIGITUTF8 */
  137.     NDIGIT,        /* NDIGITL */
  138.     NDIGIT,        /* NDIGITLUTF8 */
  139.     CLUMP,        /* CLUMP */
  140.     BRANCH,        /* BRANCH */
  141.     BACK,        /* BACK */
  142.     EXACT,        /* EXACT */
  143.     EXACT,        /* EXACTF */
  144.     EXACT,        /* EXACTFL */
  145.     NOTHING,        /* NOTHING */
  146.     NOTHING,        /* TAIL */
  147.     STAR,        /* STAR */
  148.     PLUS,        /* PLUS */
  149.     CURLY,        /* CURLY */
  150.     CURLY,        /* CURLYN */
  151.     CURLY,        /* CURLYM */
  152.     CURLY,        /* CURLYX */
  153.     WHILEM,        /* WHILEM */
  154.     OPEN,        /* OPEN */
  155.     CLOSE,        /* CLOSE */
  156.     REF,        /* REF */
  157.     REF,        /* REFF */
  158.     REF,        /* REFFL */
  159.     BRANCHJ,        /* IFMATCH */
  160.     BRANCHJ,        /* UNLESSM */
  161.     BRANCHJ,        /* SUSPEND */
  162.     BRANCHJ,        /* IFTHEN */
  163.     GROUPP,        /* GROUPP */
  164.     LONGJMP,        /* LONGJMP */
  165.     BRANCHJ,        /* BRANCHJ */
  166.     EVAL,        /* EVAL */
  167.     MINMOD,        /* MINMOD */
  168.     LOGICAL,        /* LOGICAL */
  169.     BRANCHJ,        /* RENUM */
  170.     NOTHING,        /* OPTIMIZED */
  171. };
  172. #endif
  173.  
  174.  
  175. #ifdef REG_COMP_C
  176. const static U8 regarglen[] = {
  177.     0,        /* END */
  178.     0,        /* SUCCEED */
  179.     0,        /* BOL */
  180.     0,        /* MBOL */
  181.     0,        /* SBOL */
  182.     0,        /* EOS */
  183.     0,        /* EOL */
  184.     0,        /* MEOL */
  185.     0,        /* SEOL */
  186.     0,        /* BOUND */
  187.     0,        /* BOUNDUTF8 */
  188.     0,        /* BOUNDL */
  189.     0,        /* BOUNDLUTF8 */
  190.     0,        /* NBOUND */
  191.     0,        /* NBOUNDUTF8 */
  192.     0,        /* NBOUNDL */
  193.     0,        /* NBOUNDLUTF8 */
  194.     0,        /* GPOS */
  195.     0,        /* REG_ANY */
  196.     0,        /* ANYUTF8 */
  197.     0,        /* SANY */
  198.     0,        /* SANYUTF8 */
  199.     0,        /* ANYOF */
  200.     EXTRA_SIZE(struct regnode_1),        /* ANYOFUTF8 */
  201.     0,        /* ALNUM */
  202.     0,        /* ALNUMUTF8 */
  203.     0,        /* ALNUML */
  204.     0,        /* ALNUMLUTF8 */
  205.     0,        /* NALNUM */
  206.     0,        /* NALNUMUTF8 */
  207.     0,        /* NALNUML */
  208.     0,        /* NALNUMLUTF8 */
  209.     0,        /* SPACE */
  210.     0,        /* SPACEUTF8 */
  211.     0,        /* SPACEL */
  212.     0,        /* SPACELUTF8 */
  213.     0,        /* NSPACE */
  214.     0,        /* NSPACEUTF8 */
  215.     0,        /* NSPACEL */
  216.     0,        /* NSPACELUTF8 */
  217.     0,        /* DIGIT */
  218.     0,        /* DIGITUTF8 */
  219.     0,        /* DIGITL */
  220.     0,        /* DIGITLUTF8 */
  221.     0,        /* NDIGIT */
  222.     0,        /* NDIGITUTF8 */
  223.     0,        /* NDIGITL */
  224.     0,        /* NDIGITLUTF8 */
  225.     0,        /* CLUMP */
  226.     0,        /* BRANCH */
  227.     0,        /* BACK */
  228.     0,        /* EXACT */
  229.     0,        /* EXACTF */
  230.     0,        /* EXACTFL */
  231.     0,        /* NOTHING */
  232.     0,        /* TAIL */
  233.     0,        /* STAR */
  234.     0,        /* PLUS */
  235.     EXTRA_SIZE(struct regnode_2),        /* CURLY */
  236.     EXTRA_SIZE(struct regnode_2),        /* CURLYN */
  237.     EXTRA_SIZE(struct regnode_2),        /* CURLYM */
  238.     EXTRA_SIZE(struct regnode_2),        /* CURLYX */
  239.     0,        /* WHILEM */
  240.     EXTRA_SIZE(struct regnode_1),        /* OPEN */
  241.     EXTRA_SIZE(struct regnode_1),        /* CLOSE */
  242.     EXTRA_SIZE(struct regnode_1),        /* REF */
  243.     EXTRA_SIZE(struct regnode_1),        /* REFF */
  244.     EXTRA_SIZE(struct regnode_1),        /* REFFL */
  245.     EXTRA_SIZE(struct regnode_1),        /* IFMATCH */
  246.     EXTRA_SIZE(struct regnode_1),        /* UNLESSM */
  247.     EXTRA_SIZE(struct regnode_1),        /* SUSPEND */
  248.     EXTRA_SIZE(struct regnode_1),        /* IFTHEN */
  249.     EXTRA_SIZE(struct regnode_1),        /* GROUPP */
  250.     EXTRA_SIZE(struct regnode_1),        /* LONGJMP */
  251.     EXTRA_SIZE(struct regnode_1),        /* BRANCHJ */
  252.     EXTRA_SIZE(struct regnode_1),        /* EVAL */
  253.     0,        /* MINMOD */
  254.     0,        /* LOGICAL */
  255.     EXTRA_SIZE(struct regnode_1),        /* RENUM */
  256.     0,        /* OPTIMIZED */
  257. };
  258.  
  259. const static char reg_off_by_arg[] = {
  260.     0,        /* END */
  261.     0,        /* SUCCEED */
  262.     0,        /* BOL */
  263.     0,        /* MBOL */
  264.     0,        /* SBOL */
  265.     0,        /* EOS */
  266.     0,        /* EOL */
  267.     0,        /* MEOL */
  268.     0,        /* SEOL */
  269.     0,        /* BOUND */
  270.     0,        /* BOUNDUTF8 */
  271.     0,        /* BOUNDL */
  272.     0,        /* BOUNDLUTF8 */
  273.     0,        /* NBOUND */
  274.     0,        /* NBOUNDUTF8 */
  275.     0,        /* NBOUNDL */
  276.     0,        /* NBOUNDLUTF8 */
  277.     0,        /* GPOS */
  278.     0,        /* REG_ANY */
  279.     0,        /* ANYUTF8 */
  280.     0,        /* SANY */
  281.     0,        /* SANYUTF8 */
  282.     0,        /* ANYOF */
  283.     0,        /* ANYOFUTF8 */
  284.     0,        /* ALNUM */
  285.     0,        /* ALNUMUTF8 */
  286.     0,        /* ALNUML */
  287.     0,        /* ALNUMLUTF8 */
  288.     0,        /* NALNUM */
  289.     0,        /* NALNUMUTF8 */
  290.     0,        /* NALNUML */
  291.     0,        /* NALNUMLUTF8 */
  292.     0,        /* SPACE */
  293.     0,        /* SPACEUTF8 */
  294.     0,        /* SPACEL */
  295.     0,        /* SPACELUTF8 */
  296.     0,        /* NSPACE */
  297.     0,        /* NSPACEUTF8 */
  298.     0,        /* NSPACEL */
  299.     0,        /* NSPACELUTF8 */
  300.     0,        /* DIGIT */
  301.     0,        /* DIGITUTF8 */
  302.     0,        /* DIGITL */
  303.     0,        /* DIGITLUTF8 */
  304.     0,        /* NDIGIT */
  305.     0,        /* NDIGITUTF8 */
  306.     0,        /* NDIGITL */
  307.     0,        /* NDIGITLUTF8 */
  308.     0,        /* CLUMP */
  309.     0,        /* BRANCH */
  310.     0,        /* BACK */
  311.     0,        /* EXACT */
  312.     0,        /* EXACTF */
  313.     0,        /* EXACTFL */
  314.     0,        /* NOTHING */
  315.     0,        /* TAIL */
  316.     0,        /* STAR */
  317.     0,        /* PLUS */
  318.     0,        /* CURLY */
  319.     0,        /* CURLYN */
  320.     0,        /* CURLYM */
  321.     0,        /* CURLYX */
  322.     0,        /* WHILEM */
  323.     0,        /* OPEN */
  324.     0,        /* CLOSE */
  325.     0,        /* REF */
  326.     0,        /* REFF */
  327.     0,        /* REFFL */
  328.     2,        /* IFMATCH */
  329.     2,        /* UNLESSM */
  330.     1,        /* SUSPEND */
  331.     1,        /* IFTHEN */
  332.     0,        /* GROUPP */
  333.     1,        /* LONGJMP */
  334.     1,        /* BRANCHJ */
  335.     0,        /* EVAL */
  336.     0,        /* MINMOD */
  337.     0,        /* LOGICAL */
  338.     1,        /* RENUM */
  339.     0,        /* OPTIMIZED */
  340. };
  341.  
  342. #ifdef DEBUGGING
  343. const static char * const reg_name[] = {
  344.     "END",        /*    0 */
  345.     "SUCCEED",        /*  0x1 */
  346.     "BOL",        /*  0x2 */
  347.     "MBOL",        /*  0x3 */
  348.     "SBOL",        /*  0x4 */
  349.     "EOS",        /*  0x5 */
  350.     "EOL",        /*  0x6 */
  351.     "MEOL",        /*  0x7 */
  352.     "SEOL",        /*  0x8 */
  353.     "BOUND",        /*  0x9 */
  354.     "BOUNDUTF8",        /*  0xa */
  355.     "BOUNDL",        /*  0xb */
  356.     "BOUNDLUTF8",        /*  0xc */
  357.     "NBOUND",        /*  0xd */
  358.     "NBOUNDUTF8",        /*  0xe */
  359.     "NBOUNDL",        /*  0xf */
  360.     "NBOUNDLUTF8",        /* 0x10 */
  361.     "GPOS",        /* 0x11 */
  362.     "REG_ANY",        /* 0x12 */
  363.     "ANYUTF8",        /* 0x13 */
  364.     "SANY",        /* 0x14 */
  365.     "SANYUTF8",        /* 0x15 */
  366.     "ANYOF",        /* 0x16 */
  367.     "ANYOFUTF8",        /* 0x17 */
  368.     "ALNUM",        /* 0x18 */
  369.     "ALNUMUTF8",        /* 0x19 */
  370.     "ALNUML",        /* 0x1a */
  371.     "ALNUMLUTF8",        /* 0x1b */
  372.     "NALNUM",        /* 0x1c */
  373.     "NALNUMUTF8",        /* 0x1d */
  374.     "NALNUML",        /* 0x1e */
  375.     "NALNUMLUTF8",        /* 0x1f */
  376.     "SPACE",        /* 0x20 */
  377.     "SPACEUTF8",        /* 0x21 */
  378.     "SPACEL",        /* 0x22 */
  379.     "SPACELUTF8",        /* 0x23 */
  380.     "NSPACE",        /* 0x24 */
  381.     "NSPACEUTF8",        /* 0x25 */
  382.     "NSPACEL",        /* 0x26 */
  383.     "NSPACELUTF8",        /* 0x27 */
  384.     "DIGIT",        /* 0x28 */
  385.     "DIGITUTF8",        /* 0x29 */
  386.     "DIGITL",        /* 0x2a */
  387.     "DIGITLUTF8",        /* 0x2b */
  388.     "NDIGIT",        /* 0x2c */
  389.     "NDIGITUTF8",        /* 0x2d */
  390.     "NDIGITL",        /* 0x2e */
  391.     "NDIGITLUTF8",        /* 0x2f */
  392.     "CLUMP",        /* 0x30 */
  393.     "BRANCH",        /* 0x31 */
  394.     "BACK",        /* 0x32 */
  395.     "EXACT",        /* 0x33 */
  396.     "EXACTF",        /* 0x34 */
  397.     "EXACTFL",        /* 0x35 */
  398.     "NOTHING",        /* 0x36 */
  399.     "TAIL",        /* 0x37 */
  400.     "STAR",        /* 0x38 */
  401.     "PLUS",        /* 0x39 */
  402.     "CURLY",        /* 0x3a */
  403.     "CURLYN",        /* 0x3b */
  404.     "CURLYM",        /* 0x3c */
  405.     "CURLYX",        /* 0x3d */
  406.     "WHILEM",        /* 0x3e */
  407.     "OPEN",        /* 0x3f */
  408.     "CLOSE",        /* 0x40 */
  409.     "REF",        /* 0x41 */
  410.     "REFF",        /* 0x42 */
  411.     "REFFL",        /* 0x43 */
  412.     "IFMATCH",        /* 0x44 */
  413.     "UNLESSM",        /* 0x45 */
  414.     "SUSPEND",        /* 0x46 */
  415.     "IFTHEN",        /* 0x47 */
  416.     "GROUPP",        /* 0x48 */
  417.     "LONGJMP",        /* 0x49 */
  418.     "BRANCHJ",        /* 0x4a */
  419.     "EVAL",        /* 0x4b */
  420.     "MINMOD",        /* 0x4c */
  421.     "LOGICAL",        /* 0x4d */
  422.     "RENUM",        /* 0x4e */
  423.     "OPTIMIZED",        /* 0x4f */
  424. };
  425.  
  426. const static int reg_num = 80;
  427.  
  428. #endif /* DEBUGGING */
  429. #endif /* REG_COMP_C */
  430.  
  431.