1
0

LEXTAB.C 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. /*
  2. * Created by IBM PC LEX from file "scan.l"
  3. * - for use with standard I/O
  4. */
  5. #include <stdio.h>
  6. #include <lex.h>
  7. #define LL16BIT int
  8. int _lmovb(struct lextab *lp, int c, int st)
  9. {
  10. int base;
  11. while ((base = lp->llbase[st]+c) > lp->llnxtmax ||
  12. (lp->llcheck[base] & 0377) != st) {
  13. if (st != lp->llendst) {
  14. base = lp->lldefault[st] & 0377;
  15. st = base;
  16. }
  17. else
  18. return(-1);
  19. }
  20. return(lp->llnext[base]&0377);
  21. }
  22. int lexval;
  23. char lbuf[];
  24. #define YYSTYPE int
  25. #include "cal_tab.h"
  26. int c;
  27. extern YYSTYPE yylval;
  28. int translate(int type);
  29. void count(void);
  30. void setLastVar(void);
  31. int lookup(int *typeOfObject);
  32. #define INTCONST 1
  33. #define DBLCONST 2
  34. #define HEXCONST 3
  35. #define VARIABLE 4
  36. #define OTHER 5
  37. int _Alextab(__na__)
  38. {
  39. if (__na__ >= 0 && __na__ <= 19) count();
  40. switch (__na__)
  41. {
  42. case 0: yylval = translate(HEXCONST); return VALUE;
  43. case 1: yylval = translate(INTCONST); return VALUE;
  44. case 2: yylval = translate(INTCONST); return VALUE;
  45. case 3: yylval = translate(DBLCONST); return VALUE;
  46. case 4:
  47. case 5: setLastVar(); yylval = lookup(&__na__); return __na__;
  48. case 6: return '+';
  49. case 7: return '-';
  50. case 8: return '*';
  51. case 9: return '/';
  52. case 10: return '%';
  53. case 11: return '&';
  54. case 12: return '|';
  55. case 13: return '(';
  56. case 14: return ')';
  57. case 15: return '=';
  58. case 16: return ',';
  59. case 17: return ';';
  60. }
  61. return (LEXSKIP);
  62. }
  63. char _Flextab[] =
  64. {
  65. 1, 18, 17, 16, 15, 14, 13, 12,
  66. 11, 10, 9, 8, 7, 6, 4, 5,
  67. 5, 4, 4, 3, 3, 3, 3, 4,
  68. 0, 4, 5, 0, 5, 4, 1, 3,
  69. 0, 2, -1, 1, -1,
  70. };
  71. char _Nlextab[] =
  72. {
  73. 36, 36, 36, 36, 36, 36, 36, 36,
  74. 36, 1, 36, 36, 36, 36, 36, 36,
  75. 36, 36, 36, 36, 36, 36, 36, 36,
  76. 36, 36, 36, 36, 36, 36, 36, 36,
  77. 1, 36, 36, 36, 36, 9, 8, 36,
  78. 6, 5, 11, 13, 3, 12, 19, 10,
  79. 30, 30, 30, 30, 30, 30, 30, 30,
  80. 30, 30, 36, 2, 36, 4, 36, 36,
  81. 36, 29, 29, 29, 29, 29, 29, 18,
  82. 18, 18, 18, 18, 18, 18, 18, 18,
  83. 18, 18, 18, 18, 18, 18, 18, 18,
  84. 18, 18, 18, 36, 36, 36, 36, 18,
  85. 36, 29, 29, 29, 29, 29, 23, 18,
  86. 18, 18, 18, 18, 18, 18, 18, 18,
  87. 18, 18, 18, 18, 18, 18, 14, 18,
  88. 18, 18, 18, 36, 7, 15, 15, 15,
  89. 15, 15, 15, 15, 15, 15, 15, 36,
  90. 36, 36, 36, 36, 36, 36, 17, 17,
  91. 17, 17, 17, 17, 17, 17, 17, 17,
  92. 17, 17, 17, 17, 17, 17, 17, 17,
  93. 17, 17, 17, 17, 17, 17, 17, 17,
  94. 36, 36, 36, 36, 17, 36, 17, 17,
  95. 17, 17, 17, 17, 17, 17, 17, 17,
  96. 17, 17, 17, 17, 17, 17, 17, 17,
  97. 17, 17, 17, 17, 17, 17, 17, 17,
  98. 15, 15, 15, 15, 15, 15, 15, 15,
  99. 15, 15, 36, 36, 36, 36, 36, 36,
  100. 36, 16, 16, 16, 16, 16, 16, 16,
  101. 16, 16, 16, 16, 16, 16, 16, 16,
  102. 16, 16, 16, 16, 16, 16, 16, 16,
  103. 16, 16, 16, 36, 36, 36, 36, 16,
  104. 36, 16, 16, 16, 16, 16, 16, 16,
  105. 16, 16, 16, 16, 16, 16, 16, 16,
  106. 16, 16, 16, 16, 16, 16, 16, 16,
  107. 16, 16, 16, 22, 22, 22, 22, 22,
  108. 22, 22, 22, 22, 22, 21, 21, 21,
  109. 21, 21, 21, 21, 21, 21, 21, 36,
  110. 20, 26, 26, 26, 26, 26, 26, 26,
  111. 26, 26, 26, 36, 36, 36, 36, 36,
  112. 36, 36, 25, 25, 25, 25, 25, 25,
  113. 36, 24, 36, 36, 36, 36, 36, 36,
  114. 20, 36, 36, 36, 36, 36, 36, 36,
  115. 36, 36, 36, 36, 36, 36, 36, 36,
  116. 36, 36, 25, 25, 25, 25, 25, 25,
  117. 36, 24, 26, 26, 26, 26, 26, 26,
  118. 26, 26, 26, 26, 36, 36, 36, 36,
  119. 36, 36, 36, 28, 28, 28, 28, 28,
  120. 28, 36, 27, 36, 36, 36, 36, 36,
  121. 36, 36, 36, 36, 36, 36, 36, 36,
  122. 36, 36, 36, 36, 36, 36, 36, 36,
  123. 36, 36, 36, 28, 28, 28, 28, 28,
  124. 28, 31, 27, 35, 35, 35, 35, 35,
  125. 35, 35, 35, 35, 35, 36, 36, 36,
  126. 36, 36, 36, 36, 34, 34, 34, 33,
  127. 34, 34, 36, 32, 36, 36, 36, 36,
  128. 36, 36, 36, 36, 36, 36, 36, 36,
  129. 36, 36, 36, 36, 36, 36, 36, 36,
  130. 36, 36, 36, 36, 34, 34, 34, 33,
  131. 34, 34, 36, 32, 34, 34, 34, 34,
  132. 34, 34, 34, 34, 34, 34, 36, 36,
  133. 36, 36, 36, 36, 36, 34, 34, 34,
  134. 34, 34, 34, 36, 32, 36, 36, 36,
  135. 36, 36, 36, 36, 36, 36, 36, 36,
  136. 36, 36, 36, 36, 36, 36, 36, 36,
  137. 36, 36, 36, 36, 36, 34, 34, 34,
  138. 34, 34, 34, 36, 32,
  139. };
  140. char _Clextab[] =
  141. {
  142. -1, -1, -1, -1, -1, -1, -1, -1,
  143. -1, 0, -1, -1, -1, -1, -1, -1,
  144. -1, -1, -1, -1, -1, -1, -1, -1,
  145. -1, -1, -1, -1, -1, -1, -1, -1,
  146. 0, -1, -1, -1, -1, 0, 0, -1,
  147. 0, 0, 0, 0, 0, 0, 0, 0,
  148. 0, 0, 0, 0, 0, 0, 0, 0,
  149. 0, 0, -1, 0, -1, 0, -1, -1,
  150. -1, 0, 0, 0, 0, 0, 0, 0,
  151. 0, 0, 0, 0, 0, 0, 0, 0,
  152. 0, 0, 0, 0, 0, 0, 0, 0,
  153. 0, 0, 0, -1, -1, -1, -1, 0,
  154. -1, 0, 0, 0, 0, 0, 0, 0,
  155. 0, 0, 0, 0, 0, 0, 0, 0,
  156. 0, 0, 0, 0, 0, 0, 0, 0,
  157. 0, 0, 0, -1, 0, 14, 14, 14,
  158. 14, 14, 14, 14, 14, 14, 14, -1,
  159. -1, -1, -1, -1, -1, -1, 14, 14,
  160. 14, 14, 14, 14, 14, 14, 14, 14,
  161. 14, 14, 14, 14, 14, 14, 14, 14,
  162. 14, 14, 14, 14, 14, 14, 14, 14,
  163. -1, -1, -1, -1, 14, -1, 14, 14,
  164. 14, 14, 14, 14, 14, 14, 14, 14,
  165. 14, 14, 14, 14, 14, 14, 14, 14,
  166. 14, 14, 14, 14, 14, 14, 14, 14,
  167. 15, 15, 15, 15, 15, 15, 15, 15,
  168. 15, 15, -1, -1, -1, -1, -1, -1,
  169. -1, 15, 15, 15, 15, 15, 15, 15,
  170. 15, 15, 15, 15, 15, 15, 15, 15,
  171. 15, 15, 15, 15, 15, 15, 15, 15,
  172. 15, 15, 15, -1, -1, -1, -1, 15,
  173. -1, 15, 15, 15, 15, 15, 15, 15,
  174. 15, 15, 15, 15, 15, 15, 15, 15,
  175. 15, 15, 15, 15, 15, 15, 15, 15,
  176. 15, 15, 15, 19, 19, 19, 19, 19,
  177. 19, 19, 19, 19, 19, 20, 20, 20,
  178. 20, 20, 20, 20, 20, 20, 20, -1,
  179. 19, 23, 23, 23, 23, 23, 23, 23,
  180. 23, 23, 23, -1, -1, -1, -1, -1,
  181. -1, -1, 23, 23, 23, 23, 23, 23,
  182. -1, 23, -1, -1, -1, -1, -1, -1,
  183. 19, -1, -1, -1, -1, -1, -1, -1,
  184. -1, -1, -1, -1, -1, -1, -1, -1,
  185. -1, -1, 23, 23, 23, 23, 23, 23,
  186. -1, 23, 26, 26, 26, 26, 26, 26,
  187. 26, 26, 26, 26, -1, -1, -1, -1,
  188. -1, -1, -1, 26, 26, 26, 26, 26,
  189. 26, -1, 26, -1, -1, -1, -1, -1,
  190. -1, -1, -1, -1, -1, -1, -1, -1,
  191. -1, -1, -1, -1, -1, -1, -1, -1,
  192. -1, -1, -1, 26, 26, 26, 26, 26,
  193. 26, 30, 26, 30, 30, 30, 30, 30,
  194. 30, 30, 30, 30, 30, -1, -1, -1,
  195. -1, -1, -1, -1, 30, 30, 30, 30,
  196. 30, 30, -1, 30, -1, -1, -1, -1,
  197. -1, -1, -1, -1, -1, -1, -1, -1,
  198. -1, -1, -1, -1, -1, -1, -1, -1,
  199. -1, -1, -1, -1, 30, 30, 30, 30,
  200. 30, 30, -1, 30, 33, 33, 33, 33,
  201. 33, 33, 33, 33, 33, 33, -1, -1,
  202. -1, -1, -1, -1, -1, 33, 33, 33,
  203. 33, 33, 33, -1, 33, -1, -1, -1,
  204. -1, -1, -1, -1, -1, -1, -1, -1,
  205. -1, -1, -1, -1, -1, -1, -1, -1,
  206. -1, -1, -1, -1, -1, 33, 33, 33,
  207. 33, 33, 33, -1, 33,
  208. };
  209. char _Dlextab[] =
  210. {
  211. 36, 36, 36, 36, 36, 36, 36, 36,
  212. 36, 36, 36, 36, 36, 36, 36, 36,
  213. 15, 14, 14, 36, 36, 20, 19, 14,
  214. 14, 23, 15, 15, 26, 23, 36, 19,
  215. 36, 36, 33, 30,
  216. };
  217. int _Blextab[] =
  218. {
  219. 0, 0, 0, 0, 0, 0, 0, 0,
  220. 0, 0, 0, 0, 0, 0, 77, 152,
  221. 0, 0, 0, 227, 237, 0, 0, 249,
  222. 0, 0, 306, 0, 0, 0, 363, 0,
  223. 0, 420, 0, 0, 0,
  224. };
  225. struct lextab lextab = {
  226. 36,
  227. _Dlextab,
  228. _Nlextab,
  229. _Clextab,
  230. _Blextab,
  231. 524,
  232. _lmovb,
  233. _Flextab,
  234. _Alextab,
  235. NULL,
  236. 0,
  237. 0,
  238. 0,
  239. };