PageRenderTime 52ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/source/library/Interlace.Pinch/Interlace.Pinch/Parsing/PinchLexer.cs

https://bitbucket.org/VahidN/interlace
C# | 1438 lines | 1199 code | 102 blank | 137 comment | 137 complexity | 57f4f68698db59afe8628f404c97782a MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. //
  2. // This CSharp output file generated by Gardens Point LEX
  3. // Version: 0.6.2.196 (2007-11-13)
  4. // Machine: FOURIER
  5. // DateTime: 11/01/2012 5:48:56 PM
  6. // UserName: Administrator
  7. // GPLEX input file <PinchLexer.l>
  8. // GPLEX frame file <C:\Development\gplex\binaries\gplexx.frame>
  9. //
  10. // Option settings: parser, minimize, compressnext
  11. //
  12. //
  13. // gplexx.frame
  14. // Version 0.6.2 of 13-November-2007
  15. // Derived from gplex.frame version of 2-September-2006.
  16. // Left and Right Anchored state support.
  17. // Start condition stack. Two generic params.
  18. // Using fixed length context handling for right anchors
  19. //
  20. using System;
  21. using System.IO;
  22. using System.Collections.Generic;
  23. #if !STANDALONE
  24. using gppg;
  25. #endif
  26. using System.Text;
  27. namespace Interlace.Pinch.Parsing
  28. {
  29. /// <summary>
  30. /// Summary Canonical example of GPLEX automaton
  31. /// </summary>
  32. #if STANDALONE
  33. //
  34. // These are the dummy declarations for stand-alone GPLEX applications
  35. // normally these declarations would come from the parser.
  36. // If you declare /noparser, or %option noparser then you get this.
  37. //
  38. public enum Tokens
  39. {
  40. EOF = 0, maxParseToken = int.MaxValue
  41. // must have at least these two, values are almost arbitrary
  42. }
  43. public abstract class ScanBase
  44. {
  45. public abstract int yylex();
  46. #if BABEL
  47. protected abstract int CurrentSc { get; set; }
  48. // EolState is the 32-bit of state data persisted at
  49. // the end of each line for Visual Studio colorization.
  50. // The default is to return CurrentSc. You must override
  51. // this if you want more complicated behavior.
  52. public virtual int EolState {
  53. get { return CurrentSc; }
  54. set { CurrentSc = value; }
  55. }
  56. }
  57. public interface IColorScan
  58. {
  59. void SetSource(string source, int offset);
  60. int GetNext(ref int state, out int start, out int end);
  61. #endif // BABEL
  62. }
  63. #endif // STANDALONE
  64. public abstract class ScanBuff
  65. {
  66. public const int EOF = -1;
  67. public abstract int Pos { get; set; }
  68. public abstract int Read();
  69. public abstract int Peek();
  70. public abstract int ReadPos { get; }
  71. public abstract string GetString(int b, int e);
  72. }
  73. // If the compiler can't find ScanBase maybe you need to run
  74. // GPPG with the /gplex option, or GPLEX with /noparser
  75. #if BABEL
  76. public sealed partial class Scanner : ScanBase, IColorScan
  77. {
  78. public ScanBuff buffer;
  79. int currentScOrd; // start condition ordinal
  80. protected override int CurrentSc
  81. {
  82. // The current start state is a property
  83. // to try to avoid the user error of setting
  84. // scState but forgetting to update the FSA
  85. // start state "currentStart"
  86. //
  87. get { return currentScOrd; } // i.e. return YY_START;
  88. set { currentScOrd = value; // i.e. BEGIN(value);
  89. currentStart = startState[value]; }
  90. }
  91. #else // BABEL
  92. public sealed partial class Scanner : ScanBase
  93. {
  94. public ScanBuff buffer;
  95. int currentScOrd; // start condition ordinal
  96. #endif // BABEL
  97. private static int GetMaxParseToken() {
  98. System.Reflection.FieldInfo f = typeof(Tokens).GetField("maxParseToken");
  99. return (f == null ? int.MaxValue : (int)f.GetValue(null));
  100. }
  101. static int parserMax = GetMaxParseToken();
  102. enum Result {accept, noMatch, contextFound};
  103. const int maxAccept = 77;
  104. const int initial = 78;
  105. const int eofNum = 0;
  106. const int goStart = -1;
  107. const int INITIAL = 0;
  108. int state;
  109. int currentStart = initial;
  110. int chr; // last character read
  111. int cNum = 0; // ordinal number of chr
  112. int lNum = 0; // current line number
  113. int lineStartNum; // ordinal number at start of line
  114. //
  115. // The following instance variables are used, among other
  116. // things, for constructing the yylloc location objects.
  117. //
  118. int tokPos; // buffer position at start of token
  119. int tokNum; // ordinal number of first character
  120. int tokLen; // number of characters in token
  121. int tokCol; // zero-based column number at start of token
  122. int tokLin; // line number at start of token
  123. int tokEPos; // buffer position at end of token
  124. int tokECol; // column number at end of token
  125. int tokELin; // line number at end of token
  126. string tokTxt; // lazily constructed text of token
  127. #if STACK
  128. private Stack<int> scStack = new Stack<int>();
  129. #endif // STACK
  130. #region ScannerTables
  131. struct Table {
  132. public int min; public int rng; public int dflt;
  133. public sbyte[] nxt;
  134. public Table(int m, int x, int d, sbyte[] n) {
  135. min = m; rng = x; dflt = d; nxt = n;
  136. }
  137. };
  138. static int[] startState = {78, 0};
  139. static Table[] NxS = new Table[79];
  140. static Scanner() {
  141. NxS[0] = new Table(0, 0, 0, null); NxS[1] = new Table(0, 0, -1, null); NxS[2] = new Table(9, 24, -1, new sbyte[] {2, 2, -1, -1, 2, -1,
  142. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  143. -1, 2});
  144. NxS[3] = new Table(0, 0, -1, null); NxS[4] = new Table(0, 0, -1, null); NxS[5] = new Table(0, 0, -1, null); NxS[6] = new Table(0, 0, -1, null); NxS[7] = new Table(48, 10, -1, new sbyte[] {7, 7, 7, 7, 7, 7,
  145. 7, 7, 7, 7});
  146. NxS[8] = new Table(0, 0, -1, null); NxS[9] = new Table(0, 0, -1, null); NxS[10] = new Table(0, 0, -1, null); NxS[11] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  147. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  148. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  149. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  150. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  151. 11, 11, 11, 11, 11});
  152. NxS[12] = new Table(0, 0, -1, null); NxS[13] = new Table(0, 0, -1, null); NxS[14] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  153. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  154. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  155. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  156. 11, 11, 73, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  157. 11, 11, 11, 11, 11});
  158. NxS[15] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  159. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  160. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  161. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  162. 11, 11, 11, 11, 11, 11, 11, 11, 63, 11, 11, 11, 11, 11, 11, 11,
  163. 11, 11, 11, 11, 11});
  164. NxS[16] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  165. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  166. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  167. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 57,
  168. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  169. 11, 11, 11, 11, 11});
  170. NxS[17] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  171. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  172. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  173. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  174. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 50, 11, 11, 11, 11, 11,
  175. 11, 11, 11, 11, 11});
  176. NxS[18] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  177. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  178. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  179. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  180. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 43, 11, 11, 11,
  181. 11, 11, 11, 11, 11});
  182. NxS[19] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  183. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  184. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  185. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 31,
  186. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  187. 11, 11, 11, 11, 11});
  188. NxS[20] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  189. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  190. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  191. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  192. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 23, 11,
  193. 11, 11, 11, 11, 11});
  194. NxS[21] = new Table(0, 0, -1, null); NxS[22] = new Table(0, 0, -1, null); NxS[23] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  195. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  196. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  197. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  198. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 24, 11, 11, 11,
  199. 11, 11, 11, 11, 11});
  200. NxS[24] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  201. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  202. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  203. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  204. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 25,
  205. 11, 11, 11, 11, 11});
  206. NxS[25] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  207. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  208. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  209. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 26, 11, 11,
  210. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  211. 11, 11, 11, 11, 11});
  212. NxS[26] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  213. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  214. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  215. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  216. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 27, 11,
  217. 11, 11, 11, 11, 11});
  218. NxS[27] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  219. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  220. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  221. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  222. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 28,
  223. 11, 11, 11, 11, 11});
  224. NxS[28] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  225. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  226. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  227. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  228. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 29, 11, 11, 11,
  229. 11, 11, 11, 11, 11});
  230. NxS[29] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  231. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  232. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  233. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 30,
  234. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  235. 11, 11, 11, 11, 11});
  236. NxS[30] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  237. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  238. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  239. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  240. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  241. 11, 11, 11, 11, 11});
  242. NxS[31] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  243. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  244. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  245. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  246. 11, 11, 11, 11, 11, 11, 11, 32, 11, 11, 11, 33, 11, 11, 11, 11,
  247. 11, 11, 11, 11, 11});
  248. NxS[32] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  249. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  250. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  251. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  252. 11, 11, 11, 11, 11, 11, 11, 11, 11, 39, 11, 11, 11, 11, 11, 11,
  253. 11, 11, 11, 11, 11});
  254. NxS[33] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  255. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  256. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  257. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  258. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 34,
  259. 11, 11, 11, 11, 11});
  260. NxS[34] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  261. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  262. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  263. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  264. 11, 11, 11, 35, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  265. 11, 11, 11, 11, 11});
  266. NxS[35] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  267. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  268. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  269. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  270. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 36, 11, 11, 11,
  271. 11, 11, 11, 11, 11});
  272. NxS[36] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  273. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  274. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  275. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 37,
  276. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  277. 11, 11, 11, 11, 11});
  278. NxS[37] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  279. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  280. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  281. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 38, 11,
  282. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  283. 11, 11, 11, 11, 11});
  284. NxS[38] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  285. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  286. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  287. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  288. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  289. 11, 11, 11, 11, 11});
  290. NxS[39] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  291. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  292. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  293. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  294. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  295. 40, 11, 11, 11, 11});
  296. NxS[40] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  297. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  298. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  299. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 41,
  300. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  301. 11, 11, 11, 11, 11});
  302. NxS[41] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  303. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  304. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  305. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 42, 11,
  306. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  307. 11, 11, 11, 11, 11});
  308. NxS[42] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  309. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  310. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  311. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  312. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  313. 11, 11, 11, 11, 11});
  314. NxS[43] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  315. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  316. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  317. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  318. 11, 11, 11, 11, 11, 11, 11, 11, 11, 44, 11, 11, 11, 11, 11, 11,
  319. 11, 11, 11, 11, 11});
  320. NxS[44] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  321. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  322. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  323. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  324. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 45, 11,
  325. 11, 11, 11, 11, 11});
  326. NxS[45] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  327. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  328. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  329. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  330. 11, 11, 11, 11, 11, 11, 11, 11, 11, 46, 11, 11, 11, 11, 11, 11,
  331. 11, 11, 11, 11, 11});
  332. NxS[46] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  333. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  334. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  335. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 47, 11, 11,
  336. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  337. 11, 11, 11, 11, 11});
  338. NxS[47] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  339. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  340. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  341. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  342. 11, 11, 11, 11, 11, 11, 11, 11, 11, 48, 11, 11, 11, 11, 11, 11,
  343. 11, 11, 11, 11, 11});
  344. NxS[48] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  345. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  346. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  347. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  348. 11, 11, 11, 11, 11, 11, 49, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  349. 11, 11, 11, 11, 11});
  350. NxS[49] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  351. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  352. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  353. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  354. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  355. 11, 11, 11, 11, 11});
  356. NxS[50] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  357. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  358. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  359. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  360. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 51, 11,
  361. 11, 11, 11, 11, 11});
  362. NxS[51] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  363. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  364. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  365. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  366. 11, 11, 11, 52, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  367. 11, 11, 11, 11, 11});
  368. NxS[52] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  369. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  370. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  371. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  372. 11, 11, 11, 11, 11, 11, 11, 11, 11, 53, 11, 11, 11, 11, 11, 11,
  373. 11, 11, 11, 11, 11});
  374. NxS[53] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  375. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  376. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  377. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  378. 11, 11, 11, 11, 11, 11, 11, 11, 54, 11, 11, 11, 11, 11, 11, 11,
  379. 11, 11, 11, 11, 11});
  380. NxS[54] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  381. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  382. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  383. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 55, 11, 11, 11, 11,
  384. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  385. 11, 11, 11, 11, 11});
  386. NxS[55] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  387. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  388. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  389. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  390. 11, 11, 11, 11, 11, 11, 56, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  391. 11, 11, 11, 11, 11});
  392. NxS[56] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  393. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  394. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  395. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  396. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  397. 11, 11, 11, 11, 11});
  398. NxS[57] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  399. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  400. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  401. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  402. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 58, 11, 11,
  403. 11, 11, 11, 11, 11});
  404. NxS[58] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  405. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  406. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  407. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  408. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 59, 11, 11,
  409. 11, 11, 11, 11, 11});
  410. NxS[59] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  411. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  412. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  413. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 60, 11, 11, 11, 11,
  414. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  415. 11, 11, 11, 11, 11});
  416. NxS[60] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  417. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  418. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  419. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  420. 11, 61, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  421. 11, 11, 11, 11, 11});
  422. NxS[61] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  423. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  424. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  425. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 62,
  426. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  427. 11, 11, 11, 11, 11});
  428. NxS[62] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  429. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  430. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  431. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  432. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  433. 11, 11, 11, 11, 11});
  434. NxS[63] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  435. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  436. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  437. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  438. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 64,
  439. 11, 11, 11, 11, 11});
  440. NxS[64] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  441. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  442. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  443. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  444. 11, 11, 11, 11, 11, 11, 11, 65, 11, 11, 11, 11, 11, 11, 11, 11,
  445. 11, 11, 11, 11, 11});
  446. NxS[65] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  447. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  448. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  449. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 66,
  450. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  451. 11, 11, 11, 11, 11});
  452. NxS[66] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  453. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  454. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  455. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  456. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 67, 11, 11, 11,
  457. 11, 11, 11, 11, 11});
  458. NxS[67] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  459. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  460. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  461. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 68, 11, 11, 11, 11,
  462. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  463. 11, 11, 11, 11, 11});
  464. NxS[68] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  465. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  466. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  467. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  468. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 69, 11,
  469. 11, 11, 11, 11, 11});
  470. NxS[69] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  471. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  472. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  473. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  474. 11, 11, 11, 70, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  475. 11, 11, 11, 11, 11});
  476. NxS[70] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  477. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  478. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  479. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  480. 11, 11, 11, 11, 11, 11, 11, 11, 11, 71, 11, 11, 11, 11, 11, 11,
  481. 11, 11, 11, 11, 11});
  482. NxS[71] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  483. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  484. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  485. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  486. 11, 11, 11, 11, 11, 11, 11, 11, 72, 11, 11, 11, 11, 11, 11, 11,
  487. 11, 11, 11, 11, 11});
  488. NxS[72] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  489. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  490. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  491. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  492. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  493. 11, 11, 11, 11, 11});
  494. NxS[73] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  495. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  496. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  497. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  498. 11, 11, 11, 11, 11, 11, 11, 11, 11, 74, 11, 11, 11, 11, 11, 11,
  499. 11, 11, 11, 11, 11});
  500. NxS[74] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  501. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  502. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  503. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  504. 11, 11, 11, 75, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  505. 11, 11, 11, 11, 11});
  506. NxS[75] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  507. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  508. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  509. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 76, 11, 11,
  510. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  511. 11, 11, 11, 11, 11});
  512. NxS[76] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  513. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  514. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  515. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 77,
  516. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  517. 11, 11, 11, 11, 11});
  518. NxS[77] = new Table(48, 75, -1, new sbyte[] {11, 11, 11, 11, 11, 11,
  519. 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11,
  520. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  521. 11, 11, 11, 11, 11, -1, -1, -1, -1, 11, -1, 11, 11, 11, 11, 11,
  522. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  523. 11, 11, 11, 11, 11});
  524. NxS[78] = new Table(9, 117, 1, new sbyte[] {2, 2, 1, 1, 2, 1,
  525. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  526. 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 4, 1, 1, 5, 1, 6,
  527. 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 8, 9, 1, 10,
  528. 1, 1, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
  529. 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 1, 13, 1,
  530. 11, 1, 11, 11, 14, 11, 15, 11, 11, 11, 11, 11, 11, 11, 16, 11,
  531. 17, 18, 11, 19, 20, 11, 11, 11, 11, 11, 11, 11, 21, 1, 22});
  532. }
  533. int NextState(int qStat) {
  534. if (chr == ScanBuff.EOF)
  535. return (qStat <= maxAccept && qStat != currentStart ? currentStart : eofNum);
  536. else {
  537. int rslt;
  538. int idx = (byte)(chr - NxS[qStat].min);
  539. if ((uint)idx >= (uint)NxS[qStat].rng) rslt = NxS[qStat].dflt;
  540. else rslt = NxS[qStat].nxt[idx];
  541. return (rslt == goStart ? currentStart : rslt);
  542. }
  543. }
  544. int NextState() {
  545. if (chr == ScanBuff.EOF)
  546. return (state <= maxAccept && state != currentStart ? currentStart : eofNum);
  547. else {
  548. int rslt;
  549. int idx = (byte)(chr - NxS[state].min);
  550. if ((uint)idx >= (uint)NxS[state].rng) rslt = NxS[state].dflt;
  551. else rslt = NxS[state].nxt[idx];
  552. return (rslt == goStart ? currentStart : rslt);
  553. }
  554. }
  555. #endregion
  556. #if BACKUP
  557. // ====================== Nested class ==========================
  558. internal class Context // class used for automaton backup.
  559. {
  560. public int bPos;
  561. public int cNum;
  562. public int state;
  563. public int cChr;
  564. }
  565. #endif // BACKUP
  566. // ==============================================================
  567. // ===== Nested classes for various ScanBuff derived classes ====
  568. // ==============================================================
  569. public sealed class StringBuff : ScanBuff
  570. {
  571. string str; // input buffer
  572. int bPos; // current position in buffer
  573. int sLen;
  574. public StringBuff(string str)
  575. {
  576. this.str = str;
  577. this.sLen = str.Length;
  578. }
  579. public override int Read()
  580. {
  581. if (bPos < sLen) return str[bPos++];
  582. #if BABEL
  583. else if (bPos == sLen) { bPos++; return '\n'; } // one strike, see newline
  584. #endif // BABEL
  585. else { bPos++; return EOF; } // two strikes and you're out!
  586. }
  587. public override int ReadPos { get { return bPos - 1; } }
  588. public override int Peek()
  589. {
  590. if (bPos < sLen) return str[bPos];
  591. else return '\n';
  592. }
  593. public override string GetString(int beg, int end)
  594. {
  595. // "end" can be greater than sLen with the BABEL
  596. // option set. Read returns a "virtual" EOL if
  597. // an attempt is made to read past the end of the
  598. // string buffer. Without the guard any attempt
  599. // to fetch yytext for a token that includes the
  600. // EOL will throw an index exception.
  601. if (end > sLen) end = sLen;
  602. if (end <= beg) return "";
  603. else return str.Substring(beg, end - beg);
  604. }
  605. public override int Pos
  606. {
  607. get { return bPos; }
  608. set { bPos = value; }
  609. }
  610. }
  611. // ====================== Nested class ==========================
  612. // The LineBuff class contributed by Nigel Horspool,
  613. // nigelh@cs.uvic.cs
  614. // ==============================================================
  615. public sealed class LineBuff : ScanBuff
  616. {
  617. IList<string> line; // list of source lines from a file
  618. int numLines; // number of strings in line list
  619. string curLine; // current line in that list
  620. int cLine; // index of current line in the list
  621. int curLen; // length of current line
  622. int curLineStart; // position of line start in whole file
  623. int curLineEnd; // position of line end in whole file
  624. int maxPos; // max position ever visited in whole file
  625. int cPos; // ordinal number of chr in source
  626. // Constructed from a list of strings, one per source line.
  627. // The lines have had trailing '\n' characters removed.
  628. public LineBuff(IList<string> lineList)
  629. {
  630. line = lineList;
  631. numLines = line.Count;
  632. cPos = curLineStart = 0;
  633. curLine = numLines>0? line[0] : "";
  634. maxPos = curLineEnd = curLen = curLine.Length;
  635. cLine = 1;
  636. }
  637. public override int Read()
  638. {
  639. if (cPos < curLineEnd)
  640. return curLine[cPos++ - curLineStart];
  641. if (cPos++ == curLineEnd)
  642. return '\n';
  643. if (cLine >= numLines)
  644. return EOF;
  645. curLine = line[cLine];
  646. curLen = curLine.Length;
  647. curLineStart = curLineEnd + 1;
  648. curLineEnd = curLineStart + curLen;
  649. if (curLineEnd>maxPos)
  650. maxPos = curLineEnd;
  651. cLine++;
  652. return curLen>0? curLine[0] : '\n';
  653. }
  654. public override int Peek()
  655. {
  656. return (cPos < curLineEnd)? curLine[cPos - curLineStart] : '\n';
  657. }
  658. // To speed up searches for the line containing a position
  659. private int cachedPos = 0;
  660. private int cachedIx = 0;
  661. private int cachedLstart = 0;
  662. // Given a position pos within the entire source, the results are
  663. // ix -- the index of the containing line
  664. // lstart -- the position of the first character on that line
  665. private void findIndex( int pos, out int ix, out int lstart )
  666. {
  667. if (pos >= cachedPos) {
  668. ix = cachedIx; lstart = cachedLstart;
  669. } else {
  670. ix = lstart = 0;
  671. }
  672. for( ; ; ) {
  673. int len = line[ix].Length + 1;
  674. if (pos < lstart+len) break;
  675. lstart += len;
  676. ix++;
  677. }
  678. cachedPos = pos;
  679. cachedIx = ix;
  680. cachedLstart = lstart;
  681. }
  682. public override string GetString(int beg, int end)
  683. {
  684. if (beg >= maxPos || end <= beg) return "";
  685. int endIx, begIx, endLineStart, begLineStart;
  686. findIndex(beg, out begIx, out begLineStart);
  687. int begCol = beg - begLineStart;
  688. findIndex(end, out endIx, out endLineStart);
  689. int endCol = end - endLineStart;
  690. string s = line[begIx];
  691. if (begIx == endIx) {
  692. // the usual case, substring all on one line
  693. return (endCol <= s.Length)?
  694. s.Substring(begCol, endCol-begCol)
  695. : s.Substring(begCol) + "\n";
  696. }
  697. // the string spans multiple lines, yuk!
  698. StringBuilder sb = new StringBuilder();
  699. if (begCol < s.Length)
  700. sb.Append(s.Substring(begCol));
  701. for( ; ; ) {
  702. sb.Append("\n");
  703. s = line[++begIx];
  704. if (begIx >= endIx) break;
  705. sb.Append(s);
  706. }
  707. if (endCol <= s.Length) {
  708. sb.Append(s.Substring(0, endCol));
  709. } else {
  710. sb.Append(s);
  711. sb.Append("\n");
  712. }
  713. return sb.ToString();
  714. }
  715. public override int Pos
  716. {
  717. get { return cPos; }
  718. set {
  719. cPos = value;
  720. findIndex(cPos, out cLine, out curLineStart);
  721. curLine = line[cLine];
  722. curLineEnd = curLineStart+curLine.Length;
  723. }
  724. }
  725. public override int ReadPos { get { return cPos - 1; } }
  726. }
  727. // ====================== Nested class ==========================
  728. public sealed class StreamBuff : ScanBuff
  729. {
  730. BufferedStream bStrm; // input buffer
  731. int delta = 1; // number of bytes in chr, could be 0 for EOF.
  732. public StreamBuff(Stream str) { this.bStrm = new BufferedStream(str); }
  733. public override int Read() {
  734. int ch0 = bStrm.ReadByte();
  735. delta = (ch0 == EOF ? 0 : 1);
  736. return ch0;
  737. }
  738. public override int ReadPos {
  739. get { return (int)bStrm.Position - delta; }
  740. }
  741. public override int Peek()
  742. {
  743. int rslt = bStrm.ReadByte();
  744. bStrm.Seek(-delta, SeekOrigin.Current);
  745. return rslt;
  746. }
  747. public override string GetString(int beg, int end)
  748. {
  749. if (end - beg <= 0) return "";
  750. long savePos = bStrm.Position;
  751. char[] arr = new char[end - beg];
  752. bStrm.Position = (long)beg;
  753. for (int i = 0; i < (end - beg); i++)
  754. arr[i] = (char)bStrm.ReadByte();
  755. bStrm.Position = savePos;
  756. return new String(arr);
  757. }
  758. // Pos is the position *after* reading chr!
  759. public override int Pos
  760. {
  761. get { return (int)bStrm.Position; }
  762. set { bStrm.Position = value; }
  763. }
  764. }
  765. // ====================== Nested class ==========================
  766. /// <summary>
  767. /// This is the Buffer for UTF8 files.
  768. /// It attempts to read the encoding preamble, which for
  769. /// this encoding should be unicode point \uFEFF which is
  770. /// encoded as EF BB BF
  771. /// </summary>
  772. public class TextBuff : ScanBuff
  773. {
  774. protected BufferedStream bStrm; // input buffer
  775. protected int delta = 1; // length of chr, zero for EOF!
  776. private Exception BadUTF8()
  777. { return new Exception(String.Format("BadUTF8 Character")); }
  778. /// <summary>
  779. /// TextBuff factory. Reads the file preamble
  780. /// and returns a TextBuff, LittleEndTextBuff or
  781. /// BigEndTextBuff according to the result.
  782. /// </summary>
  783. /// <param name="strm">The underlying stream</param>
  784. /// <returns></returns>
  785. public static TextBuff NewTextBuff(Stream strm)
  786. {
  787. // First check if this is a UTF16 file
  788. //
  789. int b0 = strm.ReadByte();
  790. int b1 = strm.ReadByte();
  791. if (b0 == 0xfe && b1 == 0xff)
  792. return new BigEndTextBuff(strm);
  793. if (b0 == 0xff && b1 == 0xfe)
  794. return new LittleEndTextBuff(strm);
  795. int b2 = strm.ReadByte();
  796. if (b0 == 0xef && b1 == 0xbb && b2 == 0xbf)
  797. return new TextBuff(strm);
  798. //
  799. // There is no unicode preamble, so we
  800. // must go back to the UTF8 default.
  801. //
  802. strm.Seek(0, SeekOrigin.Begin);
  803. return new TextBuff(strm);
  804. }
  805. protected TextBuff(Stream str) {
  806. this.bStrm = new BufferedStream(str);
  807. }
  808. public override int Read()
  809. {
  810. int ch0 = bStrm.ReadByte();
  811. int ch1;
  812. int ch2;
  813. if (ch0 < 0x7f)
  814. {
  815. delta = (ch0 == EOF ? 0 : 1);
  816. return ch0;
  817. }
  818. else if ((ch0 & 0xe0) == 0xc0)
  819. {
  820. delta = 2;
  821. ch1 = bStrm.ReadByte();
  822. if ((ch1 & 0xc0) == 0x80)
  823. return ((ch0 & 0x1f) << 6) + (ch1 & 0x3f);
  824. else
  825. throw BadUTF8();
  826. }
  827. else if ((ch0 & 0xf0) == 0xe0)
  828. {
  829. delta = 3;
  830. ch1 = bStrm.ReadByte();
  831. ch2 = bStrm.ReadByte();
  832. if ((ch1 & ch2 & 0xc0) == 0x80)
  833. return ((ch0 & 0xf) << 12) + ((ch1 & 0x3f) << 6) + (ch2 & 0x3f);
  834. else
  835. throw BadUTF8();
  836. }
  837. else
  838. throw BadUTF8();
  839. }
  840. public sealed override int ReadPos
  841. {
  842. get { return (int)bStrm.Position - delta; }
  843. }
  844. public sealed override int Peek()
  845. {
  846. int rslt = Read();
  847. bStrm.Seek(-delta, SeekOrigin.Current);
  848. return rslt;
  849. }
  850. /// <summary>
  851. /// Returns the string from the buffer between
  852. /// the given file positions. This needs to be
  853. /// done carefully, as the number of characters
  854. /// is, in general, not equal to (end - beg).
  855. /// </summary>
  856. /// <param name="beg">Begin filepos</param>
  857. /// <param name="end">End filepos</param>
  858. /// <returns></returns>
  859. public sealed override string GetString(int beg, int end)
  860. {
  861. int i;
  862. if (end - beg <= 0) return "";
  863. long savePos = bStrm.Position;
  864. char[] arr = new char[end - beg];
  865. bStrm.Position = (long)beg;
  866. for (i = 0; bStrm.Position < end; i++)
  867. arr[i] = (char)Read();
  868. bStrm.Position = savePos;
  869. return new String(arr, 0, i);
  870. }
  871. // Pos is the position *after* reading chr!
  872. public sealed override int Pos
  873. {
  874. get { return (int)bStrm.Position; }
  875. set { bStrm.Position = value; }
  876. }
  877. }
  878. // ====================== Nested class ==========================
  879. /// <summary>
  880. /// This is the Buffer for Big-endian UTF16 files.
  881. /// </summary>
  882. public sealed class BigEndTextBuff : TextBuff
  883. {
  884. internal BigEndTextBuff(Stream str) : base(str) { } //
  885. public override int Read()
  886. {
  887. int ch0 = bStrm.ReadByte();
  888. int ch1 = bStrm.ReadByte();
  889. if (ch1 == EOF)
  890. {
  891. // An EOF in either byte counts as an EOF
  892. delta = (ch0 == EOF ? 0 : 1);
  893. return -1;
  894. }
  895. else
  896. {
  897. delta = 2;
  898. return (ch0 << 8) + ch1;
  899. }
  900. }
  901. }
  902. // ====================== Nested class ==========================
  903. /// <summary>
  904. /// This is the Buffer for Little-endian UTF16 files.
  905. /// </summary>
  906. public sealed class LittleEndTextBuff : TextBuff
  907. {
  908. internal LittleEndTextBuff(Stream str) : base(str) { } // { this.bStrm = new BufferedStream(str); }
  909. public override int Read()
  910. {
  911. int ch0 = bStrm.ReadByte();
  912. int ch1 = bStrm.ReadByte();
  913. if (ch1 == EOF)
  914. {
  915. // An EOF in either byte counts as an EOF
  916. delta = (ch0 == EOF ? 0 : 1);
  917. return -1;
  918. }
  919. else
  920. {
  921. delta = 2;
  922. return (ch1 << 8) + ch1;
  923. }
  924. }
  925. }
  926. // =================== End Nested classes =======================
  927. public Scanner(Stream file) {
  928. buffer = new StreamBuff(file);
  929. this.cNum = -1;
  930. this.chr = '\n'; // to initialize yyline, yycol and lineStart
  931. GetChr();
  932. }
  933. public Scanner() { }
  934. void GetChr()
  935. {
  936. if (chr == '\n')
  937. {
  938. lineStartNum = cNum + 1;
  939. lNum++;
  940. }
  941. chr = buffer.Read();
  942. cNum++;
  943. }
  944. void MarkToken()
  945. {
  946. tokPos = buffer.ReadPos;
  947. tokNum = cNum;
  948. tokLin = lNum;
  949. tokCol = cNum - lineStartNum;
  950. }
  951. void MarkEnd()
  952. {
  953. tokTxt = null;
  954. tokLen = cNum - tokNum;
  955. tokEPos = buffer.ReadPos;
  956. tokELin = lNum;
  957. tokECol = cNum - lineStartNum;
  958. }
  959. // ===================================================…

Large files files are truncated, but you can click here to view the full file