PageRenderTime 54ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/protected/libs/yii/vendors/TextHighlighter/Text/Highlighter/MYSQL.php

https://bitbucket.org/graaaf/erso
PHP | 416 lines | 375 code | 4 blank | 37 comment | 0 complexity | 98e3cc796fda1c2d3a725c3be9d2f9c2 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-3.0, LGPL-2.1, BSD-3-Clause, BSD-2-Clause
  1. <?php
  2. /**
  3. * Auto-generated class. MYSQL syntax highlighting
  4. *
  5. * PHP version 4 and 5
  6. *
  7. * LICENSE: This source file is subject to version 3.0 of the PHP license
  8. * that is available through the world-wide-web at the following URI:
  9. * http://www.php.net/license/3_0.txt. If you did not receive a copy of
  10. * the PHP License and are unable to obtain it through the web, please
  11. * send a note to license@php.net so we can mail you a copy immediately.
  12. *
  13. * @copyright 2004-2006 Andrey Demenev
  14. * @license http://www.php.net/license/3_0.txt PHP License
  15. * @link http://pear.php.net/package/Text_Highlighter
  16. * @category Text
  17. * @package Text_Highlighter
  18. * @version generated from: : mysql.xml,v 1.1 2007/06/03 02:35:28 ssttoo Exp
  19. * @author Andrey Demenev <demenev@gmail.com>
  20. *
  21. */
  22. /**
  23. * Auto-generated class. MYSQL syntax highlighting
  24. *
  25. * @author Andrey Demenev <demenev@gmail.com>
  26. * @category Text
  27. * @package Text_Highlighter
  28. * @copyright 2004-2006 Andrey Demenev
  29. * @license http://www.php.net/license/3_0.txt PHP License
  30. * @version Release: 0.7.1
  31. * @link http://pear.php.net/package/Text_Highlighter
  32. */
  33. class Text_Highlighter_MYSQL extends Text_Highlighter
  34. {
  35. var $_language = 'mysql';
  36. /**
  37. * Constructor
  38. *
  39. * @param array $options
  40. * @access public
  41. */
  42. function __construct($options=array())
  43. {
  44. $this->_options = $options;
  45. $this->_regs = array (
  46. -1 => '/((?i)`)|((?i)\\/\\*)|((?i)(#|--\\s).*)|((?i)[a-z_]\\w*(?=\\s*\\())|((?i)[a-z_]\\w*)|((?i)")|((?i)\\()|((?i)\')|((?i)((\\d+|((\\d*\\.\\d+)|(\\d+\\.\\d*)))[eE][+-]?\\d+))|((?i)(\\d*\\.\\d+)|(\\d+\\.\\d*))|((?i)\\d+l?|\\b0l?\\b)|((?i)0[xX][\\da-f]+l?)/',
  47. 0 => '//',
  48. 1 => '//',
  49. 2 => '/((?i)\\\\.)/',
  50. 3 => '/((?i)`)|((?i)\\/\\*)|((?i)(#|--\\s).*)|((?i)[a-z_]\\w*(?=\\s*\\())|((?i)[a-z_]\\w*)|((?i)")|((?i)\\()|((?i)\')|((?i)((\\d+|((\\d*\\.\\d+)|(\\d+\\.\\d*)))[eE][+-]?\\d+))|((?i)(\\d*\\.\\d+)|(\\d+\\.\\d*))|((?i)\\d+l?|\\b0l?\\b)|((?i)0[xX][\\da-f]+l?)/',
  51. 4 => '/((?i)\\\\.)/',
  52. );
  53. $this->_counts = array (
  54. -1 =>
  55. array (
  56. 0 => 0,
  57. 1 => 0,
  58. 2 => 1,
  59. 3 => 0,
  60. 4 => 0,
  61. 5 => 0,
  62. 6 => 0,
  63. 7 => 0,
  64. 8 => 5,
  65. 9 => 2,
  66. 10 => 0,
  67. 11 => 0,
  68. ),
  69. 0 =>
  70. array (
  71. ),
  72. 1 =>
  73. array (
  74. ),
  75. 2 =>
  76. array (
  77. 0 => 0,
  78. ),
  79. 3 =>
  80. array (
  81. 0 => 0,
  82. 1 => 0,
  83. 2 => 1,
  84. 3 => 0,
  85. 4 => 0,
  86. 5 => 0,
  87. 6 => 0,
  88. 7 => 0,
  89. 8 => 5,
  90. 9 => 2,
  91. 10 => 0,
  92. 11 => 0,
  93. ),
  94. 4 =>
  95. array (
  96. 0 => 0,
  97. ),
  98. );
  99. $this->_delim = array (
  100. -1 =>
  101. array (
  102. 0 => 'quotes',
  103. 1 => 'comment',
  104. 2 => '',
  105. 3 => '',
  106. 4 => '',
  107. 5 => 'quotes',
  108. 6 => 'brackets',
  109. 7 => 'quotes',
  110. 8 => '',
  111. 9 => '',
  112. 10 => '',
  113. 11 => '',
  114. ),
  115. 0 =>
  116. array (
  117. ),
  118. 1 =>
  119. array (
  120. ),
  121. 2 =>
  122. array (
  123. 0 => '',
  124. ),
  125. 3 =>
  126. array (
  127. 0 => 'quotes',
  128. 1 => 'comment',
  129. 2 => '',
  130. 3 => '',
  131. 4 => '',
  132. 5 => 'quotes',
  133. 6 => 'brackets',
  134. 7 => 'quotes',
  135. 8 => '',
  136. 9 => '',
  137. 10 => '',
  138. 11 => '',
  139. ),
  140. 4 =>
  141. array (
  142. 0 => '',
  143. ),
  144. );
  145. $this->_inner = array (
  146. -1 =>
  147. array (
  148. 0 => 'identifier',
  149. 1 => 'comment',
  150. 2 => 'comment',
  151. 3 => 'identifier',
  152. 4 => 'identifier',
  153. 5 => 'string',
  154. 6 => 'code',
  155. 7 => 'string',
  156. 8 => 'number',
  157. 9 => 'number',
  158. 10 => 'number',
  159. 11 => 'number',
  160. ),
  161. 0 =>
  162. array (
  163. ),
  164. 1 =>
  165. array (
  166. ),
  167. 2 =>
  168. array (
  169. 0 => 'special',
  170. ),
  171. 3 =>
  172. array (
  173. 0 => 'identifier',
  174. 1 => 'comment',
  175. 2 => 'comment',
  176. 3 => 'identifier',
  177. 4 => 'identifier',
  178. 5 => 'string',
  179. 6 => 'code',
  180. 7 => 'string',
  181. 8 => 'number',
  182. 9 => 'number',
  183. 10 => 'number',
  184. 11 => 'number',
  185. ),
  186. 4 =>
  187. array (
  188. 0 => 'special',
  189. ),
  190. );
  191. $this->_end = array (
  192. 0 => '/(?i)`/',
  193. 1 => '/(?i)\\*\\//',
  194. 2 => '/(?i)"/',
  195. 3 => '/(?i)\\)/',
  196. 4 => '/(?i)\'/',
  197. );
  198. $this->_states = array (
  199. -1 =>
  200. array (
  201. 0 => 0,
  202. 1 => 1,
  203. 2 => -1,
  204. 3 => -1,
  205. 4 => -1,
  206. 5 => 2,
  207. 6 => 3,
  208. 7 => 4,
  209. 8 => -1,
  210. 9 => -1,
  211. 10 => -1,
  212. 11 => -1,
  213. ),
  214. 0 =>
  215. array (
  216. ),
  217. 1 =>
  218. array (
  219. ),
  220. 2 =>
  221. array (
  222. 0 => -1,
  223. ),
  224. 3 =>
  225. array (
  226. 0 => 0,
  227. 1 => 1,
  228. 2 => -1,
  229. 3 => -1,
  230. 4 => -1,
  231. 5 => 2,
  232. 6 => 3,
  233. 7 => 4,
  234. 8 => -1,
  235. 9 => -1,
  236. 10 => -1,
  237. 11 => -1,
  238. ),
  239. 4 =>
  240. array (
  241. 0 => -1,
  242. ),
  243. );
  244. $this->_keywords = array (
  245. -1 =>
  246. array (
  247. 0 => -1,
  248. 1 => -1,
  249. 2 =>
  250. array (
  251. ),
  252. 3 =>
  253. array (
  254. 'function' => '/^((?i)abs|acos|adddate|ascii|asin|atan|atan2|avg|benchmark|bin|ceiling|char|coalesce|concat|conv|cos|cot|count|curdate|curtime|database|dayname|dayofmonth|dayofweek|dayofyear|decode|degrees|elt|encode|encrypt|exp|extract|field|floor|format|greatest|hex|hour|if|ifnull|insert|instr|interval|isnull|lcase|least|left|length|locate|log|log10|lower|lpad|ltrim|max|md5|mid|min|minute|mod|month|monthname|now|nullif|oct|ord|password|pi|position|pow|power|prepare|quarter|radians|rand|repeat|replace|reverse|right|round|rpad|rtrim|second|sign|sin|soundex|space|sqrt|std|stddev|strcmp|subdate|substring|sum|sysdate|tan|trim|truncate|ucase|upper|user|version|week|weekday|year)$/',
  255. ),
  256. 4 =>
  257. array (
  258. 'reserved' => '/^((?i)action|add|aggregate|all|alter|after|and|as|asc|avg|avg_row_length|auto_increment|between|bigint|bit|binary|blob|bool|both|by|cascade|case|char|character|change|check|checksum|column|columns|comment|constraint|create|cross|current_date|current_time|current_timestamp|data|database|databases|date|datetime|day|day_hour|day_minute|day_second|dayofmonth|dayofweek|dayofyear|dec|decimal|default|delayed|delay_key_write|delete|desc|describe|distinct|distinctrow|double|drop|end|else|escape|escaped|enclosed|enum|explain|exists|fields|file|first|float|float4|float8|flush|foreign|from|for|full|function|global|grant|grants|group|having|heap|high_priority|hour|hour_minute|hour_second|hosts|identified|ignore|in|index|infile|inner|insert|insert_id|int|integer|interval|int1|int2|int3|int4|int8|into|if|is|isam|join|key|keys|kill|last_insert_id|leading|left|length|like|lines|limit|load|local|lock|logs|long|longblob|longtext|low_priority|max|max_rows|match|mediumblob|mediumtext|mediumint|middleint|min_rows|minute|minute_second|modify|month|monthname|myisam|natural|numeric|no|not|null|on|optimize|option|optionally|or|order|outer|outfile|pack_keys|partial|password|precision|primary|procedure|process|processlist|privileges|read|real|references|reload|regexp|rename|replace|restrict|returns|revoke|rlike|row|rows|second|select|set|show|shutdown|smallint|soname|sql_big_tables|sql_big_selects|sql_low_priority_updates|sql_log_off|sql_log_update|sql_select_limit|sql_small_result|sql_big_result|sql_warnings|straight_join|starting|status|string|table|tables|temporary|terminated|text|then|time|timestamp|tinyblob|tinytext|tinyint|trailing|to|type|use|using|unique|unlock|unsigned|update|usage|values|varchar|variables|varying|varbinary|with|write|when|where|year|year_month|zerofill)$/',
  259. ),
  260. 5 => -1,
  261. 6 => -1,
  262. 7 => -1,
  263. 8 =>
  264. array (
  265. ),
  266. 9 =>
  267. array (
  268. ),
  269. 10 =>
  270. array (
  271. ),
  272. 11 =>
  273. array (
  274. ),
  275. ),
  276. 0 =>
  277. array (
  278. ),
  279. 1 =>
  280. array (
  281. ),
  282. 2 =>
  283. array (
  284. 0 =>
  285. array (
  286. ),
  287. ),
  288. 3 =>
  289. array (
  290. 0 => -1,
  291. 1 => -1,
  292. 2 =>
  293. array (
  294. ),
  295. 3 =>
  296. array (
  297. 'function' => '/^((?i)abs|acos|adddate|ascii|asin|atan|atan2|avg|benchmark|bin|ceiling|char|coalesce|concat|conv|cos|cot|count|curdate|curtime|database|dayname|dayofmonth|dayofweek|dayofyear|decode|degrees|elt|encode|encrypt|exp|extract|field|floor|format|greatest|hex|hour|if|ifnull|insert|instr|interval|isnull|lcase|least|left|length|locate|log|log10|lower|lpad|ltrim|max|md5|mid|min|minute|mod|month|monthname|now|nullif|oct|ord|password|pi|position|pow|power|prepare|quarter|radians|rand|repeat|replace|reverse|right|round|rpad|rtrim|second|sign|sin|soundex|space|sqrt|std|stddev|strcmp|subdate|substring|sum|sysdate|tan|trim|truncate|ucase|upper|user|version|week|weekday|year)$/',
  298. ),
  299. 4 =>
  300. array (
  301. 'reserved' => '/^((?i)action|add|aggregate|all|alter|after|and|as|asc|avg|avg_row_length|auto_increment|between|bigint|bit|binary|blob|bool|both|by|cascade|case|char|character|change|check|checksum|column|columns|comment|constraint|create|cross|current_date|current_time|current_timestamp|data|database|databases|date|datetime|day|day_hour|day_minute|day_second|dayofmonth|dayofweek|dayofyear|dec|decimal|default|delayed|delay_key_write|delete|desc|describe|distinct|distinctrow|double|drop|end|else|escape|escaped|enclosed|enum|explain|exists|fields|file|first|float|float4|float8|flush|foreign|from|for|full|function|global|grant|grants|group|having|heap|high_priority|hour|hour_minute|hour_second|hosts|identified|ignore|in|index|infile|inner|insert|insert_id|int|integer|interval|int1|int2|int3|int4|int8|into|if|is|isam|join|key|keys|kill|last_insert_id|leading|left|length|like|lines|limit|load|local|lock|logs|long|longblob|longtext|low_priority|max|max_rows|match|mediumblob|mediumtext|mediumint|middleint|min_rows|minute|minute_second|modify|month|monthname|myisam|natural|numeric|no|not|null|on|optimize|option|optionally|or|order|outer|outfile|pack_keys|partial|password|precision|primary|procedure|process|processlist|privileges|read|real|references|reload|regexp|rename|replace|restrict|returns|revoke|rlike|row|rows|second|select|set|show|shutdown|smallint|soname|sql_big_tables|sql_big_selects|sql_low_priority_updates|sql_log_off|sql_log_update|sql_select_limit|sql_small_result|sql_big_result|sql_warnings|straight_join|starting|status|string|table|tables|temporary|terminated|text|then|time|timestamp|tinyblob|tinytext|tinyint|trailing|to|type|use|using|unique|unlock|unsigned|update|usage|values|varchar|variables|varying|varbinary|with|write|when|where|year|year_month|zerofill)$/',
  302. ),
  303. 5 => -1,
  304. 6 => -1,
  305. 7 => -1,
  306. 8 =>
  307. array (
  308. ),
  309. 9 =>
  310. array (
  311. ),
  312. 10 =>
  313. array (
  314. ),
  315. 11 =>
  316. array (
  317. ),
  318. ),
  319. 4 =>
  320. array (
  321. 0 =>
  322. array (
  323. ),
  324. ),
  325. );
  326. $this->_parts = array (
  327. 0 =>
  328. array (
  329. ),
  330. 1 =>
  331. array (
  332. ),
  333. 2 =>
  334. array (
  335. 0 => NULL,
  336. ),
  337. 3 =>
  338. array (
  339. 0 => NULL,
  340. 1 => NULL,
  341. 2 => NULL,
  342. 3 => NULL,
  343. 4 => NULL,
  344. 5 => NULL,
  345. 6 => NULL,
  346. 7 => NULL,
  347. 8 => NULL,
  348. 9 => NULL,
  349. 10 => NULL,
  350. 11 => NULL,
  351. ),
  352. 4 =>
  353. array (
  354. 0 => NULL,
  355. ),
  356. );
  357. $this->_subst = array (
  358. -1 =>
  359. array (
  360. 0 => false,
  361. 1 => false,
  362. 2 => false,
  363. 3 => false,
  364. 4 => false,
  365. 5 => false,
  366. 6 => false,
  367. 7 => false,
  368. 8 => false,
  369. 9 => false,
  370. 10 => false,
  371. 11 => false,
  372. ),
  373. 0 =>
  374. array (
  375. ),
  376. 1 =>
  377. array (
  378. ),
  379. 2 =>
  380. array (
  381. 0 => false,
  382. ),
  383. 3 =>
  384. array (
  385. 0 => false,
  386. 1 => false,
  387. 2 => false,
  388. 3 => false,
  389. 4 => false,
  390. 5 => false,
  391. 6 => false,
  392. 7 => false,
  393. 8 => false,
  394. 9 => false,
  395. 10 => false,
  396. 11 => false,
  397. ),
  398. 4 =>
  399. array (
  400. 0 => false,
  401. ),
  402. );
  403. $this->_conditions = array (
  404. );
  405. $this->_kwmap = array (
  406. 'function' => 'reserved',
  407. 'reserved' => 'reserved',
  408. );
  409. $this->_defClass = 'code';
  410. $this->_checkDefines();
  411. }
  412. }