prestogres 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +20 -0
  4. data/LICENSE +202 -0
  5. data/NOTICE +22 -0
  6. data/README.md +217 -0
  7. data/Rakefile +13 -0
  8. data/VERSION +1 -0
  9. data/bin/prestogres +254 -0
  10. data/config/pcp.conf.sample +28 -0
  11. data/config/pgpool.conf +678 -0
  12. data/config/pool_hba.conf +84 -0
  13. data/config/pool_passwd +0 -0
  14. data/config/postgresql.conf +2 -0
  15. data/ext/.gitignore +6 -0
  16. data/ext/depend +26 -0
  17. data/ext/extconf.rb +4 -0
  18. data/ext/prestogres_config.c +12 -0
  19. data/pgpool2/.gitignore +36 -0
  20. data/pgpool2/AUTHORS +4 -0
  21. data/pgpool2/COPYING +12 -0
  22. data/pgpool2/ChangeLog +1 -0
  23. data/pgpool2/INSTALL +1 -0
  24. data/pgpool2/Makefile.am +159 -0
  25. data/pgpool2/Makefile.in +1187 -0
  26. data/pgpool2/NEWS +4960 -0
  27. data/pgpool2/README +1 -0
  28. data/pgpool2/README.euc_jp +1 -0
  29. data/pgpool2/README.online-recovery +62 -0
  30. data/pgpool2/TODO +103 -0
  31. data/pgpool2/ac_func_accept_argtypes.m4 +85 -0
  32. data/pgpool2/aclocal.m4 +1088 -0
  33. data/pgpool2/c-compiler.m4 +134 -0
  34. data/pgpool2/c-library.m4 +325 -0
  35. data/pgpool2/child.c +2097 -0
  36. data/pgpool2/config.guess +1532 -0
  37. data/pgpool2/config.h.in +332 -0
  38. data/pgpool2/config.sub +1640 -0
  39. data/pgpool2/configure +15752 -0
  40. data/pgpool2/configure.in +392 -0
  41. data/pgpool2/depcomp +522 -0
  42. data/pgpool2/doc/basebackup.sh +17 -0
  43. data/pgpool2/doc/pgpool-de.html +4220 -0
  44. data/pgpool2/doc/pgpool-en.html +5738 -0
  45. data/pgpool2/doc/pgpool-fr.html +4118 -0
  46. data/pgpool2/doc/pgpool-ja.css +198 -0
  47. data/pgpool2/doc/pgpool-ja.html +11279 -0
  48. data/pgpool2/doc/pgpool-zh_cn.html +4445 -0
  49. data/pgpool2/doc/pgpool.css +280 -0
  50. data/pgpool2/doc/pgpool_remote_start +13 -0
  51. data/pgpool2/doc/recovery.conf.sample +117 -0
  52. data/pgpool2/doc/tutorial-en.html +707 -0
  53. data/pgpool2/doc/tutorial-ja.html +422 -0
  54. data/pgpool2/doc/tutorial-memqcache-en.html +325 -0
  55. data/pgpool2/doc/tutorial-memqcache-ja.html +370 -0
  56. data/pgpool2/doc/tutorial-memqcache-zh_cn.html +322 -0
  57. data/pgpool2/doc/tutorial-watchdog-en.html +306 -0
  58. data/pgpool2/doc/tutorial-watchdog-ja.html +343 -0
  59. data/pgpool2/doc/tutorial-watchdog-zh_cn.html +301 -0
  60. data/pgpool2/doc/tutorial-zh_cn.html +537 -0
  61. data/pgpool2/doc/watchdog.png +0 -0
  62. data/pgpool2/doc/wd-en.html +236 -0
  63. data/pgpool2/doc/wd-en.jpg +0 -0
  64. data/pgpool2/doc/wd-ja.html +219 -0
  65. data/pgpool2/doc/wd-ja.jpg +0 -0
  66. data/pgpool2/doc/wd-zh_cn.html +201 -0
  67. data/pgpool2/doc/where_to_send_queries.odg +0 -0
  68. data/pgpool2/doc/where_to_send_queries.pdf +0 -0
  69. data/pgpool2/general.m4 +166 -0
  70. data/pgpool2/getopt_long.c +200 -0
  71. data/pgpool2/getopt_long.h +44 -0
  72. data/pgpool2/install-sh +251 -0
  73. data/pgpool2/ltmain.sh +8406 -0
  74. data/pgpool2/m4/libtool.m4 +7360 -0
  75. data/pgpool2/m4/ltoptions.m4 +368 -0
  76. data/pgpool2/m4/ltsugar.m4 +123 -0
  77. data/pgpool2/m4/ltversion.m4 +23 -0
  78. data/pgpool2/m4/lt~obsolete.m4 +92 -0
  79. data/pgpool2/main.c +2971 -0
  80. data/pgpool2/md5.c +444 -0
  81. data/pgpool2/md5.h +28 -0
  82. data/pgpool2/missing +360 -0
  83. data/pgpool2/mkinstalldirs +40 -0
  84. data/pgpool2/parser/Makefile.am +50 -0
  85. data/pgpool2/parser/Makefile.in +559 -0
  86. data/pgpool2/parser/copyfuncs.c +3310 -0
  87. data/pgpool2/parser/gram.c +39100 -0
  88. data/pgpool2/parser/gram.h +940 -0
  89. data/pgpool2/parser/gram.y +13408 -0
  90. data/pgpool2/parser/gramparse.h +74 -0
  91. data/pgpool2/parser/keywords.c +32 -0
  92. data/pgpool2/parser/keywords.h +39 -0
  93. data/pgpool2/parser/kwlist.h +425 -0
  94. data/pgpool2/parser/kwlookup.c +88 -0
  95. data/pgpool2/parser/list.c +1156 -0
  96. data/pgpool2/parser/makefuncs.c +518 -0
  97. data/pgpool2/parser/makefuncs.h +83 -0
  98. data/pgpool2/parser/memnodes.h +79 -0
  99. data/pgpool2/parser/nodes.c +29 -0
  100. data/pgpool2/parser/nodes.h +609 -0
  101. data/pgpool2/parser/outfuncs.c +5790 -0
  102. data/pgpool2/parser/parsenodes.h +2615 -0
  103. data/pgpool2/parser/parser.c +262 -0
  104. data/pgpool2/parser/parser.h +46 -0
  105. data/pgpool2/parser/pg_class.h +158 -0
  106. data/pgpool2/parser/pg_config_manual.h +273 -0
  107. data/pgpool2/parser/pg_list.h +352 -0
  108. data/pgpool2/parser/pg_trigger.h +147 -0
  109. data/pgpool2/parser/pg_wchar.h +492 -0
  110. data/pgpool2/parser/pool_memory.c +342 -0
  111. data/pgpool2/parser/pool_memory.h +77 -0
  112. data/pgpool2/parser/pool_parser.h +222 -0
  113. data/pgpool2/parser/pool_string.c +121 -0
  114. data/pgpool2/parser/pool_string.h +37 -0
  115. data/pgpool2/parser/primnodes.h +1280 -0
  116. data/pgpool2/parser/scan.c +4094 -0
  117. data/pgpool2/parser/scan.l +1451 -0
  118. data/pgpool2/parser/scanner.h +120 -0
  119. data/pgpool2/parser/scansup.c +221 -0
  120. data/pgpool2/parser/scansup.h +28 -0
  121. data/pgpool2/parser/snprintf.c +1102 -0
  122. data/pgpool2/parser/stringinfo.c +294 -0
  123. data/pgpool2/parser/stringinfo.h +178 -0
  124. data/pgpool2/parser/value.c +78 -0
  125. data/pgpool2/parser/value.h +62 -0
  126. data/pgpool2/parser/wchar.c +2048 -0
  127. data/pgpool2/pcp.conf.sample +28 -0
  128. data/pgpool2/pcp/Makefile.am +40 -0
  129. data/pgpool2/pcp/Makefile.in +771 -0
  130. data/pgpool2/pcp/libpcp_ext.h +250 -0
  131. data/pgpool2/pcp/md5.c +444 -0
  132. data/pgpool2/pcp/md5.h +28 -0
  133. data/pgpool2/pcp/pcp.c +1652 -0
  134. data/pgpool2/pcp/pcp.h +61 -0
  135. data/pgpool2/pcp/pcp_attach_node.c +172 -0
  136. data/pgpool2/pcp/pcp_detach_node.c +185 -0
  137. data/pgpool2/pcp/pcp_error.c +87 -0
  138. data/pgpool2/pcp/pcp_node_count.c +160 -0
  139. data/pgpool2/pcp/pcp_node_info.c +198 -0
  140. data/pgpool2/pcp/pcp_pool_status.c +166 -0
  141. data/pgpool2/pcp/pcp_proc_count.c +166 -0
  142. data/pgpool2/pcp/pcp_proc_info.c +261 -0
  143. data/pgpool2/pcp/pcp_promote_node.c +185 -0
  144. data/pgpool2/pcp/pcp_recovery_node.c +172 -0
  145. data/pgpool2/pcp/pcp_stop_pgpool.c +179 -0
  146. data/pgpool2/pcp/pcp_stream.c +385 -0
  147. data/pgpool2/pcp/pcp_stream.h +52 -0
  148. data/pgpool2/pcp/pcp_systemdb_info.c +194 -0
  149. data/pgpool2/pcp/pcp_watchdog_info.c +211 -0
  150. data/pgpool2/pcp_child.c +1493 -0
  151. data/pgpool2/pg_md5.c +305 -0
  152. data/pgpool2/pgpool.8.in +121 -0
  153. data/pgpool2/pgpool.conf +553 -0
  154. data/pgpool2/pgpool.conf.sample +666 -0
  155. data/pgpool2/pgpool.conf.sample-master-slave +665 -0
  156. data/pgpool2/pgpool.conf.sample-replication +664 -0
  157. data/pgpool2/pgpool.conf.sample-stream +664 -0
  158. data/pgpool2/pgpool.spec +264 -0
  159. data/pgpool2/pgpool_adm/TODO +7 -0
  160. data/pgpool2/pgpool_adm/pgpool_adm--1.0.sql +85 -0
  161. data/pgpool2/pgpool_adm/pgpool_adm.c +558 -0
  162. data/pgpool2/pgpool_adm/pgpool_adm.control +5 -0
  163. data/pgpool2/pgpool_adm/pgpool_adm.h +46 -0
  164. data/pgpool2/pgpool_adm/pgpool_adm.sql.in +85 -0
  165. data/pgpool2/pool.h +655 -0
  166. data/pgpool2/pool_auth.c +1390 -0
  167. data/pgpool2/pool_config.c +5007 -0
  168. data/pgpool2/pool_config.h +284 -0
  169. data/pgpool2/pool_config.l +3281 -0
  170. data/pgpool2/pool_config_md5.c +29 -0
  171. data/pgpool2/pool_connection_pool.c +812 -0
  172. data/pgpool2/pool_error.c +242 -0
  173. data/pgpool2/pool_globals.c +27 -0
  174. data/pgpool2/pool_hba.c +1723 -0
  175. data/pgpool2/pool_hba.conf.sample +67 -0
  176. data/pgpool2/pool_ip.c +567 -0
  177. data/pgpool2/pool_ip.h +65 -0
  178. data/pgpool2/pool_ipc.h +38 -0
  179. data/pgpool2/pool_lobj.c +242 -0
  180. data/pgpool2/pool_lobj.h +32 -0
  181. data/pgpool2/pool_memqcache.c +3818 -0
  182. data/pgpool2/pool_memqcache.h +268 -0
  183. data/pgpool2/pool_params.c +163 -0
  184. data/pgpool2/pool_passwd.c +249 -0
  185. data/pgpool2/pool_passwd.h +41 -0
  186. data/pgpool2/pool_path.c +193 -0
  187. data/pgpool2/pool_path.h +81 -0
  188. data/pgpool2/pool_process_context.c +247 -0
  189. data/pgpool2/pool_process_context.h +62 -0
  190. data/pgpool2/pool_process_query.c +5001 -0
  191. data/pgpool2/pool_process_reporting.c +1671 -0
  192. data/pgpool2/pool_process_reporting.h +44 -0
  193. data/pgpool2/pool_proto2.c +671 -0
  194. data/pgpool2/pool_proto_modules.c +3524 -0
  195. data/pgpool2/pool_proto_modules.h +185 -0
  196. data/pgpool2/pool_query_cache.c +1020 -0
  197. data/pgpool2/pool_query_context.c +1871 -0
  198. data/pgpool2/pool_query_context.h +105 -0
  199. data/pgpool2/pool_relcache.c +284 -0
  200. data/pgpool2/pool_relcache.h +78 -0
  201. data/pgpool2/pool_rewrite_outfuncs.c +9060 -0
  202. data/pgpool2/pool_rewrite_query.c +715 -0
  203. data/pgpool2/pool_rewrite_query.h +192 -0
  204. data/pgpool2/pool_select_walker.c +1150 -0
  205. data/pgpool2/pool_select_walker.h +68 -0
  206. data/pgpool2/pool_sema.c +161 -0
  207. data/pgpool2/pool_session_context.c +952 -0
  208. data/pgpool2/pool_session_context.h +203 -0
  209. data/pgpool2/pool_shmem.c +185 -0
  210. data/pgpool2/pool_signal.c +158 -0
  211. data/pgpool2/pool_signal.h +61 -0
  212. data/pgpool2/pool_ssl.c +339 -0
  213. data/pgpool2/pool_stream.c +962 -0
  214. data/pgpool2/pool_stream.h +61 -0
  215. data/pgpool2/pool_system.c +659 -0
  216. data/pgpool2/pool_timestamp.c +1215 -0
  217. data/pgpool2/pool_timestamp.h +38 -0
  218. data/pgpool2/pool_type.h +171 -0
  219. data/pgpool2/pool_worker_child.c +384 -0
  220. data/pgpool2/ps_status.c +404 -0
  221. data/pgpool2/recovery.c +435 -0
  222. data/pgpool2/redhat/pgpool.conf.sample.patch +52 -0
  223. data/pgpool2/redhat/pgpool.init +201 -0
  224. data/pgpool2/redhat/pgpool.sysconfig +7 -0
  225. data/pgpool2/redhat/rpm_installer/basebackup-replication.sh +53 -0
  226. data/pgpool2/redhat/rpm_installer/basebackup-stream.sh +55 -0
  227. data/pgpool2/redhat/rpm_installer/config_for_script +17 -0
  228. data/pgpool2/redhat/rpm_installer/failover.sh +64 -0
  229. data/pgpool2/redhat/rpm_installer/getsources.sh +141 -0
  230. data/pgpool2/redhat/rpm_installer/install.sh +1363 -0
  231. data/pgpool2/redhat/rpm_installer/pgpool_recovery_pitr +47 -0
  232. data/pgpool2/redhat/rpm_installer/pgpool_remote_start +15 -0
  233. data/pgpool2/redhat/rpm_installer/recovery.conf +4 -0
  234. data/pgpool2/redhat/rpm_installer/uninstall.sh +57 -0
  235. data/pgpool2/sample/dist_def_pgbench.sql +73 -0
  236. data/pgpool2/sample/pgpool.pam +3 -0
  237. data/pgpool2/sample/pgpool_recovery +20 -0
  238. data/pgpool2/sample/pgpool_recovery_pitr +19 -0
  239. data/pgpool2/sample/pgpool_remote_start +13 -0
  240. data/pgpool2/sample/replicate_def_pgbench.sql +18 -0
  241. data/pgpool2/sql/insert_lock.sql +15 -0
  242. data/pgpool2/sql/pgpool-recovery/pgpool-recovery.c +280 -0
  243. data/pgpool2/sql/pgpool-recovery/pgpool-recovery.sql.in +19 -0
  244. data/pgpool2/sql/pgpool-recovery/pgpool_recovery--1.0.sql +24 -0
  245. data/pgpool2/sql/pgpool-recovery/pgpool_recovery.control +5 -0
  246. data/pgpool2/sql/pgpool-recovery/uninstall_pgpool-recovery.sql +3 -0
  247. data/pgpool2/sql/pgpool-regclass/pgpool-regclass.c +206 -0
  248. data/pgpool2/sql/pgpool-regclass/pgpool-regclass.sql.in +4 -0
  249. data/pgpool2/sql/pgpool-regclass/pgpool_regclass--1.0.sql +7 -0
  250. data/pgpool2/sql/pgpool-regclass/pgpool_regclass.control +5 -0
  251. data/pgpool2/sql/pgpool-regclass/uninstall_pgpool-regclass.sql +1 -0
  252. data/pgpool2/sql/system_db.sql +38 -0
  253. data/pgpool2/strlcpy.c +85 -0
  254. data/pgpool2/test/C/test_extended.c +98 -0
  255. data/pgpool2/test/jdbc/.cvsignore +2 -0
  256. data/pgpool2/test/jdbc/AutoCommitTest.java +45 -0
  257. data/pgpool2/test/jdbc/BatchTest.java +55 -0
  258. data/pgpool2/test/jdbc/ColumnTest.java +60 -0
  259. data/pgpool2/test/jdbc/CreateTempTableTest.java +48 -0
  260. data/pgpool2/test/jdbc/InsertTest.java +34 -0
  261. data/pgpool2/test/jdbc/LockTest.java +36 -0
  262. data/pgpool2/test/jdbc/PgpoolTest.java +75 -0
  263. data/pgpool2/test/jdbc/README.euc_jp +73 -0
  264. data/pgpool2/test/jdbc/RunTest.java +83 -0
  265. data/pgpool2/test/jdbc/SelectTest.java +37 -0
  266. data/pgpool2/test/jdbc/UpdateTest.java +32 -0
  267. data/pgpool2/test/jdbc/expected/CreateTempTable +1 -0
  268. data/pgpool2/test/jdbc/expected/autocommit +10 -0
  269. data/pgpool2/test/jdbc/expected/batch +1 -0
  270. data/pgpool2/test/jdbc/expected/column +100 -0
  271. data/pgpool2/test/jdbc/expected/insert +1 -0
  272. data/pgpool2/test/jdbc/expected/lock +100 -0
  273. data/pgpool2/test/jdbc/expected/select +2 -0
  274. data/pgpool2/test/jdbc/expected/update +1 -0
  275. data/pgpool2/test/jdbc/pgpool.properties +7 -0
  276. data/pgpool2/test/jdbc/prepare.sql +54 -0
  277. data/pgpool2/test/jdbc/run.sh +6 -0
  278. data/pgpool2/test/parser/.cvsignore +6 -0
  279. data/pgpool2/test/parser/README +32 -0
  280. data/pgpool2/test/parser/expected/copy.out +17 -0
  281. data/pgpool2/test/parser/expected/create.out +64 -0
  282. data/pgpool2/test/parser/expected/cursor.out +37 -0
  283. data/pgpool2/test/parser/expected/delete.out +10 -0
  284. data/pgpool2/test/parser/expected/drop.out +12 -0
  285. data/pgpool2/test/parser/expected/insert.out +13 -0
  286. data/pgpool2/test/parser/expected/misc.out +28 -0
  287. data/pgpool2/test/parser/expected/prepare.out +4 -0
  288. data/pgpool2/test/parser/expected/privileges.out +31 -0
  289. data/pgpool2/test/parser/expected/scanner.out +30 -0
  290. data/pgpool2/test/parser/expected/select.out +89 -0
  291. data/pgpool2/test/parser/expected/transaction.out +38 -0
  292. data/pgpool2/test/parser/expected/update.out +11 -0
  293. data/pgpool2/test/parser/expected/v84.out +37 -0
  294. data/pgpool2/test/parser/expected/v90.out +25 -0
  295. data/pgpool2/test/parser/expected/var.out +22 -0
  296. data/pgpool2/test/parser/input/alter.sql +2 -0
  297. data/pgpool2/test/parser/input/copy.sql +17 -0
  298. data/pgpool2/test/parser/input/create.sql +64 -0
  299. data/pgpool2/test/parser/input/cursor.sql +37 -0
  300. data/pgpool2/test/parser/input/delete.sql +10 -0
  301. data/pgpool2/test/parser/input/drop.sql +12 -0
  302. data/pgpool2/test/parser/input/insert.sql +13 -0
  303. data/pgpool2/test/parser/input/misc.sql +28 -0
  304. data/pgpool2/test/parser/input/prepare.sql +4 -0
  305. data/pgpool2/test/parser/input/privileges.sql +31 -0
  306. data/pgpool2/test/parser/input/scanner.sql +34 -0
  307. data/pgpool2/test/parser/input/select.sql +89 -0
  308. data/pgpool2/test/parser/input/transaction.sql +38 -0
  309. data/pgpool2/test/parser/input/update.sql +11 -0
  310. data/pgpool2/test/parser/input/v84.sql +37 -0
  311. data/pgpool2/test/parser/input/v90.sql +38 -0
  312. data/pgpool2/test/parser/input/var.sql +22 -0
  313. data/pgpool2/test/parser/main.c +96 -0
  314. data/pgpool2/test/parser/parse_schedule +16 -0
  315. data/pgpool2/test/parser/pool.h +13 -0
  316. data/pgpool2/test/parser/run-test +62 -0
  317. data/pgpool2/test/pdo-test/README.euc_jp +58 -0
  318. data/pgpool2/test/pdo-test/SQLlist/test1.sql +3 -0
  319. data/pgpool2/test/pdo-test/SQLlist/test2.sql +3 -0
  320. data/pgpool2/test/pdo-test/collections.inc +11 -0
  321. data/pgpool2/test/pdo-test/def.inc +7 -0
  322. data/pgpool2/test/pdo-test/log.txt +0 -0
  323. data/pgpool2/test/pdo-test/mod/database.inc +36 -0
  324. data/pgpool2/test/pdo-test/mod/def.inc +0 -0
  325. data/pgpool2/test/pdo-test/mod/errorhandler.inc +27 -0
  326. data/pgpool2/test/pdo-test/pdotest.php +11 -0
  327. data/pgpool2/test/pdo-test/regsql.inc +56 -0
  328. data/pgpool2/test/pgpool_setup +898 -0
  329. data/pgpool2/test/regression/README +39 -0
  330. data/pgpool2/test/regression/clean.sh +21 -0
  331. data/pgpool2/test/regression/libs.sh +16 -0
  332. data/pgpool2/test/regression/regress.sh +166 -0
  333. data/pgpool2/test/regression/tests/001.load_balance/test.sh +128 -0
  334. data/pgpool2/test/regression/tests/002.native_replication/PgTester.java +47 -0
  335. data/pgpool2/test/regression/tests/002.native_replication/create.sql +6 -0
  336. data/pgpool2/test/regression/tests/002.native_replication/test.sh +71 -0
  337. data/pgpool2/test/regression/tests/003.failover/expected.r +6 -0
  338. data/pgpool2/test/regression/tests/003.failover/expected.s +6 -0
  339. data/pgpool2/test/regression/tests/003.failover/test.sh +45 -0
  340. data/pgpool2/test/regression/tests/004.watchdog/master.conf +12 -0
  341. data/pgpool2/test/regression/tests/004.watchdog/standby.conf +19 -0
  342. data/pgpool2/test/regression/tests/004.watchdog/test.sh +52 -0
  343. data/pgpool2/test/regression/tests/050.bug58/test.sh +50 -0
  344. data/pgpool2/test/regression/tests/051.bug60/bug.sql +12 -0
  345. data/pgpool2/test/regression/tests/051.bug60/database-clean.sql +6 -0
  346. data/pgpool2/test/regression/tests/051.bug60/database-setup.sql +28 -0
  347. data/pgpool2/test/regression/tests/051.bug60/test.sh +79 -0
  348. data/pgpool2/test/regression/tests/052.do_query/test.sh +44 -0
  349. data/pgpool2/test/regression/tests/053.insert_lock_hangs/test.sh +81 -0
  350. data/pgpool2/test/regression/tests/054.postgres_fdw/test.sh +67 -0
  351. data/pgpool2/test/regression/tests/055.backend_all_down/test.sh +52 -0
  352. data/pgpool2/test/regression/tests/056.bug63/jdbctest2.java +66 -0
  353. data/pgpool2/test/regression/tests/056.bug63/test.sh +47 -0
  354. data/pgpool2/test/regression/tests/057.bug61/test.sh +40 -0
  355. data/pgpool2/test/regression/tests/058.bug68/jdbctest3.java +45 -0
  356. data/pgpool2/test/regression/tests/058.bug68/test.sh +47 -0
  357. data/pgpool2/test/timestamp/expected/insert.out +16 -0
  358. data/pgpool2/test/timestamp/expected/misc.out +3 -0
  359. data/pgpool2/test/timestamp/expected/update.out +6 -0
  360. data/pgpool2/test/timestamp/input/insert.sql +16 -0
  361. data/pgpool2/test/timestamp/input/misc.sql +3 -0
  362. data/pgpool2/test/timestamp/input/update.sql +6 -0
  363. data/pgpool2/test/timestamp/main.c +129 -0
  364. data/pgpool2/test/timestamp/parse_schedule +3 -0
  365. data/pgpool2/test/timestamp/run-test +69 -0
  366. data/pgpool2/version.h +1 -0
  367. data/pgpool2/watchdog/Makefile.am +17 -0
  368. data/pgpool2/watchdog/Makefile.in +505 -0
  369. data/pgpool2/watchdog/test/stab.c +266 -0
  370. data/pgpool2/watchdog/test/test.c +85 -0
  371. data/pgpool2/watchdog/test/wd_child_t.c +87 -0
  372. data/pgpool2/watchdog/test/wd_lifecheck_t.c +87 -0
  373. data/pgpool2/watchdog/test/wd_packet_t.c +87 -0
  374. data/pgpool2/watchdog/test/wd_ping_t.c +20 -0
  375. data/pgpool2/watchdog/watchdog.c +408 -0
  376. data/pgpool2/watchdog/watchdog.h +209 -0
  377. data/pgpool2/watchdog/wd_child.c +444 -0
  378. data/pgpool2/watchdog/wd_ext.h +123 -0
  379. data/pgpool2/watchdog/wd_heartbeat.c +577 -0
  380. data/pgpool2/watchdog/wd_if.c +216 -0
  381. data/pgpool2/watchdog/wd_init.c +126 -0
  382. data/pgpool2/watchdog/wd_interlock.c +347 -0
  383. data/pgpool2/watchdog/wd_lifecheck.c +512 -0
  384. data/pgpool2/watchdog/wd_list.c +429 -0
  385. data/pgpool2/watchdog/wd_packet.c +1159 -0
  386. data/pgpool2/watchdog/wd_ping.c +330 -0
  387. data/pgpool2/ylwrap +223 -0
  388. data/pgsql/presto_client.py +346 -0
  389. data/pgsql/prestogres.py +156 -0
  390. data/pgsql/setup_functions.sql +21 -0
  391. data/pgsql/setup_language.sql +3 -0
  392. data/prestogres.gemspec +23 -0
  393. metadata +496 -0
