zu.go 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206
  1. /*
  2. * Copyright (c) 2000-2018, 达梦数据库有限公司.
  3. * All rights reserved.
  4. */
  5. package parser
  6. import (
  7. "io"
  8. "strconv"
  9. "unicode/utf8"
  10. )
  11. const (
  12. YYEOF = -1 /** This character denotes the end of file */
  13. ZZ_BUFFERSIZE = 16384 /** initial size of the lookahead buffer */
  14. /** lexical states */
  15. YYINITIAL = 0
  16. xc = 2
  17. xq = 4
  18. xdq = 6
  19. xsb = 8
  20. xbin = 10
  21. xhex = 12
  22. xhint = 14
  23. xq2 = 16
  24. xq2_2 = 18
  25. )
  26. /**
  27. * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
  28. * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
  29. * at the beginning of a line
  30. * l is of the form l = 2*k, k a non negative integer
  31. */
  32. var ZZ_LEXSTATE []int = []int{0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 4, 4, 7, 7, 8, 8}
  33. /**
  34. * Translates characters to character classes
  35. */
  36. var ZZ_CMAP_PACKED []rune = []rune{0011, 0000, 0001, 0026, 0001, 0025, 0001, 0030, 0001, 0026, 0001, 0025, 0022, 0000, 0001, 0026, 0001, 0017, 0001, 0002,
  37. 0002, 0012, 0002, 0017, 0001, 0001, 0002, 0017, 0001, 0004, 0001, 0023, 0001, 0017, 0001, 0027, 0001, 0016, 0001, 0003,
  38. 0001, 0020, 0011, 0013, 0001, 0014, 0001, 0017, 0001, 0017, 0001, 0015, 0003, 0017, 0001, 0021, 0001, 0010, 0001, 0021,
  39. 0001, 0024, 0001, 0022, 0001, 0024, 0002, 0012, 0001, 0034, 0002, 0012, 0001, 0033, 0001, 0012, 0001, 0031, 0001, 0036,
  40. 0001, 0012, 0001, 0007, 0001, 0012, 0001, 0035, 0001, 0037, 0001, 0032, 0002, 0012, 0001, 0011, 0002, 0012, 0001, 0005,
  41. 0001, 0000, 0001, 0006, 0001, 0017, 0001, 0012, 0001, 0000, 0001, 0021, 0001, 0010, 0001, 0021, 0001, 0024, 0001, 0022,
  42. 0001, 0024, 0002, 0012, 0001, 0034, 0002, 0012, 0001, 0033, 0001, 0012, 0001, 0031, 0001, 0036, 0001, 0012, 0001, 0007,
  43. 0001, 0012, 0001, 0035, 0001, 0037, 0001, 0032, 0002, 0012, 0001, 0011, 0002, 0012, 0001, 0017, 0001, 0017, 0002, 0017,
  44. 0001, 0000, 0005, 0012, 0001, 0012, 0172, 0012, 0x1f28, 0000, 0001, 0030, 0001, 0030, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xffff, 0000, 0xdfe6, 0000}
  45. /**
  46. * Translates characters to character classes
  47. */
  48. var ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED)
  49. /**
  50. * Translates DFA states to action switch labels.
  51. */
  52. var ZZ_ACTION = zzUnpackActionNoParams()
  53. var ZZ_ACTION_PACKED_0 []rune = []rune{0011, 0000, 0001, 0001, 0001, 0002, 0001, 0003, 0002, 0004, 0004, 0005, 0001, 0006, 0002, 0004,
  54. 0001, 0006, 0001, 0007, 0001, 0004, 0002, 0005, 0001, 0010, 0002, 0011, 0001, 0012, 0001, 0013,
  55. 0001, 0014, 0001, 0015, 0001, 0016, 0001, 0017, 0001, 0020, 0001, 0021, 0001, 0022, 0001, 0023,
  56. 0001, 0024, 0001, 0025, 0001, 0026, 0001, 0007, 0001, 0027, 0001, 0000, 0001, 0030, 0001, 0031,
  57. 0001, 0032, 0001, 0000, 0001, 0033, 0001, 0034, 0001, 0035, 0001, 0032, 0001, 0036, 0001, 0000,
  58. 0003, 0005, 0001, 0037, 0001, 0040, 0001, 0000, 0001, 0041, 0002, 0000, 0001, 0042, 0004, 0000,
  59. 0001, 0043, 0001, 0044, 0001, 0033, 0001, 0000, 0001, 0045, 0002, 0005, 0003, 0000, 0001, 0046,
  60. 0001, 0047, 0001, 0050, 0001, 0051, 0020, 0000, 0001, 0052, 0001, 0000, 0001, 0053, 0001, 0052,
  61. 0001, 0053}
  62. func zzUnpackActionNoParams() []int {
  63. result := make([]int, 104)
  64. offset := 0
  65. offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result)
  66. return result
  67. }
  68. func zzUnpackAction(packed []rune, offset int, result []int) int {
  69. i := 0 /* index in packed string */
  70. j := offset /* index in unpacked array */
  71. l := len(packed) //130
  72. for i < l {
  73. count := packed[i]
  74. i++
  75. value := packed[i]
  76. i++
  77. result[j] = int(value)
  78. j++
  79. count--
  80. for count > 0 {
  81. result[j] = int(value)
  82. j++
  83. count--
  84. }
  85. }
  86. return j
  87. }
  88. /**
  89. * Translates a state to a row index in the transition table
  90. */
  91. var ZZ_ROWMAP = zzUnpackRowMapNoParams()
  92. var ZZ_ROWMAP_PACKED_0 []rune = []rune{0000, 0000, 0000, 0040, 0000, 0100, 0000, 0140, 0000, 0200, 0000, 0240, 0000, 0300, 0000, 0340,
  93. 0000, 0x0100, 0000, 0200, 0000, 0200, 0000, 0200, 0000, 0x0120, 0000, 0200, 0000, 0x0140, 0000, 0x0160,
  94. 0000, 0x0180, 0000, 0x01a0, 0000, 0x01c0, 0000, 0x01e0, 0000, 0x0200, 0000, 0x0220, 0000, 0200, 0000, 0x0240,
  95. 0000, 0x0260, 0000, 0x0280, 0000, 0x02a0, 0000, 0x02c0, 0000, 0x02e0, 0000, 0x0300, 0000, 0x0320, 0000, 0x0340,
  96. 0000, 0x0360, 0000, 0x0380, 0000, 0x03a0, 0000, 0x03c0, 0000, 0x03e0, 0000, 0x0400, 0000, 0200, 0000, 0200,
  97. 0000, 0200, 0000, 0200, 0000, 0x0420, 0000, 0200, 0000, 0x0440, 0000, 0200, 0000, 0200, 0000, 0x0460,
  98. 0000, 0x0480, 0000, 0200, 0000, 0200, 0000, 0200, 0000, 0x04a0, 0000, 0200, 0000, 0x04c0, 0000, 0x04e0,
  99. 0000, 0x0500, 0000, 0x0520, 0000, 0200, 0000, 0200, 0000, 0x02e0, 0000, 0200, 0000, 0x0540, 0000, 0x0560,
  100. 0000, 0200, 0000, 0x0580, 0000, 0x03a0, 0000, 0x05a0, 0000, 0x03e0, 0000, 0200, 0000, 0200, 0000, 0x05c0,
  101. 0000, 0x05c0, 0000, 0x04c0, 0000, 0x05e0, 0000, 0x0600, 0000, 0x0620, 0000, 0x0640, 0000, 0x0660, 0000, 0200,
  102. 0000, 0200, 0000, 0200, 0000, 0x01a0, 0000, 0x0680, 0000, 0x06a0, 0000, 0x06c0, 0000, 0x06e0, 0000, 0x0700,
  103. 0000, 0x0720, 0000, 0x0740, 0000, 0x0760, 0000, 0x0780, 0000, 0x07a0, 0000, 0x07c0, 0000, 0x07e0, 0000, 0x0800,
  104. 0000, 0x0820, 0000, 0x0840, 0000, 0x0860, 0000, 0200, 0000, 0x0880, 0000, 0200, 0000, 0x06e0, 0000, 0x0720}
  105. func zzUnpackRowMapNoParams() []int {
  106. result := make([]int, 104)
  107. offset := 0
  108. offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result)
  109. return result
  110. }
  111. func zzUnpackRowMap(packed []rune, offset int, result []int) int {
  112. i := 0 /* index in packed string */
  113. j := offset /* index in unpacked array */
  114. l := len(packed) //208
  115. for i < l {
  116. high := packed[i] << 16
  117. i++
  118. result[j] = int(high | packed[i])
  119. i++
  120. j++
  121. }
  122. return j
  123. }
  124. /**
  125. * The transition table of the DFA
  126. */
  127. var ZZ_TRANS []int = zzUnpackTransNoParams()
  128. var ZZ_TRANS_PACKED_0 []rune = []rune{0001, 0012, 0001, 0013, 0001, 0014, 0001, 0015, 0003, 0016, 0001, 0017, 0001, 0020, 0001, 0021,
  129. 0001, 0022, 0001, 0023, 0001, 0024, 0001, 0016, 0001, 0025, 0001, 0016, 0001, 0026, 0002, 0022,
  130. 0001, 0016, 0001, 0022, 0002, 0027, 0001, 0030, 0001, 0000, 0001, 0031, 0002, 0022, 0001, 0032,
  131. 0003, 0022, 0003, 0033, 0001, 0034, 0001, 0035, 0033, 0033, 0001, 0036, 0001, 0037, 0036, 0036,
  132. 0002, 0040, 0001, 0041, 0035, 0040, 0040, 0000, 0001, 0042, 0001, 0043, 0036, 0042, 0001, 0044,
  133. 0001, 0045, 0036, 0044, 0006, 0046, 0001, 0047, 0031, 0046, 0001, 0050, 0001, 0051, 0004, 0050,
  134. 0001, 0052, 0031, 0050, 0003, 0000, 0001, 0053, 0001, 0054, 0034, 0000, 0001, 0055, 0005, 0000,
  135. 0005, 0022, 0004, 0000, 0003, 0022, 0001, 0000, 0001, 0022, 0004, 0000, 0007, 0022, 0001, 0000,
  136. 0001, 0056, 0005, 0000, 0005, 0022, 0004, 0000, 0003, 0022, 0001, 0000, 0001, 0022, 0004, 0000,
  137. 0007, 0022, 0001, 0000, 0001, 0057, 0005, 0000, 0005, 0022, 0004, 0000, 0003, 0022, 0001, 0000,
  138. 0001, 0022, 0004, 0000, 0007, 0022, 0007, 0000, 0005, 0022, 0004, 0000, 0003, 0022, 0001, 0000,
  139. 0001, 0022, 0004, 0000, 0007, 0022, 0013, 0000, 0001, 0023, 0002, 0000, 0001, 0060, 0001, 0000,
  140. 0001, 0023, 0001, 0000, 0001, 0061, 0001, 0000, 0001, 0062, 0030, 0000, 0001, 0063, 0026, 0000,
  141. 0001, 0064, 0006, 0000, 0001, 0065, 0002, 0000, 0001, 0066, 0001, 0000, 0001, 0065, 0030, 0000,
  142. 0001, 0067, 0001, 0000, 0001, 0023, 0002, 0000, 0001, 0060, 0001, 0000, 0001, 0023, 0001, 0000,
  143. 0001, 0061, 0001, 0000, 0001, 0062, 0042, 0000, 0001, 0053, 0017, 0000, 0005, 0022, 0004, 0000,
  144. 0003, 0022, 0001, 0000, 0001, 0022, 0004, 0000, 0001, 0022, 0001, 0070, 0003, 0022, 0001, 0071,
  145. 0001, 0022, 0007, 0000, 0005, 0022, 0004, 0000, 0003, 0022, 0001, 0000, 0001, 0022, 0004, 0000,
  146. 0004, 0022, 0001, 0072, 0002, 0022, 0003, 0033, 0002, 0000, 0033, 0033, 0004, 0000, 0001, 0073,
  147. 0036, 0000, 0001, 0074, 0001, 0075, 0033, 0000, 0001, 0036, 0001, 0000, 0036, 0036, 0001, 0000,
  148. 0001, 0076, 0023, 0000, 0001, 0077, 0001, 0100, 0011, 0000, 0002, 0040, 0001, 0000, 0035, 0040,
  149. 0002, 0000, 0001, 0101, 0035, 0000, 0001, 0042, 0001, 0000, 0036, 0042, 0025, 0000, 0001, 0102,
  150. 0001, 0103, 0011, 0000, 0001, 0044, 0001, 0000, 0036, 0044, 0025, 0000, 0001, 0104, 0001, 0105,
  151. 0011, 0000, 0006, 0046, 0001, 0000, 0031, 0046, 0025, 0053, 0001, 0000, 0012, 0053, 0005, 0000,
  152. 0001, 0106, 0045, 0000, 0001, 0065, 0002, 0000, 0001, 0107, 0001, 0000, 0001, 0065, 0001, 0000,
  153. 0001, 0061, 0001, 0000, 0001, 0062, 0026, 0000, 0001, 0110, 0004, 0000, 0001, 0110, 0002, 0000,
  154. 0001, 0111, 0003, 0000, 0001, 0111, 0023, 0000, 0001, 0065, 0004, 0000, 0001, 0065, 0001, 0000,
  155. 0001, 0061, 0001, 0000, 0001, 0062, 0023, 0000, 0001, 0112, 0002, 0000, 0001, 0112, 0004, 0000,
  156. 0003, 0112, 0001, 0000, 0001, 0112, 0022, 0000, 0005, 0022, 0004, 0000, 0003, 0022, 0001, 0000,
  157. 0001, 0022, 0004, 0000, 0002, 0022, 0001, 0113, 0004, 0022, 0007, 0000, 0005, 0022, 0004, 0000,
  158. 0003, 0022, 0001, 0000, 0001, 0022, 0004, 0000, 0006, 0022, 0001, 0114, 0003, 0000, 0001, 0115,
  159. 0003, 0000, 0005, 0022, 0004, 0000, 0003, 0022, 0001, 0000, 0001, 0022, 0002, 0116, 0001, 0117,
  160. 0001, 0000, 0007, 0022, 0001, 0000, 0001, 0120, 0023, 0000, 0002, 0077, 0036, 0000, 0001, 0077,
  161. 0001, 0100, 0012, 0000, 0001, 0121, 0023, 0000, 0002, 0102, 0012, 0000, 0001, 0122, 0023, 0000,
  162. 0002, 0104, 0024, 0000, 0001, 0110, 0004, 0000, 0001, 0110, 0026, 0000, 0005, 0022, 0004, 0000,
  163. 0003, 0022, 0001, 0000, 0001, 0022, 0004, 0000, 0002, 0022, 0001, 0123, 0004, 0022, 0003, 0000,
  164. 0001, 0124, 0003, 0000, 0005, 0022, 0004, 0000, 0003, 0022, 0001, 0000, 0001, 0022, 0002, 0125,
  165. 0001, 0126, 0001, 0000, 0007, 0022, 0003, 0000, 0001, 0127, 0037, 0000, 0001, 0115, 0021, 0000,
  166. 0002, 0116, 0001, 0117, 0001, 0000, 0001, 0130, 0035, 0000, 0001, 0127, 0013, 0000, 0001, 0131,
  167. 0037, 0000, 0001, 0124, 0021, 0000, 0002, 0125, 0001, 0126, 0001, 0000, 0001, 0132, 0035, 0000,
  168. 0001, 0131, 0010, 0000, 0025, 0127, 0001, 0116, 0003, 0127, 0001, 0133, 0006, 0127, 0032, 0000,
  169. 0001, 0134, 0005, 0000, 0025, 0131, 0001, 0125, 0003, 0131, 0001, 0135, 0006, 0131, 0032, 0000,
  170. 0001, 0136, 0005, 0000, 0025, 0127, 0001, 0116, 0003, 0127, 0001, 0133, 0001, 0137, 0005, 0127,
  171. 0033, 0000, 0001, 0140, 0004, 0000, 0025, 0131, 0001, 0125, 0003, 0131, 0001, 0135, 0001, 0141,
  172. 0005, 0131, 0033, 0000, 0001, 0142, 0004, 0000, 0025, 0127, 0001, 0116, 0003, 0127, 0001, 0133,
  173. 0001, 0127, 0001, 0143, 0004, 0127, 0033, 0000, 0001, 0144, 0004, 0000, 0025, 0131, 0001, 0125,
  174. 0003, 0131, 0001, 0135, 0001, 0131, 0001, 0145, 0004, 0131, 0033, 0000, 0001, 0146, 0004, 0000,
  175. 0025, 0127, 0001, 0116, 0003, 0127, 0001, 0133, 0001, 0127, 0001, 0147, 0004, 0127, 0025, 0131,
  176. 0001, 0125, 0003, 0131, 0001, 0135, 0001, 0131, 0001, 0150, 0004, 0131}
  177. func zzUnpackTransNoParams() []int {
  178. result := make([]int, 2208)
  179. offset := 0
  180. offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result)
  181. return result
  182. }
  183. func zzUnpackTrans(packed []rune, offset int, result []int) int {
  184. i := 0 /* index in packed string */
  185. j := offset /* index in unpacked array */
  186. l := len(packed) //780
  187. for i < l {
  188. count := packed[i]
  189. i++
  190. value := packed[i]
  191. i++
  192. value--
  193. result[j] = int(value)
  194. j++
  195. count--
  196. for count > 0 {
  197. result[j] = int(value)
  198. j++
  199. count--
  200. }
  201. }
  202. return j
  203. }
  204. /* error codes */
  205. const (
  206. ZZ_UNKNOWN_ERROR = 0
  207. ZZ_NO_MATCH = 1
  208. ZZ_PUSHBACK_2BIG = 2
  209. )
  210. /* error messages for the codes above */
  211. var ZZ_ERROR_MSG []string = []string{
  212. "Unknown internal scanner error",
  213. "Error: could not match input",
  214. "Error: pushback Value was too large"}
  215. /**
  216. * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
  217. */
  218. var ZZ_ATTRIBUTE []int = zzUnpackAttributeNoParams()
  219. var ZZ_ATTRIBUTE_PACKED_0 []rune = []rune{0004, 0000, 0001, 0010, 0004, 0000, 0003, 0011, 0001, 0001, 0001, 0011, 0010, 0001, 0001, 0011,
  220. 0017, 0001, 0004, 0011, 0001, 0001, 0001, 0011, 0001, 0000, 0002, 0011, 0001, 0001, 0001, 0000,
  221. 0003, 0011, 0001, 0001, 0001, 0011, 0001, 0000, 0003, 0001, 0002, 0011, 0001, 0000, 0001, 0011,
  222. 0002, 0000, 0001, 0011, 0004, 0000, 0002, 0011, 0001, 0001, 0001, 0000, 0003, 0001, 0003, 0000,
  223. 0003, 0011, 0001, 0001, 0020, 0000, 0001, 0011, 0001, 0000, 0001, 0011, 0002, 0001}
  224. func zzUnpackAttributeNoParams() []int {
  225. result := make([]int, 104)
  226. offset := 0
  227. offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result)
  228. return result
  229. }
  230. func zzUnpackAttribute(packed []rune, offset int, result []int) int {
  231. i := 0 /* index in packed string */
  232. j := offset /* index in unpacked array */
  233. l := len(packed) //78
  234. for i < l {
  235. count := packed[i]
  236. i++
  237. value := packed[i]
  238. i++
  239. result[j] = int(value)
  240. j++
  241. count--
  242. for count > 0 {
  243. result[j] = int(value)
  244. j++
  245. count--
  246. }
  247. }
  248. return j
  249. }
  250. type Lexer struct {
  251. /** the input device */
  252. zzReader io.RuneReader
  253. /** the current state of the DFA */
  254. zzState int
  255. /** the current lexical state */
  256. zzLexicalState int
  257. /** this buffer contains the current text to be matched and is
  258. the source of the yytext() string */
  259. zzBuffer []rune
  260. //zzBytesBuffer []byte
  261. /** the textposition at the last accepting state */
  262. zzMarkedPos int
  263. /** the current text Position in the buffer */
  264. zzCurrentPos int
  265. /** startRead marks the beginning of the yytext() string in the buffer */
  266. zzStartRead int
  267. /** endRead marks the last character in the buffer, that has been read
  268. from input */
  269. zzEndRead int
  270. /** number of newlines encountered up to the start of the matched text */
  271. yyline int
  272. /** the number of characters up to the start of the matched text */
  273. yychar int
  274. /**
  275. * the number of characters from the last newline up to the start of the
  276. * matched text
  277. */
  278. yycolumn int
  279. /**
  280. * zzAtBOL == true <=> the scanner is currently at the beginning of a line
  281. */
  282. zzAtBOL bool
  283. /** zzAtEOF == true <=> the scanner is at the EOF */
  284. zzAtEOF bool
  285. /** denotes if the user-EOF-code has already been executed */
  286. zzEOFDone bool
  287. /**
  288. * The number of occupied positions in zzBuffer beyond zzEndRead.
  289. * When a lead/high surrogate has been read from the input stream
  290. * into the final zzBuffer Position, this will have a Value of 1;
  291. * otherwise, it will have a Value of 0.
  292. */
  293. zzFinalHighSurrogate int
  294. /* user code: */
  295. ltstr string
  296. debugFlag bool
  297. }
  298. func (lexer *Lexer) init() {
  299. lexer.zzLexicalState = YYINITIAL
  300. lexer.zzBuffer = make([]rune, ZZ_BUFFERSIZE)
  301. lexer.zzAtBOL = true
  302. }
  303. func (lexer *Lexer) Reset(in io.RuneReader) *Lexer {
  304. lexer.zzLexicalState = YYINITIAL
  305. lexer.zzAtBOL = true
  306. lexer.zzReader = in
  307. lexer.zzState = 0
  308. lexer.zzMarkedPos = 0
  309. lexer.zzCurrentPos = 0
  310. lexer.zzStartRead = 0
  311. lexer.zzEndRead = 0
  312. lexer.yyline = 0
  313. lexer.yychar = 0
  314. lexer.yycolumn = 0
  315. lexer.zzAtEOF = false
  316. lexer.zzEOFDone = false
  317. lexer.zzFinalHighSurrogate = 0
  318. lexer.ltstr = ""
  319. return lexer
  320. }
  321. func (lexer *Lexer) debug(info string) {
  322. if !lexer.debugFlag {
  323. return
  324. }
  325. }
  326. func (lexer *Lexer) yyerror(msg string) {
  327. locInfo := "(line: " + strconv.Itoa(lexer.yyline) + ", column: " + strconv.Itoa(lexer.yycolumn) + ", char: " + strconv.Itoa(lexer.yychar) + ")"
  328. if msg == "" {
  329. panic("syntex error" + locInfo)
  330. } else {
  331. panic("syntex error" + locInfo + ": " + msg)
  332. }
  333. }
  334. /**
  335. * Creates a new scanner
  336. *
  337. * @param in the java.io.Reader to read input from.
  338. */
  339. func NewLexer(in io.RuneReader, debug bool) *Lexer {
  340. l := new(Lexer)
  341. l.init()
  342. l.debugFlag = debug
  343. l.zzReader = in
  344. return l
  345. }
  346. /**
  347. * Unpacks the compressed character translation table.
  348. *
  349. * @param packed the packed character translation table
  350. * @return the unpacked character translation table
  351. */
  352. func zzUnpackCMap(packed []rune) []rune {
  353. m := make([]rune, 0x110000)
  354. i := 0 /* index in packed string */
  355. j := 0 /* index in unpacked array */
  356. for i < 208 {
  357. count := packed[i]
  358. i++
  359. value := packed[i]
  360. i++
  361. m[j] = value
  362. j++
  363. count--
  364. for count > 0 {
  365. m[j] = value
  366. j++
  367. count--
  368. }
  369. }
  370. return m
  371. }
  372. /**
  373. * Refills the input buffer.
  374. *
  375. * @return <code>false</code>, iff there was new input.
  376. *
  377. * @exception java.io.IOException if any I/O-Error occurs
  378. */
  379. func (lexer *Lexer) zzRefill() (bool, error) {
  380. /* first: make room (if you can) */
  381. if lexer.zzStartRead > 0 {
  382. lexer.zzEndRead += lexer.zzFinalHighSurrogate
  383. lexer.zzFinalHighSurrogate = 0
  384. l := lexer.zzEndRead - lexer.zzStartRead
  385. if l > 0 {
  386. copy(lexer.zzBuffer[:l], lexer.zzBuffer[lexer.zzStartRead:lexer.zzEndRead])
  387. }
  388. /* translate stored positions */
  389. lexer.zzEndRead -= lexer.zzStartRead
  390. lexer.zzCurrentPos -= lexer.zzStartRead
  391. lexer.zzMarkedPos -= lexer.zzStartRead
  392. lexer.zzStartRead = 0
  393. }
  394. /* is the buffer big enough? */
  395. if lexer.zzCurrentPos >= len(lexer.zzBuffer)-lexer.zzFinalHighSurrogate {
  396. /* if not: blow it up */
  397. newBuffer := make([]rune, len(lexer.zzBuffer)*2)
  398. copy(newBuffer[:len(lexer.zzBuffer)], lexer.zzBuffer[:len(lexer.zzBuffer)])
  399. lexer.zzBuffer = newBuffer
  400. lexer.zzEndRead += lexer.zzFinalHighSurrogate
  401. lexer.zzFinalHighSurrogate = 0
  402. }
  403. /* fill the buffer with new input */
  404. requested := len(lexer.zzBuffer) - lexer.zzEndRead
  405. var numRead = 0
  406. for i := lexer.zzEndRead; i < lexer.zzEndRead+requested; i++ {
  407. r, _, err := lexer.zzReader.ReadRune()
  408. if err == io.EOF {
  409. if numRead == 0 {
  410. numRead = -1
  411. }
  412. break
  413. } else if err != nil {
  414. return false, err
  415. } else {
  416. numRead++
  417. lexer.zzBuffer[i] = r
  418. }
  419. }
  420. /* not supposed to occur according to specification of java.io.Reader */
  421. if numRead == 0 {
  422. panic("Reader returned 0 characters. See JFlex examples for workaround.")
  423. }
  424. if numRead > 0 {
  425. lexer.zzEndRead += numRead
  426. /* If numRead == requested, we might have requested to few chars to
  427. encode a full Unicode character. We assume that a Reader would
  428. otherwise never return half characters. */
  429. if numRead == requested {
  430. if utf8.ValidRune(lexer.zzBuffer[lexer.zzEndRead-1]) {
  431. lexer.zzEndRead--
  432. lexer.zzFinalHighSurrogate = 1
  433. }
  434. }
  435. /* potentially more input available */
  436. return false, nil
  437. }
  438. /* numRead < 0 ==> end of stream */
  439. return true, nil
  440. }
  441. /**
  442. * Closes the input stream.
  443. */
  444. func (lexer *Lexer) yyclose() error {
  445. lexer.zzAtEOF = true /* indicate end of file */
  446. lexer.zzEndRead = lexer.zzStartRead /* invalidate buffer */
  447. if lexer.zzReader != nil {
  448. if c, ok := lexer.zzReader.(io.Closer); ok {
  449. return c.Close()
  450. }
  451. }
  452. return nil
  453. }
  454. /**
  455. * Resets the scanner to read from a new input stream.
  456. * Does not close the old reader.
  457. *
  458. * All internal variables are reset, the old input stream
  459. * <b>cannot</b> be reused (internal buffer is discarded and lost).
  460. * Lexical state is set to <tt>ZZ_INITIAL</tt>.
  461. *
  462. * Internal scan buffer is resized down to its initial length, if it has grown.
  463. *
  464. * @param reader the new input stream
  465. */
  466. func (lexer *Lexer) yyreset(reader io.RuneReader) {
  467. lexer.zzReader = reader
  468. lexer.zzAtBOL = true
  469. lexer.zzAtEOF = false
  470. lexer.zzEOFDone = false
  471. lexer.zzEndRead = 0
  472. lexer.zzStartRead = 0
  473. lexer.zzCurrentPos = 0
  474. lexer.zzMarkedPos = 0
  475. lexer.zzFinalHighSurrogate = 0
  476. lexer.yyline = 0
  477. lexer.yychar = 0
  478. lexer.yycolumn = 0
  479. lexer.zzLexicalState = YYINITIAL
  480. if len(lexer.zzBuffer) > ZZ_BUFFERSIZE {
  481. lexer.zzBuffer = make([]rune, ZZ_BUFFERSIZE)
  482. }
  483. }
  484. /**
  485. * Returns the current lexical state.
  486. */
  487. func (lexer *Lexer) yystate() int {
  488. return lexer.zzLexicalState
  489. }
  490. /**
  491. * Enters a new lexical state
  492. *
  493. * @param newState the new lexical state
  494. */
  495. func (lexer *Lexer) yybegin(newState int) {
  496. lexer.zzLexicalState = newState
  497. }
  498. /**
  499. * Returns the text matched by the current regular expression.
  500. */
  501. func (lexer *Lexer) yytext() string {
  502. return string(lexer.zzBuffer[lexer.zzStartRead:lexer.zzMarkedPos])
  503. }
  504. /**
  505. * Returns the character at Position <tt>pos</tt> from the
  506. * matched text.
  507. *
  508. * It is equivalent to yytext().charAt(pos), but faster
  509. *
  510. * @param pos the Position of the character to fetch.
  511. * A Value from 0 to yylength()-1.
  512. *
  513. * @return the character at Position pos
  514. */
  515. func (lexer *Lexer) yycharat(pos int) rune {
  516. return lexer.zzBuffer[lexer.zzStartRead+pos]
  517. }
  518. /**
  519. * Returns the length of the matched text region.
  520. */
  521. func (lexer *Lexer) yylength() int {
  522. return lexer.zzMarkedPos - lexer.zzStartRead
  523. }
  524. /**
  525. * Reports an error that occured while scanning.
  526. *
  527. * In a wellformed scanner (no or only correct usage of
  528. * yypushback(int) and a match-all fallback rule) this method
  529. * will only be called with things that "Can't Possibly Happen".
  530. * If this method is called, something is seriously wrong
  531. * (e.g. a JFlex bug producing a faulty scanner etc.).
  532. *
  533. * Usual syntax/scanner level error handling should be done
  534. * in error fallback rules.
  535. *
  536. * @param errorCode the code of the errormessage to display
  537. */
  538. func (lexer *Lexer) zzScanError(errorCode int) {
  539. var message string
  540. message = ZZ_ERROR_MSG[errorCode]
  541. if message == "" {
  542. message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]
  543. }
  544. panic(message)
  545. }
  546. /**
  547. * Pushes the specified amount of characters back into the input stream.
  548. *
  549. * They will be read again by then next call of the scanning method
  550. *
  551. * @param number the number of characters to be read again.
  552. * This number must not be greater than yylength()!
  553. */
  554. func (lexer *Lexer) yypushback(number int) {
  555. if number > lexer.yylength() {
  556. lexer.zzScanError(ZZ_PUSHBACK_2BIG)
  557. }
  558. lexer.zzMarkedPos -= number
  559. }
  560. /**
  561. * Resumes scanning until the next regular expression is matched,
  562. * the end of input is encountered or an I/O-Error occurs.
  563. *
  564. * @return the next token
  565. * @exception java.io.IOException if any I/O-Error occurs
  566. */
  567. func (lexer *Lexer) Yylex() (*LVal, error) {
  568. var zzInput rune
  569. var zzAction, zzCurrentPosL, zzMarkedPosL int
  570. // cached fields:
  571. zzEndReadL := lexer.zzEndRead
  572. zzBufferL := lexer.zzBuffer
  573. zzCMapL := ZZ_CMAP
  574. zzTransL := ZZ_TRANS
  575. zzRowMapL := ZZ_ROWMAP
  576. zzAttrL := ZZ_ATTRIBUTE
  577. for {
  578. zzMarkedPosL = lexer.zzMarkedPos
  579. lexer.yychar += zzMarkedPosL - lexer.zzStartRead
  580. zzR := false
  581. var zzCh rune
  582. var zzCharCount int
  583. zzCurrentPosL = lexer.zzStartRead
  584. for zzCurrentPosL < zzMarkedPosL {
  585. zzCh = zzBufferL[zzCurrentPosL]
  586. zzCharCount = utf8.RuneLen(zzCh)
  587. switch zzCh {
  588. case '\u000B', '\u000C', '\u0085', '\u2028', '\u2029':
  589. lexer.yyline++
  590. lexer.yycolumn = 0
  591. zzR = false
  592. case '\r':
  593. lexer.yyline++
  594. lexer.yycolumn = 0
  595. zzR = true
  596. case '\n':
  597. if zzR {
  598. zzR = false
  599. } else {
  600. lexer.yyline++
  601. lexer.yycolumn = 0
  602. }
  603. default:
  604. zzR = false
  605. lexer.yycolumn += zzCharCount
  606. }
  607. zzCurrentPosL += zzCharCount
  608. }
  609. if zzR {
  610. // peek one character ahead if it is \n (if we have counted one line too much)
  611. var zzPeek bool
  612. if zzMarkedPosL < zzEndReadL {
  613. zzPeek = zzBufferL[zzMarkedPosL] == '\n'
  614. } else if lexer.zzAtEOF {
  615. zzPeek = false
  616. } else {
  617. eof, err := lexer.zzRefill()
  618. if err != nil {
  619. return nil, err
  620. }
  621. zzEndReadL = lexer.zzEndRead
  622. zzMarkedPosL = lexer.zzMarkedPos
  623. zzBufferL = lexer.zzBuffer
  624. if eof {
  625. zzPeek = false
  626. } else {
  627. zzPeek = zzBufferL[zzMarkedPosL] == '\n'
  628. }
  629. }
  630. if zzPeek {
  631. lexer.yyline--
  632. }
  633. }
  634. zzAction = -1
  635. zzCurrentPosL = zzMarkedPosL
  636. lexer.zzCurrentPos = zzMarkedPosL
  637. lexer.zzStartRead = zzMarkedPosL
  638. lexer.zzState = ZZ_LEXSTATE[lexer.zzLexicalState]
  639. // set up zzAction for empty match case:
  640. zzAttributes := zzAttrL[lexer.zzState]
  641. if (zzAttributes & 1) == 1 {
  642. zzAction = lexer.zzState
  643. }
  644. {
  645. for true {
  646. if zzCurrentPosL < zzEndReadL {
  647. zzInput = zzBufferL[zzCurrentPosL]
  648. zzCurrentPosL += 1 //utf8.RuneLen(zzInput)
  649. } else if lexer.zzAtEOF {
  650. zzInput = YYEOF
  651. goto zzForAction
  652. } else {
  653. // store back cached positions
  654. lexer.zzCurrentPos = zzCurrentPosL
  655. lexer.zzMarkedPos = zzMarkedPosL
  656. eof, err := lexer.zzRefill()
  657. if err != nil {
  658. return nil, err
  659. }
  660. // get translated positions and possibly new buffer
  661. zzCurrentPosL = lexer.zzCurrentPos
  662. zzMarkedPosL = lexer.zzMarkedPos
  663. zzBufferL = lexer.zzBuffer
  664. zzEndReadL = lexer.zzEndRead
  665. if eof {
  666. zzInput = YYEOF
  667. goto zzForAction
  668. } else {
  669. zzInput = zzBufferL[zzCurrentPosL]
  670. zzCurrentPosL += 1 //utf8.RuneLen(zzInput)
  671. }
  672. }
  673. zzNext := zzTransL[zzRowMapL[lexer.zzState]+int(zzCMapL[zzInput])]
  674. if zzNext == -1 {
  675. goto zzForAction
  676. }
  677. lexer.zzState = zzNext
  678. zzAttributes = zzAttrL[lexer.zzState]
  679. if (zzAttributes & 1) == 1 {
  680. zzAction = lexer.zzState
  681. zzMarkedPosL = zzCurrentPosL
  682. if (zzAttributes & 8) == 8 {
  683. goto zzForAction
  684. }
  685. }
  686. }
  687. }
  688. zzForAction:
  689. // store back cached Position
  690. lexer.zzMarkedPos = zzMarkedPosL
  691. if zzInput == YYEOF && lexer.zzStartRead == lexer.zzCurrentPos {
  692. lexer.zzAtEOF = true
  693. switch lexer.zzLexicalState {
  694. case xc:
  695. {
  696. lexer.debug("<xc><<EOF>>")
  697. lexer.yybegin(YYINITIAL)
  698. lexer.yyerror("unterminated /* comment")
  699. }
  700. case 105:
  701. case xq:
  702. {
  703. lexer.debug("<xq><<EOF>>")
  704. lexer.yybegin(YYINITIAL)
  705. lexer.yyerror("unterminated quoted string")
  706. }
  707. fallthrough
  708. case 106:
  709. case xdq:
  710. {
  711. lexer.debug("<xdq><<EOF>>")
  712. lexer.yybegin(YYINITIAL)
  713. lexer.yyerror("unterminated quoted identifier")
  714. }
  715. fallthrough
  716. case 107:
  717. case xbin:
  718. {
  719. lexer.debug("<xbin><<EOF>>")
  720. lexer.yybegin(YYINITIAL)
  721. lexer.yyerror("unterminated binary string literal")
  722. }
  723. fallthrough
  724. case 108:
  725. case xhex:
  726. {
  727. lexer.debug("<xhex><<EOF>>")
  728. lexer.yybegin(YYINITIAL)
  729. lexer.yyerror("unterminated hexadecimal integer")
  730. }
  731. fallthrough
  732. case 109:
  733. case xq2:
  734. {
  735. lexer.yybegin(YYINITIAL)
  736. lexer.yyerror("unterminated q2 string")
  737. }
  738. fallthrough
  739. case 110:
  740. case xq2_2:
  741. {
  742. lexer.yybegin(YYINITIAL)
  743. lexer.yyerror("unterminated q2 string")
  744. }
  745. fallthrough
  746. case 111:
  747. default:
  748. return nil, nil
  749. }
  750. } else {
  751. var action int
  752. if zzAction < 0 {
  753. action = zzAction
  754. } else {
  755. action = ZZ_ACTION[zzAction]
  756. }
  757. switch action {
  758. case 1:
  759. {
  760. lexer.debug("{other}")
  761. return newLVal(lexer.yytext(), NORMAL), nil
  762. }
  763. fallthrough
  764. case 44:
  765. case 2:
  766. {
  767. lexer.debug("{xq_start}")
  768. lexer.yybegin(xq)
  769. lexer.ltstr = ""
  770. }
  771. fallthrough
  772. case 45:
  773. case 3:
  774. {
  775. lexer.debug("{xdq_start}")
  776. lexer.yybegin(xdq)
  777. lexer.ltstr = ""
  778. lexer.ltstr += lexer.yytext()
  779. }
  780. fallthrough
  781. case 46:
  782. case 4:
  783. {
  784. lexer.debug("{self} | {op_chars}")
  785. return newLVal(lexer.yytext(), NORMAL), nil
  786. }
  787. fallthrough
  788. case 47:
  789. case 5:
  790. {
  791. lexer.debug("{identifier}")
  792. return newLVal(lexer.yytext(), NORMAL), nil
  793. }
  794. fallthrough
  795. case 48:
  796. case 6:
  797. {
  798. lexer.debug("{integer}")
  799. return newLVal(lexer.yytext(), INT), nil
  800. }
  801. fallthrough
  802. case 49:
  803. case 7:
  804. {
  805. lexer.debug("{whitespace} | {comment} | {c_line_comment}")
  806. return newLVal(lexer.yytext(), WHITESPACE_OR_COMMENT), nil
  807. }
  808. fallthrough
  809. case 50:
  810. case 8:
  811. {
  812. lexer.debug("<xc>{xc_inside}")
  813. lexer.ltstr += lexer.yytext()
  814. }
  815. fallthrough
  816. case 51:
  817. case 9:
  818. {
  819. lexer.debug("<xc>[\\/] | <xc>[\\*]")
  820. lexer.ltstr += lexer.yytext()
  821. }
  822. fallthrough
  823. case 52:
  824. case 10:
  825. {
  826. lexer.debug("<xq>{xq_inside}")
  827. lexer.ltstr += lexer.yytext()
  828. }
  829. fallthrough
  830. case 53:
  831. case 11:
  832. {
  833. lexer.debug("<xq>{xq_stop}")
  834. lexer.yybegin(YYINITIAL)
  835. return newLVal(lexer.ltstr, STRING), nil
  836. }
  837. fallthrough
  838. case 54:
  839. case 12:
  840. {
  841. lexer.debug("<xdq>{xdq_inside}")
  842. lexer.ltstr += lexer.yytext()
  843. }
  844. fallthrough
  845. case 55:
  846. case 13:
  847. {
  848. lexer.debug("<xdq>{xdq_stop}")
  849. lexer.yybegin(YYINITIAL)
  850. lexer.ltstr += lexer.yytext()
  851. return newLVal(lexer.ltstr, NORMAL), nil
  852. }
  853. fallthrough
  854. case 56:
  855. case 14:
  856. {
  857. lexer.debug("<xbin>{xbin_inside}")
  858. lexer.ltstr += lexer.yytext()
  859. }
  860. fallthrough
  861. case 57:
  862. case 15:
  863. {
  864. lexer.debug("<xbin>{xbin_stop}")
  865. lexer.yybegin(YYINITIAL)
  866. lexer.ltstr += lexer.yytext()
  867. return newLVal(lexer.ltstr, NORMAL), nil
  868. }
  869. fallthrough
  870. case 58:
  871. case 16:
  872. {
  873. lexer.debug("<xhex>{xhex_inside}")
  874. lexer.ltstr += lexer.yytext()
  875. }
  876. fallthrough
  877. case 59:
  878. case 17:
  879. {
  880. lexer.debug("<xhex>{xhex_stop}")
  881. lexer.yybegin(YYINITIAL)
  882. lexer.ltstr += lexer.yytext()
  883. return newLVal(lexer.ltstr, NORMAL), nil
  884. }
  885. fallthrough
  886. case 60:
  887. case 18:
  888. {
  889. lexer.ltstr += lexer.yytext()
  890. }
  891. fallthrough
  892. case 61:
  893. case 19:
  894. {
  895. lexer.yybegin(xq2_2)
  896. }
  897. fallthrough
  898. case 62:
  899. case 20:
  900. {
  901. lexer.ltstr += "]"
  902. lexer.ltstr += lexer.yytext()
  903. lexer.yybegin(xq2)
  904. }
  905. fallthrough
  906. case 63:
  907. case 21:
  908. {
  909. lexer.yybegin(YYINITIAL)
  910. return newLVal(lexer.ltstr, STRING), nil
  911. }
  912. fallthrough
  913. case 64:
  914. case 22:
  915. {
  916. lexer.ltstr += "]"
  917. lexer.yybegin(xq2_2)
  918. }
  919. fallthrough
  920. case 65:
  921. case 23:
  922. {
  923. lexer.debug("{xc_start}")
  924. lexer.yybegin(xc)
  925. lexer.ltstr = lexer.yytext()
  926. }
  927. fallthrough
  928. case 66:
  929. case 24:
  930. {
  931. lexer.debug("{xbin_start}")
  932. lexer.yybegin(xbin)
  933. lexer.ltstr = ""
  934. lexer.ltstr += lexer.yytext()
  935. }
  936. fallthrough
  937. case 67:
  938. case 25:
  939. {
  940. lexer.debug("{xhex_start}")
  941. lexer.yybegin(xhex)
  942. lexer.ltstr = ""
  943. lexer.ltstr += lexer.yytext()
  944. }
  945. fallthrough
  946. case 68:
  947. case 26:
  948. {
  949. lexer.debug("{decimal}")
  950. return newLVal(lexer.yytext(), DECIMAL), nil
  951. }
  952. fallthrough
  953. case 69:
  954. case 27:
  955. {
  956. lexer.debug("{real}")
  957. return newLVal(lexer.yytext(), DOUBLE), nil
  958. }
  959. fallthrough
  960. case 70:
  961. case 28:
  962. {
  963. lexer.debug("{assign}")
  964. return newLVal(lexer.yytext(), NORMAL), nil
  965. }
  966. fallthrough
  967. case 71:
  968. case 29:
  969. {
  970. lexer.debug("{selstar}")
  971. return newLVal(lexer.yytext(), NORMAL), nil
  972. }
  973. fallthrough
  974. case 72:
  975. case 30:
  976. {
  977. lexer.debug("{boundary}")
  978. return newLVal(lexer.yytext(), NORMAL), nil
  979. }
  980. fallthrough
  981. case 73:
  982. case 31:
  983. {
  984. lexer.debug("<xc>{xc_start}")
  985. lexer.ltstr += lexer.yytext()
  986. }
  987. fallthrough
  988. case 74:
  989. case 32:
  990. {
  991. lexer.debug("<xc>{xc_stop}")
  992. lexer.yybegin(YYINITIAL)
  993. lexer.ltstr += lexer.yytext()
  994. return newLVal(lexer.ltstr, WHITESPACE_OR_COMMENT), nil
  995. }
  996. fallthrough
  997. case 75:
  998. case 33:
  999. {
  1000. lexer.debug("<xq>{xq_double}")
  1001. lexer.ltstr += "\\'"
  1002. }
  1003. fallthrough
  1004. case 76:
  1005. case 34:
  1006. { // keep original string
  1007. lexer.debug("<xdq>{xdq_double}")
  1008. lexer.ltstr += lexer.yytext()
  1009. }
  1010. fallthrough
  1011. case 77:
  1012. case 35:
  1013. {
  1014. lexer.yybegin(xq2)
  1015. lexer.ltstr = ""
  1016. }
  1017. fallthrough
  1018. case 78:
  1019. case 36:
  1020. {
  1021. lexer.debug("{integer_with_boundary}")
  1022. return newLVal(lexer.yytext(), NORMAL), nil
  1023. }
  1024. fallthrough
  1025. case 79:
  1026. case 37:
  1027. {
  1028. lexer.debug("{hex_integer}")
  1029. return newLVal(lexer.yytext(), HEX_INT), nil
  1030. }
  1031. fallthrough
  1032. case 80:
  1033. case 38:
  1034. {
  1035. lexer.debug("<xq>{xq_cat}")
  1036. }
  1037. fallthrough
  1038. case 81:
  1039. case 39:
  1040. { /* ignore */
  1041. lexer.debug("<xbin>{xbin_cat}")
  1042. }
  1043. fallthrough
  1044. case 82:
  1045. case 40:
  1046. {
  1047. lexer.debug("<xhex>{xhex_cat}")
  1048. }
  1049. fallthrough
  1050. case 83:
  1051. case 41:
  1052. {
  1053. lexer.debug("{null}")
  1054. return newLVal("null", NULL), nil
  1055. }
  1056. fallthrough
  1057. case 84:
  1058. case 42:
  1059. {
  1060. lexer.debug("{is_null}")
  1061. return newLVal(lexer.yytext(), NORMAL), nil
  1062. }
  1063. fallthrough
  1064. case 85:
  1065. case 43:
  1066. {
  1067. lexer.debug("{not_null}")
  1068. return newLVal(lexer.yytext(), NORMAL), nil
  1069. }
  1070. fallthrough
  1071. case 86:
  1072. default:
  1073. lexer.zzScanError(ZZ_NO_MATCH)
  1074. }
  1075. }
  1076. }
  1077. }