home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Text / Highlighter / SQL.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  17.5 KB  |  419 lines

  1. <?php
  2. /**
  3.  * Auto-generated class. SQL syntax highlighting
  4.  * 
  5.  * Based on SQL-99 
  6.  *
  7.  * PHP version 4 and 5
  8.  *
  9.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  10.  * that is available through the world-wide-web at the following URI:
  11.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  12.  * the PHP License and are unable to obtain it through the web, please
  13.  * send a note to license@php.net so we can mail you a copy immediately.
  14.  *
  15.  * @copyright  2004-2006 Andrey Demenev
  16.  * @license    http://www.php.net/license/3_0.txt  PHP License
  17.  * @link       http://pear.php.net/package/Text_Highlighter
  18.  * @category   Text
  19.  * @package    Text_Highlighter
  20.  * @version    generated from: : sql.xml,v 1.1 2007/06/03 02:35:28 ssttoo Exp 
  21.  * @author Andrey Demenev <demenev@gmail.com>
  22.  *
  23.  */
  24.  
  25. /**
  26.  * @ignore
  27.  */
  28.  
  29. require_once 'Text/Highlighter.php';
  30.  
  31. /**
  32.  * Auto-generated class. SQL syntax highlighting
  33.  *
  34.  * @author Andrey Demenev <demenev@gmail.com>
  35.  * @category   Text
  36.  * @package    Text_Highlighter
  37.  * @copyright  2004-2006 Andrey Demenev
  38.  * @license    http://www.php.net/license/3_0.txt  PHP License
  39.  * @version    Release: 0.7.1
  40.  * @link       http://pear.php.net/package/Text_Highlighter
  41.  */
  42. class  Text_Highlighter_SQL extends Text_Highlighter
  43. {
  44.     var $_language = 'sql';
  45.  
  46.     /**
  47.      * PHP4 Compatible Constructor
  48.      *
  49.      * @param array  $options
  50.      * @access public
  51.      */
  52.     function Text_Highlighter_SQL($options=array())
  53.     {
  54.         $this->__construct($options);
  55.     }
  56.  
  57.  
  58.     /**
  59.      *  Constructor
  60.      *
  61.      * @param array  $options
  62.      * @access public
  63.      */
  64.     function __construct($options=array())
  65.     {
  66.  
  67.         $this->_options = $options;
  68.         $this->_regs = array (
  69.             -1 => '/((?i)`)|((?i)\\/\\*)|((?i)(#|--\\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?)/',
  70.             0 => '//',
  71.             1 => '//',
  72.             2 => '/((?i)\\\\.)/',
  73.             3 => '/((?i)`)|((?i)\\/\\*)|((?i)(#|--\\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?)/',
  74.             4 => '/((?i)\\\\.)/',
  75.         );
  76.         $this->_counts = array (
  77.             -1 => 
  78.             array (
  79.                 0 => 0,
  80.                 1 => 0,
  81.                 2 => 1,
  82.                 3 => 0,
  83.                 4 => 0,
  84.                 5 => 0,
  85.                 6 => 0,
  86.                 7 => 5,
  87.                 8 => 2,
  88.                 9 => 0,
  89.                 10 => 0,
  90.             ),
  91.             0 => 
  92.             array (
  93.             ),
  94.             1 => 
  95.             array (
  96.             ),
  97.             2 => 
  98.             array (
  99.                 0 => 0,
  100.             ),
  101.             3 => 
  102.             array (
  103.                 0 => 0,
  104.                 1 => 0,
  105.                 2 => 1,
  106.                 3 => 0,
  107.                 4 => 0,
  108.                 5 => 0,
  109.                 6 => 0,
  110.                 7 => 5,
  111.                 8 => 2,
  112.                 9 => 0,
  113.                 10 => 0,
  114.             ),
  115.             4 => 
  116.             array (
  117.                 0 => 0,
  118.             ),
  119.         );
  120.         $this->_delim = array (
  121.             -1 => 
  122.             array (
  123.                 0 => 'quotes',
  124.                 1 => 'comment',
  125.                 2 => '',
  126.                 3 => '',
  127.                 4 => 'quotes',
  128.                 5 => 'brackets',
  129.                 6 => 'quotes',
  130.                 7 => '',
  131.                 8 => '',
  132.                 9 => '',
  133.                 10 => '',
  134.             ),
  135.             0 => 
  136.             array (
  137.             ),
  138.             1 => 
  139.             array (
  140.             ),
  141.             2 => 
  142.             array (
  143.                 0 => '',
  144.             ),
  145.             3 => 
  146.             array (
  147.                 0 => 'quotes',
  148.                 1 => 'comment',
  149.                 2 => '',
  150.                 3 => '',
  151.                 4 => 'quotes',
  152.                 5 => 'brackets',
  153.                 6 => 'quotes',
  154.                 7 => '',
  155.                 8 => '',
  156.                 9 => '',
  157.                 10 => '',
  158.             ),
  159.             4 => 
  160.             array (
  161.                 0 => '',
  162.             ),
  163.         );
  164.         $this->_inner = array (
  165.             -1 => 
  166.             array (
  167.                 0 => 'identifier',
  168.                 1 => 'comment',
  169.                 2 => 'comment',
  170.                 3 => 'identifier',
  171.                 4 => 'string',
  172.                 5 => 'code',
  173.                 6 => 'string',
  174.                 7 => 'number',
  175.                 8 => 'number',
  176.                 9 => 'number',
  177.                 10 => 'number',
  178.             ),
  179.             0 => 
  180.             array (
  181.             ),
  182.             1 => 
  183.             array (
  184.             ),
  185.             2 => 
  186.             array (
  187.                 0 => 'special',
  188.             ),
  189.             3 => 
  190.             array (
  191.                 0 => 'identifier',
  192.                 1 => 'comment',
  193.                 2 => 'comment',
  194.                 3 => 'identifier',
  195.                 4 => 'string',
  196.                 5 => 'code',
  197.                 6 => 'string',
  198.                 7 => 'number',
  199.                 8 => 'number',
  200.                 9 => 'number',
  201.                 10 => 'number',
  202.             ),
  203.             4 => 
  204.             array (
  205.                 0 => 'special',
  206.             ),
  207.         );
  208.         $this->_end = array (
  209.             0 => '/(?i)`/',
  210.             1 => '/(?i)\\*\\//',
  211.             2 => '/(?i)"/',
  212.             3 => '/(?i)\\)/',
  213.             4 => '/(?i)\'/',
  214.         );
  215.         $this->_states = array (
  216.             -1 => 
  217.             array (
  218.                 0 => 0,
  219.                 1 => 1,
  220.                 2 => -1,
  221.                 3 => -1,
  222.                 4 => 2,
  223.                 5 => 3,
  224.                 6 => 4,
  225.                 7 => -1,
  226.                 8 => -1,
  227.                 9 => -1,
  228.                 10 => -1,
  229.             ),
  230.             0 => 
  231.             array (
  232.             ),
  233.             1 => 
  234.             array (
  235.             ),
  236.             2 => 
  237.             array (
  238.                 0 => -1,
  239.             ),
  240.             3 => 
  241.             array (
  242.                 0 => 0,
  243.                 1 => 1,
  244.                 2 => -1,
  245.                 3 => -1,
  246.                 4 => 2,
  247.                 5 => 3,
  248.                 6 => 4,
  249.                 7 => -1,
  250.                 8 => -1,
  251.                 9 => -1,
  252.                 10 => -1,
  253.             ),
  254.             4 => 
  255.             array (
  256.                 0 => -1,
  257.             ),
  258.         );
  259.         $this->_keywords = array (
  260.             -1 => 
  261.             array (
  262.                 0 => -1,
  263.                 1 => -1,
  264.                 2 => 
  265.                 array (
  266.                 ),
  267.                 3 => 
  268.                 array (
  269.                     'reserved' => '/^((?i)absolute|action|add|admin|after|aggregate|alias|all|allocate|alter|and|any|are|array|as|asc|assertion|at|authorization|before|begin|binary|bit|blob|boolean|both|breadth|by|call|cascade|cascaded|case|cast|catalog|char|character|check|class|clob|close|collate|collation|column|commit|completion|connect|connection|constraint|constraints|constructor|continue|corresponding|create|cross|cube|current|current_date|current_path|current_role|current_time|current_timestamp|current_user|cursor|cycle|data|date|day|deallocate|dec|decimal|declare|default|deferrable|deferred|delete|depth|deref|desc|describe|descriptor|destroy|destructor|deterministic|diagnostics|dictionary|disconnect|distinct|domain|double|drop|dynamic|each|else|end|end-exec|equals|escape|every|except|exception|exec|execute|external|false|fetch|first|float|for|foreign|found|free|from|full|function|general|get|global|go|goto|grant|group|grouping|having|host|hour|identity|ignore|immediate|in|indicator|initialize|initially|inner|inout|input|insert|int|integer|intersect|interval|into|is|isolation|iterate|join|key|language|large|last|lateral|leading|left|less|level|like|limit|local|localtime|localtimestamp|locator|map|match|minute|modifies|modify|module|month|names|national|natural|nchar|nclob|new|next|no|none|not|null|numeric|object|of|off|old|on|only|open|operation|option|or|order|ordinality|out|outer|output|pad|parameter|parameters|partial|path|postfix|precision|prefix|preorder|prepare|preserve|primary|prior|privileges|procedure|public|read|reads|real|recursive|ref|references|referencing|relative|restrict|result|return|returns|revoke|right|role|rollback|rollup|routine|row|rows|savepoint|schema|scope|scroll|search|second|section|select|sequence|session|session_user|set|sets|size|smallint|some|space|specific|specifictype|sql|sqlexception|sqlstate|sqlwarning|start|state|statement|static|structure|system_user|table|temporary|terminate|than|then|time|timestamp|timezone_hour|timezone_minute|to|trailing|transaction|translation|treat|trigger|true|under|union|unique|unknown|unnest|update|usage|user|using|value|values|varchar|variable|varying|view|when|whenever|where|with|without|work|write|year|zone)$/',
  270.                     'keyword' => '/^((?i)abs|ada|asensitive|assignment|asymmetric|atomic|avg|between|bitvar|bit_length|c|called|cardinality|catalog_name|chain|character_length|character_set_catalog|character_set_name|character_set_schema|char_length|checked|class_origin|coalesce|cobol|collation_catalog|collation_name|collation_schema|column_name|command_function|command_function_code|committed|condition_number|connection_name|constraint_catalog|constraint_name|constraint_schema|contains|convert|count|cursor_name|datetime_interval_code|datetime_interval_precision|defined|definer|dispatch|dynamic_function|dynamic_function_code|existing|exists|extract|final|fortran|g|generated|granted|hierarchy|hold|implementation|infix|insensitive|instance|instantiable|invoker|k|key_member|key_type|length|lower|m|max|message_length|message_octet_length|message_text|method|min|mod|more|mumps|name|nullable|nullif|number|octet_length|options|overlaps|overlay|overriding|parameter_mode|parameter_name|parameter_ordinal_position|parameter_specific_catalog|parameter_specific_name|parameter_specific_schema|pascal|pli|position|repeatable|returned_length|returned_octet_length|returned_sqlstate|routine_catalog|routine_name|routine_schema|row_count|scale|schema_name|security|self|sensitive|serializable|server_name|similar|simple|source|specific_name|style|subclass_origin|sublist|substring|sum|symmetric|system|table_name|transactions_committed|transactions_rolled_back|transaction_active|transform|transforms|translate|trigger_catalog|trigger_name|trigger_schema|trim|type|uncommitted|unnamed|upper|user_defined_type_catalog|user_defined_type_name|user_defined_type_schema)$/',
  271.                 ),
  272.                 4 => -1,
  273.                 5 => -1,
  274.                 6 => -1,
  275.                 7 => 
  276.                 array (
  277.                 ),
  278.                 8 => 
  279.                 array (
  280.                 ),
  281.                 9 => 
  282.                 array (
  283.                 ),
  284.                 10 => 
  285.                 array (
  286.                 ),
  287.             ),
  288.             0 => 
  289.             array (
  290.             ),
  291.             1 => 
  292.             array (
  293.             ),
  294.             2 => 
  295.             array (
  296.                 0 => 
  297.                 array (
  298.                 ),
  299.             ),
  300.             3 => 
  301.             array (
  302.                 0 => -1,
  303.                 1 => -1,
  304.                 2 => 
  305.                 array (
  306.                 ),
  307.                 3 => 
  308.                 array (
  309.                     'reserved' => '/^((?i)absolute|action|add|admin|after|aggregate|alias|all|allocate|alter|and|any|are|array|as|asc|assertion|at|authorization|before|begin|binary|bit|blob|boolean|both|breadth|by|call|cascade|cascaded|case|cast|catalog|char|character|check|class|clob|close|collate|collation|column|commit|completion|connect|connection|constraint|constraints|constructor|continue|corresponding|create|cross|cube|current|current_date|current_path|current_role|current_time|current_timestamp|current_user|cursor|cycle|data|date|day|deallocate|dec|decimal|declare|default|deferrable|deferred|delete|depth|deref|desc|describe|descriptor|destroy|destructor|deterministic|diagnostics|dictionary|disconnect|distinct|domain|double|drop|dynamic|each|else|end|end-exec|equals|escape|every|except|exception|exec|execute|external|false|fetch|first|float|for|foreign|found|free|from|full|function|general|get|global|go|goto|grant|group|grouping|having|host|hour|identity|ignore|immediate|in|indicator|initialize|initially|inner|inout|input|insert|int|integer|intersect|interval|into|is|isolation|iterate|join|key|language|large|last|lateral|leading|left|less|level|like|limit|local|localtime|localtimestamp|locator|map|match|minute|modifies|modify|module|month|names|national|natural|nchar|nclob|new|next|no|none|not|null|numeric|object|of|off|old|on|only|open|operation|option|or|order|ordinality|out|outer|output|pad|parameter|parameters|partial|path|postfix|precision|prefix|preorder|prepare|preserve|primary|prior|privileges|procedure|public|read|reads|real|recursive|ref|references|referencing|relative|restrict|result|return|returns|revoke|right|role|rollback|rollup|routine|row|rows|savepoint|schema|scope|scroll|search|second|section|select|sequence|session|session_user|set|sets|size|smallint|some|space|specific|specifictype|sql|sqlexception|sqlstate|sqlwarning|start|state|statement|static|structure|system_user|table|temporary|terminate|than|then|time|timestamp|timezone_hour|timezone_minute|to|trailing|transaction|translation|treat|trigger|true|under|union|unique|unknown|unnest|update|usage|user|using|value|values|varchar|variable|varying|view|when|whenever|where|with|without|work|write|year|zone)$/',
  310.                     'keyword' => '/^((?i)abs|ada|asensitive|assignment|asymmetric|atomic|avg|between|bitvar|bit_length|c|called|cardinality|catalog_name|chain|character_length|character_set_catalog|character_set_name|character_set_schema|char_length|checked|class_origin|coalesce|cobol|collation_catalog|collation_name|collation_schema|column_name|command_function|command_function_code|committed|condition_number|connection_name|constraint_catalog|constraint_name|constraint_schema|contains|convert|count|cursor_name|datetime_interval_code|datetime_interval_precision|defined|definer|dispatch|dynamic_function|dynamic_function_code|existing|exists|extract|final|fortran|g|generated|granted|hierarchy|hold|implementation|infix|insensitive|instance|instantiable|invoker|k|key_member|key_type|length|lower|m|max|message_length|message_octet_length|message_text|method|min|mod|more|mumps|name|nullable|nullif|number|octet_length|options|overlaps|overlay|overriding|parameter_mode|parameter_name|parameter_ordinal_position|parameter_specific_catalog|parameter_specific_name|parameter_specific_schema|pascal|pli|position|repeatable|returned_length|returned_octet_length|returned_sqlstate|routine_catalog|routine_name|routine_schema|row_count|scale|schema_name|security|self|sensitive|serializable|server_name|similar|simple|source|specific_name|style|subclass_origin|sublist|substring|sum|symmetric|system|table_name|transactions_committed|transactions_rolled_back|transaction_active|transform|transforms|translate|trigger_catalog|trigger_name|trigger_schema|trim|type|uncommitted|unnamed|upper|user_defined_type_catalog|user_defined_type_name|user_defined_type_schema)$/',
  311.                 ),
  312.                 4 => -1,
  313.                 5 => -1,
  314.                 6 => -1,
  315.                 7 => 
  316.                 array (
  317.                 ),
  318.                 8 => 
  319.                 array (
  320.                 ),
  321.                 9 => 
  322.                 array (
  323.                 ),
  324.                 10 => 
  325.                 array (
  326.                 ),
  327.             ),
  328.             4 => 
  329.             array (
  330.                 0 => 
  331.                 array (
  332.                 ),
  333.             ),
  334.         );
  335.         $this->_parts = array (
  336.             0 => 
  337.             array (
  338.             ),
  339.             1 => 
  340.             array (
  341.             ),
  342.             2 => 
  343.             array (
  344.                 0 => NULL,
  345.             ),
  346.             3 => 
  347.             array (
  348.                 0 => NULL,
  349.                 1 => NULL,
  350.                 2 => NULL,
  351.                 3 => NULL,
  352.                 4 => NULL,
  353.                 5 => NULL,
  354.                 6 => NULL,
  355.                 7 => NULL,
  356.                 8 => NULL,
  357.                 9 => NULL,
  358.                 10 => NULL,
  359.             ),
  360.             4 => 
  361.             array (
  362.                 0 => NULL,
  363.             ),
  364.         );
  365.         $this->_subst = array (
  366.             -1 => 
  367.             array (
  368.                 0 => false,
  369.                 1 => false,
  370.                 2 => false,
  371.                 3 => false,
  372.                 4 => false,
  373.                 5 => false,
  374.                 6 => false,
  375.                 7 => false,
  376.                 8 => false,
  377.                 9 => false,
  378.                 10 => false,
  379.             ),
  380.             0 => 
  381.             array (
  382.             ),
  383.             1 => 
  384.             array (
  385.             ),
  386.             2 => 
  387.             array (
  388.                 0 => false,
  389.             ),
  390.             3 => 
  391.             array (
  392.                 0 => false,
  393.                 1 => false,
  394.                 2 => false,
  395.                 3 => false,
  396.                 4 => false,
  397.                 5 => false,
  398.                 6 => false,
  399.                 7 => false,
  400.                 8 => false,
  401.                 9 => false,
  402.                 10 => false,
  403.             ),
  404.             4 => 
  405.             array (
  406.                 0 => false,
  407.             ),
  408.         );
  409.         $this->_conditions = array (
  410.         );
  411.         $this->_kwmap = array (
  412.             'reserved' => 'reserved',
  413.             'keyword' => 'var',
  414.         );
  415.         $this->_defClass = 'code';
  416.         $this->_checkDefines();
  417.     }
  418.     
  419. }