@@ -0,0 +1,4094 @@
1
+ #line 2 "scan.c"
2
+
3
+ #line 4 "scan.c"
4
+
5
+ #define YY_INT_ALIGNED short int
6
+
7
+ /* A lexical scanner generated by flex */
8
+
9
+ #define FLEX_SCANNER
10
+ #define YY_FLEX_MAJOR_VERSION 2
11
+ #define YY_FLEX_MINOR_VERSION 5
12
+ #define YY_FLEX_SUBMINOR_VERSION 35
13
+ #if YY_FLEX_SUBMINOR_VERSION > 0
14
+ #define FLEX_BETA
15
+ #endif
16
+
17
+ /* First, we deal with platform-specific or compiler-specific issues. */
18
+
19
+ /* begin standard C headers. */
20
+ #include <stdio.h>
21
+ #include <string.h>
22
+ #include <errno.h>
23
+ #include <stdlib.h>
24
+
25
+ /* end standard C headers. */
26
+
27
+ /* flex integer type definitions */
28
+
29
+ #ifndef FLEXINT_H
30
+ #define FLEXINT_H
31
+
32
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
+
34
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
+
36
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37
+ * if you want the limit (max/min) macros for int types.
38
+ */
39
+ #ifndef __STDC_LIMIT_MACROS
40
+ #define __STDC_LIMIT_MACROS 1
41
+ #endif
42
+
43
+ #include <inttypes.h>
44
+ typedef int8_t flex_int8_t;
45
+ typedef uint8_t flex_uint8_t;
46
+ typedef int16_t flex_int16_t;
47
+ typedef uint16_t flex_uint16_t;
48
+ typedef int32_t flex_int32_t;
49
+ typedef uint32_t flex_uint32_t;
50
+ #else
51
+ typedef signed char flex_int8_t;
52
+ typedef short int flex_int16_t;
53
+ typedef int flex_int32_t;
54
+ typedef unsigned char flex_uint8_t;
55
+ typedef unsigned short int flex_uint16_t;
56
+ typedef unsigned int flex_uint32_t;
57
+ #endif /* ! C99 */
58
+
59
+ /* Limits of integral types. */
60
+ #ifndef INT8_MIN
61
+ #define INT8_MIN (-128)
62
+ #endif
63
+ #ifndef INT16_MIN
64
+ #define INT16_MIN (-32767-1)
65
+ #endif
66
+ #ifndef INT32_MIN
67
+ #define INT32_MIN (-2147483647-1)
68
+ #endif
69
+ #ifndef INT8_MAX
70
+ #define INT8_MAX (127)
71
+ #endif
72
+ #ifndef INT16_MAX
73
+ #define INT16_MAX (32767)
74
+ #endif
75
+ #ifndef INT32_MAX
76
+ #define INT32_MAX (2147483647)
77
+ #endif
78
+ #ifndef UINT8_MAX
79
+ #define UINT8_MAX (255U)
80
+ #endif
81
+ #ifndef UINT16_MAX
82
+ #define UINT16_MAX (65535U)
83
+ #endif
84
+ #ifndef UINT32_MAX
85
+ #define UINT32_MAX (4294967295U)
86
+ #endif
87
+
88
+ #endif /* ! FLEXINT_H */
89
+
90
+ #ifdef __cplusplus
91
+
92
+ /* The "const" storage-class-modifier is valid. */
93
+ #define YY_USE_CONST
94
+
95
+ #else /* ! __cplusplus */
96
+
97
+ /* C99 requires __STDC__ to be defined as 1. */
98
+ #if defined (__STDC__)
99
+
100
+ #define YY_USE_CONST
101
+
102
+ #endif /* defined (__STDC__) */
103
+ #endif /* ! __cplusplus */
104
+
105
+ #ifdef YY_USE_CONST
106
+ #define yyconst const
107
+ #else
108
+ #define yyconst
109
+ #endif
110
+
111
+ /* Returned upon end-of-file. */
112
+ #define YY_NULL 0
113
+
114
+ /* Promotes a possibly negative, possibly signed char to an unsigned
115
+ * integer for use as an array index. If the signed char is negative,
116
+ * we want to instead treat it as an 8-bit unsigned char, hence the
117
+ * double cast.
118
+ */
119
+ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
+
121
+ /* An opaque pointer. */
122
+ #ifndef YY_TYPEDEF_YY_SCANNER_T
123
+ #define YY_TYPEDEF_YY_SCANNER_T
124
+ typedef void* yyscan_t;
125
+ #endif
126
+
127
+ /* For convenience, these vars (plus the bison vars far below)
128
+ are macros in the reentrant scanner. */
129
+ #define yyin yyg->yyin_r
130
+ #define yyout yyg->yyout_r
131
+ #define yyextra yyg->yyextra_r
132
+ #define yyleng yyg->yyleng_r
133
+ #define yytext yyg->yytext_r
134
+ #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
135
+ #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
136
+ #define yy_flex_debug yyg->yy_flex_debug_r
137
+
138
+ /* Enter a start condition. This macro really ought to take a parameter,
139
+ * but we do it the disgusting crufty way forced on us by the ()-less
140
+ * definition of BEGIN.
141
+ */
142
+ #define BEGIN yyg->yy_start = 1 + 2 *
143
+
144
+ /* Translate the current start state into a value that can be later handed
145
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
146
+ * compatibility.
147
+ */
148
+ #define YY_START ((yyg->yy_start - 1) / 2)
149
+ #define YYSTATE YY_START
150
+
151
+ /* Action number for EOF rule of a given start state. */
152
+ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
153
+
154
+ /* Special action meaning "start processing a new file". */
155
+ #define YY_NEW_FILE core_yyrestart(yyin ,yyscanner )
156
+
157
+ #define YY_END_OF_BUFFER_CHAR 0
158
+
159
+ /* Size of default input buffer. */
160
+ #ifndef YY_BUF_SIZE
161
+ #define YY_BUF_SIZE 16384
162
+ #endif
163
+
164
+ /* The state buf must be large enough to hold one state per character in the main buffer.
165
+ */
166
+ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
167
+
168
+ #ifndef YY_TYPEDEF_YY_BUFFER_STATE
169
+ #define YY_TYPEDEF_YY_BUFFER_STATE
170
+ typedef struct yy_buffer_state *YY_BUFFER_STATE;
171
+ #endif
172
+
173
+ #define EOB_ACT_CONTINUE_SCAN 0
174
+ #define EOB_ACT_END_OF_FILE 1
175
+ #define EOB_ACT_LAST_MATCH 2
176
+
177
+ #define YY_LESS_LINENO(n)
178
+
179
+ /* Return all but the first "n" matched characters back to the input stream. */
180
+ #define yyless(n) \
181
+ do \
182
+ { \
183
+ /* Undo effects of setting up yytext. */ \
184
+ int yyless_macro_arg = (n); \
185
+ YY_LESS_LINENO(yyless_macro_arg);\
186
+ *yy_cp = yyg->yy_hold_char; \
187
+ YY_RESTORE_YY_MORE_OFFSET \
188
+ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
189
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
190
+ } \
191
+ while ( 0 )
192
+
193
+ #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
194
+
195
+ #ifndef YY_TYPEDEF_YY_SIZE_T
196
+ #define YY_TYPEDEF_YY_SIZE_T
197
+ typedef size_t yy_size_t;
198
+ #endif
199
+
200
+ #ifndef YY_STRUCT_YY_BUFFER_STATE
201
+ #define YY_STRUCT_YY_BUFFER_STATE
202
+ struct yy_buffer_state
203
+ {
204
+ FILE *yy_input_file;
205
+
206
+ char *yy_ch_buf; /* input buffer */
207
+ char *yy_buf_pos; /* current position in input buffer */
208
+
209
+ /* Size of input buffer in bytes, not including room for EOB
210
+ * characters.
211
+ */
212
+ yy_size_t yy_buf_size;
213
+
214
+ /* Number of characters read into yy_ch_buf, not including EOB
215
+ * characters.
216
+ */
217
+ int yy_n_chars;
218
+
219
+ /* Whether we "own" the buffer - i.e., we know we created it,
220
+ * and can realloc() it to grow it, and should free() it to
221
+ * delete it.
222
+ */
223
+ int yy_is_our_buffer;
224
+
225
+ /* Whether this is an "interactive" input source; if so, and
226
+ * if we're using stdio for input, then we want to use getc()
227
+ * instead of fread(), to make sure we stop fetching input after
228
+ * each newline.
229
+ */
230
+ int yy_is_interactive;
231
+
232
+ /* Whether we're considered to be at the beginning of a line.
233
+ * If so, '^' rules will be active on the next match, otherwise
234
+ * not.
235
+ */
236
+ int yy_at_bol;
237
+
238
+ int yy_bs_lineno; /**< The line count. */
239
+ int yy_bs_column; /**< The column count. */
240
+
241
+ /* Whether to try to fill the input buffer when we reach the
242
+ * end of it.
243
+ */
244
+ int yy_fill_buffer;
245
+
246
+ int yy_buffer_status;
247
+
248
+ #define YY_BUFFER_NEW 0
249
+ #define YY_BUFFER_NORMAL 1
250
+ /* When an EOF's been seen but there's still some text to process
251
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
252
+ * shouldn't try reading from the input source any more. We might
253
+ * still have a bunch of tokens to match, though, because of
254
+ * possible backing-up.
255
+ *
256
+ * When we actually see the EOF, we change the status to "new"
257
+ * (via core_yyrestart()), so that the user can continue scanning by
258
+ * just pointing yyin at a new input file.
259
+ */
260
+ #define YY_BUFFER_EOF_PENDING 2
261
+
262
+ };
263
+ #endif /* !YY_STRUCT_YY_BUFFER_STATE */
264
+
265
+ /* We provide macros for accessing buffer states in case in the
266
+ * future we want to put the buffer states in a more general
267
+ * "scanner state".
268
+ *
269
+ * Returns the top of the stack, or NULL.
270
+ */
271
+ #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
272
+ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
273
+ : NULL)
274
+
275
+ /* Same as previous macro, but useful when we know that the buffer stack is not
276
+ * NULL or when we need an lvalue. For internal use only.
277
+ */
278
+ #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
279
+
280
+ void core_yyrestart (FILE *input_file ,yyscan_t yyscanner );
281
+ void core_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
282
+ YY_BUFFER_STATE core_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
283
+ void core_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
284
+ void core_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
285
+ void core_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
286
+ void core_yypop_buffer_state (yyscan_t yyscanner );
287
+
288
+ static void core_yyensure_buffer_stack (yyscan_t yyscanner );
289
+ static void core_yy_load_buffer_state (yyscan_t yyscanner );
290
+ static void core_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
291
+
292
+ #define YY_FLUSH_BUFFER core_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
293
+
294
+ YY_BUFFER_STATE core_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
295
+ YY_BUFFER_STATE core_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
296
+ YY_BUFFER_STATE core_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
297
+
298
+ void *core_yyalloc (yy_size_t ,yyscan_t yyscanner );
299
+ void *core_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
300
+ void core_yyfree (void * ,yyscan_t yyscanner );
301
+
302
+ #define yy_new_buffer core_yy_create_buffer
303
+
304
+ #define yy_set_interactive(is_interactive) \
305
+ { \
306
+ if ( ! YY_CURRENT_BUFFER ){ \
307
+ core_yyensure_buffer_stack (yyscanner); \
308
+ YY_CURRENT_BUFFER_LVALUE = \
309
+ core_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
310
+ } \
311
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
312
+ }
313
+
314
+ #define yy_set_bol(at_bol) \
315
+ { \
316
+ if ( ! YY_CURRENT_BUFFER ){\
317
+ core_yyensure_buffer_stack (yyscanner); \
318
+ YY_CURRENT_BUFFER_LVALUE = \
319
+ core_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
320
+ } \
321
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
322
+ }
323
+
324
+ #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
325
+
326
+ /* Begin user sect3 */
327
+
328
+ #define core_yywrap(n) 1
329
+ #define YY_SKIP_YYWRAP
330
+
331
+ typedef unsigned char YY_CHAR;
332
+
333
+ typedef int yy_state_type;
334
+
335
+ #define yytext_ptr yytext_r
336
+
337
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
338
+ static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
339
+ static int yy_get_next_buffer (yyscan_t yyscanner );
340
+ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
341
+
342
+ /* Done after the current pattern has been matched and before the
343
+ * corresponding action - sets up yytext.
344
+ */
345
+ #define YY_DO_BEFORE_ACTION \
346
+ yyg->yytext_ptr = yy_bp; \
347
+ yyleng = (size_t) (yy_cp - yy_bp); \
348
+ yyg->yy_hold_char = *yy_cp; \
349
+ *yy_cp = '\0'; \
350
+ yyg->yy_c_buf_p = yy_cp;
351
+
352
+ #define YY_NUM_RULES 67
353
+ #define YY_END_OF_BUFFER 68
354
+ /* This struct is not used in this scanner,
355
+ but its presence is necessary. */
356
+ struct yy_trans_info
357
+ {
358
+ flex_int32_t yy_verify;
359
+ flex_int32_t yy_nxt;
360
+ };
361
+ static yyconst flex_int16_t yy_accept[389] =
362
+ { 0,
363
+ 0, 0, 12, 12, 0, 0, 0, 0, 11, 11,
364
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
365
+ 0, 0, 68, 66, 1, 1, 57, 45, 66, 56,
366
+ 19, 56, 56, 56, 56, 59, 56, 65, 65, 65,
367
+ 65, 65, 65, 12, 9, 5, 5, 6, 6, 51,
368
+ 47, 11, 16, 28, 28, 22, 38, 27, 22, 42,
369
+ 42, 44, 48, 24, 31, 32, 31, 1, 57, 39,
370
+ 58, 40, 1, 54, 60, 2, 60, 59, 63, 53,
371
+ 55, 65, 8, 20, 18, 52, 15, 12, 9, 9,
372
+ 10, 5, 7, 4, 3, 51, 50, 11, 16, 16,
373
+
374
+ 17, 28, 22, 22, 26, 23, 34, 35, 33, 33,
375
+ 34, 27, 42, 41, 43, 48, 48, 48, 24, 24,
376
+ 24, 24, 33, 33, 40, 1, 1, 2, 61, 60,
377
+ 64, 62, 46, 21, 9, 14, 10, 9, 3, 16,
378
+ 13, 17, 16, 22, 37, 23, 22, 35, 33, 33,
379
+ 36, 43, 48, 48, 24, 24, 24, 24, 33, 33,
380
+ 9, 9, 9, 9, 16, 16, 16, 16, 22, 22,
381
+ 22, 22, 35, 33, 33, 36, 48, 48, 48, 48,
382
+ 48, 24, 24, 24, 24, 24, 24, 33, 33, 9,
383
+ 9, 9, 9, 9, 16, 16, 16, 16, 16, 22,
384
+
385
+ 22, 22, 22, 22, 33, 33, 48, 48, 48, 24,
386
+ 24, 24, 24, 24, 24, 24, 24, 33, 33, 9,
387
+ 16, 22, 33, 29, 48, 48, 24, 24, 24, 24,
388
+ 33, 30, 33, 48, 48, 24, 24, 24, 33, 33,
389
+ 48, 48, 24, 24, 24, 33, 33, 48, 48, 48,
390
+ 48, 24, 24, 24, 24, 24, 33, 48, 48, 48,
391
+ 24, 24, 24, 24, 48, 48, 48, 48, 49, 48,
392
+ 48, 48, 48, 24, 24, 24, 24, 24, 25, 24,
393
+ 24, 24, 24, 48, 48, 48, 48, 48, 48, 48,
394
+ 48, 48, 48, 48, 48, 24, 24, 24, 24, 24,
395
+
396
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
397
+ 24, 24, 24, 48, 48, 48, 48, 48, 48, 48,
398
+ 48, 48, 24, 24, 24, 24, 24, 24, 24, 24,
399
+ 25, 24, 24, 24, 24, 24, 24, 24, 48, 48,
400
+ 48, 48, 48, 48, 48, 48, 24, 24, 24, 24,
401
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
402
+ 24, 48, 48, 24, 24, 24, 24, 24, 24, 24,
403
+ 24, 24, 24, 48, 24, 24, 24, 48, 24, 24,
404
+ 48, 24, 24, 48, 24, 24, 24, 0
405
+ } ;
406
+
407
+ static yyconst flex_int32_t yy_ec[256] =
408
+ { 0,
409
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
410
+ 1, 2, 4, 1, 1, 1, 1, 1, 1, 1,
411
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412
+ 1, 2, 5, 6, 5, 7, 8, 9, 10, 11,
413
+ 11, 12, 13, 11, 14, 15, 16, 17, 17, 17,
414
+ 17, 17, 17, 17, 17, 18, 18, 19, 11, 8,
415
+ 20, 8, 5, 5, 21, 22, 23, 24, 25, 24,
416
+ 26, 26, 26, 26, 26, 26, 26, 27, 26, 28,
417
+ 26, 26, 29, 26, 30, 26, 26, 31, 26, 26,
418
+ 11, 32, 11, 8, 26, 5, 21, 22, 23, 24,
419
+
420
+ 25, 24, 26, 26, 26, 26, 26, 26, 26, 27,
421
+ 26, 28, 26, 26, 29, 26, 33, 26, 26, 34,
422
+ 26, 26, 1, 5, 1, 5, 1, 26, 26, 26,
423
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
424
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
425
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
426
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
427
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
428
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
429
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
430
+
431
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
432
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
433
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
434
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
435
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
436
+ 26, 26, 26, 26, 26
437
+ } ;
438
+
439
+ static yyconst flex_int32_t yy_meta[35] =
440
+ { 0,
441
+ 1, 1, 2, 2, 3, 4, 5, 3, 3, 6,
442
+ 1, 7, 3, 3, 1, 7, 8, 8, 1, 3,
443
+ 9, 9, 9, 9, 9, 10, 10, 10, 10, 10,
444
+ 10, 11, 10, 10
445
+ } ;
446
+
447
+ static yyconst flex_int16_t yy_base[462] =
448
+ { 0,
449
+ 0, 0, 616, 615, 30, 46, 616, 613, 608, 597,
450
+ 37, 38, 596, 594, 42, 49, 597, 596, 591, 590,
451
+ 33, 50, 599, 2032, 69, 72, 0, 2032, 50, 0,
452
+ 2032, 2032, 584, 46, 585, 62, 64, 0, 586, 584,
453
+ 583, 581, 577, 0, 86, 0, 0, 69, 574, 0,
454
+ 569, 0, 89, 0, 0, 92, 80, 0, 105, 0,
455
+ 0, 567, 118, 150, 2032, 2032, 68, 114, 0, 2032,
456
+ 87, 565, 179, 2032, 108, 0, 112, 121, 127, 2032,
457
+ 2032, 0, 2032, 2032, 2032, 125, 2032, 0, 153, 159,
458
+ 557, 0, 131, 2032, 0, 0, 2032, 0, 168, 175,
459
+
460
+ 556, 0, 172, 194, 2032, 555, 2032, 551, 0, 0,
461
+ 0, 0, 0, 2032, 560, 560, 551, 539, 552, 207,
462
+ 547, 533, 0, 0, 548, 0, 236, 0, 2032, 141,
463
+ 94, 132, 2032, 2032, 210, 2032, 540, 224, 0, 229,
464
+ 2032, 529, 232, 251, 2032, 528, 255, 523, 0, 0,
465
+ 0, 532, 268, 508, 0, 522, 300, 506, 0, 0,
466
+ 260, 264, 273, 277, 281, 286, 303, 306, 309, 322,
467
+ 325, 338, 2032, 0, 0, 2032, 351, 383, 415, 447,
468
+ 511, 479, 511, 543, 575, 607, 510, 0, 0, 342,
469
+ 345, 358, 374, 387, 390, 396, 418, 421, 438, 451,
470
+
471
+ 454, 460, 482, 485, 0, 0, 109, 165, 510, 639,
472
+ 671, 0, 703, 735, 191, 177, 509, 0, 0, 488,
473
+ 502, 515, 0, 2032, 178, 498, 193, 190, 200, 496,
474
+ 0, 2032, 0, 226, 486, 269, 272, 485, 0, 0,
475
+ 140, 518, 294, 271, 546, 0, 0, 483, 549, 0,
476
+ 493, 293, 478, 578, 0, 487, 0, 767, 490, 581,
477
+ 473, 791, 487, 610, 815, 839, 871, 318, 2032, 613,
478
+ 642, 645, 674, 903, 927, 951, 983, 344, 2032, 677,
479
+ 706, 709, 738, 481, 306, 312, 1015, 357, 484, 1047,
480
+ 741, 770, 786, 800, 818, 1079, 0, 1103, 349, 0,
481
+
482
+ 0, 465, 325, 341, 468, 401, 466, 1135, 834, 848,
483
+ 853, 874, 888, 1167, 450, 0, 0, 1199, 459, 446,
484
+ 906, 0, 354, 370, 459, 513, 457, 1231, 1263, 441,
485
+ 2032, 1295, 0, 1327, 446, 422, 922, 0, 429, 429,
486
+ 428, 427, 324, 402, 422, 405, 408, 0, 0, 1359,
487
+ 416, 389, 395, 394, 395, 386, 373, 392, 421, 361,
488
+ 344, 1391, 347, 347, 276, 263, 393, 434, 246, 213,
489
+ 1423, 0, 207, 208, 1455, 199, 179, 153, 121, 100,
490
+ 74, 58, 53, 0, 12, 0, 0, 2032, 1488, 1499,
491
+ 1510, 1521, 1532, 1543, 1554, 1565, 1574, 1577, 1583, 1593,
492
+
493
+ 1604, 1615, 1626, 1637, 1647, 1658, 1669, 1676, 1682, 1692,
494
+ 1701, 1706, 1706, 1708, 1710, 1715, 1718, 1720, 1729, 1740,
495
+ 1751, 1755, 1757, 1759, 1768, 1779, 1783, 1785, 1794, 1805,
496
+ 1816, 1820, 1822, 1831, 1835, 1837, 1839, 1841, 1843, 1845,
497
+ 1847, 1849, 1851, 1853, 1855, 1857, 1866, 1877, 1888, 1899,
498
+ 1910, 1921, 1932, 1943, 1954, 1965, 1976, 1987, 1998, 2009,
499
+ 2020
500
+ } ;
501
+
502
+ static yyconst flex_int16_t yy_def[462] =
503
+ { 0,
504
+ 388, 1, 389, 389, 390, 390, 391, 391, 392, 392,
505
+ 393, 393, 394, 394, 395, 395, 391, 391, 394, 394,
506
+ 396, 396, 388, 388, 388, 388, 397, 388, 398, 397,
507
+ 388, 388, 397, 388, 397, 388, 388, 399, 399, 399,
508
+ 399, 399, 399, 400, 388, 401, 401, 388, 388, 402,
509
+ 388, 403, 388, 404, 404, 388, 405, 406, 388, 407,
510
+ 407, 408, 388, 388, 388, 388, 388, 388, 397, 388,
511
+ 388, 409, 410, 388, 388, 411, 388, 388, 388, 388,
512
+ 388, 399, 388, 388, 388, 388, 388, 400, 388, 388,
513
+ 388, 401, 388, 388, 412, 402, 388, 403, 388, 388,
514
+
515
+ 388, 404, 388, 388, 388, 388, 388, 388, 413, 414,
516
+ 415, 406, 407, 388, 416, 63, 388, 388, 64, 388,
517
+ 388, 388, 417, 418, 409, 410, 410, 411, 388, 388,
518
+ 388, 388, 388, 388, 388, 388, 388, 419, 412, 388,
519
+ 388, 388, 420, 388, 388, 388, 421, 388, 422, 423,
520
+ 424, 416, 425, 388, 120, 388, 426, 388, 427, 428,
521
+ 429, 419, 419, 419, 430, 420, 420, 420, 431, 421,
522
+ 421, 421, 388, 432, 433, 388, 425, 425, 425, 425,
523
+ 388, 434, 426, 426, 426, 426, 388, 435, 436, 429,
524
+ 429, 388, 429, 419, 430, 430, 388, 430, 420, 431,
525
+
526
+ 431, 388, 431, 421, 437, 438, 180, 180, 388, 434,
527
+ 434, 120, 434, 434, 186, 186, 388, 439, 440, 429,
528
+ 430, 431, 441, 388, 180, 388, 214, 214, 186, 388,
529
+ 442, 388, 443, 180, 388, 214, 186, 388, 444, 445,
530
+ 180, 388, 214, 186, 388, 446, 438, 180, 388, 447,
531
+ 388, 214, 186, 388, 448, 388, 440, 180, 388, 449,
532
+ 214, 186, 388, 450, 180, 388, 451, 180, 388, 449,
533
+ 449, 452, 449, 214, 186, 388, 453, 186, 388, 450,
534
+ 450, 454, 450, 388, 180, 180, 388, 180, 180, 455,
535
+ 449, 449, 388, 449, 449, 214, 276, 456, 214, 276,
536
+
537
+ 448, 388, 186, 186, 120, 186, 186, 457, 450, 450,
538
+ 388, 450, 450, 455, 180, 314, 314, 458, 314, 314,
539
+ 452, 447, 214, 214, 120, 214, 214, 459, 459, 186,
540
+ 388, 457, 332, 460, 332, 332, 454, 448, 314, 314,
541
+ 314, 266, 314, 314, 314, 314, 214, 329, 329, 461,
542
+ 329, 329, 329, 332, 332, 332, 276, 332, 332, 332,
543
+ 332, 458, 314, 329, 329, 276, 329, 329, 329, 329,
544
+ 460, 448, 332, 314, 461, 329, 332, 314, 329, 332,
545
+ 314, 329, 332, 314, 329, 332, 329, 0, 388, 388,
546
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
547
+
548
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
549
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
550
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
551
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
552
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
553
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
554
+ 388
555
+ } ;
556
+
557
+ static yyconst flex_int16_t yy_nxt[2067] =
558
+ { 0,
559
+ 24, 25, 26, 25, 27, 28, 29, 30, 27, 31,
560
+ 32, 30, 30, 33, 34, 35, 36, 36, 37, 30,
561
+ 38, 39, 38, 38, 40, 38, 41, 38, 38, 42,
562
+ 43, 24, 42, 43, 47, 66, 387, 47, 47, 55,
563
+ 55, 48, 47, 47, 61, 49, 56, 56, 62, 47,
564
+ 47, 61, 66, 47, 47, 62, 70, 48, 47, 47,
565
+ 74, 49, 75, 75, 67, 47, 71, 71, 57, 57,
566
+ 68, 68, 68, 68, 68, 68, 77, 386, 78, 78,
567
+ 93, 67, 80, 81, 94, 385, 79, 89, 90, 90,
568
+ 99, 100, 100, 103, 104, 104, 108, 123, 384, 91,
569
+
570
+ 124, 105, 101, 71, 71, 106, 103, 104, 104, 109,
571
+ 132, 132, 110, 111, 105, 68, 68, 68, 106, 116,
572
+ 116, 116, 207, 97, 75, 75, 129, 383, 130, 130,
573
+ 133, 117, 79, 177, 134, 77, 79, 78, 78, 131,
574
+ 131, 382, 93, 132, 132, 79, 94, 118, 132, 132,
575
+ 118, 119, 120, 120, 89, 90, 90, 130, 130, 105,
576
+ 135, 135, 135, 121, 177, 79, 91, 248, 136, 99,
577
+ 100, 100, 137, 103, 104, 104, 140, 140, 140, 122,
578
+ 381, 101, 122, 127, 141, 106, 127, 127, 142, 177,
579
+ 127, 127, 127, 225, 127, 144, 144, 144, 127, 380,
580
+
581
+ 234, 183, 177, 145, 215, 229, 227, 146, 155, 155,
582
+ 155, 135, 135, 135, 210, 183, 145, 210, 236, 136,
583
+ 156, 379, 237, 137, 183, 163, 90, 90, 378, 377,
584
+ 140, 140, 140, 167, 100, 100, 122, 164, 141, 122,
585
+ 127, 376, 142, 127, 127, 168, 241, 127, 127, 127,
586
+ 177, 127, 144, 144, 144, 127, 171, 104, 104, 369,
587
+ 145, 191, 192, 192, 146, 163, 90, 90, 172, 178,
588
+ 116, 116, 372, 193, 163, 90, 90, 164, 163, 90,
589
+ 90, 179, 196, 197, 197, 375, 164, 167, 100, 100,
590
+ 194, 243, 244, 210, 198, 183, 183, 180, 253, 168,
591
+
592
+ 180, 184, 120, 120, 167, 100, 100, 167, 100, 100,
593
+ 201, 202, 202, 185, 252, 315, 168, 210, 210, 199,
594
+ 261, 315, 203, 171, 104, 104, 171, 104, 104, 186,
595
+ 177, 290, 186, 362, 330, 172, 177, 345, 172, 171,
596
+ 104, 104, 177, 191, 192, 192, 191, 192, 192, 183,
597
+ 330, 204, 178, 116, 116, 193, 375, 308, 193, 135,
598
+ 135, 135, 328, 347, 179, 183, 315, 136, 183, 374,
599
+ 207, 137, 373, 210, 360, 191, 192, 192, 210, 347,
600
+ 180, 177, 372, 180, 178, 116, 116, 220, 163, 90,
601
+ 90, 196, 197, 197, 210, 371, 179, 196, 197, 197,
602
+
603
+ 194, 371, 375, 198, 371, 360, 369, 360, 369, 198,
604
+ 330, 362, 180, 370, 215, 180, 178, 116, 116, 140,
605
+ 140, 140, 196, 197, 197, 183, 346, 141, 207, 369,
606
+ 371, 142, 210, 363, 221, 345, 322, 362, 362, 167,
607
+ 100, 100, 345, 375, 180, 361, 361, 180, 178, 116,
608
+ 116, 199, 201, 202, 202, 201, 202, 202, 370, 360,
609
+ 179, 144, 144, 144, 203, 183, 347, 203, 331, 145,
610
+ 346, 208, 345, 146, 177, 330, 180, 331, 329, 180,
611
+ 211, 212, 212, 201, 202, 202, 171, 104, 104, 191,
612
+ 192, 192, 213, 315, 314, 222, 279, 274, 204, 269,
613
+
614
+ 264, 220, 262, 196, 197, 197, 260, 258, 214, 245,
615
+ 242, 214, 184, 120, 120, 221, 201, 202, 202, 249,
616
+ 249, 249, 347, 238, 185, 235, 227, 250, 222, 230,
617
+ 226, 251, 217, 209, 187, 182, 181, 210, 114, 173,
618
+ 186, 169, 165, 186, 184, 120, 120, 254, 254, 254,
619
+ 249, 249, 249, 161, 70, 255, 185, 158, 250, 256,
620
+ 157, 388, 251, 154, 153, 388, 114, 148, 147, 143,
621
+ 138, 70, 186, 114, 97, 186, 184, 120, 120, 254,
622
+ 254, 254, 271, 249, 249, 95, 87, 255, 215, 86,
623
+ 272, 256, 85, 84, 273, 83, 76, 73, 388, 64,
624
+
625
+ 64, 63, 63, 59, 186, 59, 53, 186, 184, 120,
626
+ 120, 281, 254, 254, 271, 249, 249, 53, 51, 282,
627
+ 185, 51, 272, 283, 45, 45, 273, 388, 388, 388,
628
+ 388, 216, 388, 388, 388, 388, 186, 388, 388, 186,
629
+ 211, 212, 212, 271, 249, 249, 292, 293, 293, 388,
630
+ 388, 272, 213, 388, 272, 273, 388, 388, 294, 388,
631
+ 388, 388, 388, 388, 388, 388, 388, 388, 214, 388,
632
+ 388, 214, 211, 212, 212, 271, 249, 249, 281, 254,
633
+ 254, 388, 388, 272, 213, 388, 282, 295, 388, 388,
634
+ 283, 388, 388, 388, 388, 388, 388, 388, 388, 388,
635
+
636
+ 214, 388, 388, 214, 211, 212, 212, 281, 254, 254,
637
+ 310, 311, 311, 388, 388, 282, 227, 388, 282, 283,
638
+ 388, 388, 312, 388, 388, 388, 388, 388, 388, 388,
639
+ 388, 388, 214, 388, 388, 214, 211, 212, 212, 281,
640
+ 254, 254, 271, 249, 249, 388, 388, 282, 213, 388,
641
+ 321, 313, 388, 388, 273, 388, 388, 388, 388, 228,
642
+ 388, 388, 388, 388, 214, 388, 388, 214, 265, 266,
643
+ 266, 271, 249, 249, 388, 388, 267, 388, 388, 321,
644
+ 268, 388, 388, 273, 388, 388, 388, 249, 249, 249,
645
+ 388, 177, 275, 276, 276, 322, 388, 388, 388, 251,
646
+
647
+ 277, 271, 249, 249, 278, 388, 388, 388, 388, 321,
648
+ 388, 388, 388, 295, 388, 183, 265, 266, 266, 271,
649
+ 249, 249, 388, 388, 267, 388, 388, 272, 268, 388,
650
+ 388, 295, 388, 388, 388, 281, 254, 254, 388, 177,
651
+ 266, 266, 266, 337, 388, 388, 388, 283, 250, 281,
652
+ 254, 254, 284, 388, 254, 254, 254, 337, 388, 388,
653
+ 388, 283, 338, 388, 388, 388, 256, 388, 118, 388,
654
+ 388, 118, 286, 287, 287, 281, 254, 254, 388, 388,
655
+ 177, 388, 388, 337, 288, 388, 388, 313, 388, 281,
656
+ 254, 254, 388, 388, 388, 388, 388, 282, 388, 388,
657
+
658
+ 289, 313, 388, 289, 296, 297, 297, 292, 293, 293,
659
+ 388, 388, 298, 388, 388, 272, 299, 388, 388, 294,
660
+ 388, 388, 388, 310, 311, 311, 388, 210, 275, 276,
661
+ 276, 282, 388, 388, 388, 312, 277, 388, 388, 388,
662
+ 278, 388, 388, 388, 388, 388, 388, 388, 388, 388,
663
+ 388, 183, 300, 300, 300, 388, 388, 388, 388, 388,
664
+ 301, 388, 388, 388, 302, 388, 388, 388, 388, 388,
665
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
666
+ 122, 388, 388, 122, 304, 305, 305, 388, 388, 388,
667
+ 388, 388, 183, 388, 388, 388, 306, 388, 388, 388,
668
+
669
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
670
+ 388, 388, 307, 388, 388, 307, 116, 116, 116, 388,
671
+ 388, 388, 388, 388, 269, 388, 388, 388, 117, 388,
672
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
673
+ 388, 388, 388, 388, 118, 388, 388, 118, 317, 266,
674
+ 266, 388, 388, 388, 388, 388, 318, 388, 388, 388,
675
+ 319, 388, 388, 388, 388, 388, 388, 388, 388, 388,
676
+ 388, 388, 388, 388, 388, 388, 320, 388, 388, 320,
677
+ 296, 297, 297, 388, 388, 388, 388, 388, 298, 388,
678
+ 388, 388, 299, 388, 388, 388, 388, 388, 388, 388,
679
+
680
+ 388, 388, 388, 210, 324, 325, 325, 388, 388, 388,
681
+ 388, 388, 210, 388, 388, 388, 326, 388, 388, 388,
682
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
683
+ 388, 388, 327, 388, 388, 327, 333, 276, 276, 388,
684
+ 388, 388, 388, 388, 334, 388, 388, 388, 335, 388,
685
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
686
+ 388, 388, 388, 388, 336, 388, 388, 336, 317, 266,
687
+ 266, 388, 388, 388, 388, 388, 318, 388, 388, 388,
688
+ 339, 388, 388, 388, 388, 388, 388, 388, 388, 388,
689
+ 388, 388, 388, 388, 388, 388, 320, 388, 388, 320,
690
+
691
+ 341, 342, 342, 388, 388, 388, 388, 388, 318, 388,
692
+ 388, 388, 343, 388, 388, 388, 388, 388, 388, 388,
693
+ 388, 388, 388, 388, 388, 388, 388, 388, 344, 388,
694
+ 388, 344, 349, 297, 297, 388, 388, 388, 388, 388,
695
+ 350, 388, 388, 388, 351, 388, 388, 388, 388, 388,
696
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
697
+ 352, 388, 388, 352, 349, 297, 297, 388, 388, 388,
698
+ 388, 388, 350, 388, 388, 388, 353, 388, 388, 388,
699
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
700
+ 388, 388, 352, 388, 388, 352, 333, 276, 276, 388,
701
+
702
+ 388, 388, 388, 388, 334, 388, 388, 388, 354, 388,
703
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
704
+ 388, 388, 388, 388, 336, 388, 388, 336, 356, 357,
705
+ 357, 388, 388, 388, 388, 388, 334, 388, 388, 388,
706
+ 358, 388, 388, 388, 388, 388, 388, 388, 388, 388,
707
+ 388, 388, 388, 388, 388, 388, 359, 388, 388, 359,
708
+ 365, 366, 366, 388, 388, 388, 388, 388, 350, 388,
709
+ 388, 388, 367, 388, 388, 388, 388, 388, 388, 388,
710
+ 388, 388, 388, 388, 388, 388, 388, 388, 368, 388,
711
+ 388, 368, 341, 342, 342, 388, 388, 388, 388, 388,
712
+
713
+ 318, 388, 388, 388, 343, 388, 388, 388, 388, 388,
714
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
715
+ 344, 388, 388, 344, 356, 357, 357, 388, 388, 388,
716
+ 388, 388, 334, 388, 388, 388, 358, 388, 388, 388,
717
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
718
+ 388, 388, 359, 388, 388, 359, 365, 366, 366, 388,
719
+ 388, 388, 388, 388, 350, 388, 388, 388, 367, 388,
720
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
721
+ 388, 388, 388, 388, 368, 388, 388, 368, 44, 44,
722
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 46,
723
+
724
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
725
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
726
+ 50, 52, 52, 52, 52, 52, 52, 52, 52, 52,
727
+ 52, 52, 54, 54, 54, 54, 54, 54, 54, 54,
728
+ 54, 54, 54, 58, 58, 58, 58, 58, 58, 58,
729
+ 58, 58, 58, 58, 60, 60, 60, 60, 60, 60,
730
+ 60, 60, 60, 60, 60, 65, 65, 65, 65, 65,
731
+ 65, 65, 65, 65, 65, 65, 69, 388, 388, 388,
732
+ 69, 72, 388, 388, 72, 72, 72, 82, 388, 388,
733
+ 82, 82, 82, 88, 88, 88, 88, 88, 388, 88,
734
+
735
+ 88, 88, 88, 88, 92, 92, 92, 92, 92, 92,
736
+ 388, 92, 92, 92, 92, 96, 96, 96, 388, 96,
737
+ 96, 96, 96, 96, 96, 96, 98, 98, 98, 98,
738
+ 98, 388, 98, 98, 98, 98, 98, 102, 102, 102,
739
+ 102, 102, 388, 102, 102, 102, 102, 107, 107, 107,
740
+ 107, 107, 107, 107, 107, 107, 107, 107, 112, 112,
741
+ 112, 112, 112, 388, 112, 112, 112, 112, 112, 113,
742
+ 113, 113, 113, 388, 113, 113, 113, 113, 113, 113,
743
+ 115, 388, 388, 388, 115, 115, 125, 388, 388, 125,
744
+ 125, 125, 126, 388, 126, 126, 126, 126, 126, 126,
745
+
746
+ 126, 126, 126, 128, 388, 388, 388, 128, 139, 388,
747
+ 388, 388, 139, 149, 149, 150, 150, 151, 151, 152,
748
+ 388, 388, 152, 152, 152, 159, 159, 160, 160, 162,
749
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
750
+ 166, 166, 166, 166, 166, 166, 166, 166, 166, 166,
751
+ 166, 170, 170, 170, 170, 170, 170, 170, 170, 170,
752
+ 170, 170, 174, 174, 175, 175, 176, 176, 177, 177,
753
+ 177, 177, 177, 177, 177, 177, 177, 177, 177, 183,
754
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
755
+ 188, 188, 189, 189, 190, 190, 190, 190, 190, 190,
756
+
757
+ 190, 190, 190, 190, 190, 195, 195, 195, 195, 195,
758
+ 195, 195, 195, 195, 195, 195, 200, 200, 200, 200,
759
+ 200, 200, 200, 200, 200, 200, 200, 205, 205, 206,
760
+ 206, 210, 210, 210, 210, 210, 210, 210, 210, 210,
761
+ 210, 210, 218, 218, 219, 219, 223, 223, 224, 224,
762
+ 231, 231, 232, 232, 233, 233, 239, 239, 240, 240,
763
+ 246, 246, 247, 247, 257, 257, 259, 259, 259, 259,
764
+ 259, 388, 259, 259, 259, 259, 259, 263, 263, 263,
765
+ 263, 263, 388, 263, 263, 263, 263, 263, 270, 270,
766
+ 270, 270, 270, 270, 270, 270, 270, 270, 270, 280,
767
+
768
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
769
+ 285, 285, 285, 285, 285, 285, 285, 285, 285, 285,
770
+ 285, 291, 291, 291, 291, 291, 291, 291, 291, 291,
771
+ 291, 291, 303, 303, 303, 303, 303, 303, 303, 303,
772
+ 303, 303, 303, 309, 309, 309, 309, 309, 309, 309,
773
+ 309, 309, 309, 309, 316, 316, 316, 316, 316, 316,
774
+ 316, 316, 316, 316, 316, 323, 323, 323, 323, 323,
775
+ 323, 323, 323, 323, 323, 323, 332, 332, 332, 332,
776
+ 332, 332, 332, 332, 332, 332, 332, 340, 340, 340,
777
+ 340, 340, 340, 340, 340, 340, 340, 340, 348, 348,
778
+
779
+ 348, 348, 348, 348, 348, 348, 348, 348, 348, 355,
780
+ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
781
+ 364, 364, 364, 364, 364, 364, 364, 364, 364, 364,
782
+ 364, 23, 388, 388, 388, 388, 388, 388, 388, 388,
783
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
784
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
785
+ 388, 388, 388, 388, 388, 388
786
+ } ;
787
+
788
+ static yyconst flex_int16_t yy_chk[2067] =
789
+ { 0,
790
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
791
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
792
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
793
+ 1, 1, 1, 1, 5, 21, 385, 5, 5, 11,
794
+ 12, 5, 5, 5, 15, 5, 11, 12, 15, 5,
795
+ 6, 16, 22, 6, 6, 16, 29, 6, 6, 6,
796
+ 34, 6, 34, 34, 21, 6, 29, 29, 11, 12,
797
+ 25, 25, 25, 26, 26, 26, 36, 383, 36, 36,
798
+ 48, 22, 37, 37, 48, 382, 36, 45, 45, 45,
799
+ 53, 53, 53, 56, 56, 56, 57, 67, 381, 45,
800
+
801
+ 67, 56, 53, 71, 71, 56, 59, 59, 59, 57,
802
+ 131, 131, 57, 57, 59, 68, 68, 68, 59, 63,
803
+ 63, 63, 207, 63, 75, 75, 77, 380, 77, 77,
804
+ 86, 63, 75, 207, 86, 78, 77, 78, 78, 79,
805
+ 79, 379, 93, 79, 79, 78, 93, 63, 132, 132,
806
+ 63, 64, 64, 64, 89, 89, 89, 130, 130, 64,
807
+ 90, 90, 90, 64, 241, 130, 89, 241, 90, 99,
808
+ 99, 99, 90, 103, 103, 103, 100, 100, 100, 64,
809
+ 378, 99, 64, 73, 100, 103, 73, 73, 100, 208,
810
+ 73, 73, 73, 208, 73, 104, 104, 104, 73, 377,
811
+
812
+ 225, 216, 225, 104, 215, 216, 227, 104, 120, 120,
813
+ 120, 135, 135, 135, 228, 215, 120, 227, 228, 135,
814
+ 120, 376, 229, 135, 229, 138, 138, 138, 374, 373,
815
+ 140, 140, 140, 143, 143, 143, 120, 138, 140, 120,
816
+ 127, 370, 140, 127, 127, 143, 234, 127, 127, 127,
817
+ 234, 127, 144, 144, 144, 127, 147, 147, 147, 369,
818
+ 144, 161, 161, 161, 144, 162, 162, 162, 147, 153,
819
+ 153, 153, 366, 161, 163, 163, 163, 162, 164, 164,
820
+ 164, 153, 165, 165, 165, 365, 163, 166, 166, 166,
821
+ 164, 236, 237, 236, 165, 244, 237, 153, 244, 166,
822
+
823
+ 153, 157, 157, 157, 167, 167, 167, 168, 168, 168,
824
+ 169, 169, 169, 157, 243, 285, 167, 252, 243, 168,
825
+ 252, 286, 169, 170, 170, 170, 171, 171, 171, 157,
826
+ 285, 268, 157, 343, 303, 170, 286, 343, 171, 172,
827
+ 172, 172, 268, 190, 190, 190, 191, 191, 191, 303,
828
+ 304, 172, 177, 177, 177, 190, 364, 278, 191, 192,
829
+ 192, 192, 299, 323, 177, 304, 288, 192, 278, 363,
830
+ 288, 192, 361, 299, 360, 193, 193, 193, 323, 324,
831
+ 177, 288, 357, 177, 178, 178, 178, 193, 194, 194,
832
+ 194, 195, 195, 195, 324, 356, 178, 196, 196, 196,
833
+
834
+ 194, 358, 367, 195, 355, 358, 367, 354, 353, 196,
835
+ 306, 344, 178, 352, 306, 178, 179, 179, 179, 197,
836
+ 197, 197, 198, 198, 198, 306, 344, 197, 179, 351,
837
+ 359, 197, 347, 346, 198, 345, 342, 341, 340, 199,
838
+ 199, 199, 339, 368, 179, 359, 336, 179, 180, 180,
839
+ 180, 199, 200, 200, 200, 201, 201, 201, 368, 335,
840
+ 180, 202, 202, 202, 200, 330, 327, 201, 325, 202,
841
+ 320, 180, 319, 202, 315, 307, 180, 305, 302, 180,
842
+ 182, 182, 182, 203, 203, 203, 204, 204, 204, 220,
843
+ 220, 220, 182, 289, 284, 203, 263, 261, 204, 259,
844
+
845
+ 256, 220, 253, 221, 221, 221, 251, 248, 182, 238,
846
+ 235, 182, 183, 183, 183, 221, 222, 222, 222, 242,
847
+ 242, 242, 326, 230, 183, 226, 326, 242, 222, 217,
848
+ 209, 242, 187, 181, 158, 156, 154, 326, 152, 148,
849
+ 183, 146, 142, 183, 184, 184, 184, 245, 245, 245,
850
+ 249, 249, 249, 137, 125, 245, 184, 122, 249, 245,
851
+ 121, 119, 249, 118, 117, 116, 115, 108, 106, 101,
852
+ 91, 72, 184, 62, 51, 184, 185, 185, 185, 254,
853
+ 254, 254, 260, 260, 260, 49, 43, 254, 185, 42,
854
+ 260, 254, 41, 40, 260, 39, 35, 33, 23, 20,
855
+
856
+ 19, 18, 17, 14, 185, 13, 10, 185, 186, 186,
857
+ 186, 264, 264, 264, 270, 270, 270, 9, 8, 264,
858
+ 186, 7, 270, 264, 4, 3, 270, 0, 0, 0,
859
+ 0, 186, 0, 0, 0, 0, 186, 0, 0, 186,
860
+ 210, 210, 210, 271, 271, 271, 272, 272, 272, 0,
861
+ 0, 271, 210, 0, 272, 271, 0, 0, 272, 0,
862
+ 0, 0, 0, 0, 0, 0, 0, 0, 210, 0,
863
+ 0, 210, 211, 211, 211, 273, 273, 273, 280, 280,
864
+ 280, 0, 0, 273, 211, 0, 280, 273, 0, 0,
865
+ 280, 0, 0, 0, 0, 0, 0, 0, 0, 0,
866
+
867
+ 211, 0, 0, 211, 213, 213, 213, 281, 281, 281,
868
+ 282, 282, 282, 0, 0, 281, 213, 0, 282, 281,
869
+ 0, 0, 282, 0, 0, 0, 0, 0, 0, 0,
870
+ 0, 0, 213, 0, 0, 213, 214, 214, 214, 283,
871
+ 283, 283, 291, 291, 291, 0, 0, 283, 214, 0,
872
+ 291, 283, 0, 0, 291, 0, 0, 0, 0, 214,
873
+ 0, 0, 0, 0, 214, 0, 0, 214, 258, 258,
874
+ 258, 292, 292, 292, 0, 0, 258, 0, 0, 292,
875
+ 258, 0, 0, 292, 0, 0, 0, 293, 293, 293,
876
+ 0, 258, 262, 262, 262, 293, 0, 0, 0, 293,
877
+
878
+ 262, 294, 294, 294, 262, 0, 0, 0, 0, 294,
879
+ 0, 0, 0, 294, 0, 262, 265, 265, 265, 295,
880
+ 295, 295, 0, 0, 265, 0, 0, 295, 265, 0,
881
+ 0, 295, 0, 0, 0, 309, 309, 309, 0, 265,
882
+ 266, 266, 266, 309, 0, 0, 0, 309, 266, 310,
883
+ 310, 310, 266, 0, 311, 311, 311, 310, 0, 0,
884
+ 0, 310, 311, 0, 0, 0, 311, 0, 266, 0,
885
+ 0, 266, 267, 267, 267, 312, 312, 312, 0, 0,
886
+ 267, 0, 0, 312, 267, 0, 0, 312, 0, 313,
887
+ 313, 313, 0, 0, 0, 0, 0, 313, 0, 0,
888
+
889
+ 267, 313, 0, 267, 274, 274, 274, 321, 321, 321,
890
+ 0, 0, 274, 0, 0, 321, 274, 0, 0, 321,
891
+ 0, 0, 0, 337, 337, 337, 0, 274, 275, 275,
892
+ 275, 337, 0, 0, 0, 337, 275, 0, 0, 0,
893
+ 275, 0, 0, 0, 0, 0, 0, 0, 0, 0,
894
+ 0, 275, 276, 276, 276, 0, 0, 0, 0, 0,
895
+ 276, 0, 0, 0, 276, 0, 0, 0, 0, 0,
896
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
897
+ 276, 0, 0, 276, 277, 277, 277, 0, 0, 0,
898
+ 0, 0, 277, 0, 0, 0, 277, 0, 0, 0,
899
+
900
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
901
+ 0, 0, 277, 0, 0, 277, 287, 287, 287, 0,
902
+ 0, 0, 0, 0, 287, 0, 0, 0, 287, 0,
903
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
904
+ 0, 0, 0, 0, 287, 0, 0, 287, 290, 290,
905
+ 290, 0, 0, 0, 0, 0, 290, 0, 0, 0,
906
+ 290, 0, 0, 0, 0, 0, 0, 0, 0, 0,
907
+ 0, 0, 0, 0, 0, 0, 290, 0, 0, 290,
908
+ 296, 296, 296, 0, 0, 0, 0, 0, 296, 0,
909
+ 0, 0, 296, 0, 0, 0, 0, 0, 0, 0,
910
+
911
+ 0, 0, 0, 296, 298, 298, 298, 0, 0, 0,
912
+ 0, 0, 298, 0, 0, 0, 298, 0, 0, 0,
913
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
914
+ 0, 0, 298, 0, 0, 298, 308, 308, 308, 0,
915
+ 0, 0, 0, 0, 308, 0, 0, 0, 308, 0,
916
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
917
+ 0, 0, 0, 0, 308, 0, 0, 308, 314, 314,
918
+ 314, 0, 0, 0, 0, 0, 314, 0, 0, 0,
919
+ 314, 0, 0, 0, 0, 0, 0, 0, 0, 0,
920
+ 0, 0, 0, 0, 0, 0, 314, 0, 0, 314,
921
+
922
+ 318, 318, 318, 0, 0, 0, 0, 0, 318, 0,
923
+ 0, 0, 318, 0, 0, 0, 0, 0, 0, 0,
924
+ 0, 0, 0, 0, 0, 0, 0, 0, 318, 0,
925
+ 0, 318, 328, 328, 328, 0, 0, 0, 0, 0,
926
+ 328, 0, 0, 0, 328, 0, 0, 0, 0, 0,
927
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
928
+ 328, 0, 0, 328, 329, 329, 329, 0, 0, 0,
929
+ 0, 0, 329, 0, 0, 0, 329, 0, 0, 0,
930
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
931
+ 0, 0, 329, 0, 0, 329, 332, 332, 332, 0,
932
+
933
+ 0, 0, 0, 0, 332, 0, 0, 0, 332, 0,
934
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
935
+ 0, 0, 0, 0, 332, 0, 0, 332, 334, 334,
936
+ 334, 0, 0, 0, 0, 0, 334, 0, 0, 0,
937
+ 334, 0, 0, 0, 0, 0, 0, 0, 0, 0,
938
+ 0, 0, 0, 0, 0, 0, 334, 0, 0, 334,
939
+ 350, 350, 350, 0, 0, 0, 0, 0, 350, 0,
940
+ 0, 0, 350, 0, 0, 0, 0, 0, 0, 0,
941
+ 0, 0, 0, 0, 0, 0, 0, 0, 350, 0,
942
+ 0, 350, 362, 362, 362, 0, 0, 0, 0, 0,
943
+
944
+ 362, 0, 0, 0, 362, 0, 0, 0, 0, 0,
945
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
946
+ 362, 0, 0, 362, 371, 371, 371, 0, 0, 0,
947
+ 0, 0, 371, 0, 0, 0, 371, 0, 0, 0,
948
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
949
+ 0, 0, 371, 0, 0, 371, 375, 375, 375, 0,
950
+ 0, 0, 0, 0, 375, 0, 0, 0, 375, 0,
951
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
952
+ 0, 0, 0, 0, 375, 0, 0, 375, 389, 389,
953
+ 389, 389, 389, 389, 389, 389, 389, 389, 389, 390,
954
+
955
+ 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
956
+ 391, 391, 391, 391, 391, 391, 391, 391, 391, 391,
957
+ 391, 392, 392, 392, 392, 392, 392, 392, 392, 392,
958
+ 392, 392, 393, 393, 393, 393, 393, 393, 393, 393,
959
+ 393, 393, 393, 394, 394, 394, 394, 394, 394, 394,
960
+ 394, 394, 394, 394, 395, 395, 395, 395, 395, 395,
961
+ 395, 395, 395, 395, 395, 396, 396, 396, 396, 396,
962
+ 396, 396, 396, 396, 396, 396, 397, 0, 0, 0,
963
+ 397, 398, 0, 0, 398, 398, 398, 399, 0, 0,
964
+ 399, 399, 399, 400, 400, 400, 400, 400, 0, 400,
965
+
966
+ 400, 400, 400, 400, 401, 401, 401, 401, 401, 401,
967
+ 0, 401, 401, 401, 401, 402, 402, 402, 0, 402,
968
+ 402, 402, 402, 402, 402, 402, 403, 403, 403, 403,
969
+ 403, 0, 403, 403, 403, 403, 403, 404, 404, 404,
970
+ 404, 404, 0, 404, 404, 404, 404, 405, 405, 405,
971
+ 405, 405, 405, 405, 405, 405, 405, 405, 406, 406,
972
+ 406, 406, 406, 0, 406, 406, 406, 406, 406, 407,
973
+ 407, 407, 407, 0, 407, 407, 407, 407, 407, 407,
974
+ 408, 0, 0, 0, 408, 408, 409, 0, 0, 409,
975
+ 409, 409, 410, 0, 410, 410, 410, 410, 410, 410,
976
+
977
+ 410, 410, 410, 411, 0, 0, 0, 411, 412, 0,
978
+ 0, 0, 412, 413, 413, 414, 414, 415, 415, 416,
979
+ 0, 0, 416, 416, 416, 417, 417, 418, 418, 419,
980
+ 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
981
+ 420, 420, 420, 420, 420, 420, 420, 420, 420, 420,
982
+ 420, 421, 421, 421, 421, 421, 421, 421, 421, 421,
983
+ 421, 421, 422, 422, 423, 423, 424, 424, 425, 425,
984
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 426,
985
+ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426,
986
+ 427, 427, 428, 428, 429, 429, 429, 429, 429, 429,
987
+
988
+ 429, 429, 429, 429, 429, 430, 430, 430, 430, 430,
989
+ 430, 430, 430, 430, 430, 430, 431, 431, 431, 431,
990
+ 431, 431, 431, 431, 431, 431, 431, 432, 432, 433,
991
+ 433, 434, 434, 434, 434, 434, 434, 434, 434, 434,
992
+ 434, 434, 435, 435, 436, 436, 437, 437, 438, 438,
993
+ 439, 439, 440, 440, 441, 441, 442, 442, 443, 443,
994
+ 444, 444, 445, 445, 446, 446, 447, 447, 447, 447,
995
+ 447, 0, 447, 447, 447, 447, 447, 448, 448, 448,
996
+ 448, 448, 0, 448, 448, 448, 448, 448, 449, 449,
997
+ 449, 449, 449, 449, 449, 449, 449, 449, 449, 450,
998
+
999
+ 450, 450, 450, 450, 450, 450, 450, 450, 450, 450,
1000
+ 451, 451, 451, 451, 451, 451, 451, 451, 451, 451,
1001
+ 451, 452, 452, 452, 452, 452, 452, 452, 452, 452,
1002
+ 452, 452, 453, 453, 453, 453, 453, 453, 453, 453,
1003
+ 453, 453, 453, 454, 454, 454, 454, 454, 454, 454,
1004
+ 454, 454, 454, 454, 455, 455, 455, 455, 455, 455,
1005
+ 455, 455, 455, 455, 455, 456, 456, 456, 456, 456,
1006
+ 456, 456, 456, 456, 456, 456, 457, 457, 457, 457,
1007
+ 457, 457, 457, 457, 457, 457, 457, 458, 458, 458,
1008
+ 458, 458, 458, 458, 458, 458, 458, 458, 459, 459,
1009
+
1010
+ 459, 459, 459, 459, 459, 459, 459, 459, 459, 460,
1011
+ 460, 460, 460, 460, 460, 460, 460, 460, 460, 460,
1012
+ 461, 461, 461, 461, 461, 461, 461, 461, 461, 461,
1013
+ 461, 388, 388, 388, 388, 388, 388, 388, 388, 388,
1014
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
1015
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388,
1016
+ 388, 388, 388, 388, 388, 388
1017
+ } ;
1018
+
1019
+ /* The intent behind this definition is that it'll catch
1020
+ * any uses of REJECT which flex missed.
1021
+ */
1022
+ #define REJECT reject_used_but_not_detected
1023
+ #define yymore() yymore_used_but_not_detected
1024
+ #define YY_MORE_ADJ 0
1025
+ #define YY_RESTORE_YY_MORE_OFFSET
1026
+ #line 1 "scan.l"
1027
+ #line 2 "scan.l"
1028
+ /*-------------------------------------------------------------------------
1029
+ *
1030
+ * scan.l
1031
+ * lexical scanner for PostgreSQL
1032
+ *
1033
+ * NOTE NOTE NOTE:
1034
+ *
1035
+ * The rules in this file must be kept in sync with psql's lexer!!!
1036
+ *
1037
+ * The rules are designed so that the scanner never has to backtrack,
1038
+ * in the sense that there is always a rule that can match the input
1039
+ * consumed so far (the rule action may internally throw back some input
1040
+ * with yyless(), however). As explained in the flex manual, this makes
1041
+ * for a useful speed increase --- about a third faster than a plain -CF
1042
+ * lexer, in simple testing. The extra complexity is mostly in the rules
1043
+ * for handling float numbers and continued string literals. If you change
1044
+ * the lexical rules, verify that you haven't broken the no-backtrack
1045
+ * property by running flex with the "-b" option and checking that the
1046
+ * resulting "lex.backup" file says that no backing up is needed.
1047
+ *
1048
+ *
1049
+ * Portions Copyright (c) 2003-2013, PgPool Global Development Group
1050
+ * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
1051
+ * Portions Copyright (c) 1994, Regents of the University of California
1052
+ *
1053
+ * IDENTIFICATION
1054
+ * src/backend/parser/scan.l
1055
+ *
1056
+ *-------------------------------------------------------------------------
1057
+ */
1058
+ #include "pool_parser.h"
1059
+
1060
+ #include <ctype.h>
1061
+ #include <unistd.h>
1062
+ #include <errno.h>
1063
+ #include <string.h>
1064
+
1065
+ /* Not needed now that this file is compiled as part of gram.y */
1066
+ /* #include "parser/parse.h" */
1067
+ #include "parser.h"
1068
+ #include "gram.h"
1069
+ #include "scanner.h"
1070
+ #include "scansup.h"
1071
+
1072
+ #include "pool_memory.h"
1073
+ #include "pg_wchar.h"
1074
+
1075
+
1076
+
1077
+
1078
+ /* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
1079
+ #undef fprintf
1080
+ #define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
1081
+
1082
+ /*
1083
+ * GUC variables. This is a DIRECT violation of the warning given at the
1084
+ * head of gram.y, ie flex/bison code must not depend on any GUC variables;
1085
+ * as such, changing their values can induce very unintuitive behavior.
1086
+ * But we shall have to live with it as a short-term thing until the switch
1087
+ * to SQL-standard string syntax is complete.
1088
+ */
1089
+ int backslash_quote = BACKSLASH_QUOTE_SAFE_ENCODING;
1090
+ bool escape_string_warning = true;
1091
+ bool standard_conforming_strings = false;
1092
+
1093
+ /*
1094
+ * Set the type of YYSTYPE.
1095
+ */
1096
+ #define YYSTYPE core_YYSTYPE
1097
+
1098
+ /*
1099
+ * Set the type of yyextra. All state variables used by the scanner should
1100
+ * be in yyextra, *not* statically allocated.
1101
+ */
1102
+ #define YY_EXTRA_TYPE core_yy_extra_type *
1103
+
1104
+ /*
1105
+ * Each call to core_yylex must set yylloc to the location of the found token
1106
+ * (expressed as a byte offset from the start of the input text).
1107
+ * When we parse a token that requires multiple lexer rules to process,
1108
+ * this should be done in the first such rule, else yylloc will point
1109
+ * into the middle of the token.
1110
+ */
1111
+ #define SET_YYLLOC() (*(yylloc) = yytext - yyextra->scanbuf)
1112
+
1113
+ /*
1114
+ * Advance yylloc by the given number of bytes.
1115
+ */
1116
+ #define ADVANCE_YYLLOC(delta) ( *(yylloc) += (delta) )
1117
+
1118
+ #define startlit() ( yyextra->literallen = 0 )
1119
+ static void addlit(char *ytext, int yleng, core_yyscan_t yyscanner);
1120
+ static void addlitchar(unsigned char ychar, core_yyscan_t yyscanner);
1121
+ static char *litbufdup(core_yyscan_t yyscanner);
1122
+ static char *litbuf_udeescape(unsigned char escape, core_yyscan_t yyscanner);
1123
+ static unsigned char unescape_single_char(unsigned char c, core_yyscan_t yyscanner);
1124
+ static int process_integer_literal(const char *token, YYSTYPE *lval);
1125
+ static bool is_utf16_surrogate_first(pg_wchar c);
1126
+ static bool is_utf16_surrogate_second(pg_wchar c);
1127
+ static pg_wchar surrogate_pair_to_codepoint(pg_wchar first, pg_wchar second);
1128
+ static void addunicode(pg_wchar c, yyscan_t yyscanner);
1129
+
1130
+ #define yyerror(msg) scanner_yyerror(msg, yyscanner)
1131
+
1132
+ #define lexer_errposition() scanner_errposition(*(yylloc), yyscanner)
1133
+
1134
+ static void check_string_escape_warning(unsigned char ychar, core_yyscan_t yyscanner);
1135
+ static void check_escape_warning(core_yyscan_t yyscanner);
1136
+
1137
+ /*
1138
+ * Work around a bug in flex 2.5.35: it emits a couple of functions that
1139
+ * it forgets to emit declarations for. Since we use -Wmissing-prototypes,
1140
+ * this would cause warnings. Providing our own declarations should be
1141
+ * harmless even when the bug gets fixed.
1142
+ */
1143
+ extern int core_yyget_column(yyscan_t yyscanner);
1144
+ extern void core_yyset_column(int column_no, yyscan_t yyscanner);
1145
+
1146
+ #define YY_NO_INPUT 1
1147
+ /*
1148
+ * OK, here is a short description of lex/flex rules behavior.
1149
+ * The longest pattern which matches an input string is always chosen.
1150
+ * For equal-length patterns, the first occurring in the rules list is chosen.
1151
+ * INITIAL is the starting state, to which all non-conditional rules apply.
1152
+ * Exclusive states change parsing rules while the state is active. When in
1153
+ * an exclusive state, only those rules defined for that state apply.
1154
+ *
1155
+ * We use exclusive states for quoted strings, extended comments,
1156
+ * and to eliminate parsing troubles for numeric strings.
1157
+ * Exclusive states:
1158
+ * <xb> bit string literal
1159
+ * <xc> extended C-style comments
1160
+ * <xd> delimited identifiers (double-quoted identifiers)
1161
+ * <xh> hexadecimal numeric string
1162
+ * <xq> standard quoted strings
1163
+ * <xe> extended quoted strings (support backslash escape sequences)
1164
+ * <xdolq> $foo$ quoted strings
1165
+ * <xui> quoted identifier with Unicode escapes
1166
+ * <xus> quoted string with Unicode escapes
1167
+ * <xeu> Unicode surrogate pair in extended quoted string
1168
+ */
1169
+
1170
+
1171
+
1172
+
1173
+
1174
+
1175
+
1176
+
1177
+
1178
+
1179
+ /*
1180
+ * In order to make the world safe for Windows and Mac clients as well as
1181
+ * Unix ones, we accept either \n or \r as a newline. A DOS-style \r\n
1182
+ * sequence will be seen as two successive newlines, but that doesn't cause
1183
+ * any problems. Comments that start with -- and extend to the next
1184
+ * newline are treated as equivalent to a single whitespace character.
1185
+ *
1186
+ * NOTE a fine point: if there is no newline following --, we will absorb
1187
+ * everything to the end of the input as a comment. This is correct. Older
1188
+ * versions of Postgres failed to recognize -- as a comment if the input
1189
+ * did not end with a newline.
1190
+ *
1191
+ * XXX perhaps \f (formfeed) should be treated as a newline as well?
1192
+ *
1193
+ * XXX if you change the set of whitespace characters, fix scanner_isspace()
1194
+ * to agree, and see also the plpgsql lexer.
1195
+ */
1196
+ /*
1197
+ * SQL requires at least one newline in the whitespace separating
1198
+ * string literals that are to be concatenated. Silly, but who are we
1199
+ * to argue? Note that {whitespace_with_newline} should not have * after
1200
+ * it, whereas {whitespace} should generally have a * after it...
1201
+ */
1202
+ /*
1203
+ * To ensure that {quotecontinue} can be scanned without having to back up
1204
+ * if the full pattern isn't matched, we include trailing whitespace in
1205
+ * {quotestop}. This matches all cases where {quotecontinue} fails to match,
1206
+ * except for {quote} followed by whitespace and just one "-" (not two,
1207
+ * which would start a {comment}). To cover that we have {quotefail}.
1208
+ * The actions for {quotestop} and {quotefail} must throw back characters
1209
+ * beyond the quote proper.
1210
+ */
1211
+ /* Bit string
1212
+ * It is tempting to scan the string for only those characters
1213
+ * which are allowed. However, this leads to silently swallowed
1214
+ * characters if illegal characters are included in the string.
1215
+ * For example, if xbinside is [01] then B'ABCD' is interpreted
1216
+ * as a zero-length string, and the ABCD' is lost!
1217
+ * Better to pass the string forward and let the input routines
1218
+ * validate the contents.
1219
+ */
1220
+ /* Hexadecimal number */
1221
+ /* National character */
1222
+ /* Quoted string that allows backslash escapes */
1223
+ /* Extended quote
1224
+ * xqdouble implements embedded quote, ''''
1225
+ */
1226
+ /* $foo$ style quotes ("dollar quoting")
1227
+ * The quoted string starts with $foo$ where "foo" is an optional string
1228
+ * in the form of an identifier, except that it may not contain "$",
1229
+ * and extends to the first occurrence of an identical string.
1230
+ * There is *no* processing of the quoted text.
1231
+ *
1232
+ * {dolqfailed} is an error rule to avoid scanner backup when {dolqdelim}
1233
+ * fails to match its trailing "$".
1234
+ */
1235
+ /* Double quote
1236
+ * Allows embedded spaces and other special characters into identifiers.
1237
+ */
1238
+ /* Unicode escapes */
1239
+ /* error rule to avoid backup */
1240
+ /* Quoted identifier with Unicode escapes */
1241
+ /* Quoted string with Unicode escapes */
1242
+ /* error rule to avoid backup */
1243
+ /* C-style comments
1244
+ *
1245
+ * The "extended comment" syntax closely resembles allowable operator syntax.
1246
+ * The tricky part here is to get lex to recognize a string starting with
1247
+ * slash-star as a comment, when interpreting it as an operator would produce
1248
+ * a longer match --- remember lex will prefer a longer match! Also, if we
1249
+ * have something like plus-slash-star, lex will think this is a 3-character
1250
+ * operator whereas we want to see it as a + operator and a comment start.
1251
+ * The solution is two-fold:
1252
+ * 1. append {op_chars}* to xcstart so that it matches as much text as
1253
+ * {operator} would. Then the tie-breaker (first matching rule of same
1254
+ * length) ensures xcstart wins. We put back the extra stuff with yyless()
1255
+ * in case it contains a star-slash that should terminate the comment.
1256
+ * 2. In the operator rule, check for slash-star within the operator, and
1257
+ * if found throw it back with yyless(). This handles the plus-slash-star
1258
+ * problem.
1259
+ * Dash-dash comments have similar interactions with the operator rule.
1260
+ */
1261
+ /*
1262
+ * "self" is the set of chars that should be returned as single-character
1263
+ * tokens. "op_chars" is the set of chars that can make up "Op" tokens,
1264
+ * which can be one or more characters long (but if a single-char token
1265
+ * appears in the "self" set, it is not to be returned as an Op). Note
1266
+ * that the sets overlap, but each has some chars that are not in the other.
1267
+ *
1268
+ * If you change either set, adjust the character lists appearing in the
1269
+ * rule for "operator"!
1270
+ */
1271
+ /* we no longer allow unary minus in numbers.
1272
+ * instead we pass it separately to parser. there it gets
1273
+ * coerced via doNegate() -- Leon aug 20 1999
1274
+ *
1275
+ * {decimalfail} is used because we would like "1..10" to lex as 1, dot_dot, 10.
1276
+ *
1277
+ * {realfail1} and {realfail2} are added to prevent the need for scanner
1278
+ * backup when the {real} rule fails to match completely.
1279
+ */
1280
+ /*
1281
+ * Dollar quoted strings are totally opaque, and no escaping is done on them.
1282
+ * Other quoted strings must allow some special characters such as single-quote
1283
+ * and newline.
1284
+ * Embedded single-quotes are implemented both in the SQL standard
1285
+ * style of two adjacent single quotes "''" and in the Postgres/Java style
1286
+ * of escaped-quote "\'".
1287
+ * Other embedded escaped characters are matched explicitly and the leading
1288
+ * backslash is dropped from the string.
1289
+ * Note that xcstart must appear before operator, as explained above!
1290
+ * Also whitespace (comment) must appear before operator.
1291
+ */
1292
+ #line 1293 "scan.c"
1293
+
1294
+ #define INITIAL 0
1295
+ #define xb 1
1296
+ #define xc 2
1297
+ #define xd 3
1298
+ #define xh 4
1299
+ #define xe 5
1300
+ #define xq 6
1301
+ #define xdolq 7
1302
+ #define xui 8
1303
+ #define xus 9
1304
+ #define xeu 10
1305
+
1306
+ #ifndef YY_NO_UNISTD_H
1307
+ /* Special case for "unistd.h", since it is non-ANSI. We include it way
1308
+ * down here because we want the user's section 1 to have been scanned first.
1309
+ * The user has a chance to override it with an option.
1310
+ */
1311
+ #include <unistd.h>
1312
+ #endif
1313
+
1314
+ #ifndef YY_EXTRA_TYPE
1315
+ #define YY_EXTRA_TYPE void *
1316
+ #endif
1317
+
1318
+ /* Holds the entire state of the reentrant scanner. */
1319
+ struct yyguts_t
1320
+ {
1321
+
1322
+ /* User-defined. Not touched by flex. */
1323
+ YY_EXTRA_TYPE yyextra_r;
1324
+
1325
+ /* The rest are the same as the globals declared in the non-reentrant scanner. */
1326
+ FILE *yyin_r, *yyout_r;
1327
+ size_t yy_buffer_stack_top; /**< index of top of stack. */
1328
+ size_t yy_buffer_stack_max; /**< capacity of stack. */
1329
+ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1330
+ char yy_hold_char;
1331
+ int yy_n_chars;
1332
+ int yyleng_r;
1333
+ char *yy_c_buf_p;
1334
+ int yy_init;
1335
+ int yy_start;
1336
+ int yy_did_buffer_switch_on_eof;
1337
+ int yy_start_stack_ptr;
1338
+ int yy_start_stack_depth;
1339
+ int *yy_start_stack;
1340
+ yy_state_type yy_last_accepting_state;
1341
+ char* yy_last_accepting_cpos;
1342
+
1343
+ int yylineno_r;
1344
+ int yy_flex_debug_r;
1345
+
1346
+ char *yytext_r;
1347
+ int yy_more_flag;
1348
+ int yy_more_len;
1349
+
1350
+ YYSTYPE * yylval_r;
1351
+
1352
+ YYLTYPE * yylloc_r;
1353
+
1354
+ }; /* end struct yyguts_t */
1355
+
1356
+ static int yy_init_globals (yyscan_t yyscanner );
1357
+
1358
+ /* This must go here because YYSTYPE and YYLTYPE are included
1359
+ * from bison output in section 1.*/
1360
+ # define yylval yyg->yylval_r
1361
+
1362
+ # define yylloc yyg->yylloc_r
1363
+
1364
+ int core_yylex_init (yyscan_t* scanner);
1365
+
1366
+ int core_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1367
+
1368
+ /* Accessor methods to globals.
1369
+ These are made visible to non-reentrant scanners for convenience. */
1370
+
1371
+ int core_yylex_destroy (yyscan_t yyscanner );
1372
+
1373
+ int core_yyget_debug (yyscan_t yyscanner );
1374
+
1375
+ void core_yyset_debug (int debug_flag ,yyscan_t yyscanner );
1376
+
1377
+ YY_EXTRA_TYPE core_yyget_extra (yyscan_t yyscanner );
1378
+
1379
+ void core_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1380
+
1381
+ FILE *core_yyget_in (yyscan_t yyscanner );
1382
+
1383
+ void core_yyset_in (FILE * in_str ,yyscan_t yyscanner );
1384
+
1385
+ FILE *core_yyget_out (yyscan_t yyscanner );
1386
+
1387
+ void core_yyset_out (FILE * out_str ,yyscan_t yyscanner );
1388
+
1389
+ int core_yyget_leng (yyscan_t yyscanner );
1390
+
1391
+ char *core_yyget_text (yyscan_t yyscanner );
1392
+
1393
+ int core_yyget_lineno (yyscan_t yyscanner );
1394
+
1395
+ void core_yyset_lineno (int line_number ,yyscan_t yyscanner );
1396
+
1397
+ int core_yyget_column (yyscan_t yyscanner );
1398
+
1399
+ void core_yyset_column (int column_no ,yyscan_t yyscanner );
1400
+
1401
+ YYSTYPE * core_yyget_lval (yyscan_t yyscanner );
1402
+
1403
+ void core_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
1404
+
1405
+ YYLTYPE *core_yyget_lloc (yyscan_t yyscanner );
1406
+
1407
+ void core_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
1408
+
1409
+ /* Macros after this point can all be overridden by user definitions in
1410
+ * section 1.
1411
+ */
1412
+
1413
+ #ifndef YY_SKIP_YYWRAP
1414
+ #ifdef __cplusplus
1415
+ extern "C" int core_yywrap (yyscan_t yyscanner );
1416
+ #else
1417
+ extern int core_yywrap (yyscan_t yyscanner );
1418
+ #endif
1419
+ #endif
1420
+
1421
+ #ifndef yytext_ptr
1422
+ static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1423
+ #endif
1424
+
1425
+ #ifdef YY_NEED_STRLEN
1426
+ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1427
+ #endif
1428
+
1429
+ #ifndef YY_NO_INPUT
1430
+
1431
+ #ifdef __cplusplus
1432
+ static int yyinput (yyscan_t yyscanner );
1433
+ #else
1434
+ static int input (yyscan_t yyscanner );
1435
+ #endif
1436
+
1437
+ #endif
1438
+
1439
+ /* Amount of stuff to slurp up with each read. */
1440
+ #ifndef YY_READ_BUF_SIZE
1441
+ #define YY_READ_BUF_SIZE 8192
1442
+ #endif
1443
+
1444
+ /* Copy whatever the last rule matched to the standard output. */
1445
+ #ifndef ECHO
1446
+ /* This used to be an fputs(), but since the string might contain NUL's,
1447
+ * we now use fwrite().
1448
+ */
1449
+ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1450
+ #endif
1451
+
1452
+ /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1453
+ * is returned in "result".
1454
+ */
1455
+ #ifndef YY_INPUT
1456
+ #define YY_INPUT(buf,result,max_size) \
1457
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1458
+ { \
1459
+ int c = '*'; \
1460
+ unsigned n; \
1461
+ for ( n = 0; n < max_size && \
1462
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1463
+ buf[n] = (char) c; \
1464
+ if ( c == '\n' ) \
1465
+ buf[n++] = (char) c; \
1466
+ if ( c == EOF && ferror( yyin ) ) \
1467
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
1468
+ result = n; \
1469
+ } \
1470
+ else \
1471
+ { \
1472
+ errno=0; \
1473
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1474
+ { \
1475
+ if( errno != EINTR) \
1476
+ { \
1477
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
1478
+ break; \
1479
+ } \
1480
+ errno=0; \
1481
+ clearerr(yyin); \
1482
+ } \
1483
+ }\
1484
+ \
1485
+
1486
+ #endif
1487
+
1488
+ /* No semi-colon after return; correct usage is to write "yyterminate();" -
1489
+ * we don't want an extra ';' after the "return" because that will cause
1490
+ * some compilers to complain about unreachable statements.
1491
+ */
1492
+ #ifndef yyterminate
1493
+ #define yyterminate() return YY_NULL
1494
+ #endif
1495
+
1496
+ /* Number of entries by which start-condition stack grows. */
1497
+ #ifndef YY_START_STACK_INCR
1498
+ #define YY_START_STACK_INCR 25
1499
+ #endif
1500
+
1501
+ /* Report a fatal error. */
1502
+ #ifndef YY_FATAL_ERROR
1503
+ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1504
+ #endif
1505
+
1506
+ /* end tables serialization structures and prototypes */
1507
+
1508
+ /* Default declaration of generated scanner - a define so the user can
1509
+ * easily add parameters.
1510
+ */
1511
+ #ifndef YY_DECL
1512
+ #define YY_DECL_IS_OURS 1
1513
+
1514
+ extern int core_yylex \
1515
+ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
1516
+
1517
+ #define YY_DECL int core_yylex \
1518
+ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
1519
+ #endif /* !YY_DECL */
1520
+
1521
+ /* Code executed at the beginning of each rule, after yytext and yyleng
1522
+ * have been set up.
1523
+ */
1524
+ #ifndef YY_USER_ACTION
1525
+ #define YY_USER_ACTION
1526
+ #endif
1527
+
1528
+ /* Code executed at the end of each rule. */
1529
+ #ifndef YY_BREAK
1530
+ #define YY_BREAK break;
1531
+ #endif
1532
+
1533
+ #define YY_RULE_SETUP \
1534
+ YY_USER_ACTION
1535
+
1536
+ /** The main scanner function which does all the work.
1537
+ */
1538
+ YY_DECL
1539
+ {
1540
+ register yy_state_type yy_current_state;
1541
+ register char *yy_cp, *yy_bp;
1542
+ register int yy_act;
1543
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1544
+
1545
+ #line 381 "scan.l"
1546
+
1547
+
1548
+ #line 1549 "scan.c"
1549
+
1550
+ yylval = yylval_param;
1551
+
1552
+ yylloc = yylloc_param;
1553
+
1554
+ if ( !yyg->yy_init )
1555
+ {
1556
+ yyg->yy_init = 1;
1557
+
1558
+ #ifdef YY_USER_INIT
1559
+ YY_USER_INIT;
1560
+ #endif
1561
+
1562
+ if ( ! yyg->yy_start )
1563
+ yyg->yy_start = 1; /* first start state */
1564
+
1565
+ if ( ! yyin )
1566
+ yyin = stdin;
1567
+
1568
+ if ( ! yyout )
1569
+ yyout = stdout;
1570
+
1571
+ if ( ! YY_CURRENT_BUFFER ) {
1572
+ core_yyensure_buffer_stack (yyscanner);
1573
+ YY_CURRENT_BUFFER_LVALUE =
1574
+ core_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1575
+ }
1576
+
1577
+ core_yy_load_buffer_state(yyscanner );
1578
+ }
1579
+
1580
+ while ( 1 ) /* loops until end-of-file is reached */
1581
+ {
1582
+ yy_cp = yyg->yy_c_buf_p;
1583
+
1584
+ /* Support of yytext. */
1585
+ *yy_cp = yyg->yy_hold_char;
1586
+
1587
+ /* yy_bp points to the position in yy_ch_buf of the start of
1588
+ * the current run.
1589
+ */
1590
+ yy_bp = yy_cp;
1591
+
1592
+ yy_current_state = yyg->yy_start;
1593
+ yy_match:
1594
+ do
1595
+ {
1596
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1597
+ if ( yy_accept[yy_current_state] )
1598
+ {
1599
+ yyg->yy_last_accepting_state = yy_current_state;
1600
+ yyg->yy_last_accepting_cpos = yy_cp;
1601
+ }
1602
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1603
+ {
1604
+ yy_current_state = (int) yy_def[yy_current_state];
1605
+ if ( yy_current_state >= 389 )
1606
+ yy_c = yy_meta[(unsigned int) yy_c];
1607
+ }
1608
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1609
+ ++yy_cp;
1610
+ }
1611
+ while ( yy_current_state != 388 );
1612
+ yy_cp = yyg->yy_last_accepting_cpos;
1613
+ yy_current_state = yyg->yy_last_accepting_state;
1614
+
1615
+ yy_find_action:
1616
+ yy_act = yy_accept[yy_current_state];
1617
+
1618
+ YY_DO_BEFORE_ACTION;
1619
+
1620
+ do_action: /* This label is used only to access EOF actions. */
1621
+
1622
+ switch ( yy_act )
1623
+ { /* beginning of action switch */
1624
+ case 0: /* must back up */
1625
+ /* undo the effects of YY_DO_BEFORE_ACTION */
1626
+ *yy_cp = yyg->yy_hold_char;
1627
+ yy_cp = yyg->yy_last_accepting_cpos;
1628
+ yy_current_state = yyg->yy_last_accepting_state;
1629
+ goto yy_find_action;
1630
+
1631
+ case 1:
1632
+ /* rule 1 can match eol */
1633
+ YY_RULE_SETUP
1634
+ #line 383 "scan.l"
1635
+ {
1636
+ /* ignore */
1637
+ }
1638
+ YY_BREAK
1639
+ case 2:
1640
+ YY_RULE_SETUP
1641
+ #line 387 "scan.l"
1642
+ {
1643
+ /* Set location in case of syntax error in comment */
1644
+ SET_YYLLOC();
1645
+ yyextra->xcdepth = 0;
1646
+ BEGIN(xc);
1647
+ /* Put back any characters past slash-star; see above */
1648
+ yyless(2);
1649
+ }
1650
+ YY_BREAK
1651
+ case 3:
1652
+ YY_RULE_SETUP
1653
+ #line 396 "scan.l"
1654
+ {
1655
+ (yyextra->xcdepth)++;
1656
+ /* Put back any characters past slash-star; see above */
1657
+ yyless(2);
1658
+ }
1659
+ YY_BREAK
1660
+ case 4:
1661
+ YY_RULE_SETUP
1662
+ #line 402 "scan.l"
1663
+ {
1664
+ if (yyextra->xcdepth <= 0)
1665
+ BEGIN(INITIAL);
1666
+ else
1667
+ (yyextra->xcdepth)--;
1668
+ }
1669
+ YY_BREAK
1670
+ case 5:
1671
+ /* rule 5 can match eol */
1672
+ YY_RULE_SETUP
1673
+ #line 409 "scan.l"
1674
+ {
1675
+ /* ignore */
1676
+ }
1677
+ YY_BREAK
1678
+ case 6:
1679
+ YY_RULE_SETUP
1680
+ #line 413 "scan.l"
1681
+ {
1682
+ /* ignore */
1683
+ }
1684
+ YY_BREAK
1685
+ case 7:
1686
+ YY_RULE_SETUP
1687
+ #line 417 "scan.l"
1688
+ {
1689
+ /* ignore */
1690
+ }
1691
+ YY_BREAK
1692
+ case YY_STATE_EOF(xc):
1693
+ #line 421 "scan.l"
1694
+ { yyerror("unterminated /* comment"); }
1695
+ YY_BREAK
1696
+ case 8:
1697
+ YY_RULE_SETUP
1698
+ #line 423 "scan.l"
1699
+ {
1700
+ /* Binary bit type.
1701
+ * At some point we should simply pass the string
1702
+ * forward to the parser and label it there.
1703
+ * In the meantime, place a leading "b" on the string
1704
+ * to mark it for the input routine as a binary string.
1705
+ */
1706
+ SET_YYLLOC();
1707
+ BEGIN(xb);
1708
+ startlit();
1709
+ addlitchar('b', yyscanner);
1710
+ }
1711
+ YY_BREAK
1712
+ case 9:
1713
+ /* rule 9 can match eol */
1714
+ #line 436 "scan.l"
1715
+ case 10:
1716
+ /* rule 10 can match eol */
1717
+ YY_RULE_SETUP
1718
+ #line 436 "scan.l"
1719
+ {
1720
+ yyless(1);
1721
+ BEGIN(INITIAL);
1722
+ yylval->str = litbufdup(yyscanner);
1723
+ return BCONST;
1724
+ }
1725
+ YY_BREAK
1726
+ case 11:
1727
+ /* rule 11 can match eol */
1728
+ #line 443 "scan.l"
1729
+ case 12:
1730
+ /* rule 12 can match eol */
1731
+ YY_RULE_SETUP
1732
+ #line 443 "scan.l"
1733
+ {
1734
+ addlit(yytext, yyleng, yyscanner);
1735
+ }
1736
+ YY_BREAK
1737
+ case 13:
1738
+ /* rule 13 can match eol */
1739
+ #line 447 "scan.l"
1740
+ case 14:
1741
+ /* rule 14 can match eol */
1742
+ YY_RULE_SETUP
1743
+ #line 447 "scan.l"
1744
+ {
1745
+ /* ignore */
1746
+ }
1747
+ YY_BREAK
1748
+ case YY_STATE_EOF(xb):
1749
+ #line 450 "scan.l"
1750
+ { yyerror("unterminated bit string literal"); }
1751
+ YY_BREAK
1752
+ case 15:
1753
+ YY_RULE_SETUP
1754
+ #line 452 "scan.l"
1755
+ {
1756
+ /* Hexadecimal bit type.
1757
+ * At some point we should simply pass the string
1758
+ * forward to the parser and label it there.
1759
+ * In the meantime, place a leading "x" on the string
1760
+ * to mark it for the input routine as a hex string.
1761
+ */
1762
+ SET_YYLLOC();
1763
+ BEGIN(xh);
1764
+ startlit();
1765
+ addlitchar('x', yyscanner);
1766
+ }
1767
+ YY_BREAK
1768
+ case 16:
1769
+ /* rule 16 can match eol */
1770
+ #line 465 "scan.l"
1771
+ case 17:
1772
+ /* rule 17 can match eol */
1773
+ YY_RULE_SETUP
1774
+ #line 465 "scan.l"
1775
+ {
1776
+ yyless(1);
1777
+ BEGIN(INITIAL);
1778
+ yylval->str = litbufdup(yyscanner);
1779
+ return XCONST;
1780
+ }
1781
+ YY_BREAK
1782
+ case YY_STATE_EOF(xh):
1783
+ #line 471 "scan.l"
1784
+ { yyerror("unterminated hexadecimal string literal"); }
1785
+ YY_BREAK
1786
+ case 18:
1787
+ YY_RULE_SETUP
1788
+ #line 473 "scan.l"
1789
+ {
1790
+ /* National character.
1791
+ * We will pass this along as a normal character string,
1792
+ * but preceded with an internally-generated "NCHAR".
1793
+ */
1794
+ const ScanKeyword *keyword;
1795
+
1796
+ SET_YYLLOC();
1797
+ yyless(1); /* eat only 'n' this time */
1798
+
1799
+ keyword = ScanKeywordLookup("nchar",
1800
+ yyextra->keywords,
1801
+ yyextra->num_keywords);
1802
+ if (keyword != NULL)
1803
+ {
1804
+ yylval->keyword = keyword->name;
1805
+ return keyword->value;
1806
+ }
1807
+ else
1808
+ {
1809
+ /* If NCHAR isn't a keyword, just return "n" */
1810
+ yylval->str = pstrdup("n");
1811
+ return IDENT;
1812
+ }
1813
+ }
1814
+ YY_BREAK
1815
+ case 19:
1816
+ YY_RULE_SETUP
1817
+ #line 499 "scan.l"
1818
+ {
1819
+ yyextra->warn_on_first_escape = true;
1820
+ yyextra->saw_non_ascii = false;
1821
+ SET_YYLLOC();
1822
+ if (standard_conforming_strings)
1823
+ BEGIN(xq);
1824
+ else
1825
+ BEGIN(xe);
1826
+ startlit();
1827
+ }
1828
+ YY_BREAK
1829
+ case 20:
1830
+ YY_RULE_SETUP
1831
+ #line 509 "scan.l"
1832
+ {
1833
+ yyextra->warn_on_first_escape = false;
1834
+ yyextra->saw_non_ascii = false;
1835
+ SET_YYLLOC();
1836
+ BEGIN(xe);
1837
+ startlit();
1838
+ }
1839
+ YY_BREAK
1840
+ case 21:
1841
+ YY_RULE_SETUP
1842
+ #line 516 "scan.l"
1843
+ {
1844
+ SET_YYLLOC();
1845
+ if (!standard_conforming_strings)
1846
+ ereport(ERROR,
1847
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1848
+ errmsg("unsafe use of string constant with Unicode escapes"),
1849
+ errdetail("String constants with Unicode escapes cannot be used when standard_conforming_strings is off."),
1850
+ lexer_errposition()));
1851
+ BEGIN(xus);
1852
+ startlit();
1853
+ }
1854
+ YY_BREAK
1855
+ case 22:
1856
+ /* rule 22 can match eol */
1857
+ #line 528 "scan.l"
1858
+ case 23:
1859
+ /* rule 23 can match eol */
1860
+ YY_RULE_SETUP
1861
+ #line 528 "scan.l"
1862
+ {
1863
+ yyless(1);
1864
+ BEGIN(INITIAL);
1865
+ /*
1866
+ * check that the data remains valid if it might have been
1867
+ * made invalid by unescaping any chars.
1868
+ */
1869
+ if (yyextra->saw_non_ascii)
1870
+ pg_verifymbstr(yyextra->literalbuf,
1871
+ yyextra->literallen,
1872
+ false);
1873
+ yylval->str = litbufdup(yyscanner);
1874
+ return SCONST;
1875
+ }
1876
+ YY_BREAK
1877
+ case 24:
1878
+ /* rule 24 can match eol */
1879
+ YY_RULE_SETUP
1880
+ #line 542 "scan.l"
1881
+ {
1882
+ /* throw back all but the quote */
1883
+ yyless(1);
1884
+ BEGIN(INITIAL);
1885
+ yylval->str = litbuf_udeescape('\\', yyscanner);
1886
+ return SCONST;
1887
+ }
1888
+ YY_BREAK
1889
+ case 25:
1890
+ /* rule 25 can match eol */
1891
+ YY_RULE_SETUP
1892
+ #line 549 "scan.l"
1893
+ {
1894
+ BEGIN(INITIAL);
1895
+ yylval->str = litbuf_udeescape(yytext[yyleng-2], yyscanner);
1896
+ return SCONST;
1897
+ }
1898
+ YY_BREAK
1899
+ case 26:
1900
+ YY_RULE_SETUP
1901
+ #line 554 "scan.l"
1902
+ {
1903
+ addlitchar('\'', yyscanner);
1904
+ }
1905
+ YY_BREAK
1906
+ case 27:
1907
+ /* rule 27 can match eol */
1908
+ YY_RULE_SETUP
1909
+ #line 557 "scan.l"
1910
+ {
1911
+ addlit(yytext, yyleng, yyscanner);
1912
+ }
1913
+ YY_BREAK
1914
+ case 28:
1915
+ /* rule 28 can match eol */
1916
+ YY_RULE_SETUP
1917
+ #line 560 "scan.l"
1918
+ {
1919
+ addlit(yytext, yyleng, yyscanner);
1920
+ }
1921
+ YY_BREAK
1922
+ case 29:
1923
+ YY_RULE_SETUP
1924
+ #line 563 "scan.l"
1925
+ {
1926
+ pg_wchar c = strtoul(yytext+2, NULL, 16);
1927
+
1928
+ check_escape_warning(yyscanner);
1929
+
1930
+ if (is_utf16_surrogate_first(c))
1931
+ {
1932
+ yyextra->utf16_first_part = c;
1933
+ BEGIN(xeu);
1934
+ }
1935
+ else if (is_utf16_surrogate_second(c))
1936
+ yyerror("invalid Unicode surrogate pair");
1937
+ else
1938
+ addunicode(c, yyscanner);
1939
+ }
1940
+ YY_BREAK
1941
+ case 30:
1942
+ YY_RULE_SETUP
1943
+ #line 578 "scan.l"
1944
+ {
1945
+ pg_wchar c = strtoul(yytext+2, NULL, 16);
1946
+
1947
+ if (!is_utf16_surrogate_second(c))
1948
+ yyerror("invalid Unicode surrogate pair");
1949
+
1950
+ c = surrogate_pair_to_codepoint(yyextra->utf16_first_part, c);
1951
+
1952
+ addunicode(c, yyscanner);
1953
+
1954
+ BEGIN(xe);
1955
+ }
1956
+ YY_BREAK
1957
+ case 31:
1958
+ YY_RULE_SETUP
1959
+ #line 590 "scan.l"
1960
+ { yyerror("invalid Unicode surrogate pair"); }
1961
+ YY_BREAK
1962
+ case 32:
1963
+ /* rule 32 can match eol */
1964
+ YY_RULE_SETUP
1965
+ #line 591 "scan.l"
1966
+ { yyerror("invalid Unicode surrogate pair"); }
1967
+ YY_BREAK
1968
+ case YY_STATE_EOF(xeu):
1969
+ #line 592 "scan.l"
1970
+ { yyerror("invalid Unicode surrogate pair"); }
1971
+ YY_BREAK
1972
+ case 33:
1973
+ YY_RULE_SETUP
1974
+ #line 593 "scan.l"
1975
+ {
1976
+ ereport(ERROR,
1977
+ (errcode(ERRCODE_INVALID_ESCAPE_SEQUENCE),
1978
+ errmsg("invalid Unicode escape"),
1979
+ errhint("Unicode escapes must be \\uXXXX or \\UXXXXXXXX."),
1980
+ lexer_errposition()));
1981
+ }
1982
+ YY_BREAK
1983
+ case 34:
1984
+ /* rule 34 can match eol */
1985
+ YY_RULE_SETUP
1986
+ #line 600 "scan.l"
1987
+ {
1988
+ #ifdef PGPOOL_NOT_USED
1989
+ if (yytext[1] == '\'')
1990
+ {
1991
+ if (backslash_quote == BACKSLASH_QUOTE_OFF ||
1992
+ (backslash_quote == BACKSLASH_QUOTE_SAFE_ENCODING &&
1993
+ PG_ENCODING_IS_CLIENT_ONLY(pg_get_client_encoding())))
1994
+ ereport(ERROR,
1995
+ (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER),
1996
+ errmsg("unsafe use of \\' in a string literal"),
1997
+ errhint("Use '' to write quotes in strings. \\' is insecure in client-only encodings."),
1998
+ lexer_errposition()));
1999
+ }
2000
+ #endif
2001
+ check_string_escape_warning(yytext[1], yyscanner);
2002
+ addlitchar(unescape_single_char(yytext[1], yyscanner),
2003
+ yyscanner);
2004
+ }
2005
+ YY_BREAK
2006
+ case 35:
2007
+ YY_RULE_SETUP
2008
+ #line 618 "scan.l"
2009
+ {
2010
+ unsigned char c = strtoul(yytext+1, NULL, 8);
2011
+
2012
+ check_escape_warning(yyscanner);
2013
+ addlitchar(c, yyscanner);
2014
+ if (c == '\0' || IS_HIGHBIT_SET(c))
2015
+ yyextra->saw_non_ascii = true;
2016
+ }
2017
+ YY_BREAK
2018
+ case 36:
2019
+ YY_RULE_SETUP
2020
+ #line 626 "scan.l"
2021
+ {
2022
+ unsigned char c = strtoul(yytext+2, NULL, 16);
2023
+
2024
+ check_escape_warning(yyscanner);
2025
+ addlitchar(c, yyscanner);
2026
+ if (c == '\0' || IS_HIGHBIT_SET(c))
2027
+ yyextra->saw_non_ascii = true;
2028
+ }
2029
+ YY_BREAK
2030
+ case 37:
2031
+ /* rule 37 can match eol */
2032
+ YY_RULE_SETUP
2033
+ #line 634 "scan.l"
2034
+ {
2035
+ /* ignore */
2036
+ }
2037
+ YY_BREAK
2038
+ case 38:
2039
+ YY_RULE_SETUP
2040
+ #line 637 "scan.l"
2041
+ {
2042
+ /* This is only needed for \ just before EOF */
2043
+ addlitchar(yytext[0], yyscanner);
2044
+ }
2045
+ YY_BREAK
2046
+ case YY_STATE_EOF(xq):
2047
+ case YY_STATE_EOF(xe):
2048
+ case YY_STATE_EOF(xus):
2049
+ #line 641 "scan.l"
2050
+ { yyerror("unterminated quoted string"); }
2051
+ YY_BREAK
2052
+ case 39:
2053
+ YY_RULE_SETUP
2054
+ #line 643 "scan.l"
2055
+ {
2056
+ SET_YYLLOC();
2057
+ yyextra->dolqstart = pstrdup(yytext);
2058
+ BEGIN(xdolq);
2059
+ startlit();
2060
+ }
2061
+ YY_BREAK
2062
+ case 40:
2063
+ YY_RULE_SETUP
2064
+ #line 649 "scan.l"
2065
+ {
2066
+ SET_YYLLOC();
2067
+ /* throw back all but the initial "$" */
2068
+ yyless(1);
2069
+ /* and treat it as {other} */
2070
+ return yytext[0];
2071
+ }
2072
+ YY_BREAK
2073
+ case 41:
2074
+ YY_RULE_SETUP
2075
+ #line 656 "scan.l"
2076
+ {
2077
+ if (strcmp(yytext, yyextra->dolqstart) == 0)
2078
+ {
2079
+ pfree(yyextra->dolqstart);
2080
+ yyextra->dolqstart = NULL;
2081
+ BEGIN(INITIAL);
2082
+ yylval->str = litbufdup(yyscanner);
2083
+ return SCONST;
2084
+ }
2085
+ else
2086
+ {
2087
+ /*
2088
+ * When we fail to match $...$ to dolqstart, transfer
2089
+ * the $... part to the output, but put back the final
2090
+ * $ for rescanning. Consider $delim$...$junk$delim$
2091
+ */
2092
+ addlit(yytext, yyleng-1, yyscanner);
2093
+ yyless(yyleng-1);
2094
+ }
2095
+ }
2096
+ YY_BREAK
2097
+ case 42:
2098
+ /* rule 42 can match eol */
2099
+ YY_RULE_SETUP
2100
+ #line 676 "scan.l"
2101
+ {
2102
+ addlit(yytext, yyleng, yyscanner);
2103
+ }
2104
+ YY_BREAK
2105
+ case 43:
2106
+ YY_RULE_SETUP
2107
+ #line 679 "scan.l"
2108
+ {
2109
+ addlit(yytext, yyleng, yyscanner);
2110
+ }
2111
+ YY_BREAK
2112
+ case 44:
2113
+ YY_RULE_SETUP
2114
+ #line 682 "scan.l"
2115
+ {
2116
+ /* This is only needed for $ inside the quoted text */
2117
+ addlitchar(yytext[0], yyscanner);
2118
+ }
2119
+ YY_BREAK
2120
+ case YY_STATE_EOF(xdolq):
2121
+ #line 686 "scan.l"
2122
+ { yyerror("unterminated dollar-quoted string"); }
2123
+ YY_BREAK
2124
+ case 45:
2125
+ YY_RULE_SETUP
2126
+ #line 688 "scan.l"
2127
+ {
2128
+ SET_YYLLOC();
2129
+ BEGIN(xd);
2130
+ startlit();
2131
+ }
2132
+ YY_BREAK
2133
+ case 46:
2134
+ YY_RULE_SETUP
2135
+ #line 693 "scan.l"
2136
+ {
2137
+ SET_YYLLOC();
2138
+ BEGIN(xui);
2139
+ startlit();
2140
+ }
2141
+ YY_BREAK
2142
+ case 47:
2143
+ YY_RULE_SETUP
2144
+ #line 698 "scan.l"
2145
+ {
2146
+ char *ident;
2147
+
2148
+ BEGIN(INITIAL);
2149
+ if (yyextra->literallen == 0)
2150
+ yyerror("zero-length delimited identifier");
2151
+ ident = litbufdup(yyscanner);
2152
+ if (yyextra->literallen >= NAMEDATALEN)
2153
+ truncate_identifier(ident, yyextra->literallen, true);
2154
+ yylval->str = ident;
2155
+ return IDENT;
2156
+ }
2157
+ YY_BREAK
2158
+ case 48:
2159
+ /* rule 48 can match eol */
2160
+ YY_RULE_SETUP
2161
+ #line 710 "scan.l"
2162
+ {
2163
+ char *ident;
2164
+
2165
+ BEGIN(INITIAL);
2166
+ if (yyextra->literallen == 0)
2167
+ yyerror("zero-length delimited identifier");
2168
+ ident = litbuf_udeescape('\\', yyscanner);
2169
+ if (yyextra->literallen >= NAMEDATALEN)
2170
+ truncate_identifier(ident, yyextra->literallen, true);
2171
+ yylval->str = ident;
2172
+ /* throw back all but the quote */
2173
+ yyless(1);
2174
+ return IDENT;
2175
+ }
2176
+ YY_BREAK
2177
+ case 49:
2178
+ /* rule 49 can match eol */
2179
+ YY_RULE_SETUP
2180
+ #line 724 "scan.l"
2181
+ {
2182
+ char *ident;
2183
+
2184
+ BEGIN(INITIAL);
2185
+ if (yyextra->literallen == 0)
2186
+ yyerror("zero-length delimited identifier");
2187
+ ident = litbuf_udeescape(yytext[yyleng - 2], yyscanner);
2188
+ if (yyextra->literallen >= NAMEDATALEN)
2189
+ truncate_identifier(ident, yyextra->literallen, true);
2190
+ yylval->str = ident;
2191
+ return IDENT;
2192
+ }
2193
+ YY_BREAK
2194
+ case 50:
2195
+ YY_RULE_SETUP
2196
+ #line 736 "scan.l"
2197
+ {
2198
+ addlitchar('"', yyscanner);
2199
+ }
2200
+ YY_BREAK
2201
+ case 51:
2202
+ /* rule 51 can match eol */
2203
+ YY_RULE_SETUP
2204
+ #line 739 "scan.l"
2205
+ {
2206
+ addlit(yytext, yyleng, yyscanner);
2207
+ }
2208
+ YY_BREAK
2209
+ case YY_STATE_EOF(xd):
2210
+ case YY_STATE_EOF(xui):
2211
+ #line 742 "scan.l"
2212
+ { yyerror("unterminated quoted identifier"); }
2213
+ YY_BREAK
2214
+ case 52:
2215
+ YY_RULE_SETUP
2216
+ #line 744 "scan.l"
2217
+ {
2218
+ char *ident;
2219
+
2220
+ SET_YYLLOC();
2221
+ /* throw back all but the initial u/U */
2222
+ yyless(1);
2223
+ /* and treat it as {identifier} */
2224
+ ident = downcase_truncate_identifier(yytext, yyleng, true);
2225
+ yylval->str = ident;
2226
+ return IDENT;
2227
+ }
2228
+ YY_BREAK
2229
+ case 53:
2230
+ YY_RULE_SETUP
2231
+ #line 756 "scan.l"
2232
+ {
2233
+ SET_YYLLOC();
2234
+ return TYPECAST;
2235
+ }
2236
+ YY_BREAK
2237
+ case 54:
2238
+ YY_RULE_SETUP
2239
+ #line 761 "scan.l"
2240
+ {
2241
+ SET_YYLLOC();
2242
+ return DOT_DOT;
2243
+ }
2244
+ YY_BREAK
2245
+ case 55:
2246
+ YY_RULE_SETUP
2247
+ #line 766 "scan.l"
2248
+ {
2249
+ SET_YYLLOC();
2250
+ return COLON_EQUALS;
2251
+ }
2252
+ YY_BREAK
2253
+ case 56:
2254
+ YY_RULE_SETUP
2255
+ #line 771 "scan.l"
2256
+ {
2257
+ SET_YYLLOC();
2258
+ return yytext[0];
2259
+ }
2260
+ YY_BREAK
2261
+ case 57:
2262
+ YY_RULE_SETUP
2263
+ #line 776 "scan.l"
2264
+ {
2265
+ /*
2266
+ * Check for embedded slash-star or dash-dash; those
2267
+ * are comment starts, so operator must stop there.
2268
+ * Note that slash-star or dash-dash at the first
2269
+ * character will match a prior rule, not this one.
2270
+ */
2271
+ int nchars = yyleng;
2272
+ char *slashstar = strstr(yytext, "/*");
2273
+ char *dashdash = strstr(yytext, "--");
2274
+
2275
+ if (slashstar && dashdash)
2276
+ {
2277
+ /* if both appear, take the first one */
2278
+ if (slashstar > dashdash)
2279
+ slashstar = dashdash;
2280
+ }
2281
+ else if (!slashstar)
2282
+ slashstar = dashdash;
2283
+ if (slashstar)
2284
+ nchars = slashstar - yytext;
2285
+
2286
+ /*
2287
+ * For SQL compatibility, '+' and '-' cannot be the
2288
+ * last char of a multi-char operator unless the operator
2289
+ * contains chars that are not in SQL operators.
2290
+ * The idea is to lex '=-' as two operators, but not
2291
+ * to forbid operator names like '?-' that could not be
2292
+ * sequences of SQL operators.
2293
+ */
2294
+ while (nchars > 1 &&
2295
+ (yytext[nchars-1] == '+' ||
2296
+ yytext[nchars-1] == '-'))
2297
+ {
2298
+ int ic;
2299
+
2300
+ for (ic = nchars-2; ic >= 0; ic--)
2301
+ {
2302
+ if (strchr("~!@#^&|`?%", yytext[ic]))
2303
+ break;
2304
+ }
2305
+ if (ic >= 0)
2306
+ break; /* found a char that makes it OK */
2307
+ nchars--; /* else remove the +/-, and check again */
2308
+ }
2309
+
2310
+ SET_YYLLOC();
2311
+
2312
+ if (nchars < yyleng)
2313
+ {
2314
+ /* Strip the unwanted chars from the token */
2315
+ yyless(nchars);
2316
+ /*
2317
+ * If what we have left is only one char, and it's
2318
+ * one of the characters matching "self", then
2319
+ * return it as a character token the same way
2320
+ * that the "self" rule would have.
2321
+ */
2322
+ if (nchars == 1 &&
2323
+ strchr(",()[].;:+-*/%^<>=", yytext[0]))
2324
+ return yytext[0];
2325
+ }
2326
+
2327
+ /*
2328
+ * Complain if operator is too long. Unlike the case
2329
+ * for identifiers, we make this an error not a notice-
2330
+ * and-truncate, because the odds are we are looking at
2331
+ * a syntactic mistake anyway.
2332
+ */
2333
+ if (nchars >= NAMEDATALEN)
2334
+ yyerror("operator too long");
2335
+
2336
+ /* Convert "!=" operator to "<>" for compatibility */
2337
+ if (strcmp(yytext, "!=") == 0)
2338
+ yylval->str = pstrdup("<>");
2339
+ else
2340
+ yylval->str = pstrdup(yytext);
2341
+ return Op;
2342
+ }
2343
+ YY_BREAK
2344
+ case 58:
2345
+ YY_RULE_SETUP
2346
+ #line 856 "scan.l"
2347
+ {
2348
+ SET_YYLLOC();
2349
+ yylval->ival = atol(yytext + 1);
2350
+ return PARAM;
2351
+ }
2352
+ YY_BREAK
2353
+ case 59:
2354
+ YY_RULE_SETUP
2355
+ #line 862 "scan.l"
2356
+ {
2357
+ SET_YYLLOC();
2358
+ return process_integer_literal(yytext, yylval);
2359
+ }
2360
+ YY_BREAK
2361
+ case 60:
2362
+ YY_RULE_SETUP
2363
+ #line 866 "scan.l"
2364
+ {
2365
+ SET_YYLLOC();
2366
+ yylval->str = pstrdup(yytext);
2367
+ return FCONST;
2368
+ }
2369
+ YY_BREAK
2370
+ case 61:
2371
+ YY_RULE_SETUP
2372
+ #line 871 "scan.l"
2373
+ {
2374
+ /* throw back the .., and treat as integer */
2375
+ yyless(yyleng-2);
2376
+ SET_YYLLOC();
2377
+ return process_integer_literal(yytext, yylval);
2378
+ }
2379
+ YY_BREAK
2380
+ case 62:
2381
+ YY_RULE_SETUP
2382
+ #line 877 "scan.l"
2383
+ {
2384
+ SET_YYLLOC();
2385
+ yylval->str = pstrdup(yytext);
2386
+ return FCONST;
2387
+ }
2388
+ YY_BREAK
2389
+ case 63:
2390
+ YY_RULE_SETUP
2391
+ #line 882 "scan.l"
2392
+ {
2393
+ /*
2394
+ * throw back the [Ee], and treat as {decimal}. Note
2395
+ * that it is possible the input is actually {integer},
2396
+ * but since this case will almost certainly lead to a
2397
+ * syntax error anyway, we don't bother to distinguish.
2398
+ */
2399
+ yyless(yyleng-1);
2400
+ SET_YYLLOC();
2401
+ yylval->str = pstrdup(yytext);
2402
+ return FCONST;
2403
+ }
2404
+ YY_BREAK
2405
+ case 64:
2406
+ YY_RULE_SETUP
2407
+ #line 894 "scan.l"
2408
+ {
2409
+ /* throw back the [Ee][+-], and proceed as above */
2410
+ yyless(yyleng-2);
2411
+ SET_YYLLOC();
2412
+ yylval->str = pstrdup(yytext);
2413
+ return FCONST;
2414
+ }
2415
+ YY_BREAK
2416
+ case 65:
2417
+ YY_RULE_SETUP
2418
+ #line 903 "scan.l"
2419
+ {
2420
+ const ScanKeyword *keyword;
2421
+ char *ident;
2422
+
2423
+ SET_YYLLOC();
2424
+
2425
+ /* Is it a keyword? */
2426
+ keyword = ScanKeywordLookup(yytext,
2427
+ yyextra->keywords,
2428
+ yyextra->num_keywords);
2429
+ if (keyword != NULL)
2430
+ {
2431
+ yylval->keyword = keyword->name;
2432
+ return keyword->value;
2433
+ }
2434
+
2435
+ /*
2436
+ * No. Convert the identifier to lower case, and truncate
2437
+ * if necessary.
2438
+ */
2439
+ ident = downcase_truncate_identifier(yytext, yyleng, true);
2440
+ yylval->str = ident;
2441
+ return IDENT;
2442
+ }
2443
+ YY_BREAK
2444
+ case 66:
2445
+ YY_RULE_SETUP
2446
+ #line 928 "scan.l"
2447
+ {
2448
+ SET_YYLLOC();
2449
+ return yytext[0];
2450
+ }
2451
+ YY_BREAK
2452
+ case YY_STATE_EOF(INITIAL):
2453
+ #line 933 "scan.l"
2454
+ {
2455
+ SET_YYLLOC();
2456
+ yyterminate();
2457
+ }
2458
+ YY_BREAK
2459
+ case 67:
2460
+ YY_RULE_SETUP
2461
+ #line 938 "scan.l"
2462
+ YY_FATAL_ERROR( "flex scanner jammed" );
2463
+ YY_BREAK
2464
+ #line 2465 "scan.c"
2465
+
2466
+ case YY_END_OF_BUFFER:
2467
+ {
2468
+ /* Amount of text matched not including the EOB char. */
2469
+ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2470
+
2471
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
2472
+ *yy_cp = yyg->yy_hold_char;
2473
+ YY_RESTORE_YY_MORE_OFFSET
2474
+
2475
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2476
+ {
2477
+ /* We're scanning a new file or input source. It's
2478
+ * possible that this happened because the user
2479
+ * just pointed yyin at a new source and called
2480
+ * core_yylex(). If so, then we have to assure
2481
+ * consistency between YY_CURRENT_BUFFER and our
2482
+ * globals. Here is the right place to do so, because
2483
+ * this is the first action (other than possibly a
2484
+ * back-up) that will match for the new input source.
2485
+ */
2486
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2487
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2488
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2489
+ }
2490
+
2491
+ /* Note that here we test for yy_c_buf_p "<=" to the position
2492
+ * of the first EOB in the buffer, since yy_c_buf_p will
2493
+ * already have been incremented past the NUL character
2494
+ * (since all states make transitions on EOB to the
2495
+ * end-of-buffer state). Contrast this with the test
2496
+ * in input().
2497
+ */
2498
+ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2499
+ { /* This was really a NUL. */
2500
+ yy_state_type yy_next_state;
2501
+
2502
+ yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2503
+
2504
+ yy_current_state = yy_get_previous_state( yyscanner );
2505
+
2506
+ /* Okay, we're now positioned to make the NUL
2507
+ * transition. We couldn't have
2508
+ * yy_get_previous_state() go ahead and do it
2509
+ * for us because it doesn't know how to deal
2510
+ * with the possibility of jamming (and we don't
2511
+ * want to build jamming into it because then it
2512
+ * will run more slowly).
2513
+ */
2514
+
2515
+ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2516
+
2517
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2518
+
2519
+ if ( yy_next_state )
2520
+ {
2521
+ /* Consume the NUL. */
2522
+ yy_cp = ++yyg->yy_c_buf_p;
2523
+ yy_current_state = yy_next_state;
2524
+ goto yy_match;
2525
+ }
2526
+
2527
+ else
2528
+ {
2529
+ yy_cp = yyg->yy_last_accepting_cpos;
2530
+ yy_current_state = yyg->yy_last_accepting_state;
2531
+ goto yy_find_action;
2532
+ }
2533
+ }
2534
+
2535
+ else switch ( yy_get_next_buffer( yyscanner ) )
2536
+ {
2537
+ case EOB_ACT_END_OF_FILE:
2538
+ {
2539
+ yyg->yy_did_buffer_switch_on_eof = 0;
2540
+
2541
+ if ( core_yywrap(yyscanner ) )
2542
+ {
2543
+ /* Note: because we've taken care in
2544
+ * yy_get_next_buffer() to have set up
2545
+ * yytext, we can now set up
2546
+ * yy_c_buf_p so that if some total
2547
+ * hoser (like flex itself) wants to
2548
+ * call the scanner after we return the
2549
+ * YY_NULL, it'll still work - another
2550
+ * YY_NULL will get returned.
2551
+ */
2552
+ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2553
+
2554
+ yy_act = YY_STATE_EOF(YY_START);
2555
+ goto do_action;
2556
+ }
2557
+
2558
+ else
2559
+ {
2560
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
2561
+ YY_NEW_FILE;
2562
+ }
2563
+ break;
2564
+ }
2565
+
2566
+ case EOB_ACT_CONTINUE_SCAN:
2567
+ yyg->yy_c_buf_p =
2568
+ yyg->yytext_ptr + yy_amount_of_matched_text;
2569
+
2570
+ yy_current_state = yy_get_previous_state( yyscanner );
2571
+
2572
+ yy_cp = yyg->yy_c_buf_p;
2573
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2574
+ goto yy_match;
2575
+
2576
+ case EOB_ACT_LAST_MATCH:
2577
+ yyg->yy_c_buf_p =
2578
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2579
+
2580
+ yy_current_state = yy_get_previous_state( yyscanner );
2581
+
2582
+ yy_cp = yyg->yy_c_buf_p;
2583
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2584
+ goto yy_find_action;
2585
+ }
2586
+ break;
2587
+ }
2588
+
2589
+ default:
2590
+ YY_FATAL_ERROR(
2591
+ "fatal flex scanner internal error--no action found" );
2592
+ } /* end of action switch */
2593
+ } /* end of scanning one token */
2594
+ } /* end of core_yylex */
2595
+
2596
+ /* yy_get_next_buffer - try to read in a new buffer
2597
+ *
2598
+ * Returns a code representing an action:
2599
+ * EOB_ACT_LAST_MATCH -
2600
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2601
+ * EOB_ACT_END_OF_FILE - end of file
2602
+ */
2603
+ static int yy_get_next_buffer (yyscan_t yyscanner)
2604
+ {
2605
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2606
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2607
+ register char *source = yyg->yytext_ptr;
2608
+ register int number_to_move, i;
2609
+ int ret_val;
2610
+
2611
+ if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2612
+ YY_FATAL_ERROR(
2613
+ "fatal flex scanner internal error--end of buffer missed" );
2614
+
2615
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2616
+ { /* Don't try to fill the buffer, so this is an EOF. */
2617
+ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2618
+ {
2619
+ /* We matched a single character, the EOB, so
2620
+ * treat this as a final EOF.
2621
+ */
2622
+ return EOB_ACT_END_OF_FILE;
2623
+ }
2624
+
2625
+ else
2626
+ {
2627
+ /* We matched some text prior to the EOB, first
2628
+ * process it.
2629
+ */
2630
+ return EOB_ACT_LAST_MATCH;
2631
+ }
2632
+ }
2633
+
2634
+ /* Try to read more data. */
2635
+
2636
+ /* First move last chars to start of buffer. */
2637
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2638
+
2639
+ for ( i = 0; i < number_to_move; ++i )
2640
+ *(dest++) = *(source++);
2641
+
2642
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2643
+ /* don't do the read, it's not guaranteed to return an EOF,
2644
+ * just force an EOF
2645
+ */
2646
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2647
+
2648
+ else
2649
+ {
2650
+ int num_to_read =
2651
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2652
+
2653
+ while ( num_to_read <= 0 )
2654
+ { /* Not enough room in the buffer - grow it. */
2655
+
2656
+ /* just a shorter name for the current buffer */
2657
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2658
+
2659
+ int yy_c_buf_p_offset =
2660
+ (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2661
+
2662
+ if ( b->yy_is_our_buffer )
2663
+ {
2664
+ int new_size = b->yy_buf_size * 2;
2665
+
2666
+ if ( new_size <= 0 )
2667
+ b->yy_buf_size += b->yy_buf_size / 8;
2668
+ else
2669
+ b->yy_buf_size *= 2;
2670
+
2671
+ b->yy_ch_buf = (char *)
2672
+ /* Include room in for 2 EOB chars. */
2673
+ core_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2674
+ }
2675
+ else
2676
+ /* Can't grow it, we don't own it. */
2677
+ b->yy_ch_buf = 0;
2678
+
2679
+ if ( ! b->yy_ch_buf )
2680
+ YY_FATAL_ERROR(
2681
+ "fatal error - scanner input buffer overflow" );
2682
+
2683
+ yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2684
+
2685
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2686
+ number_to_move - 1;
2687
+
2688
+ }
2689
+
2690
+ if ( num_to_read > YY_READ_BUF_SIZE )
2691
+ num_to_read = YY_READ_BUF_SIZE;
2692
+
2693
+ /* Read in more data. */
2694
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2695
+ yyg->yy_n_chars, (size_t) num_to_read );
2696
+
2697
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2698
+ }
2699
+
2700
+ if ( yyg->yy_n_chars == 0 )
2701
+ {
2702
+ if ( number_to_move == YY_MORE_ADJ )
2703
+ {
2704
+ ret_val = EOB_ACT_END_OF_FILE;
2705
+ core_yyrestart(yyin ,yyscanner);
2706
+ }
2707
+
2708
+ else
2709
+ {
2710
+ ret_val = EOB_ACT_LAST_MATCH;
2711
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2712
+ YY_BUFFER_EOF_PENDING;
2713
+ }
2714
+ }
2715
+
2716
+ else
2717
+ ret_val = EOB_ACT_CONTINUE_SCAN;
2718
+
2719
+ if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2720
+ /* Extend the array by 50%, plus the number we really need. */
2721
+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2722
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) core_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2723
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2724
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2725
+ }
2726
+
2727
+ yyg->yy_n_chars += number_to_move;
2728
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2729
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2730
+
2731
+ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2732
+
2733
+ return ret_val;
2734
+ }
2735
+
2736
+ /* yy_get_previous_state - get the state just before the EOB char was reached */
2737
+
2738
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2739
+ {
2740
+ register yy_state_type yy_current_state;
2741
+ register char *yy_cp;
2742
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2743
+
2744
+ yy_current_state = yyg->yy_start;
2745
+
2746
+ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2747
+ {
2748
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2749
+ if ( yy_accept[yy_current_state] )
2750
+ {
2751
+ yyg->yy_last_accepting_state = yy_current_state;
2752
+ yyg->yy_last_accepting_cpos = yy_cp;
2753
+ }
2754
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2755
+ {
2756
+ yy_current_state = (int) yy_def[yy_current_state];
2757
+ if ( yy_current_state >= 389 )
2758
+ yy_c = yy_meta[(unsigned int) yy_c];
2759
+ }
2760
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2761
+ }
2762
+
2763
+ return yy_current_state;
2764
+ }
2765
+
2766
+ /* yy_try_NUL_trans - try to make a transition on the NUL character
2767
+ *
2768
+ * synopsis
2769
+ * next_state = yy_try_NUL_trans( current_state );
2770
+ */
2771
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2772
+ {
2773
+ register int yy_is_jam;
2774
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2775
+ register char *yy_cp = yyg->yy_c_buf_p;
2776
+
2777
+ register YY_CHAR yy_c = 1;
2778
+ if ( yy_accept[yy_current_state] )
2779
+ {
2780
+ yyg->yy_last_accepting_state = yy_current_state;
2781
+ yyg->yy_last_accepting_cpos = yy_cp;
2782
+ }
2783
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2784
+ {
2785
+ yy_current_state = (int) yy_def[yy_current_state];
2786
+ if ( yy_current_state >= 389 )
2787
+ yy_c = yy_meta[(unsigned int) yy_c];
2788
+ }
2789
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2790
+ yy_is_jam = (yy_current_state == 388);
2791
+
2792
+ return yy_is_jam ? 0 : yy_current_state;
2793
+ }
2794
+
2795
+ #ifndef YY_NO_INPUT
2796
+ #ifdef __cplusplus
2797
+ static int yyinput (yyscan_t yyscanner)
2798
+ #else
2799
+ static int input (yyscan_t yyscanner)
2800
+ #endif
2801
+
2802
+ {
2803
+ int c;
2804
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2805
+
2806
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
2807
+
2808
+ if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2809
+ {
2810
+ /* yy_c_buf_p now points to the character we want to return.
2811
+ * If this occurs *before* the EOB characters, then it's a
2812
+ * valid NUL; if not, then we've hit the end of the buffer.
2813
+ */
2814
+ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2815
+ /* This was really a NUL. */
2816
+ *yyg->yy_c_buf_p = '\0';
2817
+
2818
+ else
2819
+ { /* need more input */
2820
+ int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2821
+ ++yyg->yy_c_buf_p;
2822
+
2823
+ switch ( yy_get_next_buffer( yyscanner ) )
2824
+ {
2825
+ case EOB_ACT_LAST_MATCH:
2826
+ /* This happens because yy_g_n_b()
2827
+ * sees that we've accumulated a
2828
+ * token and flags that we need to
2829
+ * try matching the token before
2830
+ * proceeding. But for input(),
2831
+ * there's no matching to consider.
2832
+ * So convert the EOB_ACT_LAST_MATCH
2833
+ * to EOB_ACT_END_OF_FILE.
2834
+ */
2835
+
2836
+ /* Reset buffer status. */
2837
+ core_yyrestart(yyin ,yyscanner);
2838
+
2839
+ /*FALLTHROUGH*/
2840
+
2841
+ case EOB_ACT_END_OF_FILE:
2842
+ {
2843
+ if ( core_yywrap(yyscanner ) )
2844
+ return EOF;
2845
+
2846
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
2847
+ YY_NEW_FILE;
2848
+ #ifdef __cplusplus
2849
+ return yyinput(yyscanner);
2850
+ #else
2851
+ return input(yyscanner);
2852
+ #endif
2853
+ }
2854
+
2855
+ case EOB_ACT_CONTINUE_SCAN:
2856
+ yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2857
+ break;
2858
+ }
2859
+ }
2860
+ }
2861
+
2862
+ c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2863
+ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2864
+ yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2865
+
2866
+ return c;
2867
+ }
2868
+ #endif /* ifndef YY_NO_INPUT */
2869
+
2870
+ /** Immediately switch to a different input stream.
2871
+ * @param input_file A readable stream.
2872
+ * @param yyscanner The scanner object.
2873
+ * @note This function does not reset the start condition to @c INITIAL .
2874
+ */
2875
+ void core_yyrestart (FILE * input_file , yyscan_t yyscanner)
2876
+ {
2877
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2878
+
2879
+ if ( ! YY_CURRENT_BUFFER ){
2880
+ core_yyensure_buffer_stack (yyscanner);
2881
+ YY_CURRENT_BUFFER_LVALUE =
2882
+ core_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2883
+ }
2884
+
2885
+ core_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2886
+ core_yy_load_buffer_state(yyscanner );
2887
+ }
2888
+
2889
+ /** Switch to a different input buffer.
2890
+ * @param new_buffer The new input buffer.
2891
+ * @param yyscanner The scanner object.
2892
+ */
2893
+ void core_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2894
+ {
2895
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2896
+
2897
+ /* TODO. We should be able to replace this entire function body
2898
+ * with
2899
+ * core_yypop_buffer_state();
2900
+ * core_yypush_buffer_state(new_buffer);
2901
+ */
2902
+ core_yyensure_buffer_stack (yyscanner);
2903
+ if ( YY_CURRENT_BUFFER == new_buffer )
2904
+ return;
2905
+
2906
+ if ( YY_CURRENT_BUFFER )
2907
+ {
2908
+ /* Flush out information for old buffer. */
2909
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
2910
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2911
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2912
+ }
2913
+
2914
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
2915
+ core_yy_load_buffer_state(yyscanner );
2916
+
2917
+ /* We don't actually know whether we did this switch during
2918
+ * EOF (core_yywrap()) processing, but the only time this flag
2919
+ * is looked at is after core_yywrap() is called, so it's safe
2920
+ * to go ahead and always set it.
2921
+ */
2922
+ yyg->yy_did_buffer_switch_on_eof = 1;
2923
+ }
2924
+
2925
+ static void core_yy_load_buffer_state (yyscan_t yyscanner)
2926
+ {
2927
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2928
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2929
+ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2930
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2931
+ yyg->yy_hold_char = *yyg->yy_c_buf_p;
2932
+ }
2933
+
2934
+ /** Allocate and initialize an input buffer state.
2935
+ * @param file A readable stream.
2936
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2937
+ * @param yyscanner The scanner object.
2938
+ * @return the allocated buffer state.
2939
+ */
2940
+ YY_BUFFER_STATE core_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
2941
+ {
2942
+ YY_BUFFER_STATE b;
2943
+
2944
+ b = (YY_BUFFER_STATE) core_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2945
+ if ( ! b )
2946
+ YY_FATAL_ERROR( "out of dynamic memory in core_yy_create_buffer()" );
2947
+
2948
+ b->yy_buf_size = size;
2949
+
2950
+ /* yy_ch_buf has to be 2 characters longer than the size given because
2951
+ * we need to put in 2 end-of-buffer characters.
2952
+ */
2953
+ b->yy_ch_buf = (char *) core_yyalloc(b->yy_buf_size + 2 ,yyscanner );
2954
+ if ( ! b->yy_ch_buf )
2955
+ YY_FATAL_ERROR( "out of dynamic memory in core_yy_create_buffer()" );
2956
+
2957
+ b->yy_is_our_buffer = 1;
2958
+
2959
+ core_yy_init_buffer(b,file ,yyscanner);
2960
+
2961
+ return b;
2962
+ }
2963
+
2964
+ /** Destroy the buffer.
2965
+ * @param b a buffer created with core_yy_create_buffer()
2966
+ * @param yyscanner The scanner object.
2967
+ */
2968
+ void core_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2969
+ {
2970
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2971
+
2972
+ if ( ! b )
2973
+ return;
2974
+
2975
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2976
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2977
+
2978
+ if ( b->yy_is_our_buffer )
2979
+ core_yyfree((void *) b->yy_ch_buf ,yyscanner );
2980
+
2981
+ core_yyfree((void *) b ,yyscanner );
2982
+ }
2983
+
2984
+ /* Initializes or reinitializes a buffer.
2985
+ * This function is sometimes called more than once on the same buffer,
2986
+ * such as during a core_yyrestart() or at EOF.
2987
+ */
2988
+ static void core_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2989
+
2990
+ {
2991
+ int oerrno = errno;
2992
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2993
+
2994
+ core_yy_flush_buffer(b ,yyscanner);
2995
+
2996
+ b->yy_input_file = file;
2997
+ b->yy_fill_buffer = 1;
2998
+
2999
+ /* If b is the current buffer, then core_yy_init_buffer was _probably_
3000
+ * called from core_yyrestart() or through yy_get_next_buffer.
3001
+ * In that case, we don't want to reset the lineno or column.
3002
+ */
3003
+ if (b != YY_CURRENT_BUFFER){
3004
+ b->yy_bs_lineno = 1;
3005
+ b->yy_bs_column = 0;
3006
+ }
3007
+
3008
+ b->yy_is_interactive = 0;
3009
+
3010
+ errno = oerrno;
3011
+ }
3012
+
3013
+ /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3014
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3015
+ * @param yyscanner The scanner object.
3016
+ */
3017
+ void core_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
3018
+ {
3019
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3020
+ if ( ! b )
3021
+ return;
3022
+
3023
+ b->yy_n_chars = 0;
3024
+
3025
+ /* We always need two end-of-buffer characters. The first causes
3026
+ * a transition to the end-of-buffer state. The second causes
3027
+ * a jam in that state.
3028
+ */
3029
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3030
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3031
+
3032
+ b->yy_buf_pos = &b->yy_ch_buf[0];
3033
+
3034
+ b->yy_at_bol = 1;
3035
+ b->yy_buffer_status = YY_BUFFER_NEW;
3036
+
3037
+ if ( b == YY_CURRENT_BUFFER )
3038
+ core_yy_load_buffer_state(yyscanner );
3039
+ }
3040
+
3041
+ /** Pushes the new state onto the stack. The new state becomes
3042
+ * the current state. This function will allocate the stack
3043
+ * if necessary.
3044
+ * @param new_buffer The new state.
3045
+ * @param yyscanner The scanner object.
3046
+ */
3047
+ void core_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
3048
+ {
3049
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3050
+ if (new_buffer == NULL)
3051
+ return;
3052
+
3053
+ core_yyensure_buffer_stack(yyscanner);
3054
+
3055
+ /* This block is copied from core_yy_switch_to_buffer. */
3056
+ if ( YY_CURRENT_BUFFER )
3057
+ {
3058
+ /* Flush out information for old buffer. */
3059
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
3060
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
3061
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
3062
+ }
3063
+
3064
+ /* Only push if top exists. Otherwise, replace top. */
3065
+ if (YY_CURRENT_BUFFER)
3066
+ yyg->yy_buffer_stack_top++;
3067
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
3068
+
3069
+ /* copied from core_yy_switch_to_buffer. */
3070
+ core_yy_load_buffer_state(yyscanner );
3071
+ yyg->yy_did_buffer_switch_on_eof = 1;
3072
+ }
3073
+
3074
+ /** Removes and deletes the top of the stack, if present.
3075
+ * The next element becomes the new top.
3076
+ * @param yyscanner The scanner object.
3077
+ */
3078
+ void core_yypop_buffer_state (yyscan_t yyscanner)
3079
+ {
3080
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3081
+ if (!YY_CURRENT_BUFFER)
3082
+ return;
3083
+
3084
+ core_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
3085
+ YY_CURRENT_BUFFER_LVALUE = NULL;
3086
+ if (yyg->yy_buffer_stack_top > 0)
3087
+ --yyg->yy_buffer_stack_top;
3088
+
3089
+ if (YY_CURRENT_BUFFER) {
3090
+ core_yy_load_buffer_state(yyscanner );
3091
+ yyg->yy_did_buffer_switch_on_eof = 1;
3092
+ }
3093
+ }
3094
+
3095
+ /* Allocates the stack if it does not exist.
3096
+ * Guarantees space for at least one push.
3097
+ */
3098
+ static void core_yyensure_buffer_stack (yyscan_t yyscanner)
3099
+ {
3100
+ int num_to_alloc;
3101
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3102
+
3103
+ if (!yyg->yy_buffer_stack) {
3104
+
3105
+ /* First allocation is just for 2 elements, since we don't know if this
3106
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
3107
+ * immediate realloc on the next call.
3108
+ */
3109
+ num_to_alloc = 1;
3110
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)core_yyalloc
3111
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
3112
+ , yyscanner);
3113
+ if ( ! yyg->yy_buffer_stack )
3114
+ YY_FATAL_ERROR( "out of dynamic memory in core_yyensure_buffer_stack()" );
3115
+
3116
+ memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3117
+
3118
+ yyg->yy_buffer_stack_max = num_to_alloc;
3119
+ yyg->yy_buffer_stack_top = 0;
3120
+ return;
3121
+ }
3122
+
3123
+ if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
3124
+
3125
+ /* Increase the buffer to prepare for a possible push. */
3126
+ int grow_size = 8 /* arbitrary grow size */;
3127
+
3128
+ num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
3129
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)core_yyrealloc
3130
+ (yyg->yy_buffer_stack,
3131
+ num_to_alloc * sizeof(struct yy_buffer_state*)
3132
+ , yyscanner);
3133
+ if ( ! yyg->yy_buffer_stack )
3134
+ YY_FATAL_ERROR( "out of dynamic memory in core_yyensure_buffer_stack()" );
3135
+
3136
+ /* zero only the new slots.*/
3137
+ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
3138
+ yyg->yy_buffer_stack_max = num_to_alloc;
3139
+ }
3140
+ }
3141
+
3142
+ /** Setup the input buffer state to scan directly from a user-specified character buffer.
3143
+ * @param base the character buffer
3144
+ * @param size the size in bytes of the character buffer
3145
+ * @param yyscanner The scanner object.
3146
+ * @return the newly allocated buffer state object.
3147
+ */
3148
+ YY_BUFFER_STATE core_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
3149
+ {
3150
+ YY_BUFFER_STATE b;
3151
+
3152
+ if ( size < 2 ||
3153
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
3154
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
3155
+ /* They forgot to leave room for the EOB's. */
3156
+ return 0;
3157
+
3158
+ b = (YY_BUFFER_STATE) core_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
3159
+ if ( ! b )
3160
+ YY_FATAL_ERROR( "out of dynamic memory in core_yy_scan_buffer()" );
3161
+
3162
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3163
+ b->yy_buf_pos = b->yy_ch_buf = base;
3164
+ b->yy_is_our_buffer = 0;
3165
+ b->yy_input_file = 0;
3166
+ b->yy_n_chars = b->yy_buf_size;
3167
+ b->yy_is_interactive = 0;
3168
+ b->yy_at_bol = 1;
3169
+ b->yy_fill_buffer = 0;
3170
+ b->yy_buffer_status = YY_BUFFER_NEW;
3171
+
3172
+ core_yy_switch_to_buffer(b ,yyscanner );
3173
+
3174
+ return b;
3175
+ }
3176
+
3177
+ /** Setup the input buffer state to scan a string. The next call to core_yylex() will
3178
+ * scan from a @e copy of @a str.
3179
+ * @param yystr a NUL-terminated string to scan
3180
+ * @param yyscanner The scanner object.
3181
+ * @return the newly allocated buffer state object.
3182
+ * @note If you want to scan bytes that may contain NUL values, then use
3183
+ * core_yy_scan_bytes() instead.
3184
+ */
3185
+ YY_BUFFER_STATE core_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
3186
+ {
3187
+
3188
+ return core_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
3189
+ }
3190
+
3191
+ /** Setup the input buffer state to scan the given bytes. The next call to core_yylex() will
3192
+ * scan from a @e copy of @a bytes.
3193
+ * @param bytes the byte buffer to scan
3194
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
3195
+ * @param yyscanner The scanner object.
3196
+ * @return the newly allocated buffer state object.
3197
+ */
3198
+ YY_BUFFER_STATE core_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
3199
+ {
3200
+ YY_BUFFER_STATE b;
3201
+ char *buf;
3202
+ yy_size_t n;
3203
+ int i;
3204
+
3205
+ /* Get memory for full buffer, including space for trailing EOB's. */
3206
+ n = _yybytes_len + 2;
3207
+ buf = (char *) core_yyalloc(n ,yyscanner );
3208
+ if ( ! buf )
3209
+ YY_FATAL_ERROR( "out of dynamic memory in core_yy_scan_bytes()" );
3210
+
3211
+ for ( i = 0; i < _yybytes_len; ++i )
3212
+ buf[i] = yybytes[i];
3213
+
3214
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3215
+
3216
+ b = core_yy_scan_buffer(buf,n ,yyscanner);
3217
+ if ( ! b )
3218
+ YY_FATAL_ERROR( "bad buffer in core_yy_scan_bytes()" );
3219
+
3220
+ /* It's okay to grow etc. this buffer, and we should throw it
3221
+ * away when we're done.
3222
+ */
3223
+ b->yy_is_our_buffer = 1;
3224
+
3225
+ return b;
3226
+ }
3227
+
3228
+ #ifndef YY_EXIT_FAILURE
3229
+ #define YY_EXIT_FAILURE 2
3230
+ #endif
3231
+
3232
+ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
3233
+ {
3234
+ (void) fprintf( stderr, "%s\n", msg );
3235
+ exit( YY_EXIT_FAILURE );
3236
+ }
3237
+
3238
+ /* Redefine yyless() so it works in section 3 code. */
3239
+
3240
+ #undef yyless
3241
+ #define yyless(n) \
3242
+ do \
3243
+ { \
3244
+ /* Undo effects of setting up yytext. */ \
3245
+ int yyless_macro_arg = (n); \
3246
+ YY_LESS_LINENO(yyless_macro_arg);\
3247
+ yytext[yyleng] = yyg->yy_hold_char; \
3248
+ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
3249
+ yyg->yy_hold_char = *yyg->yy_c_buf_p; \
3250
+ *yyg->yy_c_buf_p = '\0'; \
3251
+ yyleng = yyless_macro_arg; \
3252
+ } \
3253
+ while ( 0 )
3254
+
3255
+ /* Accessor methods (get/set functions) to struct members. */
3256
+
3257
+ /** Get the user-defined data for this scanner.
3258
+ * @param yyscanner The scanner object.
3259
+ */
3260
+ YY_EXTRA_TYPE core_yyget_extra (yyscan_t yyscanner)
3261
+ {
3262
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3263
+ return yyextra;
3264
+ }
3265
+
3266
+ /** Get the current line number.
3267
+ * @param yyscanner The scanner object.
3268
+ */
3269
+ int core_yyget_lineno (yyscan_t yyscanner)
3270
+ {
3271
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3272
+
3273
+ if (! YY_CURRENT_BUFFER)
3274
+ return 0;
3275
+
3276
+ return yylineno;
3277
+ }
3278
+
3279
+ /** Get the current column number.
3280
+ * @param yyscanner The scanner object.
3281
+ */
3282
+ int core_yyget_column (yyscan_t yyscanner)
3283
+ {
3284
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3285
+
3286
+ if (! YY_CURRENT_BUFFER)
3287
+ return 0;
3288
+
3289
+ return yycolumn;
3290
+ }
3291
+
3292
+ /** Get the input stream.
3293
+ * @param yyscanner The scanner object.
3294
+ */
3295
+ FILE *core_yyget_in (yyscan_t yyscanner)
3296
+ {
3297
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3298
+ return yyin;
3299
+ }
3300
+
3301
+ /** Get the output stream.
3302
+ * @param yyscanner The scanner object.
3303
+ */
3304
+ FILE *core_yyget_out (yyscan_t yyscanner)
3305
+ {
3306
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3307
+ return yyout;
3308
+ }
3309
+
3310
+ /** Get the length of the current token.
3311
+ * @param yyscanner The scanner object.
3312
+ */
3313
+ int core_yyget_leng (yyscan_t yyscanner)
3314
+ {
3315
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3316
+ return yyleng;
3317
+ }
3318
+
3319
+ /** Get the current token.
3320
+ * @param yyscanner The scanner object.
3321
+ */
3322
+
3323
+ char *core_yyget_text (yyscan_t yyscanner)
3324
+ {
3325
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3326
+ return yytext;
3327
+ }
3328
+
3329
+ /** Set the user-defined data. This data is never touched by the scanner.
3330
+ * @param user_defined The data to be associated with this scanner.
3331
+ * @param yyscanner The scanner object.
3332
+ */
3333
+ void core_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3334
+ {
3335
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3336
+ yyextra = user_defined ;
3337
+ }
3338
+
3339
+ /** Set the current line number.
3340
+ * @param line_number
3341
+ * @param yyscanner The scanner object.
3342
+ */
3343
+ void core_yyset_lineno (int line_number , yyscan_t yyscanner)
3344
+ {
3345
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3346
+
3347
+ /* lineno is only valid if an input buffer exists. */
3348
+ if (! YY_CURRENT_BUFFER )
3349
+ yy_fatal_error( "core_yyset_lineno called with no buffer" , yyscanner);
3350
+
3351
+ yylineno = line_number;
3352
+ }
3353
+
3354
+ /** Set the current column.
3355
+ * @param line_number
3356
+ * @param yyscanner The scanner object.
3357
+ */
3358
+ void core_yyset_column (int column_no , yyscan_t yyscanner)
3359
+ {
3360
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3361
+
3362
+ /* column is only valid if an input buffer exists. */
3363
+ if (! YY_CURRENT_BUFFER )
3364
+ yy_fatal_error( "core_yyset_column called with no buffer" , yyscanner);
3365
+
3366
+ yycolumn = column_no;
3367
+ }
3368
+
3369
+ /** Set the input stream. This does not discard the current
3370
+ * input buffer.
3371
+ * @param in_str A readable stream.
3372
+ * @param yyscanner The scanner object.
3373
+ * @see core_yy_switch_to_buffer
3374
+ */
3375
+ void core_yyset_in (FILE * in_str , yyscan_t yyscanner)
3376
+ {
3377
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3378
+ yyin = in_str ;
3379
+ }
3380
+
3381
+ void core_yyset_out (FILE * out_str , yyscan_t yyscanner)
3382
+ {
3383
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3384
+ yyout = out_str ;
3385
+ }
3386
+
3387
+ int core_yyget_debug (yyscan_t yyscanner)
3388
+ {
3389
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3390
+ return yy_flex_debug;
3391
+ }
3392
+
3393
+ void core_yyset_debug (int bdebug , yyscan_t yyscanner)
3394
+ {
3395
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3396
+ yy_flex_debug = bdebug ;
3397
+ }
3398
+
3399
+ /* Accessor methods for yylval and yylloc */
3400
+
3401
+ YYSTYPE * core_yyget_lval (yyscan_t yyscanner)
3402
+ {
3403
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3404
+ return yylval;
3405
+ }
3406
+
3407
+ void core_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
3408
+ {
3409
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3410
+ yylval = yylval_param;
3411
+ }
3412
+
3413
+ YYLTYPE *core_yyget_lloc (yyscan_t yyscanner)
3414
+ {
3415
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3416
+ return yylloc;
3417
+ }
3418
+
3419
+ void core_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
3420
+ {
3421
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3422
+ yylloc = yylloc_param;
3423
+ }
3424
+
3425
+ /* User-visible API */
3426
+
3427
+ /* core_yylex_init is special because it creates the scanner itself, so it is
3428
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
3429
+ * That's why we explicitly handle the declaration, instead of using our macros.
3430
+ */
3431
+
3432
+ int core_yylex_init(yyscan_t* ptr_yy_globals)
3433
+
3434
+ {
3435
+ if (ptr_yy_globals == NULL){
3436
+ errno = EINVAL;
3437
+ return 1;
3438
+ }
3439
+
3440
+ *ptr_yy_globals = (yyscan_t) core_yyalloc ( sizeof( struct yyguts_t ), NULL );
3441
+
3442
+ if (*ptr_yy_globals == NULL){
3443
+ errno = ENOMEM;
3444
+ return 1;
3445
+ }
3446
+
3447
+ /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3448
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3449
+
3450
+ return yy_init_globals ( *ptr_yy_globals );
3451
+ }
3452
+
3453
+ /* core_yylex_init_extra has the same functionality as core_yylex_init, but follows the
3454
+ * convention of taking the scanner as the last argument. Note however, that
3455
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
3456
+ * is the reason, too, why this function also must handle its own declaration).
3457
+ * The user defined value in the first argument will be available to core_yyalloc in
3458
+ * the yyextra field.
3459
+ */
3460
+
3461
+ int core_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3462
+
3463
+ {
3464
+ struct yyguts_t dummy_yyguts;
3465
+
3466
+ core_yyset_extra (yy_user_defined, &dummy_yyguts);
3467
+
3468
+ if (ptr_yy_globals == NULL){
3469
+ errno = EINVAL;
3470
+ return 1;
3471
+ }
3472
+
3473
+ *ptr_yy_globals = (yyscan_t) core_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3474
+
3475
+ if (*ptr_yy_globals == NULL){
3476
+ errno = ENOMEM;
3477
+ return 1;
3478
+ }
3479
+
3480
+ /* By setting to 0xAA, we expose bugs in
3481
+ yy_init_globals. Leave at 0x00 for releases. */
3482
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3483
+
3484
+ core_yyset_extra (yy_user_defined, *ptr_yy_globals);
3485
+
3486
+ return yy_init_globals ( *ptr_yy_globals );
3487
+ }
3488
+
3489
+ static int yy_init_globals (yyscan_t yyscanner)
3490
+ {
3491
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3492
+ /* Initialization is the same as for the non-reentrant scanner.
3493
+ * This function is called from core_yylex_destroy(), so don't allocate here.
3494
+ */
3495
+
3496
+ yyg->yy_buffer_stack = 0;
3497
+ yyg->yy_buffer_stack_top = 0;
3498
+ yyg->yy_buffer_stack_max = 0;
3499
+ yyg->yy_c_buf_p = (char *) 0;
3500
+ yyg->yy_init = 0;
3501
+ yyg->yy_start = 0;
3502
+
3503
+ yyg->yy_start_stack_ptr = 0;
3504
+ yyg->yy_start_stack_depth = 0;
3505
+ yyg->yy_start_stack = NULL;
3506
+
3507
+ /* Defined in main.c */
3508
+ #ifdef YY_STDINIT
3509
+ yyin = stdin;
3510
+ yyout = stdout;
3511
+ #else
3512
+ yyin = (FILE *) 0;
3513
+ yyout = (FILE *) 0;
3514
+ #endif
3515
+
3516
+ /* For future reference: Set errno on error, since we are called by
3517
+ * core_yylex_init()
3518
+ */
3519
+ return 0;
3520
+ }
3521
+
3522
+ /* core_yylex_destroy is for both reentrant and non-reentrant scanners. */
3523
+ int core_yylex_destroy (yyscan_t yyscanner)
3524
+ {
3525
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3526
+
3527
+ /* Pop the buffer stack, destroying each element. */
3528
+ while(YY_CURRENT_BUFFER){
3529
+ core_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3530
+ YY_CURRENT_BUFFER_LVALUE = NULL;
3531
+ core_yypop_buffer_state(yyscanner);
3532
+ }
3533
+
3534
+ /* Destroy the stack itself. */
3535
+ core_yyfree(yyg->yy_buffer_stack ,yyscanner);
3536
+ yyg->yy_buffer_stack = NULL;
3537
+
3538
+ /* Destroy the start condition stack. */
3539
+ core_yyfree(yyg->yy_start_stack ,yyscanner );
3540
+ yyg->yy_start_stack = NULL;
3541
+
3542
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
3543
+ * core_yylex() is called, initialization will occur. */
3544
+ yy_init_globals( yyscanner);
3545
+
3546
+ /* Destroy the main struct (reentrant only). */
3547
+ core_yyfree ( yyscanner , yyscanner );
3548
+ yyscanner = NULL;
3549
+ return 0;
3550
+ }
3551
+
3552
+ /*
3553
+ * Internal utility routines.
3554
+ */
3555
+
3556
+ #ifndef yytext_ptr
3557
+ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3558
+ {
3559
+ register int i;
3560
+ for ( i = 0; i < n; ++i )
3561
+ s1[i] = s2[i];
3562
+ }
3563
+ #endif
3564
+
3565
+ #ifdef YY_NEED_STRLEN
3566
+ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3567
+ {
3568
+ register int n;
3569
+ for ( n = 0; s[n]; ++n )
3570
+ ;
3571
+
3572
+ return n;
3573
+ }
3574
+ #endif
3575
+
3576
+ #define YYTABLES_NAME "yytables"
3577
+
3578
+ #line 938 "scan.l"
3579
+
3580
+
3581
+
3582
+ /*
3583
+ * Arrange access to yyextra for subroutines of the main core_yylex() function.
3584
+ * We expect each subroutine to have a yyscanner parameter. Rather than
3585
+ * use the yyget_xxx functions, which might or might not get inlined by the
3586
+ * compiler, we cheat just a bit and cast yyscanner to the right type.
3587
+ */
3588
+ #undef yyextra
3589
+ #define yyextra (((struct yyguts_t *) yyscanner)->yyextra_r)
3590
+
3591
+ /* Likewise for a couple of other things we need. */
3592
+ #undef yylloc
3593
+ #define yylloc (((struct yyguts_t *) yyscanner)->yylloc_r)
3594
+ #undef yyleng
3595
+ #define yyleng (((struct yyguts_t *) yyscanner)->yyleng_r)
3596
+
3597
+
3598
+ /*
3599
+ * scanner_errposition
3600
+ * Report a lexer or grammar error cursor position, if possible.
3601
+ *
3602
+ * This is expected to be used within an ereport() call. The return value
3603
+ * is a dummy (always 0, in fact).
3604
+ *
3605
+ * Note that this can only be used for messages emitted during raw parsing
3606
+ * (essentially, scan.l and gram.y), since it requires the yyscanner struct
3607
+ * to still be available.
3608
+ */
3609
+ int
3610
+ scanner_errposition(int location, core_yyscan_t yyscanner)
3611
+ {
3612
+ #ifdef PGPOOL_NOT_USED
3613
+ int pos;
3614
+
3615
+ if (location < 0)
3616
+ return 0; /* no-op if location is unknown */
3617
+
3618
+ /* Convert byte offset to character number */
3619
+ pos = pg_mbstrlen_with_len(yyextra->scanbuf, location) + 1;
3620
+ /* And pass it to the ereport mechanism */
3621
+ return errposition(pos);
3622
+ #endif
3623
+ return 0;
3624
+ }
3625
+
3626
+ /*
3627
+ * scanner_yyerror
3628
+ * Report a lexer or grammar error.
3629
+ *
3630
+ * The message's cursor position is whatever YYLLOC was last set to,
3631
+ * ie, the start of the current token if called within core_yylex(), or the
3632
+ * most recently lexed token if called from the grammar.
3633
+ * This is OK for syntax error messages from the Bison parser, because Bison
3634
+ * parsers report error as soon as the first unparsable token is reached.
3635
+ * Beware of using yyerror for other purposes, as the cursor position might
3636
+ * be misleading!
3637
+ */
3638
+ void
3639
+ scanner_yyerror(const char *message, core_yyscan_t yyscanner)
3640
+ {
3641
+ const char *loc = yyextra->scanbuf + *yylloc;
3642
+
3643
+ if (*loc == YY_END_OF_BUFFER_CHAR)
3644
+ {
3645
+ ereport(ERROR,
3646
+ (errcode(ERRCODE_SYNTAX_ERROR),
3647
+ /* translator: %s is typically the translation of "syntax error" */
3648
+ errmsg("%s at end of input", _(message)),
3649
+ lexer_errposition()));
3650
+ }
3651
+ else
3652
+ {
3653
+ ereport(ERROR,
3654
+ (errcode(ERRCODE_SYNTAX_ERROR),
3655
+ /* translator: first %s is typically the translation of "syntax error" */
3656
+ errmsg("%s at or near \"%s\"", _(message), loc),
3657
+ lexer_errposition()));
3658
+ }
3659
+ }
3660
+
3661
+
3662
+ /*
3663
+ * Called before any actual parsing is done
3664
+ */
3665
+ core_yyscan_t
3666
+ scanner_init(const char *str,
3667
+ core_yy_extra_type *yyext,
3668
+ const ScanKeyword *keywords,
3669
+ int num_keywords)
3670
+ {
3671
+ Size slen = strlen(str);
3672
+ yyscan_t scanner;
3673
+
3674
+ if (core_yylex_init(&scanner) != 0)
3675
+ elog(ERROR, "core_yylex_init() failed: %m");
3676
+
3677
+ core_yyset_extra(yyext, scanner);
3678
+
3679
+ yyext->keywords = keywords;
3680
+ yyext->num_keywords = num_keywords;
3681
+
3682
+ /*
3683
+ * Make a scan buffer with special termination needed by flex.
3684
+ */
3685
+ yyext->scanbuf = (char *) palloc(slen + 2);
3686
+ yyext->scanbuflen = slen;
3687
+ memcpy(yyext->scanbuf, str, slen);
3688
+ yyext->scanbuf[slen] = yyext->scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
3689
+ core_yy_scan_buffer(yyext->scanbuf,slen + 2,scanner);
3690
+
3691
+ /* initialize literal buffer to a reasonable but expansible size */
3692
+ yyext->literalalloc = 1024;
3693
+ yyext->literalbuf = (char *) palloc(yyext->literalalloc);
3694
+ yyext->literallen = 0;
3695
+
3696
+ return scanner;
3697
+ }
3698
+
3699
+
3700
+ /*
3701
+ * Called after parsing is done to clean up after scanner_init()
3702
+ */
3703
+ void
3704
+ scanner_finish(core_yyscan_t yyscanner)
3705
+ {
3706
+ /*
3707
+ * We don't bother to call core_yylex_destroy(), because all it would do
3708
+ * is pfree a small amount of control storage. It's cheaper to leak
3709
+ * the storage until the parsing context is destroyed. The amount of
3710
+ * space involved is usually negligible compared to the output parse
3711
+ * tree anyway.
3712
+ *
3713
+ * We do bother to pfree the scanbuf and literal buffer, but only if they
3714
+ * represent a nontrivial amount of space. The 8K cutoff is arbitrary.
3715
+ */
3716
+ if (yyextra->scanbuflen >= 8192)
3717
+ pfree(yyextra->scanbuf);
3718
+ if (yyextra->literalalloc >= 8192)
3719
+ pfree(yyextra->literalbuf);
3720
+ }
3721
+
3722
+
3723
+ static void
3724
+ addlit(char *ytext, int yleng, core_yyscan_t yyscanner)
3725
+ {
3726
+ /* enlarge buffer if needed */
3727
+ if ((yyextra->literallen + yleng) >= yyextra->literalalloc)
3728
+ {
3729
+ do {
3730
+ yyextra->literalalloc *= 2;
3731
+ } while ((yyextra->literallen + yleng) >= yyextra->literalalloc);
3732
+ yyextra->literalbuf = (char *) repalloc(yyextra->literalbuf,
3733
+ yyextra->literalalloc);
3734
+ }
3735
+ /* append new data */
3736
+ memcpy(yyextra->literalbuf + yyextra->literallen, ytext, yleng);
3737
+ yyextra->literallen += yleng;
3738
+ }
3739
+
3740
+
3741
+ static void
3742
+ addlitchar(unsigned char ychar, core_yyscan_t yyscanner)
3743
+ {
3744
+ /* enlarge buffer if needed */
3745
+ if ((yyextra->literallen + 1) >= yyextra->literalalloc)
3746
+ {
3747
+ yyextra->literalalloc *= 2;
3748
+ yyextra->literalbuf = (char *) repalloc(yyextra->literalbuf,
3749
+ yyextra->literalalloc);
3750
+ }
3751
+ /* append new data */
3752
+ yyextra->literalbuf[yyextra->literallen] = ychar;
3753
+ yyextra->literallen += 1;
3754
+ }
3755
+
3756
+
3757
+ /*
3758
+ * Create a palloc'd copy of literalbuf, adding a trailing null.
3759
+ */
3760
+ static char *
3761
+ litbufdup(core_yyscan_t yyscanner)
3762
+ {
3763
+ int llen = yyextra->literallen;
3764
+ char *new;
3765
+
3766
+ new = palloc(llen + 1);
3767
+ memcpy(new, yyextra->literalbuf, llen);
3768
+ new[llen] = '\0';
3769
+ return new;
3770
+ }
3771
+
3772
+ static int
3773
+ process_integer_literal(const char *token, YYSTYPE *lval)
3774
+ {
3775
+ long val;
3776
+ char *endptr;
3777
+
3778
+ errno = 0;
3779
+ val = strtol(token, &endptr, 10);
3780
+ if (*endptr != '\0' || errno == ERANGE
3781
+ #ifdef HAVE_LONG_INT_64
3782
+ /* if long > 32 bits, check for overflow of int4 */
3783
+ || val != (long) ((int32) val)
3784
+ #endif
3785
+ )
3786
+ {
3787
+ /* integer too large, treat it as a float */
3788
+ lval->str = pstrdup(token);
3789
+ return FCONST;
3790
+ }
3791
+ lval->ival = val;
3792
+ return ICONST;
3793
+ }
3794
+
3795
+ static unsigned int
3796
+ hexval(unsigned char c)
3797
+ {
3798
+ if (c >= '0' && c <= '9')
3799
+ return c - '0';
3800
+ if (c >= 'a' && c <= 'f')
3801
+ return c - 'a' + 0xA;
3802
+ if (c >= 'A' && c <= 'F')
3803
+ return c - 'A' + 0xA;
3804
+ elog(ERROR, "invalid hexadecimal digit");
3805
+ return 0; /* not reached */
3806
+ }
3807
+
3808
+ static void
3809
+ check_unicode_value(pg_wchar c, char *loc, core_yyscan_t yyscanner)
3810
+ {
3811
+ if (GetDatabaseEncoding() == PG_UTF8)
3812
+ return;
3813
+
3814
+ if (c > 0x7F)
3815
+ {
3816
+ ADVANCE_YYLLOC(loc - yyextra->literalbuf + 3); /* 3 for U&" */
3817
+ yyerror("Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8");
3818
+ }
3819
+ }
3820
+
3821
+ static bool
3822
+ is_utf16_surrogate_first(pg_wchar c)
3823
+ {
3824
+ return (c >= 0xD800 && c <= 0xDBFF);
3825
+ }
3826
+
3827
+ static bool
3828
+ is_utf16_surrogate_second(pg_wchar c)
3829
+ {
3830
+ return (c >= 0xDC00 && c <= 0xDFFF);
3831
+ }
3832
+
3833
+ static pg_wchar
3834
+ surrogate_pair_to_codepoint(pg_wchar first, pg_wchar second)
3835
+ {
3836
+ return ((first & 0x3FF) << 10) + 0x10000 + (second & 0x3FF);
3837
+ }
3838
+
3839
+ static void
3840
+ addunicode(pg_wchar c, core_yyscan_t yyscanner)
3841
+ {
3842
+ char buf[8];
3843
+
3844
+ if (c == 0 || c > 0x10FFFF)
3845
+ yyerror("invalid Unicode escape value");
3846
+ if (c > 0x7F)
3847
+ {
3848
+ if (GetDatabaseEncoding() != PG_UTF8)
3849
+ yyerror("Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8");
3850
+ yyextra->saw_non_ascii = true;
3851
+ }
3852
+ unicode_to_utf8(c, (unsigned char *) buf);
3853
+ addlit(buf, pg_mblen(buf), yyscanner);
3854
+ }
3855
+
3856
+ static char *
3857
+ litbuf_udeescape(unsigned char escape, core_yyscan_t yyscanner)
3858
+ {
3859
+ char *new;
3860
+ char *litbuf, *in, *out;
3861
+ pg_wchar pair_first = 0;
3862
+
3863
+ if (isxdigit(escape)
3864
+ || escape == '+'
3865
+ || escape == '\''
3866
+ || escape == '"'
3867
+ || scanner_isspace(escape))
3868
+ {
3869
+ ADVANCE_YYLLOC(yyextra->literallen + yyleng + 1);
3870
+ yyerror("invalid Unicode escape character");
3871
+ }
3872
+
3873
+ /* Make literalbuf null-terminated to simplify the scanning loop */
3874
+ litbuf = yyextra->literalbuf;
3875
+ litbuf[yyextra->literallen] = '\0';
3876
+
3877
+ /*
3878
+ * This relies on the subtle assumption that a UTF-8 expansion
3879
+ * cannot be longer than its escaped representation.
3880
+ */
3881
+ new = palloc(yyextra->literallen + 1);
3882
+
3883
+ in = litbuf;
3884
+ out = new;
3885
+ while (*in)
3886
+ {
3887
+ if (in[0] == escape)
3888
+ {
3889
+ if (in[1] == escape)
3890
+ {
3891
+ if (pair_first)
3892
+ {
3893
+ ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */
3894
+ yyerror("invalid Unicode surrogate pair");
3895
+ }
3896
+ *out++ = escape;
3897
+ in += 2;
3898
+ }
3899
+ else if (isxdigit((unsigned char) in[1]) &&
3900
+ isxdigit((unsigned char) in[2]) &&
3901
+ isxdigit((unsigned char) in[3]) &&
3902
+ isxdigit((unsigned char) in[4]))
3903
+ {
3904
+ pg_wchar unicode;
3905
+
3906
+ unicode = (hexval(in[1]) << 12) +
3907
+ (hexval(in[2]) << 8) +
3908
+ (hexval(in[3]) << 4) +
3909
+ hexval(in[4]);
3910
+ check_unicode_value(unicode, in, yyscanner);
3911
+ if (pair_first)
3912
+ {
3913
+ if (is_utf16_surrogate_second(unicode))
3914
+ {
3915
+ unicode = surrogate_pair_to_codepoint(pair_first, unicode);
3916
+ pair_first = 0;
3917
+ }
3918
+ else
3919
+ {
3920
+ ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */
3921
+ yyerror("invalid Unicode surrogate pair");
3922
+ }
3923
+ }
3924
+ else if (is_utf16_surrogate_second(unicode))
3925
+ yyerror("invalid Unicode surrogate pair");
3926
+
3927
+ if (is_utf16_surrogate_first(unicode))
3928
+ pair_first = unicode;
3929
+ else
3930
+ {
3931
+ unicode_to_utf8(unicode, (unsigned char *) out);
3932
+ out += pg_mblen(out);
3933
+ }
3934
+ in += 5;
3935
+ }
3936
+ else if (in[1] == '+' &&
3937
+ isxdigit((unsigned char) in[2]) &&
3938
+ isxdigit((unsigned char) in[3]) &&
3939
+ isxdigit((unsigned char) in[4]) &&
3940
+ isxdigit((unsigned char) in[5]) &&
3941
+ isxdigit((unsigned char) in[6]) &&
3942
+ isxdigit((unsigned char) in[7]))
3943
+ {
3944
+ pg_wchar unicode;
3945
+
3946
+ unicode = (hexval(in[2]) << 20) +
3947
+ (hexval(in[3]) << 16) +
3948
+ (hexval(in[4]) << 12) +
3949
+ (hexval(in[5]) << 8) +
3950
+ (hexval(in[6]) << 4) +
3951
+ hexval(in[7]);
3952
+ check_unicode_value(unicode, in, yyscanner);
3953
+ if (pair_first)
3954
+ {
3955
+ if (is_utf16_surrogate_second(unicode))
3956
+ {
3957
+ unicode = surrogate_pair_to_codepoint(pair_first, unicode);
3958
+ pair_first = 0;
3959
+ }
3960
+ else
3961
+ {
3962
+ ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */
3963
+ yyerror("invalid Unicode surrogate pair");
3964
+ }
3965
+ }
3966
+ else if (is_utf16_surrogate_second(unicode))
3967
+ yyerror("invalid Unicode surrogate pair");
3968
+
3969
+ if (is_utf16_surrogate_first(unicode))
3970
+ pair_first = unicode;
3971
+ else
3972
+ {
3973
+ unicode_to_utf8(unicode, (unsigned char *) out);
3974
+ out += pg_mblen(out);
3975
+ }
3976
+ in += 8;
3977
+ }
3978
+ else
3979
+ {
3980
+ ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */
3981
+ yyerror("invalid Unicode escape value");
3982
+ }
3983
+ }
3984
+ else
3985
+ {
3986
+ if (pair_first)
3987
+ {
3988
+ ADVANCE_YYLLOC(in - litbuf + 3); /* 3 for U&" */
3989
+ yyerror("invalid Unicode surrogate pair");
3990
+ }
3991
+ *out++ = *in++;
3992
+ }
3993
+ }
3994
+
3995
+ *out = '\0';
3996
+ /*
3997
+ * We could skip pg_verifymbstr if we didn't process any non-7-bit-ASCII
3998
+ * codes; but it's probably not worth the trouble, since this isn't
3999
+ * likely to be a performance-critical path.
4000
+ */
4001
+ pg_verifymbstr(new, out - new, false);
4002
+ return new;
4003
+ }
4004
+
4005
+ static unsigned char
4006
+ unescape_single_char(unsigned char c, core_yyscan_t yyscanner)
4007
+ {
4008
+ switch (c)
4009
+ {
4010
+ case 'b':
4011
+ return '\b';
4012
+ case 'f':
4013
+ return '\f';
4014
+ case 'n':
4015
+ return '\n';
4016
+ case 'r':
4017
+ return '\r';
4018
+ case 't':
4019
+ return '\t';
4020
+ default:
4021
+ /* check for backslash followed by non-7-bit-ASCII */
4022
+ if (c == '\0' || IS_HIGHBIT_SET(c))
4023
+ yyextra->saw_non_ascii = true;
4024
+
4025
+ return c;
4026
+ }
4027
+ }
4028
+
4029
+ static void
4030
+ check_string_escape_warning(unsigned char ychar, core_yyscan_t yyscanner)
4031
+ {
4032
+ if (ychar == '\'')
4033
+ {
4034
+ if (yyextra->warn_on_first_escape && escape_string_warning)
4035
+ ereport(WARNING,
4036
+ (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER),
4037
+ errmsg("nonstandard use of \\' in a string literal"),
4038
+ errhint("Use '' to write quotes in strings, or use the escape string syntax (E'...')."),
4039
+ lexer_errposition()));
4040
+ yyextra->warn_on_first_escape = false; /* warn only once per string */
4041
+ }
4042
+ else if (ychar == '\\')
4043
+ {
4044
+ if (yyextra->warn_on_first_escape && escape_string_warning)
4045
+ ereport(WARNING,
4046
+ (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER),
4047
+ errmsg("nonstandard use of \\\\ in a string literal"),
4048
+ errhint("Use the escape string syntax for backslashes, e.g., E'\\\\'."),
4049
+ lexer_errposition()));
4050
+ yyextra->warn_on_first_escape = false; /* warn only once per string */
4051
+ }
4052
+ else
4053
+ check_escape_warning(yyscanner);
4054
+ }
4055
+
4056
+ static void
4057
+ check_escape_warning(core_yyscan_t yyscanner)
4058
+ {
4059
+ if (yyextra->warn_on_first_escape && escape_string_warning)
4060
+ ereport(WARNING,
4061
+ (errcode(ERRCODE_NONSTANDARD_USE_OF_ESCAPE_CHARACTER),
4062
+ errmsg("nonstandard use of escape in a string literal"),
4063
+ errhint("Use the escape string syntax for escapes, e.g., E'\\r\\n'."),
4064
+ lexer_errposition()));
4065
+ yyextra->warn_on_first_escape = false; /* warn only once per string */
4066
+ }
4067
+
4068
+ /*
4069
+ * Interface functions to make flex use palloc() instead of malloc().
4070
+ * It'd be better to make these static, but flex insists otherwise.
4071
+ */
4072
+
4073
+ void *
4074
+ core_yyalloc(yy_size_t bytes, core_yyscan_t yyscanner)
4075
+ {
4076
+ return palloc(bytes);
4077
+ }
4078
+
4079
+ void *
4080
+ core_yyrealloc(void *ptr, yy_size_t bytes, core_yyscan_t yyscanner)
4081
+ {
4082
+ if (ptr)
4083
+ return repalloc(ptr, bytes);
4084
+ else
4085
+ return palloc(bytes);
4086
+ }
4087
+
4088
+ void
4089
+ core_yyfree(void *ptr, core_yyscan_t yyscanner)
4090
+ {
4091
+ if (ptr)
4092
+ pfree(ptr);
4093
+ }
4094
+