home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 10 / Fresh_Fish_10_2352.bin / new / dev / lang / sgmls / src / lextaba.c < prev    next >
Text File  |  1994-07-10  |  40KB  |  751 lines

  1. /* lextaba.c: lexical tables for ASCII. */
  2.  
  3. /* These tables are munged by setnonsgml(). */
  4.  
  5. #include "config.h"
  6. #include "entity.h"
  7. #include "lexcode.h"
  8. #include "sgmldecl.h"
  9.  
  10. /* LEXCNM: Lexical table for mixed content (PCBCONM) parse.
  11. */
  12. /* Symbols for SGML character set divisions and function characters. */
  13. #define NU      1   /* NUMERAL            Numerals */
  14. #define NMC     2   /* LC/UCNMCHAR . -    Period and hyphen */
  15. #define NMS     3   /* LC/UCNMSTRT        Lower and uppercase letters */
  16. #define SPC     4   /* SPACE     32       Space */
  17. #define NON     5   /* NONSGML   0-31 127 255 Unused, except for: */
  18. #define EE      6   /* NONSGML   00 26    Entity end (end of file) */
  19. #define EOB     7   /* NONSGML   28       End disk buffer */
  20. #define RS      8   /* Function  10       Line feed */
  21. #define RE      9   /* Function  13       Carrier return */
  22. #define SEP    10   /* SEPCHAR   09       TAB: horizontal tab */
  23. #define NSC    12   /* NONSGML   delnonch Non-SGML character prefix */
  24.  
  25. /* Symbols for SGML delimiter roles in CON and CXT.
  26.    ETI and NET must be the same in LEXCNM and LEXCON.
  27.    FRE characters are changed to FCE if an FCE entity is declared.
  28.    They are changed back to FRE when the entity is canceled.
  29. */
  30. #define ERO    13   /* &    Also CRO[1] */
  31. #define NMRE   14   /* 08   Generated non-markup RE */
  32. #define COM    15   /* -    For MDO context; also SR19 and SR20. */
  33. #undef LIT1
  34. #define LIT1   18   /* "    SR10 */
  35. #define MDO    20   /* !    Actually MDO[2] */
  36. #define MSC1   21   /* ]    Both MSC[1] and MSC[2]; also SR26. */
  37. #define MSO    22   /* [    For MDO context; also SR25. */
  38. #define PIO    23   /* ?    Actually PIO[2] */
  39. #define RNI    24   /* #    For CRO[2]; also SR11. */
  40. #define TGC1   25   /* >    For TAGO and MSC context; also MDC, PIC */
  41. #define TGO1   26   /* <    TAGO; also MDO[1], PIO[1] */
  42.  
  43. UNCH    lexcnm[256] = { /*
  44. 000  001                          bs   tab  lf   home ff   cr   so   si   */
  45. EE,  NON, NON, NON, NON, NON, NON, NON, NMRE,SEP, RS,  NON, NON, RE,  NON, NON, /*
  46.                                         eof  esc  rt   left up   down */
  47. NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, EE,  NON, EOB, NON, NON, NSC, /*
  48. 032  !    "    #    $    %    &    '    (    )    *    +    ,    -    .    /    */
  49. SPC, MDO, LIT1,RNI, FRE, FRE ,ERO, FRE, FRE, FRE, FRE, FRE, FRE, COM, NMC, ETI, /*
  50. 0    1    2    3    4    5    6    7    8    9    :    ;    <    =    >    ?    */
  51. NU , NU , NU , NU , NU , NU , NU , NU , NU , NU , FRE, FRE, TGO1,FRE, TGC1,PIO, /*
  52. @    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O    */
  53. FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
  54. P    Q    R    S    T    U    V    W    X    Y    Z    [    \    ]    ^    _    */
  55. NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, MSO, FRE, MSC1,FRE, FRE, /*
  56. `    a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    */
  57. FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
  58. p    q    r    s    t    u    v    w    x    y    z    {    |    }    ~    127  */
  59. NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, FRE, FRE, FRE, FRE, NON,
  60. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  61. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  62. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  63. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  64. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  65. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  66. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  67. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, NON
  68. };
  69. /*      free nu   nmc  nms  spc  non  ee   eob  rs   re   sep  cde  nsc  ero
  70.         nmre com  eti  lit  spcr mdo  msc  mso  net  pio  rni  tagc tago fce   */
  71. #undef ERO
  72. #undef NMRE
  73. #undef COM
  74. #undef LIT1
  75. /* def SPCR*/
  76. #undef MDO
  77. #undef MSC1
  78. #undef MSO
  79. #undef PIO
  80. #undef RNI
  81. #undef TGC1
  82. /* def TGO1*/
  83. /* def FCE*/
  84. /* LEXCON: Lexical table for RCDATA and CDATA content (PCBCON?),
  85.            prolog (PCBPRO), and nested declaration set (PCBMDS) parses.
  86.    Note: NMC is same as FRE; kept for consistency with LEXCNM and LEXLMS.
  87. */
  88. /* Symbols for SGML character set divisions and function characters. */
  89. /* Same as for LEXCNM. */
  90.  
  91. /* Symbols for SGML delimiter roles in CON, CXT, and DS.
  92.    ETI and NET must be the same in LEXCNM and LEXCON.
  93.    FRE characters are changed to FCE if an FCE entity is declared.
  94.    They are changed back to FRE when the entity is canceled.
  95. */
  96. #define ERO    13   /* &    Also CRO[1] */
  97. #define NMRE   14   /* 08   Generated non-markup RE */
  98. #define COM    15   /* -    For MDO context. */
  99. /*#define ETI    16    /    Actually ETAGO[2] */
  100. /*#define NET    17    /    When enabled. */
  101. #define MDO    18   /* !    Actually MDO[2] */
  102. #define MSC2   19   /* ]    Both MSC[1] and MSC[2]. */
  103. #define MSO    20   /* [    For MDO context. */
  104. #define PERO   21   /* %    For prolog */
  105. #define PIO    22   /* ?    Actually PIO[2] */
  106. #define RNI    23   /* #    For CRO[2]. */
  107. #define TGC2   24   /* >    For TAGO and MSC context; also MDC, PIC */
  108.  
  109. UNCH    lexcon[256] = { /*
  110. 000  001                          bs   tab  lf   home ff   cr   so   si   */
  111. EE,  NON, NON, NON, NON, NON, NON, NON, NMRE,SEP, RS,  NON, NON, RE,  NON, NON, /*
  112.                                         eof  esc  rt   left up   down */
  113. NON, NON, NON, NON, NON, NON, NON, NON, NON, NON, EE,  NON, EOB, NON, NON, NSC, /*
  114. 032  !    "    #    $    %    &    '    (    )    *    +    ,    -    .    /    */
  115. SPC, MDO, FRE, RNI, FRE, PERO,ERO, FRE, FRE, FRE, FRE, FRE, FRE, COM, NMC, ETI, /*
  116. 0    1    2    3    4    5    6    7    8    9    :    ;    <    =    >    ?    */
  117. NU , NU , NU , NU , NU , NU , NU , NU , NU , NU , FRE, FRE, TGO2,FRE, TGC2,PIO, /*
  118. @    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O    */
  119. FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
  120. P    Q    R    S    T    U    V    W    X    Y    Z    [    \    ]    ^    _    */
  121. NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, MSO, FRE, MSC2,FRE, FRE, /*
  122. `    a    b    c    d    e    f    g    h    i    j    k    l    m    n    o    */
  123. FRE, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, /*
  124. p    q    r    s    t    u    v    w    x    y    z    {    |    }    ~    127  */
  125. NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, NMS, FRE, FRE, FRE, FRE, NON,
  126. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  127. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  128. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  129. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  130. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  131. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  132. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE,
  133. FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, FRE, NON
  134. };
  135. /*      free nu   nmc  nms  spc  non  ee   eob  rs   re   sep  cde  nsc  ero
  136.         nmre com  eti  net  mdo  msc  mso  pero pio  rni  tagc tago  */
  137. #undef FRE
  138. #undef NU
  139. #undef NMC
  140. #undef NMS
  141. #undef SPC
  142. #undef NON
  143. #undef EE
  144. #undef EOB
  145. #undef RS
  146. #undef RE
  147. #undef SEP
  148. #undef NSC
  149. #undef ERO
  150. #undef NMRE
  151. #undef COM
  152. /* def ETI*/
  153. /* def NET*/
  154. #undef MDO
  155. #undef MSC2
  156. #undef MSO
  157. #undef PERO
  158. #undef PIO
  159. #undef RNI
  160. #undef TGC2
  161. /* LEXGRP: Lexical table for group parses, including PCBREF.
  162. */
  163. /* Symbols for SGML character set divisions. */
  164. #define BIT     0   /* Bit combinations (not NONCHAR) not allowed in a group. */
  165. #define NMC     1   /* NAMECHAR  . -      Period, underscore, and numerals */
  166. #define NMS     2   /* NAMESTRT           Lower and uppercase letters */
  167. #define RE      3   /* Function  13       Carrier return */
  168. #define SPC     4   /* SPACE     32 09    Space; includes TAB *