From 786dde43ea21c1990071683a8cf5efd3bd1b791d Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 20 Jul 2007 12:33:27 +0000 Subject: Replaced GeSHi with Text_Highlighter --- .gitattributes | 49 + .../3rdParty/TextHighlighter/Text/Highlighter.php | 393 +++ .../TextHighlighter/Text/Highlighter/ABAP.php | 505 ++++ .../TextHighlighter/Text/Highlighter/CPP.php | 840 ++++++ .../TextHighlighter/Text/Highlighter/CSS.php | 383 +++ .../TextHighlighter/Text/Highlighter/DIFF.php | 366 +++ .../TextHighlighter/Text/Highlighter/DTD.php | 408 +++ .../TextHighlighter/Text/Highlighter/Generator.php | 1254 +++++++++ .../TextHighlighter/Text/Highlighter/HTML.php | 220 ++ .../TextHighlighter/Text/Highlighter/JAVA.php | 784 ++++++ .../Text/Highlighter/JAVASCRIPT.php | 613 +++++ .../TextHighlighter/Text/Highlighter/MYSQL.php | 416 +++ .../TextHighlighter/Text/Highlighter/PERL.php | 1334 +++++++++ .../TextHighlighter/Text/Highlighter/PHP.php | 1089 ++++++++ .../TextHighlighter/Text/Highlighter/PRADO.php | 254 ++ .../TextHighlighter/Text/Highlighter/PYTHON.php | 629 +++++ .../TextHighlighter/Text/Highlighter/RUBY.php | 807 ++++++ .../TextHighlighter/Text/Highlighter/Renderer.php | 152 ++ .../Text/Highlighter/Renderer/Array.php | 199 ++ .../Text/Highlighter/Renderer/BB.php | 238 ++ .../Text/Highlighter/Renderer/Console.php | 208 ++ .../Text/Highlighter/Renderer/Html.php | 444 +++ .../Text/Highlighter/Renderer/HtmlTags.php | 187 ++ .../Text/Highlighter/Renderer/JSON.php | 86 + .../Text/Highlighter/Renderer/XML.php | 103 + .../TextHighlighter/Text/Highlighter/SQL.php | 401 +++ .../TextHighlighter/Text/Highlighter/XML.php | 245 ++ framework/3rdParty/TextHighlighter/Text/README | 455 ++++ framework/3rdParty/TextHighlighter/Text/TODO | 12 + framework/3rdParty/TextHighlighter/Text/abap.xml | 802 ++++++ framework/3rdParty/TextHighlighter/Text/cpp.xml | 201 ++ framework/3rdParty/TextHighlighter/Text/css.xml | 361 +++ framework/3rdParty/TextHighlighter/Text/diff.xml | 45 + framework/3rdParty/TextHighlighter/Text/dtd.xml | 66 + framework/3rdParty/TextHighlighter/Text/generate | 171 ++ .../3rdParty/TextHighlighter/Text/generate.bat | 188 ++ framework/3rdParty/TextHighlighter/Text/html.xml | 33 + framework/3rdParty/TextHighlighter/Text/java.xml | 2824 ++++++++++++++++++++ .../3rdParty/TextHighlighter/Text/javascript.xml | 173 ++ framework/3rdParty/TextHighlighter/Text/mysql.xml | 424 +++ .../3rdParty/TextHighlighter/Text/package.xml | 243 ++ framework/3rdParty/TextHighlighter/Text/perl.xml | 439 +++ framework/3rdParty/TextHighlighter/Text/php.xml | 194 ++ framework/3rdParty/TextHighlighter/Text/prado.xml | 40 + framework/3rdParty/TextHighlighter/Text/python.xml | 229 ++ framework/3rdParty/TextHighlighter/Text/ruby.xml | 141 + framework/3rdParty/TextHighlighter/Text/sample.css | 57 + framework/3rdParty/TextHighlighter/Text/sql.xml | 496 ++++ framework/3rdParty/TextHighlighter/Text/xml.xml | 37 + framework/3rdParty/TextHighlighter/highlight.css | 441 +++ framework/Exceptions/messages.txt | 2 +- framework/PradoBase.php | 13 +- framework/Web/UI/WebControls/TTextHighlighter.php | 111 +- 53 files changed, 20761 insertions(+), 44 deletions(-) create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/ABAP.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/CPP.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/CSS.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/DIFF.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/DTD.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/Generator.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/HTML.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/JAVA.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/JAVASCRIPT.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/MYSQL.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/PERL.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/PHP.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/PRADO.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/PYTHON.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/RUBY.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Array.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/BB.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Html.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/HtmlTags.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/JSON.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/XML.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/SQL.php create mode 100644 framework/3rdParty/TextHighlighter/Text/Highlighter/XML.php create mode 100644 framework/3rdParty/TextHighlighter/Text/README create mode 100644 framework/3rdParty/TextHighlighter/Text/TODO create mode 100644 framework/3rdParty/TextHighlighter/Text/abap.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/cpp.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/css.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/diff.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/dtd.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/generate create mode 100644 framework/3rdParty/TextHighlighter/Text/generate.bat create mode 100644 framework/3rdParty/TextHighlighter/Text/html.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/java.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/javascript.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/mysql.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/package.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/perl.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/php.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/prado.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/python.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/ruby.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/sample.css create mode 100644 framework/3rdParty/TextHighlighter/Text/sql.xml create mode 100644 framework/3rdParty/TextHighlighter/Text/xml.xml create mode 100644 framework/3rdParty/TextHighlighter/highlight.css diff --git a/.gitattributes b/.gitattributes index fc421b58..fbbd75d7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1660,6 +1660,55 @@ framework/3rdParty/SafeHtml/HTMLSax3/States.php -text framework/3rdParty/SafeHtml/TSafeHtmlParser.php -text framework/3rdParty/SafeHtml/license.txt -text framework/3rdParty/SafeHtml/readme.txt -text +framework/3rdParty/TextHighlighter/Text/Highlighter.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/ABAP.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/CPP.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/CSS.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/DIFF.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/DTD.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/Generator.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/HTML.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/JAVA.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/JAVASCRIPT.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/MYSQL.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/PERL.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/PHP.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/PRADO.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/PYTHON.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/RUBY.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Array.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/BB.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Html.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/HtmlTags.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/JSON.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/XML.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/SQL.php -text +framework/3rdParty/TextHighlighter/Text/Highlighter/XML.php -text +framework/3rdParty/TextHighlighter/Text/README -text +framework/3rdParty/TextHighlighter/Text/TODO -text +framework/3rdParty/TextHighlighter/Text/abap.xml -text +framework/3rdParty/TextHighlighter/Text/cpp.xml -text +framework/3rdParty/TextHighlighter/Text/css.xml -text +framework/3rdParty/TextHighlighter/Text/diff.xml -text +framework/3rdParty/TextHighlighter/Text/dtd.xml -text +framework/3rdParty/TextHighlighter/Text/generate -text +framework/3rdParty/TextHighlighter/Text/generate.bat -text +framework/3rdParty/TextHighlighter/Text/html.xml -text +framework/3rdParty/TextHighlighter/Text/java.xml -text +framework/3rdParty/TextHighlighter/Text/javascript.xml -text +framework/3rdParty/TextHighlighter/Text/mysql.xml -text +framework/3rdParty/TextHighlighter/Text/package.xml -text +framework/3rdParty/TextHighlighter/Text/perl.xml -text +framework/3rdParty/TextHighlighter/Text/php.xml -text +framework/3rdParty/TextHighlighter/Text/prado.xml -text +framework/3rdParty/TextHighlighter/Text/python.xml -text +framework/3rdParty/TextHighlighter/Text/ruby.xml -text +framework/3rdParty/TextHighlighter/Text/sample.css -text +framework/3rdParty/TextHighlighter/Text/sql.xml -text +framework/3rdParty/TextHighlighter/Text/xml.xml -text +framework/3rdParty/TextHighlighter/highlight.css -text framework/3rdParty/TinyMCE/license.txt -text framework/3rdParty/TinyMCE/tiny_mce.md5 -text framework/3rdParty/TinyMCE/tiny_mce.tar -text diff --git a/framework/3rdParty/TextHighlighter/Text/Highlighter.php b/framework/3rdParty/TextHighlighter/Text/Highlighter.php new file mode 100644 index 00000000..7a592646 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/Highlighter.php @@ -0,0 +1,393 @@ + + * @copyright 2004-2006 Andrey Demenev + * @license http://www.php.net/license/3_0.txt PHP License + * @version CVS: $Id: Highlighter.php,v 1.1 2007/06/03 02:35:28 ssttoo Exp $ + * @link http://pear.php.net/package/Text_Highlighter + */ + +// {{{ BC constants + +// BC trick : define constants related to default +// renderer if needed +if (!defined('HL_NUMBERS_LI')) { + /**#@+ + * Constant for use with $options['numbers'] + * @see Text_Highlighter_Renderer_Html::_init() + */ + /** + * use numbered list + */ + define ('HL_NUMBERS_LI' , 1); + /** + * Use 2-column table with line numbers in left column and code in right column. + * Forces $options['tag'] = HL_TAG_PRE + */ + define ('HL_NUMBERS_TABLE' , 2); + /**#@-*/ +} + +// }}} +// {{{ constants +/** + * for our purpose, it is infinity + */ +define ('HL_INFINITY', 1000000000); + +// }}} + +/** + * Text highlighter base class + * + * @author Andrey Demenev + * @copyright 2004-2006 Andrey Demenev + * @license http://www.php.net/license/3_0.txt PHP License + * @version Release: 0.7.0 + * @link http://pear.php.net/package/Text_Highlighter + */ + +// {{{ Text_Highlighter + +/** + * Text highlighter base class + * + * This class implements all functions necessary for highlighting, + * but it does not contain highlighting rules. Actual highlighting is + * done using a descendent of this class. + * + * One is not supposed to manually create descendent classes. + * Instead, describe highlighting rules in XML format and + * use {@link Text_Highlighter_Generator} to create descendent class. + * Alternatively, an instance of a descendent class can be created + * directly. + * + * Use {@link Text_Highlighter::factory()} to create an + * object for particular language highlighter + * + * Usage example + * + *require_once 'Text/Highlighter.php'; + *$hlSQL =& Text_Highlighter::factory('SQL',array('numbers'=>true)); + *echo $hlSQL->highlight('SELECT * FROM table a WHERE id = 12'); + * + * + * @author Andrey Demenev + * @package Text_Highlighter + * @access public + */ + +class Text_Highlighter +{ + // {{{ members + + /** + * Syntax highlighting rules. + * Auto-generated classes set this var + * + * @access protected + * @see _init + * @var array + */ + var $_syntax; + + /** + * Renderer object. + * + * @access private + * @var array + */ + var $_renderer; + + /** + * Options. Keeped for BC + * + * @access protected + * @var array + */ + var $_options = array(); + + /** + * Conditionds + * + * @access protected + * @var array + */ + var $_conditions = array(); + + /** + * Disabled keywords + * + * @access protected + * @var array + */ + var $_disabled = array(); + + /** + * Language + * + * @access protected + * @var string + */ + var $_language = ''; + + // }}} + // {{{ _checkDefines + + /** + * Called by subclssses' constructors to enable/disable + * optional highlighter rules + * + * @param array $defines Conditional defines + * + * @access protected + */ + function _checkDefines() + { + if (isset($this->_options['defines'])) { + $defines = $this->_options['defines']; + } else { + $defines = array(); + } + foreach ($this->_conditions as $name => $actions) { + foreach($actions as $action) { + $present = in_array($name, $defines); + if (!$action[1]) { + $present = !$present; + } + if ($present) { + unset($this->_disabled[$action[0]]); + } else { + $this->_disabled[$action[0]] = true; + } + } + } + } + + // }}} + // {{{ factory + + /** + * Create a new Highlighter object for specified language + * + * @param string $lang language, for example "SQL" + * @param array $options Rendering options. This + * parameter is only keeped for BC reasons, use + * {@link Text_Highlighter::setRenderer()} instead + * + * @return mixed a newly created Highlighter object, or + * a PEAR error object on error + * + * @static + * @access public + */ + public static function factory($lang, $options = array()) + { + $lang = strtoupper($lang); + include_once dirname(__FILE__)."/Highlighter/$lang.php"; + + $classname = 'Text_Highlighter_' . $lang; + + if (!class_exists($classname)) + return false; + + return new $classname($options); + } + + // }}} + // {{{ setRenderer + + /** + * Set renderer object + * + * @param object $renderer Text_Highlighter_Renderer + * + * @access public + */ + function setRenderer($renderer) + { + $this->_renderer = $renderer; + } + + // }}} + + /** + * Helper function to find matching brackets + * + * @access private + */ + function _matchingBrackets($str) + { + return strtr($str, '()<>[]{}', ')(><][}{'); + } + + + + + function _getToken() + { + if (!empty($this->_tokenStack)) { + return array_pop($this->_tokenStack); + } + if ($this->_pos >= $this->_len) { + return NULL; + } + + if ($this->_state != -1 && preg_match($this->_endpattern, $this->_str, $m, PREG_OFFSET_CAPTURE, $this->_pos)) { + $endpos = $m[0][1]; + $endmatch = $m[0][0]; + } else { + $endpos = -1; + } + preg_match ($this->_regs[$this->_state], $this->_str, $m, PREG_OFFSET_CAPTURE, $this->_pos); + $n = 1; + + + foreach ($this->_counts[$this->_state] as $i=>$count) { + if (!isset($m[$n])) { + break; + } + if ($m[$n][1]>-1 && ($endpos == -1 || $m[$n][1] < $endpos)) { + if ($this->_states[$this->_state][$i] != -1) { + $this->_tokenStack[] = array($this->_delim[$this->_state][$i], $m[$n][0]); + } else { + $inner = $this->_inner[$this->_state][$i]; + if (isset($this->_parts[$this->_state][$i])) { + $parts = array(); + $partpos = $m[$n][1]; + for ($j=1; $j<=$count; $j++) { + if ($m[$j+$n][1] < 0) { + continue; + } + if (isset($this->_parts[$this->_state][$i][$j])) { + if ($m[$j+$n][1] > $partpos) { + array_unshift($parts, array($inner, substr($this->_str, $partpos, $m[$j+$n][1]-$partpos))); + } + array_unshift($parts, array($this->_parts[$this->_state][$i][$j], $m[$j+$n][0])); + } + $partpos = $m[$j+$n][1] + strlen($m[$j+$n][0]); + } + if ($partpos < $m[$n][1] + strlen($m[$n][0])) { + array_unshift($parts, array($inner, substr($this->_str, $partpos, $m[$n][1] - $partpos + strlen($m[$n][0])))); + } + $this->_tokenStack = array_merge($this->_tokenStack, $parts); + } else { + foreach ($this->_keywords[$this->_state][$i] as $g => $re) { + if (isset($this->_disabled[$g])) { + continue; + } + if (preg_match($re, $m[$n][0])) { + $inner = $this->_kwmap[$g]; + break; + } + } + $this->_tokenStack[] = array($inner, $m[$n][0]); + } + } + if ($m[$n][1] > $this->_pos) { + $this->_tokenStack[] = array($this->_lastinner, substr($this->_str, $this->_pos, $m[$n][1]-$this->_pos)); + } + $this->_pos = $m[$n][1] + strlen($m[$n][0]); + if ($this->_states[$this->_state][$i] != -1) { + $this->_stack[] = array($this->_state, $this->_lastdelim, $this->_lastinner, $this->_endpattern); + $this->_lastinner = $this->_inner[$this->_state][$i]; + $this->_lastdelim = $this->_delim[$this->_state][$i]; + $l = $this->_state; + $this->_state = $this->_states[$this->_state][$i]; + $this->_endpattern = $this->_end[$this->_state]; + if ($this->_subst[$l][$i]) { + for ($k=0; $k<=$this->_counts[$l][$i]; $k++) { + if (!isset($m[$i+$k])) { + break; + } + $quoted = preg_quote($m[$n+$k][0], '/'); + $this->_endpattern = str_replace('%'.$k.'%', $quoted, $this->_endpattern); + $this->_endpattern = str_replace('%b'.$k.'%', $this->_matchingBrackets($quoted), $this->_endpattern); + } + } + } + return array_pop($this->_tokenStack); + } + $n += $count + 1; + } + + if ($endpos > -1) { + $this->_tokenStack[] = array($this->_lastdelim, $endmatch); + if ($endpos > $this->_pos) { + $this->_tokenStack[] = array($this->_lastinner, substr($this->_str, $this->_pos, $endpos-$this->_pos)); + } + list($this->_state, $this->_lastdelim, $this->_lastinner, $this->_endpattern) = array_pop($this->_stack); + $this->_pos = $endpos + strlen($endmatch); + return array_pop($this->_tokenStack); + } + $p = $this->_pos; + $this->_pos = HL_INFINITY; + return array($this->_lastinner, substr($this->_str, $p)); + } + + + + + // {{{ highlight + + /** + * Highlights code + * + * @param string $str Code to highlight + * @access public + * @return string Highlighted text + * + */ + + function highlight($str) + { + if (!($this->_renderer)) { + include_once('Text/Highlighter/Renderer/Html.php'); + $this->_renderer = new Text_Highlighter_Renderer_Html($this->_options); + } + $this->_state = -1; + $this->_pos = 0; + $this->_stack = array(); + $this->_tokenStack = array(); + $this->_lastinner = $this->_defClass; + $this->_lastdelim = $this->_defClass; + $this->_endpattern = ''; + $this->_renderer->reset(); + $this->_renderer->setCurrentLanguage($this->_language); + $this->_str = $this->_renderer->preprocess($str); + $this->_len = strlen($this->_str); + while ($token = $this->_getToken()) { + $this->_renderer->acceptToken($token[0], $token[1]); + } + $this->_renderer->finalize(); + return $this->_renderer->getOutput(); + } + + // }}} + +} + +// }}} + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * c-hanging-comment-ender-p: nil + * End: + */ + +?> \ No newline at end of file diff --git a/framework/3rdParty/TextHighlighter/Text/Highlighter/ABAP.php b/framework/3rdParty/TextHighlighter/Text/Highlighter/ABAP.php new file mode 100644 index 00000000..adeaabf9 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/Highlighter/ABAP.php @@ -0,0 +1,505 @@ + + * + */ + +/** + * @ignore + */ + +/** + * Auto-generated class. ABAP syntax highlighting + * + * @author Stoyan Stefanov + * @category Text + * @package Text_Highlighter + * @copyright 2004-2006 Andrey Demenev + * @license http://www.php.net/license/3_0.txt PHP License + * @version Release: 0.7.0 + * @link http://pear.php.net/package/Text_Highlighter + */ +class Text_Highlighter_ABAP extends Text_Highlighter +{ + var $_language = 'abap'; + + /** + * Constructor + * + * @param array $options + * @access public + */ + function __construct($options=array()) + { + + $this->_options = $options; + $this->_regs = array ( + -1 => '/((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)^\\*|")|((?i)\')|((?i)[a-z_\\-]\\w*)/', + 0 => '/((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)^\\*|")|((?i)\')|((?i)0[xX][\\da-f]+)|((?i)\\d\\d*|\\b0\\b)|((?i)0[0-7]+)|((?i)(\\d*\\.\\d+)|(\\d+\\.\\d*))|((?i)[a-z_\\-]\\w*)/', + 1 => '/((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)^\\*|")|((?i)\')|((?i)0[xX][\\da-f]+)|((?i)\\d\\d*|\\b0\\b)|((?i)0[0-7]+)|((?i)(\\d*\\.\\d+)|(\\d+\\.\\d*))|((?i)[a-z_\\-]\\w*)/', + 2 => '/((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)^\\*|")|((?i)\')|((?i)0[xX][\\da-f]+)|((?i)\\d\\d*|\\b0\\b)|((?i)0[0-7]+)|((?i)(\\d*\\.\\d+)|(\\d+\\.\\d*))|((?i)[a-z_\\-]\\w*)/', + 3 => '//', + 4 => '//', + ); + $this->_counts = array ( + -1 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + ), + 0 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 0, + 8 => 2, + 9 => 0, + ), + 1 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 0, + 8 => 2, + 9 => 0, + ), + 2 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 0, + 8 => 2, + 9 => 0, + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_delim = array ( + -1 => + array ( + 0 => 'brackets', + 1 => 'brackets', + 2 => 'brackets', + 3 => 'comment', + 4 => 'quotes', + 5 => '', + ), + 0 => + array ( + 0 => 'brackets', + 1 => 'brackets', + 2 => 'brackets', + 3 => 'comment', + 4 => 'quotes', + 5 => '', + 6 => '', + 7 => '', + 8 => '', + 9 => '', + ), + 1 => + array ( + 0 => 'brackets', + 1 => 'brackets', + 2 => 'brackets', + 3 => 'comment', + 4 => 'quotes', + 5 => '', + 6 => '', + 7 => '', + 8 => '', + 9 => '', + ), + 2 => + array ( + 0 => 'brackets', + 1 => 'brackets', + 2 => 'brackets', + 3 => 'comment', + 4 => 'quotes', + 5 => '', + 6 => '', + 7 => '', + 8 => '', + 9 => '', + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_inner = array ( + -1 => + array ( + 0 => 'code', + 1 => 'code', + 2 => 'code', + 3 => 'comment', + 4 => 'string', + 5 => 'identifier', + ), + 0 => + array ( + 0 => 'code', + 1 => 'code', + 2 => 'code', + 3 => 'comment', + 4 => 'string', + 5 => 'number', + 6 => 'number', + 7 => 'number', + 8 => 'number', + 9 => 'identifier', + ), + 1 => + array ( + 0 => 'code', + 1 => 'code', + 2 => 'code', + 3 => 'comment', + 4 => 'string', + 5 => 'number', + 6 => 'number', + 7 => 'number', + 8 => 'number', + 9 => 'identifier', + ), + 2 => + array ( + 0 => 'code', + 1 => 'code', + 2 => 'code', + 3 => 'comment', + 4 => 'string', + 5 => 'number', + 6 => 'number', + 7 => 'number', + 8 => 'number', + 9 => 'identifier', + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_end = array ( + 0 => '/(?i)\\}/', + 1 => '/(?i)\\)/', + 2 => '/(?i)\\]/', + 3 => '/(?mi)$/', + 4 => '/(?i)\'/', + ); + $this->_states = array ( + -1 => + array ( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => 4, + 5 => -1, + ), + 0 => + array ( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => 4, + 5 => -1, + 6 => -1, + 7 => -1, + 8 => -1, + 9 => -1, + ), + 1 => + array ( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => 4, + 5 => -1, + 6 => -1, + 7 => -1, + 8 => -1, + 9 => -1, + ), + 2 => + array ( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => 4, + 5 => -1, + 6 => -1, + 7 => -1, + 8 => -1, + 9 => -1, + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_keywords = array ( + -1 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + 4 => -1, + 5 => + array ( + 'sy' => '/^((?i)screen-name|screen-group1|screen-group2|screen-group3|screen-group4|screen-required|screen-input|screen-output|screen-intensified|screen-invisible|screen-length|screen-active|sy-index|sy-pagno|sy-tabix|sy-tfill|sy-tlopc|sy-tmaxl|sy-toccu|sy-ttabc|sy-tstis|sy-ttabi|sy-dbcnt|sy-fdpos|sy-colno|sy-linct|sy-linno|sy-linsz|sy-pagct|sy-macol|sy-marow|sy-tleng|sy-sfoff|sy-willi|sy-lilli|sy-subrc|sy-fleng|sy-cucol|sy-curow|sy-lsind|sy-listi|sy-stepl|sy-tpagi|sy-winx1|sy-winy1|sy-winx2|sy-winy2|sy-winco|sy-winro|sy-windi|sy-srows|sy-scols|sy-loopc|sy-folen|sy-fodec|sy-tzone|sy-dayst|sy-ftype|sy-appli|sy-fdayw|sy-ccurs|sy-ccurt|sy-debug|sy-ctype|sy-input|sy-langu|sy-modno|sy-batch|sy-binpt|sy-calld|sy-dynnr|sy-dyngr|sy-newpa|sy-pri40|sy-rstrt|sy-wtitl|sy-cpage|sy-dbnam|sy-mandt|sy-prefx|sy-fmkey|sy-pexpi|sy-prini|sy-primm|sy-prrel|sy-playo|sy-prbig|sy-playp|sy-prnew|sy-prlog|sy-pdest|sy-plist|sy-pauth|sy-prdsn|sy-pnwpa|sy-callr|sy-repi2|sy-rtitl|sy-prrec|sy-prtxt|sy-prabt|sy-lpass|sy-nrpag|sy-paart|sy-prcop|sy-batzs|sy-bspld|sy-brep4|sy-batzo|sy-batzd|sy-batzw|sy-batzm|sy-ctabl|sy-dbsys|sy-dcsys|sy-macdb|sy-sysid|sy-opsys|sy-pfkey|sy-saprl|sy-tcode|sy-ucomm|sy-cfwae|sy-chwae|sy-spono|sy-sponr|sy-waers|sy-cdate|sy-datum|sy-slset|sy-subty|sy-subcs|sy-group|sy-ffile|sy-uzeit|sy-dsnam|sy-repid|sy-tabid|sy-tfdsn|sy-uname|sy-lstat|sy-abcde|sy-marky|sy-sfnam|sy-tname|sy-msgli|sy-title|sy-entry|sy-lisel|sy-uline|sy-xcode|sy-cprog|sy-xprog|sy-xform|sy-ldbpg|sy-tvar0|sy-tvar1|sy-tvar2|sy-tvar3|sy-tvar4|sy-tvar5|sy-tvar6|sy-tvar7|sy-tvar8|sy-tvar9|sy-msgid|sy-msgty|sy-msgno|sy-msgv1|sy-msgv2|sy-msgv3|sy-msgv4|sy-oncom|sy-vline|sy-winsl|sy-staco|sy-staro|sy-datar|sy-host|sy-locdb|sy-locop|sy-datlo|sy-timlo|sy-zonlo|syst-index|syst-pagno|syst-tabix|syst-tfill|syst-tlopc|syst-tmaxl|syst-toccu|syst-ttabc|syst-tstis|syst-ttabi|syst-dbcnt|syst-fdpos|syst-colno|syst-linct|syst-linno|syst-linsz|syst-pagct|syst-macol|syst-marow|syst-tleng|syst-sfoff|syst-willi|syst-lilli|syst-subrc|syst-fleng|syst-cucol|syst-curow|syst-lsind|syst-listi|syst-stepl|syst-tpagi|syst-winx1|syst-winy1|syst-winx2|syst-winy2|syst-winco|syst-winro|syst-windi|syst-srows|syst-scols|syst-loopc|syst-folen|syst-fodec|syst-tzone|syst-dayst|syst-ftype|syst-appli|syst-fdayw|syst-ccurs|syst-ccurt|syst-debug|syst-ctype|syst-input|syst-langu|syst-modno|syst-batch|syst-binpt|syst-calld|syst-dynnr|syst-dyngr|syst-newpa|syst-pri40|syst-rstrt|syst-wtitl|syst-cpage|syst-dbnam|syst-mandt|syst-prefx|syst-fmkey|syst-pexpi|syst-prini|syst-primm|syst-prrel|syst-playo|syst-prbig|syst-playp|syst-prnew|syst-prlog|syst-pdest|syst-plist|syst-pauth|syst-prdsn|syst-pnwpa|syst-callr|syst-repi2|syst-rtitl|syst-prrec|syst-prtxt|syst-prabt|syst-lpass|syst-nrpag|syst-paart|syst-prcop|syst-batzs|syst-bspld|syst-brep4|syst-batzo|syst-batzd|syst-batzw|syst-batzm|syst-ctabl|syst-dbsys|syst-dcsys|syst-macdb|syst-sysid|syst-opsys|syst-pfkey|syst-saprl|syst-tcode|syst-ucomm|syst-cfwae|syst-chwae|syst-spono|syst-sponr|syst-waers|syst-cdate|syst-datum|syst-slset|syst-subty|syst-subcs|syst-group|syst-ffile|syst-uzeit|syst-dsnam|syst-repid|syst-tabid|syst-tfdsn|syst-uname|syst-lstat|syst-abcde|syst-marky|syst-sfnam|syst-tname|syst-msgli|syst-title|syst-entry|syst-lisel|syst-uline|syst-xcode|syst-cprog|syst-xprog|syst-xform|syst-ldbpg|syst-tvar0|syst-tvar1|syst-tvar2|syst-tvar3|syst-tvar4|syst-tvar5|syst-tvar6|syst-tvar7|syst-tvar8|syst-tvar9|syst-msgid|syst-msgty|syst-msgno|syst-msgv1|syst-msgv2|syst-msgv3|syst-msgv4|syst-oncom|syst-vline|syst-winsl|syst-staco|syst-staro|syst-datar|syst-host|syst-locdb|syst-locop|syst-datlo|syst-timlo|syst-zonlo)$/', + 'reserved' => '/^((?i)abs|acos|add|add-corresponding|adjacent|after|aliases|all|analyzer|and|any|append|as|ascending|asin|assign|assigned|assigning|at|atan|authority-check|avg|back|before|begin|binary|bit|bit-and|bit-not|bit-or|bit-xor|blank|block|break-point|buffer|by|c|call|case|catch|ceil|centered|chain|change|changing|check|checkbox|class|class-data|class-events|class-methods|class-pool|clear|client|close|cnt|code|collect|color|comment|commit|communication|compute|concatenate|condense|constants|context|contexts|continue|control|controls|convert|copy|corresponding|cos|cosh|count|country|create|currency|cursor|customer-function|data|database|dataset|delete|decimals|default|define|demand|descending|describe|dialog|distinct|div|divide|divide-corresponding|do|duplicates|dynpro|edit|editor-call|else|elseif|end|end-of-definition|end-of-page|end-of-selection|endat|endcase|endcatch|endchain|endclass|enddo|endexec|endform|endfunction|endif|endinterface|endloop|endmethod|endmodule|endon|endprovide|endselect|endwhile|entries|events|exec|exit|exit-command|exp|exponent|export|exporting|exceptions|extended|extract|fetch|field|field-groups|field-symbols|fields|floor|for|form|format|frac|frame|free|from|function|function-pool|generate|get|group|hashed|header|help-id|help-request|hide|hotspot|icon|id|if|import|importing|include|index|infotypes|initialization|inner|input|insert|intensified|interface|interface-pool|interfaces|into|inverse|join|key|language|last|leave|left|left-justified|like|line|line-count|line-selection|line-size|lines|list-processing|load|load-of-program|local|locale|log|log10|loop|m|margin|mask|matchcode|max|memory|message|message-id|messages|method|methods|min|mod|mode|modif|modify|module|move|move-corresponding|multiply|multiply-corresponding|new|new-line|new-page|next|no|no-gap|no-gaps|no-heading|no-scrolling|no-sign|no-title|no-zero|nodes|non-unique|o|object|obligatory|occurs|of|off|on|open|or|order|others|outer|output|overlay|pack|page|parameter|parameters|perform|pf-status|position|print|print-control|private|process|program|property|protected|provide|public|put|radiobutton|raise|raising|range|ranges|read|receive|refresh|reject|replace|report|requested|reserve|reset|right-justified|rollback|round|rows|rtti|run|scan|screen|search|separated|scroll|scroll-boundary|select|select-options|selection-screen|selection-table|set|shared|shift|sign|sin|single|sinh|size|skip|sort|sorted|split|sql|sqrt|stamp|standard|start-of-selection|statics|stop|string|strlen|structure|submit|subtract|subtract-corresponding|sum|supply|suppress|symbol|syntax-check|syntax-trace|system-call|system-exceptions|table|table_line|tables|tan|tanh|text|textpool|time|times|title|titlebar|to|top-of-page|transaction|transfer|translate|transporting|trunc|type|type-pool|type-pools|types|uline|under|unique|unit|unpack|up|update|user-command|using|value|value-request|values|vary|when|where|while|window|with|with-title|work|write|x|xstring|z|zone)$/', + 'constants' => '/^((?i)initial|null|space|col_background|col_heading|col_normal|col_total|col_key|col_positive|col_negative|col_group)$/', + ), + ), + 0 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + 4 => -1, + 5 => + array ( + ), + 6 => + array ( + ), + 7 => + array ( + ), + 8 => + array ( + ), + 9 => + array ( + 'sy' => '/^((?i)screen-name|screen-group1|screen-group2|screen-group3|screen-group4|screen-required|screen-input|screen-output|screen-intensified|screen-invisible|screen-length|screen-active|sy-index|sy-pagno|sy-tabix|sy-tfill|sy-tlopc|sy-tmaxl|sy-toccu|sy-ttabc|sy-tstis|sy-ttabi|sy-dbcnt|sy-fdpos|sy-colno|sy-linct|sy-linno|sy-linsz|sy-pagct|sy-macol|sy-marow|sy-tleng|sy-sfoff|sy-willi|sy-lilli|sy-subrc|sy-fleng|sy-cucol|sy-curow|sy-lsind|sy-listi|sy-stepl|sy-tpagi|sy-winx1|sy-winy1|sy-winx2|sy-winy2|sy-winco|sy-winro|sy-windi|sy-srows|sy-scols|sy-loopc|sy-folen|sy-fodec|sy-tzone|sy-dayst|sy-ftype|sy-appli|sy-fdayw|sy-ccurs|sy-ccurt|sy-debug|sy-ctype|sy-input|sy-langu|sy-modno|sy-batch|sy-binpt|sy-calld|sy-dynnr|sy-dyngr|sy-newpa|sy-pri40|sy-rstrt|sy-wtitl|sy-cpage|sy-dbnam|sy-mandt|sy-prefx|sy-fmkey|sy-pexpi|sy-prini|sy-primm|sy-prrel|sy-playo|sy-prbig|sy-playp|sy-prnew|sy-prlog|sy-pdest|sy-plist|sy-pauth|sy-prdsn|sy-pnwpa|sy-callr|sy-repi2|sy-rtitl|sy-prrec|sy-prtxt|sy-prabt|sy-lpass|sy-nrpag|sy-paart|sy-prcop|sy-batzs|sy-bspld|sy-brep4|sy-batzo|sy-batzd|sy-batzw|sy-batzm|sy-ctabl|sy-dbsys|sy-dcsys|sy-macdb|sy-sysid|sy-opsys|sy-pfkey|sy-saprl|sy-tcode|sy-ucomm|sy-cfwae|sy-chwae|sy-spono|sy-sponr|sy-waers|sy-cdate|sy-datum|sy-slset|sy-subty|sy-subcs|sy-group|sy-ffile|sy-uzeit|sy-dsnam|sy-repid|sy-tabid|sy-tfdsn|sy-uname|sy-lstat|sy-abcde|sy-marky|sy-sfnam|sy-tname|sy-msgli|sy-title|sy-entry|sy-lisel|sy-uline|sy-xcode|sy-cprog|sy-xprog|sy-xform|sy-ldbpg|sy-tvar0|sy-tvar1|sy-tvar2|sy-tvar3|sy-tvar4|sy-tvar5|sy-tvar6|sy-tvar7|sy-tvar8|sy-tvar9|sy-msgid|sy-msgty|sy-msgno|sy-msgv1|sy-msgv2|sy-msgv3|sy-msgv4|sy-oncom|sy-vline|sy-winsl|sy-staco|sy-staro|sy-datar|sy-host|sy-locdb|sy-locop|sy-datlo|sy-timlo|sy-zonlo|syst-index|syst-pagno|syst-tabix|syst-tfill|syst-tlopc|syst-tmaxl|syst-toccu|syst-ttabc|syst-tstis|syst-ttabi|syst-dbcnt|syst-fdpos|syst-colno|syst-linct|syst-linno|syst-linsz|syst-pagct|syst-macol|syst-marow|syst-tleng|syst-sfoff|syst-willi|syst-lilli|syst-subrc|syst-fleng|syst-cucol|syst-curow|syst-lsind|syst-listi|syst-stepl|syst-tpagi|syst-winx1|syst-winy1|syst-winx2|syst-winy2|syst-winco|syst-winro|syst-windi|syst-srows|syst-scols|syst-loopc|syst-folen|syst-fodec|syst-tzone|syst-dayst|syst-ftype|syst-appli|syst-fdayw|syst-ccurs|syst-ccurt|syst-debug|syst-ctype|syst-input|syst-langu|syst-modno|syst-batch|syst-binpt|syst-calld|syst-dynnr|syst-dyngr|syst-newpa|syst-pri40|syst-rstrt|syst-wtitl|syst-cpage|syst-dbnam|syst-mandt|syst-prefx|syst-fmkey|syst-pexpi|syst-prini|syst-primm|syst-prrel|syst-playo|syst-prbig|syst-playp|syst-prnew|syst-prlog|syst-pdest|syst-plist|syst-pauth|syst-prdsn|syst-pnwpa|syst-callr|syst-repi2|syst-rtitl|syst-prrec|syst-prtxt|syst-prabt|syst-lpass|syst-nrpag|syst-paart|syst-prcop|syst-batzs|syst-bspld|syst-brep4|syst-batzo|syst-batzd|syst-batzw|syst-batzm|syst-ctabl|syst-dbsys|syst-dcsys|syst-macdb|syst-sysid|syst-opsys|syst-pfkey|syst-saprl|syst-tcode|syst-ucomm|syst-cfwae|syst-chwae|syst-spono|syst-sponr|syst-waers|syst-cdate|syst-datum|syst-slset|syst-subty|syst-subcs|syst-group|syst-ffile|syst-uzeit|syst-dsnam|syst-repid|syst-tabid|syst-tfdsn|syst-uname|syst-lstat|syst-abcde|syst-marky|syst-sfnam|syst-tname|syst-msgli|syst-title|syst-entry|syst-lisel|syst-uline|syst-xcode|syst-cprog|syst-xprog|syst-xform|syst-ldbpg|syst-tvar0|syst-tvar1|syst-tvar2|syst-tvar3|syst-tvar4|syst-tvar5|syst-tvar6|syst-tvar7|syst-tvar8|syst-tvar9|syst-msgid|syst-msgty|syst-msgno|syst-msgv1|syst-msgv2|syst-msgv3|syst-msgv4|syst-oncom|syst-vline|syst-winsl|syst-staco|syst-staro|syst-datar|syst-host|syst-locdb|syst-locop|syst-datlo|syst-timlo|syst-zonlo)$/', + 'reserved' => '/^((?i)abs|acos|add|add-corresponding|adjacent|after|aliases|all|analyzer|and|any|append|as|ascending|asin|assign|assigned|assigning|at|atan|authority-check|avg|back|before|begin|binary|bit|bit-and|bit-not|bit-or|bit-xor|blank|block|break-point|buffer|by|c|call|case|catch|ceil|centered|chain|change|changing|check|checkbox|class|class-data|class-events|class-methods|class-pool|clear|client|close|cnt|code|collect|color|comment|commit|communication|compute|concatenate|condense|constants|context|contexts|continue|control|controls|convert|copy|corresponding|cos|cosh|count|country|create|currency|cursor|customer-function|data|database|dataset|delete|decimals|default|define|demand|descending|describe|dialog|distinct|div|divide|divide-corresponding|do|duplicates|dynpro|edit|editor-call|else|elseif|end|end-of-definition|end-of-page|end-of-selection|endat|endcase|endcatch|endchain|endclass|enddo|endexec|endform|endfunction|endif|endinterface|endloop|endmethod|endmodule|endon|endprovide|endselect|endwhile|entries|events|exec|exit|exit-command|exp|exponent|export|exporting|exceptions|extended|extract|fetch|field|field-groups|field-symbols|fields|floor|for|form|format|frac|frame|free|from|function|function-pool|generate|get|group|hashed|header|help-id|help-request|hide|hotspot|icon|id|if|import|importing|include|index|infotypes|initialization|inner|input|insert|intensified|interface|interface-pool|interfaces|into|inverse|join|key|language|last|leave|left|left-justified|like|line|line-count|line-selection|line-size|lines|list-processing|load|load-of-program|local|locale|log|log10|loop|m|margin|mask|matchcode|max|memory|message|message-id|messages|method|methods|min|mod|mode|modif|modify|module|move|move-corresponding|multiply|multiply-corresponding|new|new-line|new-page|next|no|no-gap|no-gaps|no-heading|no-scrolling|no-sign|no-title|no-zero|nodes|non-unique|o|object|obligatory|occurs|of|off|on|open|or|order|others|outer|output|overlay|pack|page|parameter|parameters|perform|pf-status|position|print|print-control|private|process|program|property|protected|provide|public|put|radiobutton|raise|raising|range|ranges|read|receive|refresh|reject|replace|report|requested|reserve|reset|right-justified|rollback|round|rows|rtti|run|scan|screen|search|separated|scroll|scroll-boundary|select|select-options|selection-screen|selection-table|set|shared|shift|sign|sin|single|sinh|size|skip|sort|sorted|split|sql|sqrt|stamp|standard|start-of-selection|statics|stop|string|strlen|structure|submit|subtract|subtract-corresponding|sum|supply|suppress|symbol|syntax-check|syntax-trace|system-call|system-exceptions|table|table_line|tables|tan|tanh|text|textpool|time|times|title|titlebar|to|top-of-page|transaction|transfer|translate|transporting|trunc|type|type-pool|type-pools|types|uline|under|unique|unit|unpack|up|update|user-command|using|value|value-request|values|vary|when|where|while|window|with|with-title|work|write|x|xstring|z|zone)$/', + 'constants' => '/^((?i)initial|null|space|col_background|col_heading|col_normal|col_total|col_key|col_positive|col_negative|col_group)$/', + ), + ), + 1 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + 4 => -1, + 5 => + array ( + ), + 6 => + array ( + ), + 7 => + array ( + ), + 8 => + array ( + ), + 9 => + array ( + 'sy' => '/^((?i)screen-name|screen-group1|screen-group2|screen-group3|screen-group4|screen-required|screen-input|screen-output|screen-intensified|screen-invisible|screen-length|screen-active|sy-index|sy-pagno|sy-tabix|sy-tfill|sy-tlopc|sy-tmaxl|sy-toccu|sy-ttabc|sy-tstis|sy-ttabi|sy-dbcnt|sy-fdpos|sy-colno|sy-linct|sy-linno|sy-linsz|sy-pagct|sy-macol|sy-marow|sy-tleng|sy-sfoff|sy-willi|sy-lilli|sy-subrc|sy-fleng|sy-cucol|sy-curow|sy-lsind|sy-listi|sy-stepl|sy-tpagi|sy-winx1|sy-winy1|sy-winx2|sy-winy2|sy-winco|sy-winro|sy-windi|sy-srows|sy-scols|sy-loopc|sy-folen|sy-fodec|sy-tzone|sy-dayst|sy-ftype|sy-appli|sy-fdayw|sy-ccurs|sy-ccurt|sy-debug|sy-ctype|sy-input|sy-langu|sy-modno|sy-batch|sy-binpt|sy-calld|sy-dynnr|sy-dyngr|sy-newpa|sy-pri40|sy-rstrt|sy-wtitl|sy-cpage|sy-dbnam|sy-mandt|sy-prefx|sy-fmkey|sy-pexpi|sy-prini|sy-primm|sy-prrel|sy-playo|sy-prbig|sy-playp|sy-prnew|sy-prlog|sy-pdest|sy-plist|sy-pauth|sy-prdsn|sy-pnwpa|sy-callr|sy-repi2|sy-rtitl|sy-prrec|sy-prtxt|sy-prabt|sy-lpass|sy-nrpag|sy-paart|sy-prcop|sy-batzs|sy-bspld|sy-brep4|sy-batzo|sy-batzd|sy-batzw|sy-batzm|sy-ctabl|sy-dbsys|sy-dcsys|sy-macdb|sy-sysid|sy-opsys|sy-pfkey|sy-saprl|sy-tcode|sy-ucomm|sy-cfwae|sy-chwae|sy-spono|sy-sponr|sy-waers|sy-cdate|sy-datum|sy-slset|sy-subty|sy-subcs|sy-group|sy-ffile|sy-uzeit|sy-dsnam|sy-repid|sy-tabid|sy-tfdsn|sy-uname|sy-lstat|sy-abcde|sy-marky|sy-sfnam|sy-tname|sy-msgli|sy-title|sy-entry|sy-lisel|sy-uline|sy-xcode|sy-cprog|sy-xprog|sy-xform|sy-ldbpg|sy-tvar0|sy-tvar1|sy-tvar2|sy-tvar3|sy-tvar4|sy-tvar5|sy-tvar6|sy-tvar7|sy-tvar8|sy-tvar9|sy-msgid|sy-msgty|sy-msgno|sy-msgv1|sy-msgv2|sy-msgv3|sy-msgv4|sy-oncom|sy-vline|sy-winsl|sy-staco|sy-staro|sy-datar|sy-host|sy-locdb|sy-locop|sy-datlo|sy-timlo|sy-zonlo|syst-index|syst-pagno|syst-tabix|syst-tfill|syst-tlopc|syst-tmaxl|syst-toccu|syst-ttabc|syst-tstis|syst-ttabi|syst-dbcnt|syst-fdpos|syst-colno|syst-linct|syst-linno|syst-linsz|syst-pagct|syst-macol|syst-marow|syst-tleng|syst-sfoff|syst-willi|syst-lilli|syst-subrc|syst-fleng|syst-cucol|syst-curow|syst-lsind|syst-listi|syst-stepl|syst-tpagi|syst-winx1|syst-winy1|syst-winx2|syst-winy2|syst-winco|syst-winro|syst-windi|syst-srows|syst-scols|syst-loopc|syst-folen|syst-fodec|syst-tzone|syst-dayst|syst-ftype|syst-appli|syst-fdayw|syst-ccurs|syst-ccurt|syst-debug|syst-ctype|syst-input|syst-langu|syst-modno|syst-batch|syst-binpt|syst-calld|syst-dynnr|syst-dyngr|syst-newpa|syst-pri40|syst-rstrt|syst-wtitl|syst-cpage|syst-dbnam|syst-mandt|syst-prefx|syst-fmkey|syst-pexpi|syst-prini|syst-primm|syst-prrel|syst-playo|syst-prbig|syst-playp|syst-prnew|syst-prlog|syst-pdest|syst-plist|syst-pauth|syst-prdsn|syst-pnwpa|syst-callr|syst-repi2|syst-rtitl|syst-prrec|syst-prtxt|syst-prabt|syst-lpass|syst-nrpag|syst-paart|syst-prcop|syst-batzs|syst-bspld|syst-brep4|syst-batzo|syst-batzd|syst-batzw|syst-batzm|syst-ctabl|syst-dbsys|syst-dcsys|syst-macdb|syst-sysid|syst-opsys|syst-pfkey|syst-saprl|syst-tcode|syst-ucomm|syst-cfwae|syst-chwae|syst-spono|syst-sponr|syst-waers|syst-cdate|syst-datum|syst-slset|syst-subty|syst-subcs|syst-group|syst-ffile|syst-uzeit|syst-dsnam|syst-repid|syst-tabid|syst-tfdsn|syst-uname|syst-lstat|syst-abcde|syst-marky|syst-sfnam|syst-tname|syst-msgli|syst-title|syst-entry|syst-lisel|syst-uline|syst-xcode|syst-cprog|syst-xprog|syst-xform|syst-ldbpg|syst-tvar0|syst-tvar1|syst-tvar2|syst-tvar3|syst-tvar4|syst-tvar5|syst-tvar6|syst-tvar7|syst-tvar8|syst-tvar9|syst-msgid|syst-msgty|syst-msgno|syst-msgv1|syst-msgv2|syst-msgv3|syst-msgv4|syst-oncom|syst-vline|syst-winsl|syst-staco|syst-staro|syst-datar|syst-host|syst-locdb|syst-locop|syst-datlo|syst-timlo|syst-zonlo)$/', + 'reserved' => '/^((?i)abs|acos|add|add-corresponding|adjacent|after|aliases|all|analyzer|and|any|append|as|ascending|asin|assign|assigned|assigning|at|atan|authority-check|avg|back|before|begin|binary|bit|bit-and|bit-not|bit-or|bit-xor|blank|block|break-point|buffer|by|c|call|case|catch|ceil|centered|chain|change|changing|check|checkbox|class|class-data|class-events|class-methods|class-pool|clear|client|close|cnt|code|collect|color|comment|commit|communication|compute|concatenate|condense|constants|context|contexts|continue|control|controls|convert|copy|corresponding|cos|cosh|count|country|create|currency|cursor|customer-function|data|database|dataset|delete|decimals|default|define|demand|descending|describe|dialog|distinct|div|divide|divide-corresponding|do|duplicates|dynpro|edit|editor-call|else|elseif|end|end-of-definition|end-of-page|end-of-selection|endat|endcase|endcatch|endchain|endclass|enddo|endexec|endform|endfunction|endif|endinterface|endloop|endmethod|endmodule|endon|endprovide|endselect|endwhile|entries|events|exec|exit|exit-command|exp|exponent|export|exporting|exceptions|extended|extract|fetch|field|field-groups|field-symbols|fields|floor|for|form|format|frac|frame|free|from|function|function-pool|generate|get|group|hashed|header|help-id|help-request|hide|hotspot|icon|id|if|import|importing|include|index|infotypes|initialization|inner|input|insert|intensified|interface|interface-pool|interfaces|into|inverse|join|key|language|last|leave|left|left-justified|like|line|line-count|line-selection|line-size|lines|list-processing|load|load-of-program|local|locale|log|log10|loop|m|margin|mask|matchcode|max|memory|message|message-id|messages|method|methods|min|mod|mode|modif|modify|module|move|move-corresponding|multiply|multiply-corresponding|new|new-line|new-page|next|no|no-gap|no-gaps|no-heading|no-scrolling|no-sign|no-title|no-zero|nodes|non-unique|o|object|obligatory|occurs|of|off|on|open|or|order|others|outer|output|overlay|pack|page|parameter|parameters|perform|pf-status|position|print|print-control|private|process|program|property|protected|provide|public|put|radiobutton|raise|raising|range|ranges|read|receive|refresh|reject|replace|report|requested|reserve|reset|right-justified|rollback|round|rows|rtti|run|scan|screen|search|separated|scroll|scroll-boundary|select|select-options|selection-screen|selection-table|set|shared|shift|sign|sin|single|sinh|size|skip|sort|sorted|split|sql|sqrt|stamp|standard|start-of-selection|statics|stop|string|strlen|structure|submit|subtract|subtract-corresponding|sum|supply|suppress|symbol|syntax-check|syntax-trace|system-call|system-exceptions|table|table_line|tables|tan|tanh|text|textpool|time|times|title|titlebar|to|top-of-page|transaction|transfer|translate|transporting|trunc|type|type-pool|type-pools|types|uline|under|unique|unit|unpack|up|update|user-command|using|value|value-request|values|vary|when|where|while|window|with|with-title|work|write|x|xstring|z|zone)$/', + 'constants' => '/^((?i)initial|null|space|col_background|col_heading|col_normal|col_total|col_key|col_positive|col_negative|col_group)$/', + ), + ), + 2 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + 4 => -1, + 5 => + array ( + ), + 6 => + array ( + ), + 7 => + array ( + ), + 8 => + array ( + ), + 9 => + array ( + 'sy' => '/^((?i)screen-name|screen-group1|screen-group2|screen-group3|screen-group4|screen-required|screen-input|screen-output|screen-intensified|screen-invisible|screen-length|screen-active|sy-index|sy-pagno|sy-tabix|sy-tfill|sy-tlopc|sy-tmaxl|sy-toccu|sy-ttabc|sy-tstis|sy-ttabi|sy-dbcnt|sy-fdpos|sy-colno|sy-linct|sy-linno|sy-linsz|sy-pagct|sy-macol|sy-marow|sy-tleng|sy-sfoff|sy-willi|sy-lilli|sy-subrc|sy-fleng|sy-cucol|sy-curow|sy-lsind|sy-listi|sy-stepl|sy-tpagi|sy-winx1|sy-winy1|sy-winx2|sy-winy2|sy-winco|sy-winro|sy-windi|sy-srows|sy-scols|sy-loopc|sy-folen|sy-fodec|sy-tzone|sy-dayst|sy-ftype|sy-appli|sy-fdayw|sy-ccurs|sy-ccurt|sy-debug|sy-ctype|sy-input|sy-langu|sy-modno|sy-batch|sy-binpt|sy-calld|sy-dynnr|sy-dyngr|sy-newpa|sy-pri40|sy-rstrt|sy-wtitl|sy-cpage|sy-dbnam|sy-mandt|sy-prefx|sy-fmkey|sy-pexpi|sy-prini|sy-primm|sy-prrel|sy-playo|sy-prbig|sy-playp|sy-prnew|sy-prlog|sy-pdest|sy-plist|sy-pauth|sy-prdsn|sy-pnwpa|sy-callr|sy-repi2|sy-rtitl|sy-prrec|sy-prtxt|sy-prabt|sy-lpass|sy-nrpag|sy-paart|sy-prcop|sy-batzs|sy-bspld|sy-brep4|sy-batzo|sy-batzd|sy-batzw|sy-batzm|sy-ctabl|sy-dbsys|sy-dcsys|sy-macdb|sy-sysid|sy-opsys|sy-pfkey|sy-saprl|sy-tcode|sy-ucomm|sy-cfwae|sy-chwae|sy-spono|sy-sponr|sy-waers|sy-cdate|sy-datum|sy-slset|sy-subty|sy-subcs|sy-group|sy-ffile|sy-uzeit|sy-dsnam|sy-repid|sy-tabid|sy-tfdsn|sy-uname|sy-lstat|sy-abcde|sy-marky|sy-sfnam|sy-tname|sy-msgli|sy-title|sy-entry|sy-lisel|sy-uline|sy-xcode|sy-cprog|sy-xprog|sy-xform|sy-ldbpg|sy-tvar0|sy-tvar1|sy-tvar2|sy-tvar3|sy-tvar4|sy-tvar5|sy-tvar6|sy-tvar7|sy-tvar8|sy-tvar9|sy-msgid|sy-msgty|sy-msgno|sy-msgv1|sy-msgv2|sy-msgv3|sy-msgv4|sy-oncom|sy-vline|sy-winsl|sy-staco|sy-staro|sy-datar|sy-host|sy-locdb|sy-locop|sy-datlo|sy-timlo|sy-zonlo|syst-index|syst-pagno|syst-tabix|syst-tfill|syst-tlopc|syst-tmaxl|syst-toccu|syst-ttabc|syst-tstis|syst-ttabi|syst-dbcnt|syst-fdpos|syst-colno|syst-linct|syst-linno|syst-linsz|syst-pagct|syst-macol|syst-marow|syst-tleng|syst-sfoff|syst-willi|syst-lilli|syst-subrc|syst-fleng|syst-cucol|syst-curow|syst-lsind|syst-listi|syst-stepl|syst-tpagi|syst-winx1|syst-winy1|syst-winx2|syst-winy2|syst-winco|syst-winro|syst-windi|syst-srows|syst-scols|syst-loopc|syst-folen|syst-fodec|syst-tzone|syst-dayst|syst-ftype|syst-appli|syst-fdayw|syst-ccurs|syst-ccurt|syst-debug|syst-ctype|syst-input|syst-langu|syst-modno|syst-batch|syst-binpt|syst-calld|syst-dynnr|syst-dyngr|syst-newpa|syst-pri40|syst-rstrt|syst-wtitl|syst-cpage|syst-dbnam|syst-mandt|syst-prefx|syst-fmkey|syst-pexpi|syst-prini|syst-primm|syst-prrel|syst-playo|syst-prbig|syst-playp|syst-prnew|syst-prlog|syst-pdest|syst-plist|syst-pauth|syst-prdsn|syst-pnwpa|syst-callr|syst-repi2|syst-rtitl|syst-prrec|syst-prtxt|syst-prabt|syst-lpass|syst-nrpag|syst-paart|syst-prcop|syst-batzs|syst-bspld|syst-brep4|syst-batzo|syst-batzd|syst-batzw|syst-batzm|syst-ctabl|syst-dbsys|syst-dcsys|syst-macdb|syst-sysid|syst-opsys|syst-pfkey|syst-saprl|syst-tcode|syst-ucomm|syst-cfwae|syst-chwae|syst-spono|syst-sponr|syst-waers|syst-cdate|syst-datum|syst-slset|syst-subty|syst-subcs|syst-group|syst-ffile|syst-uzeit|syst-dsnam|syst-repid|syst-tabid|syst-tfdsn|syst-uname|syst-lstat|syst-abcde|syst-marky|syst-sfnam|syst-tname|syst-msgli|syst-title|syst-entry|syst-lisel|syst-uline|syst-xcode|syst-cprog|syst-xprog|syst-xform|syst-ldbpg|syst-tvar0|syst-tvar1|syst-tvar2|syst-tvar3|syst-tvar4|syst-tvar5|syst-tvar6|syst-tvar7|syst-tvar8|syst-tvar9|syst-msgid|syst-msgty|syst-msgno|syst-msgv1|syst-msgv2|syst-msgv3|syst-msgv4|syst-oncom|syst-vline|syst-winsl|syst-staco|syst-staro|syst-datar|syst-host|syst-locdb|syst-locop|syst-datlo|syst-timlo|syst-zonlo)$/', + 'reserved' => '/^((?i)abs|acos|add|add-corresponding|adjacent|after|aliases|all|analyzer|and|any|append|as|ascending|asin|assign|assigned|assigning|at|atan|authority-check|avg|back|before|begin|binary|bit|bit-and|bit-not|bit-or|bit-xor|blank|block|break-point|buffer|by|c|call|case|catch|ceil|centered|chain|change|changing|check|checkbox|class|class-data|class-events|class-methods|class-pool|clear|client|close|cnt|code|collect|color|comment|commit|communication|compute|concatenate|condense|constants|context|contexts|continue|control|controls|convert|copy|corresponding|cos|cosh|count|country|create|currency|cursor|customer-function|data|database|dataset|delete|decimals|default|define|demand|descending|describe|dialog|distinct|div|divide|divide-corresponding|do|duplicates|dynpro|edit|editor-call|else|elseif|end|end-of-definition|end-of-page|end-of-selection|endat|endcase|endcatch|endchain|endclass|enddo|endexec|endform|endfunction|endif|endinterface|endloop|endmethod|endmodule|endon|endprovide|endselect|endwhile|entries|events|exec|exit|exit-command|exp|exponent|export|exporting|exceptions|extended|extract|fetch|field|field-groups|field-symbols|fields|floor|for|form|format|frac|frame|free|from|function|function-pool|generate|get|group|hashed|header|help-id|help-request|hide|hotspot|icon|id|if|import|importing|include|index|infotypes|initialization|inner|input|insert|intensified|interface|interface-pool|interfaces|into|inverse|join|key|language|last|leave|left|left-justified|like|line|line-count|line-selection|line-size|lines|list-processing|load|load-of-program|local|locale|log|log10|loop|m|margin|mask|matchcode|max|memory|message|message-id|messages|method|methods|min|mod|mode|modif|modify|module|move|move-corresponding|multiply|multiply-corresponding|new|new-line|new-page|next|no|no-gap|no-gaps|no-heading|no-scrolling|no-sign|no-title|no-zero|nodes|non-unique|o|object|obligatory|occurs|of|off|on|open|or|order|others|outer|output|overlay|pack|page|parameter|parameters|perform|pf-status|position|print|print-control|private|process|program|property|protected|provide|public|put|radiobutton|raise|raising|range|ranges|read|receive|refresh|reject|replace|report|requested|reserve|reset|right-justified|rollback|round|rows|rtti|run|scan|screen|search|separated|scroll|scroll-boundary|select|select-options|selection-screen|selection-table|set|shared|shift|sign|sin|single|sinh|size|skip|sort|sorted|split|sql|sqrt|stamp|standard|start-of-selection|statics|stop|string|strlen|structure|submit|subtract|subtract-corresponding|sum|supply|suppress|symbol|syntax-check|syntax-trace|system-call|system-exceptions|table|table_line|tables|tan|tanh|text|textpool|time|times|title|titlebar|to|top-of-page|transaction|transfer|translate|transporting|trunc|type|type-pool|type-pools|types|uline|under|unique|unit|unpack|up|update|user-command|using|value|value-request|values|vary|when|where|while|window|with|with-title|work|write|x|xstring|z|zone)$/', + 'constants' => '/^((?i)initial|null|space|col_background|col_heading|col_normal|col_total|col_key|col_positive|col_negative|col_group)$/', + ), + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_parts = array ( + 0 => + array ( + 0 => NULL, + 1 => NULL, + 2 => NULL, + 3 => NULL, + 4 => NULL, + 5 => NULL, + 6 => NULL, + 7 => NULL, + 8 => NULL, + 9 => NULL, + ), + 1 => + array ( + 0 => NULL, + 1 => NULL, + 2 => NULL, + 3 => NULL, + 4 => NULL, + 5 => NULL, + 6 => NULL, + 7 => NULL, + 8 => NULL, + 9 => NULL, + ), + 2 => + array ( + 0 => NULL, + 1 => NULL, + 2 => NULL, + 3 => NULL, + 4 => NULL, + 5 => NULL, + 6 => NULL, + 7 => NULL, + 8 => NULL, + 9 => NULL, + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_subst = array ( + -1 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + ), + 0 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + 7 => false, + 8 => false, + 9 => false, + ), + 1 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + 7 => false, + 8 => false, + 9 => false, + ), + 2 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + 7 => false, + 8 => false, + 9 => false, + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_conditions = array ( + ); + $this->_kwmap = array ( + 'sy' => 'reserved', + 'reserved' => 'reserved', + 'constants' => 'reserved', + ); + $this->_defClass = 'code'; + $this->_checkDefines(); + } + +} \ No newline at end of file diff --git a/framework/3rdParty/TextHighlighter/Text/Highlighter/CPP.php b/framework/3rdParty/TextHighlighter/Text/Highlighter/CPP.php new file mode 100644 index 00000000..7be6add9 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/Highlighter/CPP.php @@ -0,0 +1,840 @@ + + * + */ + +/** + * Auto-generated class. CPP syntax highlighting + * + * @author Aaron Kalin + * @author Andrey Demenev + * @category Text + * @package Text_Highlighter + * @copyright 2004-2006 Andrey Demenev + * @license http://www.php.net/license/3_0.txt PHP License + * @version Release: 0.7.0 + * @link http://pear.php.net/package/Text_Highlighter + */ +class Text_Highlighter_CPP extends Text_Highlighter +{ + var $_language = 'cpp'; + + /** + * Constructor + * + * @param array $options + * @access public + */ + function __construct($options=array()) + { + + $this->_options = $options; + $this->_regs = array ( + -1 => '/((?i)")|((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)[a-z_]\\w*)|((?mi)^[ \\t]*#include)|((?mii)^[ \\t]*#[ \\t]*[a-z]+)|((?i)\\d*\\.?\\d+)|((?i)\\/\\*)|((?i)\\/\\/.+)/', + 0 => '/((?i)\\\\)/', + 1 => '/((?i)")|((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)[a-z_]\\w*)|((?i)\\b0[xX][\\da-f]+)|((?i)\\b\\d\\d*|\\b0\\b)|((?i)\\b0[0-7]+)|((?i)\\b(\\d*\\.\\d+)|(\\d+\\.\\d*))|((?mi)^[ \\t]*#include)|((?mii)^[ \\t]*#[ \\t]*[a-z]+)|((?i)\\d*\\.?\\d+)|((?i)\\/\\*)|((?i)\\/\\/.+)/', + 2 => '/((?i)")|((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)[a-z_]\\w*)|((?i)\\b0[xX][\\da-f]+)|((?i)\\b\\d\\d*|\\b0\\b)|((?i)\\b0[0-7]+)|((?i)\\b(\\d*\\.\\d+)|(\\d+\\.\\d*))|((?mi)^[ \\t]*#include)|((?mii)^[ \\t]*#[ \\t]*[a-z]+)|((?i)\\d*\\.?\\d+)|((?i)\\/\\*)|((?i)\\/\\/.+)/', + 3 => '/((?i)")|((?i)\\{)|((?i)\\()|((?i)\\[)|((?i)[a-z_]\\w*)|((?i)\\b0[xX][\\da-f]+)|((?i)\\b\\d\\d*|\\b0\\b)|((?i)\\b0[0-7]+)|((?i)\\b(\\d*\\.\\d+)|(\\d+\\.\\d*))|((?mi)^[ \\t]*#include)|((?mii)^[ \\t]*#[ \\t]*[a-z]+)|((?i)\\d*\\.?\\d+)|((?i)\\/\\*)|((?i)\\/\\/.+)/', + 4 => '//', + 5 => '/((?i)")|((?i)<)/', + 6 => '/((?i)")|((?i)\\{)|((?i)\\()|((?i)[a-z_]\\w*)|((?i)\\b0[xX][\\da-f]+)|((?i)\\b\\d\\d*|\\b0\\b)|((?i)\\b0[0-7]+)|((?i)\\b(\\d*\\.\\d+)|(\\d+\\.\\d*))|((?i)\\/\\*)|((?i)\\/\\/.+)/', + 7 => '/((?i)\\$\\w+\\s*:.+\\$)/', + 8 => '/((?i)\\$\\w+\\s*:.+\\$)/', + ); + $this->_counts = array ( + -1 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 0, + 8 => 0, + 9 => 0, + ), + 0 => + array ( + 0 => 0, + ), + 1 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 0, + 8 => 2, + 9 => 0, + 10 => 0, + 11 => 0, + 12 => 0, + 13 => 0, + ), + 2 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 0, + 8 => 2, + 9 => 0, + 10 => 0, + 11 => 0, + 12 => 0, + 13 => 0, + ), + 3 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 0, + 8 => 2, + 9 => 0, + 10 => 0, + 11 => 0, + 12 => 0, + 13 => 0, + ), + 4 => + array ( + ), + 5 => + array ( + 0 => 0, + 1 => 0, + ), + 6 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + 3 => 0, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 2, + 8 => 0, + 9 => 0, + ), + 7 => + array ( + 0 => 0, + ), + 8 => + array ( + 0 => 0, + ), + ); + $this->_delim = array ( + -1 => + array ( + 0 => 'quotes', + 1 => 'brackets', + 2 => 'brackets', + 3 => 'brackets', + 4 => '', + 5 => 'prepro', + 6 => 'prepro', + 7 => '', + 8 => 'mlcomment', + 9 => 'comment', + ), + 0 => + array ( + 0 => '', + ), + 1 => + array ( + 0 => 'quotes', + 1 => 'brackets', + 2 => 'brackets', + 3 => 'brackets', + 4 => '', + 5 => '', + 6 => '', + 7 => '', + 8 => '', + 9 => 'prepro', + 10 => 'prepro', + 11 => '', + 12 => 'mlcomment', + 13 => 'comment', + ), + 2 => + array ( + 0 => 'quotes', + 1 => 'brackets', + 2 => 'brackets', + 3 => 'brackets', + 4 => '', + 5 => '', + 6 => '', + 7 => '', + 8 => '', + 9 => 'prepro', + 10 => 'prepro', + 11 => '', + 12 => 'mlcomment', + 13 => 'comment', + ), + 3 => + array ( + 0 => 'quotes', + 1 => 'brackets', + 2 => 'brackets', + 3 => 'brackets', + 4 => '', + 5 => '', + 6 => '', + 7 => '', + 8 => '', + 9 => 'prepro', + 10 => 'prepro', + 11 => '', + 12 => 'mlcomment', + 13 => 'comment', + ), + 4 => + array ( + ), + 5 => + array ( + 0 => 'quotes', + 1 => 'quotes', + ), + 6 => + array ( + 0 => 'quotes', + 1 => 'brackets', + 2 => 'brackets', + 3 => '', + 4 => '', + 5 => '', + 6 => '', + 7 => '', + 8 => 'mlcomment', + 9 => 'comment', + ), + 7 => + array ( + 0 => '', + ), + 8 => + array ( + 0 => '', + ), + ); + $this->_inner = array ( + -1 => + array ( + 0 => 'string', + 1 => 'code', + 2 => 'code', + 3 => 'code', + 4 => 'identifier', + 5 => 'prepro', + 6 => 'code', + 7 => 'number', + 8 => 'mlcomment', + 9 => 'comment', + ), + 0 => + array ( + 0 => 'special', + ), + 1 => + array ( + 0 => 'string', + 1 => 'code', + 2 => 'code', + 3 => 'code', + 4 => 'identifier', + 5 => 'number', + 6 => 'number', + 7 => 'number', + 8 => 'number', + 9 => 'prepro', + 10 => 'code', + 11 => 'number', + 12 => 'mlcomment', + 13 => 'comment', + ), + 2 => + array ( + 0 => 'string', + 1 => 'code', + 2 => 'code', + 3 => 'code', + 4 => 'identifier', + 5 => 'number', + 6 => 'number', + 7 => 'number', + 8 => 'number', + 9 => 'prepro', + 10 => 'code', + 11 => 'number', + 12 => 'mlcomment', + 13 => 'comment', + ), + 3 => + array ( + 0 => 'string', + 1 => 'code', + 2 => 'code', + 3 => 'code', + 4 => 'identifier', + 5 => 'number', + 6 => 'number', + 7 => 'number', + 8 => 'number', + 9 => 'prepro', + 10 => 'code', + 11 => 'number', + 12 => 'mlcomment', + 13 => 'comment', + ), + 4 => + array ( + ), + 5 => + array ( + 0 => 'string', + 1 => 'string', + ), + 6 => + array ( + 0 => 'string', + 1 => 'code', + 2 => 'code', + 3 => 'identifier', + 4 => 'number', + 5 => 'number', + 6 => 'number', + 7 => 'number', + 8 => 'mlcomment', + 9 => 'comment', + ), + 7 => + array ( + 0 => 'inlinedoc', + ), + 8 => + array ( + 0 => 'inlinedoc', + ), + ); + $this->_end = array ( + 0 => '/(?i)"/', + 1 => '/(?i)\\}/', + 2 => '/(?i)\\)/', + 3 => '/(?i)\\]/', + 4 => '/(?i)>/', + 5 => '/(?mi)(? '/(?mi)(? '/(?i)\\*\\//', + 8 => '/(?mi)$/', + ); + $this->_states = array ( + -1 => + array ( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => -1, + 5 => 5, + 6 => 6, + 7 => -1, + 8 => 7, + 9 => 8, + ), + 0 => + array ( + 0 => -1, + ), + 1 => + array ( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => -1, + 5 => -1, + 6 => -1, + 7 => -1, + 8 => -1, + 9 => 5, + 10 => 6, + 11 => -1, + 12 => 7, + 13 => 8, + ), + 2 => + array ( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => -1, + 5 => -1, + 6 => -1, + 7 => -1, + 8 => -1, + 9 => 5, + 10 => 6, + 11 => -1, + 12 => 7, + 13 => 8, + ), + 3 => + array ( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => -1, + 5 => -1, + 6 => -1, + 7 => -1, + 8 => -1, + 9 => 5, + 10 => 6, + 11 => -1, + 12 => 7, + 13 => 8, + ), + 4 => + array ( + ), + 5 => + array ( + 0 => 0, + 1 => 4, + ), + 6 => + array ( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => -1, + 4 => -1, + 5 => -1, + 6 => -1, + 7 => -1, + 8 => 7, + 9 => 8, + ), + 7 => + array ( + 0 => -1, + ), + 8 => + array ( + 0 => -1, + ), + ); + $this->_keywords = array ( + -1 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + 4 => + array ( + 'reserved' => '/^(and|and_eq|asm|bitand|bitor|break|case|catch|compl|const_cast|continue|default|delete|do|dynamic_cast|else|for|fortran|friend|goto|if|new|not|not_eq|operator|or|or_eq|private|protected|public|reinterpret_cast|return|sizeof|static_cast|switch|this|throw|try|typeid|using|while|xor|xor_eq|false|true)$/', + 'types' => '/^(auto|bool|char|class|const|double|enum|explicit|export|extern|float|inline|int|long|mutable|namespace|register|short|signed|static|struct|template|typedef|typename|union|unsigned|virtual|void|volatile|wchar_t)$/', + 'Common Macros' => '/^(NULL|TRUE|FALSE|MAX|MIN|__LINE__|__DATA__|__FILE__|__TIME__|__STDC__)$/', + ), + 5 => -1, + 6 => -1, + 7 => + array ( + ), + 8 => -1, + 9 => -1, + ), + 0 => + array ( + 0 => + array ( + ), + ), + 1 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + 4 => + array ( + 'reserved' => '/^(and|and_eq|asm|bitand|bitor|break|case|catch|compl|const_cast|continue|default|delete|do|dynamic_cast|else|for|fortran|friend|goto|if|new|not|not_eq|operator|or|or_eq|private|protected|public|reinterpret_cast|return|sizeof|static_cast|switch|this|throw|try|typeid|using|while|xor|xor_eq|false|true)$/', + 'types' => '/^(auto|bool|char|class|const|double|enum|explicit|export|extern|float|inline|int|long|mutable|namespace|register|short|signed|static|struct|template|typedef|typename|union|unsigned|virtual|void|volatile|wchar_t)$/', + 'Common Macros' => '/^(NULL|TRUE|FALSE|MAX|MIN|__LINE__|__DATA__|__FILE__|__TIME__|__STDC__)$/', + ), + 5 => + array ( + ), + 6 => + array ( + ), + 7 => + array ( + ), + 8 => + array ( + ), + 9 => -1, + 10 => -1, + 11 => + array ( + ), + 12 => -1, + 13 => -1, + ), + 2 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + 4 => + array ( + 'reserved' => '/^(and|and_eq|asm|bitand|bitor|break|case|catch|compl|const_cast|continue|default|delete|do|dynamic_cast|else|for|fortran|friend|goto|if|new|not|not_eq|operator|or|or_eq|private|protected|public|reinterpret_cast|return|sizeof|static_cast|switch|this|throw|try|typeid|using|while|xor|xor_eq|false|true)$/', + 'types' => '/^(auto|bool|char|class|const|double|enum|explicit|export|extern|float|inline|int|long|mutable|namespace|register|short|signed|static|struct|template|typedef|typename|union|unsigned|virtual|void|volatile|wchar_t)$/', + 'Common Macros' => '/^(NULL|TRUE|FALSE|MAX|MIN|__LINE__|__DATA__|__FILE__|__TIME__|__STDC__)$/', + ), + 5 => + array ( + ), + 6 => + array ( + ), + 7 => + array ( + ), + 8 => + array ( + ), + 9 => -1, + 10 => -1, + 11 => + array ( + ), + 12 => -1, + 13 => -1, + ), + 3 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + 4 => + array ( + 'reserved' => '/^(and|and_eq|asm|bitand|bitor|break|case|catch|compl|const_cast|continue|default|delete|do|dynamic_cast|else|for|fortran|friend|goto|if|new|not|not_eq|operator|or|or_eq|private|protected|public|reinterpret_cast|return|sizeof|static_cast|switch|this|throw|try|typeid|using|while|xor|xor_eq|false|true)$/', + 'types' => '/^(auto|bool|char|class|const|double|enum|explicit|export|extern|float|inline|int|long|mutable|namespace|register|short|signed|static|struct|template|typedef|typename|union|unsigned|virtual|void|volatile|wchar_t)$/', + 'Common Macros' => '/^(NULL|TRUE|FALSE|MAX|MIN|__LINE__|__DATA__|__FILE__|__TIME__|__STDC__)$/', + ), + 5 => + array ( + ), + 6 => + array ( + ), + 7 => + array ( + ), + 8 => + array ( + ), + 9 => -1, + 10 => -1, + 11 => + array ( + ), + 12 => -1, + 13 => -1, + ), + 4 => + array ( + ), + 5 => + array ( + 0 => -1, + 1 => -1, + ), + 6 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => + array ( + 'reserved' => '/^(and|and_eq|asm|bitand|bitor|break|case|catch|compl|const_cast|continue|default|delete|do|dynamic_cast|else|for|fortran|friend|goto|if|new|not|not_eq|operator|or|or_eq|private|protected|public|reinterpret_cast|return|sizeof|static_cast|switch|this|throw|try|typeid|using|while|xor|xor_eq|false|true)$/', + 'types' => '/^(auto|bool|char|class|const|double|enum|explicit|export|extern|float|inline|int|long|mutable|namespace|register|short|signed|static|struct|template|typedef|typename|union|unsigned|virtual|void|volatile|wchar_t)$/', + 'Common Macros' => '/^(NULL|TRUE|FALSE|MAX|MIN|__LINE__|__DATA__|__FILE__|__TIME__|__STDC__)$/', + ), + 4 => + array ( + ), + 5 => + array ( + ), + 6 => + array ( + ), + 7 => + array ( + ), + 8 => -1, + 9 => -1, + ), + 7 => + array ( + 0 => + array ( + ), + ), + 8 => + array ( + 0 => + array ( + ), + ), + ); + $this->_parts = array ( + 0 => + array ( + 0 => NULL, + ), + 1 => + array ( + 0 => NULL, + 1 => NULL, + 2 => NULL, + 3 => NULL, + 4 => NULL, + 5 => NULL, + 6 => NULL, + 7 => NULL, + 8 => NULL, + 9 => NULL, + 10 => NULL, + 11 => NULL, + 12 => NULL, + 13 => NULL, + ), + 2 => + array ( + 0 => NULL, + 1 => NULL, + 2 => NULL, + 3 => NULL, + 4 => NULL, + 5 => NULL, + 6 => NULL, + 7 => NULL, + 8 => NULL, + 9 => NULL, + 10 => NULL, + 11 => NULL, + 12 => NULL, + 13 => NULL, + ), + 3 => + array ( + 0 => NULL, + 1 => NULL, + 2 => NULL, + 3 => NULL, + 4 => NULL, + 5 => NULL, + 6 => NULL, + 7 => NULL, + 8 => NULL, + 9 => NULL, + 10 => NULL, + 11 => NULL, + 12 => NULL, + 13 => NULL, + ), + 4 => + array ( + ), + 5 => + array ( + 0 => NULL, + 1 => NULL, + ), + 6 => + array ( + 0 => NULL, + 1 => NULL, + 2 => NULL, + 3 => NULL, + 4 => NULL, + 5 => NULL, + 6 => NULL, + 7 => NULL, + 8 => NULL, + 9 => NULL, + ), + 7 => + array ( + 0 => NULL, + ), + 8 => + array ( + 0 => NULL, + ), + ); + $this->_subst = array ( + -1 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + 7 => false, + 8 => false, + 9 => false, + ), + 0 => + array ( + 0 => false, + ), + 1 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + 7 => false, + 8 => false, + 9 => false, + 10 => false, + 11 => false, + 12 => false, + 13 => false, + ), + 2 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + 7 => false, + 8 => false, + 9 => false, + 10 => false, + 11 => false, + 12 => false, + 13 => false, + ), + 3 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + 7 => false, + 8 => false, + 9 => false, + 10 => false, + 11 => false, + 12 => false, + 13 => false, + ), + 4 => + array ( + ), + 5 => + array ( + 0 => false, + 1 => false, + ), + 6 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + 7 => false, + 8 => false, + 9 => false, + ), + 7 => + array ( + 0 => false, + ), + 8 => + array ( + 0 => false, + ), + ); + $this->_conditions = array ( + ); + $this->_kwmap = array ( + 'reserved' => 'reserved', + 'types' => 'types', + 'Common Macros' => 'prepro', + ); + $this->_defClass = 'code'; + $this->_checkDefines(); + } + +} \ No newline at end of file diff --git a/framework/3rdParty/TextHighlighter/Text/Highlighter/CSS.php b/framework/3rdParty/TextHighlighter/Text/Highlighter/CSS.php new file mode 100644 index 00000000..04705ff6 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/Highlighter/CSS.php @@ -0,0 +1,383 @@ + + * + */ + +/** + * Auto-generated class. CSS syntax highlighting + * + * @author Andrey Demenev + * @category Text + * @package Text_Highlighter + * @copyright 2004-2006 Andrey Demenev + * @license http://www.php.net/license/3_0.txt PHP License + * @version Release: 0.7.0 + * @link http://pear.php.net/package/Text_Highlighter + */ +class Text_Highlighter_CSS extends Text_Highlighter +{ + var $_language = 'css'; + + /** + * Constructor + * + * @param array $options + * @access public + */ + function __construct($options=array()) + { + + $this->_options = $options; + $this->_regs = array ( + -1 => '/((?i)(@[a-z\\d]+))|((?i)(((\\.|#)?[a-z]+[a-z\\d\\-]*(?![a-z\\d\\-]))|(\\*))(?!\\s*:\\s*[\\s\\{]))|((?i):[a-z][a-z\\d\\-]*)|((?i)\\[)|((?i)\\{)/', + 0 => '/((?i)\\d*\\.?\\d+(\\%|em|ex|pc|pt|px|in|mm|cm))|((?i)\\d*\\.?\\d+)|((?i)[a-z][a-z\\d\\-]*)|((?i)#([\\da-f]{6}|[\\da-f]{3})\\b)/', + 1 => '/((?i)\')|((?i)")|((?i)[\\w\\-\\:]+)/', + 2 => '/((?i)[a-z][a-z\\d\\-]*\\s*:)|((?i)(((\\.|#)?[a-z]+[a-z\\d\\-]*(?![a-z\\d\\-]))|(\\*))(?!\\s*:\\s*[\\s\\{]))|((?i)\\{)/', + 3 => '/((?i)\\\\[\\\\(\\\\)\\\\])/', + 4 => '/((?i)\\\\\\\\|\\\\"|\\\\\'|\\\\`)/', + 5 => '/((?i)\\\\\\\\|\\\\"|\\\\\'|\\\\`|\\\\t|\\\\n|\\\\r)/', + ); + $this->_counts = array ( + -1 => + array ( + 0 => 1, + 1 => 4, + 2 => 0, + 3 => 0, + 4 => 0, + ), + 0 => + array ( + 0 => 1, + 1 => 0, + 2 => 0, + 3 => 1, + ), + 1 => + array ( + 0 => 0, + 1 => 0, + 2 => 0, + ), + 2 => + array ( + 0 => 0, + 1 => 4, + 2 => 0, + ), + 3 => + array ( + 0 => 0, + ), + 4 => + array ( + 0 => 0, + ), + 5 => + array ( + 0 => 0, + ), + ); + $this->_delim = array ( + -1 => + array ( + 0 => '', + 1 => '', + 2 => '', + 3 => 'brackets', + 4 => 'brackets', + ), + 0 => + array ( + 0 => '', + 1 => '', + 2 => '', + 3 => '', + ), + 1 => + array ( + 0 => 'quotes', + 1 => 'quotes', + 2 => '', + ), + 2 => + array ( + 0 => 'reserved', + 1 => '', + 2 => 'brackets', + ), + 3 => + array ( + 0 => '', + ), + 4 => + array ( + 0 => '', + ), + 5 => + array ( + 0 => '', + ), + ); + $this->_inner = array ( + -1 => + array ( + 0 => 'var', + 1 => 'identifier', + 2 => 'special', + 3 => 'code', + 4 => 'code', + ), + 0 => + array ( + 0 => 'number', + 1 => 'number', + 2 => 'code', + 3 => 'var', + ), + 1 => + array ( + 0 => 'string', + 1 => 'string', + 2 => 'var', + ), + 2 => + array ( + 0 => 'code', + 1 => 'identifier', + 2 => 'code', + ), + 3 => + array ( + 0 => 'string', + ), + 4 => + array ( + 0 => 'special', + ), + 5 => + array ( + 0 => 'special', + ), + ); + $this->_end = array ( + 0 => '/(?i)(?=;|\\})/', + 1 => '/(?i)\\]/', + 2 => '/(?i)\\}/', + 3 => '/(?i)\\)/', + 4 => '/(?i)\'/', + 5 => '/(?i)"/', + ); + $this->_states = array ( + -1 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => 1, + 4 => 2, + ), + 0 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + ), + 1 => + array ( + 0 => 4, + 1 => 5, + 2 => -1, + ), + 2 => + array ( + 0 => 0, + 1 => -1, + 2 => 2, + ), + 3 => + array ( + 0 => -1, + ), + 4 => + array ( + 0 => -1, + ), + 5 => + array ( + 0 => -1, + ), + ); + $this->_keywords = array ( + -1 => + array ( + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + ), + 3 => -1, + 4 => -1, + ), + 0 => + array ( + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + 'propertyValue' => '/^((?i)far-left|left|center-left|center-right|center|far-right|right-side|right|behind|leftwards|rightwards|inherit|scroll|fixed|transparent|none|repeat-x|repeat-y|repeat|no-repeat|collapse|separate|auto|top|bottom|both|open-quote|close-quote|no-open-quote|no-close-quote|crosshair|default|pointer|move|e-resize|ne-resize|nw-resize|n-resize|se-resize|sw-resize|s-resize|text|wait|help|ltr|rtl|inline|block|list-item|run-in|compact|marker|table|inline-table|table-row-group|table-header-group|table-footer-group|table-row|table-column-group|table-column|table-cell|table-caption|below|level|above|higher|lower|show|hide|caption|icon|menu|message-box|small-caption|status-bar|normal|wider|narrower|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|italic|oblique|small-caps|bold|bolder|lighter|inside|outside|disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-alpha|lower-latin|upper-alpha|upper-latin|hebrew|armenian|georgian|cjk-ideographic|hiragana|katakana|hiragana-iroha|katakana-iroha|crop|cross|invert|visible|hidden|always|avoid|x-low|low|medium|high|x-high|mix?|repeat?|static|relative|absolute|portrait|landscape|spell-out|once|digits|continuous|code|x-slow|slow|fast|x-fast|faster|slower|justify|underline|overline|line-through|blink|capitalize|uppercase|lowercase|embed|bidi-override|baseline|sub|super|text-top|middle|text-bottom|silent|x-soft|soft|loud|x-loud|pre|nowrap|serif|sans-serif|cursive|fantasy|monospace|empty|string|strict|loose|char|true|false|dotted|dashed|solid|double|groove|ridge|inset|outset|larger|smaller|xx-small|x-small|small|large|x-large|xx-large|all|newspaper|distribute|distribute-all-lines|distribute-center-last|inter-word|inter-ideograph|inter-cluster|kashida|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|keep-all|break-all|break-word|lr-tb|tb-rl|thin|thick|inline-block|w-resize|hand|distribute-letter|distribute-space|whitespace|male|female|child)$/', + 'namedcolor' => '/^((?i)aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|white|yellow|activeborder|activecaption|appworkspace|background|buttonface|buttonhighlight|buttonshadow|buttontext|captiontext|graytext|highlight|highlighttext|inactiveborder|inactivecaption|inactivecaptiontext|infobackground|infotext|menu|menutext|scrollbar|threeddarkshadow|threedface|threedhighlight|threedlightshadow|threedshadow|window|windowframe|windowtext)$/', + ), + 3 => + array ( + ), + ), + 1 => + array ( + 0 => -1, + 1 => -1, + 2 => + array ( + ), + ), + 2 => + array ( + 0 => -1, + 1 => + array ( + ), + 2 => -1, + ), + 3 => + array ( + 0 => + array ( + ), + ), + 4 => + array ( + 0 => + array ( + ), + ), + 5 => + array ( + 0 => + array ( + ), + ), + ); + $this->_parts = array ( + 0 => + array ( + 0 => + array ( + 1 => 'string', + ), + 1 => NULL, + 2 => NULL, + 3 => NULL, + ), + 1 => + array ( + 0 => NULL, + 1 => NULL, + 2 => NULL, + ), + 2 => + array ( + 0 => NULL, + 1 => NULL, + 2 => NULL, + ), + 3 => + array ( + 0 => NULL, + ), + 4 => + array ( + 0 => NULL, + ), + 5 => + array ( + 0 => NULL, + ), + ); + $this->_subst = array ( + -1 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + ), + 0 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + ), + 1 => + array ( + 0 => false, + 1 => false, + 2 => false, + ), + 2 => + array ( + 0 => false, + 1 => false, + 2 => false, + ), + 3 => + array ( + 0 => false, + ), + 4 => + array ( + 0 => false, + ), + 5 => + array ( + 0 => false, + ), + ); + $this->_conditions = array ( + ); + $this->_kwmap = array ( + 'propertyValue' => 'string', + 'namedcolor' => 'var', + ); + $this->_defClass = 'code'; + $this->_checkDefines(); + } + +} \ No newline at end of file diff --git a/framework/3rdParty/TextHighlighter/Text/Highlighter/DIFF.php b/framework/3rdParty/TextHighlighter/Text/Highlighter/DIFF.php new file mode 100644 index 00000000..c27301f5 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/Highlighter/DIFF.php @@ -0,0 +1,366 @@ + + * + */ + +/** + * Auto-generated class. DIFF syntax highlighting + * + * @author Andrey Demenev + * @category Text + * @package Text_Highlighter + * @copyright 2004-2006 Andrey Demenev + * @license http://www.php.net/license/3_0.txt PHP License + * @version Release: 0.7.0 + * @link http://pear.php.net/package/Text_Highlighter + */ +class Text_Highlighter_DIFF extends Text_Highlighter +{ + var $_language = 'diff'; + + /** + * Constructor + * + * @param array $options + * @access public + */ + function __construct($options=array()) + { + + $this->_options = $options; + $this->_regs = array ( + -1 => '/((?m)^\\\\\\sNo\\snewline.+$)|((?m)^\\-\\-\\-$)|((?m)^(diff\\s+\\-|Only\\s+|Index).*$)|((?m)^(\\-\\-\\-|\\+\\+\\+)\\s.+$)|((?m)^\\*.*$)|((?m)^\\+.*$)|((?m)^!.*$)|((?m)^\\<\\s.*$)|((?m)^\\>\\s.*$)|((?m)^\\d+(\\,\\d+)?[acd]\\d+(,\\d+)?$)|((?m)^\\-.*$)|((?m)^\\+.*$)|((?m)^@@.+@@$)|((?m)^d\\d+\\s\\d+$)|((?m)^a\\d+\\s\\d+$)|((?m)^(\\d+)(,\\d+)?(a)$)|((?m)^(\\d+)(,\\d+)?(c)$)|((?m)^(\\d+)(,\\d+)?(d)$)|((?m)^a(\\d+)(\\s\\d+)?$)|((?m)^c(\\d+)(\\s\\d+)?$)|((?m)^d(\\d+)(\\s\\d+)?$)/', + 0 => '//', + 1 => '//', + 2 => '//', + 3 => '//', + 4 => '//', + ); + $this->_counts = array ( + -1 => + array ( + 0 => 0, + 1 => 0, + 2 => 1, + 3 => 1, + 4 => 0, + 5 => 0, + 6 => 0, + 7 => 0, + 8 => 0, + 9 => 2, + 10 => 0, + 11 => 0, + 12 => 0, + 13 => 0, + 14 => 0, + 15 => 3, + 16 => 3, + 17 => 3, + 18 => 2, + 19 => 2, + 20 => 2, + ), + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_delim = array ( + -1 => + array ( + 0 => '', + 1 => '', + 2 => '', + 3 => '', + 4 => '', + 5 => '', + 6 => '', + 7 => '', + 8 => '', + 9 => '', + 10 => '', + 11 => '', + 12 => '', + 13 => '', + 14 => 'code', + 15 => 'code', + 16 => 'code', + 17 => '', + 18 => 'code', + 19 => 'code', + 20 => '', + ), + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_inner = array ( + -1 => + array ( + 0 => 'special', + 1 => 'code', + 2 => 'var', + 3 => 'reserved', + 4 => 'quotes', + 5 => 'string', + 6 => 'inlinedoc', + 7 => 'quotes', + 8 => 'string', + 9 => 'code', + 10 => 'quotes', + 11 => 'string', + 12 => 'code', + 13 => 'code', + 14 => 'var', + 15 => 'string', + 16 => 'inlinedoc', + 17 => 'code', + 18 => 'string', + 19 => 'inlinedoc', + 20 => 'code', + ), + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_end = array ( + 0 => '/(?m)(?=^[ad]\\d+\\s\\d+)/', + 1 => '/(?m)^(\\.)$/', + 2 => '/(?m)^(\\.)$/', + 3 => '/(?m)^(\\.)$/', + 4 => '/(?m)^(\\.)$/', + ); + $this->_states = array ( + -1 => + array ( + 0 => -1, + 1 => -1, + 2 => -1, + 3 => -1, + 4 => -1, + 5 => -1, + 6 => -1, + 7 => -1, + 8 => -1, + 9 => -1, + 10 => -1, + 11 => -1, + 12 => -1, + 13 => -1, + 14 => 0, + 15 => 1, + 16 => 2, + 17 => -1, + 18 => 3, + 19 => 4, + 20 => -1, + ), + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_keywords = array ( + -1 => + array ( + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + ), + 3 => + array ( + ), + 4 => + array ( + ), + 5 => + array ( + ), + 6 => + array ( + ), + 7 => + array ( + ), + 8 => + array ( + ), + 9 => + array ( + ), + 10 => + array ( + ), + 11 => + array ( + ), + 12 => + array ( + ), + 13 => + array ( + ), + 14 => -1, + 15 => -1, + 16 => -1, + 17 => + array ( + ), + 18 => -1, + 19 => -1, + 20 => + array ( + ), + ), + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_parts = array ( + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_subst = array ( + -1 => + array ( + 0 => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + 5 => false, + 6 => false, + 7 => false, + 8 => false, + 9 => false, + 10 => false, + 11 => false, + 12 => false, + 13 => false, + 14 => false, + 15 => false, + 16 => false, + 17 => false, + 18 => false, + 19 => false, + 20 => false, + ), + 0 => + array ( + ), + 1 => + array ( + ), + 2 => + array ( + ), + 3 => + array ( + ), + 4 => + array ( + ), + ); + $this->_conditions = array ( + ); + $this->_kwmap = array ( + ); + $this->_defClass = 'default'; + $this->_checkDefines(); + } + +} \ No newline at end of file diff --git a/framework/3rdParty/TextHighlighter/Text/Highlighter/DTD.php b/framework/3rdParty/TextHighlighter/Text/Highlighter/DTD.php new file mode 100644 index 00000000..ad33e528 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/Highlighter/DTD.php @@ -0,0 +1,408 @@ + + * + */ + +/** + * Auto-generated class. DTD syntax highlighting + * + * @author Andrey Demenev + * @category Text + * @package Text_Highlighter + * @copyright 2004-2006 Andrey Demenev + * @license http://www.php.net/license/3_0.txt PHP License + * @version Release: 0.7.0 + * @link http://pear.php.net/package/Text_Highlighter + */ +class Text_Highlighter_DTD extends Text_Highlighter +{ + var $_language = 'dtd'; + + /** + * Constructor + * + * @param array $options + * @access public + */ + function __construct($options=array()) + { + + $this->_options = $options; + $this->_regs = array ( + -1 => '/(\\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/cpp.xml b/framework/3rdParty/TextHighlighter/Text/cpp.xml new file mode 100644 index 00000000..81f0328e --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/cpp.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + +Thanks to Aaron Kalin for initial +implementation of this highlighter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/css.xml b/framework/3rdParty/TextHighlighter/Text/css.xml new file mode 100644 index 00000000..4ca4ee99 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/css.xml @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/diff.xml b/framework/3rdParty/TextHighlighter/Text/diff.xml new file mode 100644 index 00000000..d369a272 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/dtd.xml b/framework/3rdParty/TextHighlighter/Text/dtd.xml new file mode 100644 index 00000000..8e795313 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/dtd.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/generate b/framework/3rdParty/TextHighlighter/Text/generate new file mode 100644 index 00000000..41048d91 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/generate @@ -0,0 +1,171 @@ +#!@php_bin@ + + * @copyright 2004 Andrey Demenev + * @license http://www.php.net/license/3_0.txt PHP License + * @version CVS: $Id: generate,v 1.1 2007/06/03 02:35:28 ssttoo Exp $ + * @link http://pear.php.net/package/Text_Highlighter + */ + +require_once 'Text/Highlighter/Generator.php'; +require_once 'Console/Getopt.php'; + +$options = Console_Getopt::getopt($argv, 'x:p:d:h', array('xml=', 'php=','dir=', 'help')); + +if (PEAR::isError($options)) { + $message = str_replace('Console_Getopt: ','',$options->message); + usage($message); +} + +$source = array(); +$dest = array(); +$dir = ''; + +$expectp = false; +$expectx = false; +$unexpectedx = false; +$unexpectedp = false; +$si = $di = 0; + +foreach ($options[0] as $option) { + switch ($option[0]) { + case 'x': + case '--xml': + $source[$si] = $option[1]; + if ($si) { + $di++; + } + $si++; + if ($expectp) { + $unexpectedx = true; + } + $expectp = true; + $expectx = false; + break; + + case 'p': + case '--php': + if ($expectx) { + $unexpectedp = true; + } + $dest[$di] = $option[1]; + $expectp = false; + $expectx = true; + break; + + case 'd': + case '--dir': + $dir = $option[1]; + break; + + case 'h': + case '--help': + usage(); + break; + } +} + + +if ($unexpectedx && !$dir) { + usage('Unexpected -x or --xml', STDERR); +} + +if ($unexpectedp) { + usage('Unexpected -p or --php', STDERR); +} + +$nsource = count($source); +$ndest = count($dest); + +if (!$nsource && !$ndest) { + $source[]='php://stdin'; + if (!$dir) { + $dest[]='php://stdout'; + } else { + $dest[] = null; + } +} elseif ($expectp && !$dir && $nsource > 1) { + usage('-x or --xml without following -p or --php', STDERR); +} elseif ($nsource == 1 && !$ndest && !$dir) { + $dest[]='php://stdout'; +} + +if ($dir && substr($dir,-1)!='/' && substr($dir,-1)!=='\\' ) { + $dir .= DIRECTORY_SEPARATOR; +} + + +foreach ($source as $i => $xmlfile) +{ + $gen =& new Text_Highlighter_Generator; + $gen->setInputFile($xmlfile); + if ($gen->hasErrors()) { + break; + } + $gen->generate(); + if ($gen->hasErrors()) { + break; + } + if (isset($dest[$i])) { + $phpfile = $dest[$i]; + } else { + $phpfile = $dir . $gen->language . '.php'; + } + $gen->saveCode($phpfile); + if ($gen->hasErrors()) { + break; + } +} +if ($gen->hasErrors()) { + $errors = $gen->getErrors(); + foreach ($errors as $error) { + fwrite (STDERR, $error . "\n"); + } + exit(1); +} + +function usage($message='', $file=STDOUT) +{ + $code = 0; + if ($message) { + $message .= "\n\n"; + $code = 1; + } + $message .= << tag) + -h, --help + This help +MSG; + fwrite ($file, $message); + exit($code); +} +?> + diff --git a/framework/3rdParty/TextHighlighter/Text/generate.bat b/framework/3rdParty/TextHighlighter/Text/generate.bat new file mode 100644 index 00000000..3170190e --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/generate.bat @@ -0,0 +1,188 @@ +@echo off +rem vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: + +rem Console highlighter class generator + +rem PHP versions 4 and 5 + +rem LICENSE: This source file is subject to version 3.0 of the PHP license +rem that is available through the world-wide-web at the following URI: +rem http://www.php.net/license/3_0.txt. If you did not receive a copy of +rem the PHP License and are unable to obtain it through the web, please +rem send a note to license@php.net so we can mail you a copy immediately. + +rem @category Text +rem @package Text_Highlighter +rem @author Andrey Demenev +rem @copyright 2004 Andrey Demenev +rem @license http://www.php.net/license/3_0.txt PHP License +rem @version CVS: $Id: generate.bat,v 1.1 2007/06/03 02:35:28 ssttoo Exp $ +rem @link http://pear.php.net/package/Text_Highlighter + +set "MHL_PARAMS=" +:doshift +set "MHL_PARAMS=%MHL_PARAMS% %1" +shift +if -%1- == -- GOTO noshift +GOTO doshift +:noshift +@php_bin@ -q -d output_buffering=1 -d include_path="@php_dir@" @bin_dir@/Text/Highlighter/generate.bat %MHL_PARAMS% + +GOTO finish +message); + usage($message); +} + +$source = array(); +$dest = array(); +$dir = ''; + +$expectp = false; +$expectx = false; +$unexpectedx = false; +$unexpectedp = false; +$si = $di = 0; + +foreach ($options[0] as $option) { + switch ($option[0]) { + case 'x': + case '--xml': + $source[$si] = $option[1]; + if ($si) { + $di++; + } + $si++; + if ($expectp) { + $unexpectedx = true; + } + $expectp = true; + $expectx = false; + break; + + case 'p': + case '--php': + if ($expectx) { + $unexpectedp = true; + } + $dest[$di] = $option[1]; + $expectp = false; + $expectx = true; + break; + + case 'd': + case '--dir': + $dir = $option[1]; + break; + + case 'h': + case '--help': + usage(); + break; + } +} + + +if ($unexpectedx && !$dir) { + usage('Unexpected -x or --xml', STDERR); +} + +if ($unexpectedp) { + usage('Unexpected -p or --php', STDERR); +} + +$nsource = count($source); +$ndest = count($dest); + +if (!$nsource && !$ndest) { + $source[]='php://stdin'; + if (!$dir) { + $dest[]='php://stdout'; + } else { + $dest[] = null; + } +} elseif ($expectp && !$dir && $nsource > 1) { + usage('-x or --xml without following -p or --php', STDERR); +} elseif ($nsource == 1 && !$ndest && !$dir) { + $dest[]='php://stdout'; +} + +if ($dir && substr($dir,-1)!='/' && substr($dir,-1)!=='\\' ) { + $dir .= DIRECTORY_SEPARATOR; +} + + +foreach ($source as $i => $xmlfile) +{ + $gen =& new Text_Highlighter_Generator; + $gen->setInputFile($xmlfile); + if ($gen->hasErrors()) { + break; + } + $gen->generate(); + if ($gen->hasErrors()) { + break; + } + if (isset($dest[$i])) { + $phpfile = $dest[$i]; + } else { + $phpfile = $dir . $gen->language . '.php'; + } + $gen->saveCode($phpfile); + if ($gen->hasErrors()) { + break; + } +} +if ($gen->hasErrors()) { + $errors = $gen->getErrors(); + foreach ($errors as $error) { + fwrite (STDERR, $error . "\n"); + } + exit(1); +} + +exit(0); + +function usage($message='', $file=STDOUT) +{ + $code = 0; + if ($message) { + $message .= "\n\n"; + $code = 1; + } + $message .= << tag) + -h, --help + This help +MSG; + fwrite ($file, $message); + exit($code); +} +?> +:finish diff --git a/framework/3rdParty/TextHighlighter/Text/html.xml b/framework/3rdParty/TextHighlighter/Text/html.xml new file mode 100644 index 00000000..c25a3ec5 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/html.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/java.xml b/framework/3rdParty/TextHighlighter/Text/java.xml new file mode 100644 index 00000000..cafbec05 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/java.xml @@ -0,0 +1,2824 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/javascript.xml b/framework/3rdParty/TextHighlighter/Text/javascript.xml new file mode 100644 index 00000000..de5e0117 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/javascript.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/mysql.xml b/framework/3rdParty/TextHighlighter/Text/mysql.xml new file mode 100644 index 00000000..f0f1ef51 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/mysql.xml @@ -0,0 +1,424 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/package.xml b/framework/3rdParty/TextHighlighter/Text/package.xml new file mode 100644 index 00000000..4cac5d6c --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/package.xml @@ -0,0 +1,243 @@ + + + Text_Highlighter + pear.php.net + Syntax highlighting + Text_Highlighter is a package for syntax highlighting. + +It provides a base class provining all the functionality, +and a descendent classes geneator class. + +The main idea is to simplify creation of subclasses +implementing syntax highlighting for particular language. +Subclasses do not implement any new functioanality, +they just provide syntax highlighting rules. +The rules sources are in XML format. + +To create a highlighter for a language, there is no need +to code a new class manually. Simply describe the rules +in XML file and use Text_Highlighter_Generator to create +a new class. + + Stoyan Stefanov + stoyan + ssttoo@gmail.com + yes + + + Andrey Demenev + blindman + demenev@gmail.com + yes + + 2007-06-06 + + + 0.7.0 + 0.7.0 + + + beta + beta + + PHP License + - added new renderer - Array +- HTML renderer modified to extend Array +- more new renderers - BB, HTMLTags, JSON, XML, all extending Array +(feature requests #8704 and #9188 ) +- new syntax definition - ABAP programming language (feature request #8809) +- linked elements to their online documentation option (request #7480) +- option to output code as unordered list (request #4640) +- option to set starting number when outputting code in ordered lists +(request #7077) +- option to set CSS class names mapping insead of using hardcoded +class names (request #7077) +- option to set a CSS style mappping instead of class names (request #7077) +- fixed /= issue when highlighting javascript (bug #11160) +- added sample CSS to the package (bug #11211) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 4.3.3 + + + 1.4.0b1 + + + PEAR + pear.php.net + 1.0 + + + XML_Parser + pear.php.net + 1.0.1 + + + Console_Getopt + pear.php.net + 1.0 + + + + + + + (*ix|*ux) + + + + + + + + + + windows + + + + + + + + + + + + + + + + 0.7.0 + 0.7.0 + + + beta + beta + + 2007-06-06 + PHP License + - added new renderer - Array +- HTML renderer modified to extend Array +- more new renderers - BB, HTMLTags, JSON, XML, all extending Array +(feature requests #8704 and #9188 ) +- new syntax definition - ABAP programming language (feature request #8809) +- linked elements to their online documentation option (request #7480) +- option to output code as unordered list (request #4640) +- option to set starting number when outputting code in ordered lists +(request #7077) +- option to set CSS class names mapping insead of using hardcoded +class names (request #7077) +- option to set a CSS style mappping instead of class names (request #7077) +- fixed /= issue when highlighting javascript (bug #11160) +- added sample CSS to the package (bug #11211) + + + diff --git a/framework/3rdParty/TextHighlighter/Text/perl.xml b/framework/3rdParty/TextHighlighter/Text/perl.xml new file mode 100644 index 00000000..f4317653 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/perl.xml @@ -0,0 +1,439 @@ + + + + + + + + + + + This highlighter is EXPERIMENTAL, so that it may work incorrectly. +Most rules were created by Mariusz Jakubowski, and extended by me. +My knowledge of Perl is poor, and Perl syntax seems too +complicated to me. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/php.xml b/framework/3rdParty/TextHighlighter/Text/php.xml new file mode 100644 index 00000000..de00096a --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/php.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/prado.xml b/framework/3rdParty/TextHighlighter/Text/prado.xml new file mode 100644 index 00000000..480b0bbe --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/prado.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/python.xml b/framework/3rdParty/TextHighlighter/Text/python.xml new file mode 100644 index 00000000..0baef89c --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/python.xml @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/ruby.xml b/framework/3rdParty/TextHighlighter/Text/ruby.xml new file mode 100644 index 00000000..191f893a --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/ruby.xml @@ -0,0 +1,141 @@ + + + + + + + + + + +FIXME: While this construction : s.split /z/i +is valid, regular expression is not recognized as such +(/ folowing an identifier or number is not recognized as +start of RE), making highlighting improper + +%q(a (nested) string) does not get highlighted correctly + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/sample.css b/framework/3rdParty/TextHighlighter/Text/sample.css new file mode 100644 index 00000000..8b5c9d24 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/sample.css @@ -0,0 +1,57 @@ +.hl-default { + color: Black; +} +.hl-code { + color: Gray; +} +.hl-brackets { + color: Olive; +} +.hl-comment { + color: Orange; +} +.hl-quotes { + color: Darkred; +} +.hl-string { + color: Red; +} +.hl-identifier { + color: Blue; +} +.hl-builtin { + color: Teal; +} +.hl-reserved { + color: Green; +} +.hl-inlinedoc { + color: Blue; +} +.hl-var { + color: Darkblue; +} +.hl-url { + color: Blue; +} +.hl-special { + color: Navy; +} +.hl-number { + color: Maroon; +} +.hl-inlinetags { + color: Blue; +} +.hl-main { + background-color: White; +} +.hl-gutter { + background-color: #999999; + color: White +} +.hl-table { + font-family: courier; + font-size: 12px; + border: solid 1px Lightgrey; +} diff --git a/framework/3rdParty/TextHighlighter/Text/sql.xml b/framework/3rdParty/TextHighlighter/Text/sql.xml new file mode 100644 index 00000000..dcfcfab6 --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/sql.xml @@ -0,0 +1,496 @@ + + + + + + + + + + + Based on SQL-99 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/Text/xml.xml b/framework/3rdParty/TextHighlighter/Text/xml.xml new file mode 100644 index 00000000..a80ffc1a --- /dev/null +++ b/framework/3rdParty/TextHighlighter/Text/xml.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/3rdParty/TextHighlighter/highlight.css b/framework/3rdParty/TextHighlighter/highlight.css new file mode 100644 index 00000000..c581fb9f --- /dev/null +++ b/framework/3rdParty/TextHighlighter/highlight.css @@ -0,0 +1,441 @@ +.php-hl-default { + color: Black; +} +.php-hl-code { + color: Gray; +} +.php-hl-brackets { + color: Olive; +} +.php-hl-comment { + color: #808080; + font-style: italic; +} +.php-hl-quotes { + color: red; +} +.php-hl-string { + color: Red; +} +.php-hl-identifier { + color: green; +} +.php-hl-builtin { + color: Teal; +} +.php-hl-reserved { + color: black; + font-weight: bold; +} +.php-hl-inlinedoc { + color: Blue; +} +.php-hl-var { + color: blue; +} +.php-hl-url { + color: Blue; +} +.php-hl-special { + color: Navy; +} +.php-hl-number { + color: Maroon; +} +.php-hl-inlinetags { + color: Blue; +} +.php-hl-main { + font-family: 'Courier New', Courier, monospace; + font-weight: normal; +} +.php-hl-gutter { + background-color: #999999; + color: White +} +.php-hl-table { + font-family: courier; + font-size: 12px; + border: solid 1px #505050; +} + + +.prado-hl-default { + color: Black; +} +.prado-hl-code { + color: Gray; +} +.prado-hl-brackets { + color: Olive; +} +.prado-hl-comment { + color: #808080; + font-style: italic; +} +.prado-hl-quotes { + color: red; +} +.prado-hl-string { + color: Red; +} +.prado-hl-identifier { + color: Blue; +} +.prado-hl-builtin { + color: Teal; +} +.prado-hl-reserved { + color: Green; +} +.prado-hl-inlinedoc { + color: Blue; +} +.prado-hl-var { + color: #000020; +} +.prado-hl-url { + color: Blue; +} +.prado-hl-special { + color: Navy; + font-weight: bold; +} +.prado-hl-number { + color: Maroon; +} +.prado-hl-inlinetags { + color: Blue; +} +.prado-hl-main { + font-family: 'Courier New', Courier, monospace; + font-weight: normal; +} +.prado-hl-gutter { + background-color: #999999; + color: White +} +.prado-hl-table { + font-family: courier; + font-size: 12px; + border: solid 1px #505050; +} + + +.xml-hl-default { + color: Black; +} +.xml-hl-code { + color: Gray; +} +.xml-hl-brackets { + color: Olive; +} +.xml-hl-comment { + color: #808080; + font-style: italic; +} +.xml-hl-quotes { + color: red; +} +.xml-hl-string { + color: Red; +} +.xml-hl-identifier { + color: Blue; +} +.xml-hl-builtin { + color: Teal; +} +.xml-hl-reserved { + color: Green; +} +.xml-hl-inlinedoc { + color: Blue; +} +.xml-hl-var { + color: #000020; +} +.xml-hl-url { + color: Blue; +} +.xml-hl-special { + color: Navy; +} +.xml-hl-number { + color: Maroon; +} +.xml-hl-inlinetags { + color: Blue; +} +.xml-hl-main { + font-family: 'Courier New', Courier, monospace; + font-weight: normal; +} +.xml-hl-gutter { + background-color: #999999; + color: White +} +.xml-hl-table { + font-family: courier; + font-size: 12px; + border: solid 1px #505050; +} + +.html-hl-default { + color: Black; +} +.html-hl-code { + color: Gray; +} +.html-hl-brackets { + color: Olive; +} +.html-hl-comment { + color: #808080; + font-style: italic; +} +.html-hl-quotes { + color: red; +} +.html-hl-string { + color: Red; +} +.html-hl-identifier { + color: Blue; +} +.html-hl-builtin { + color: Teal; +} +.html-hl-reserved { + color: Green; +} +.html-hl-inlinedoc { + color: Blue; +} +.html-hl-var { + color: #000020; +} +.html-hl-url { + color: Blue; +} +.html-hl-special { + color: Navy; +} +.html-hl-number { + color: Maroon; +} +.html-hl-inlinetags { + color: Blue; +} +.html-hl-main { + font-family: 'Courier New', Courier, monospace; + font-weight: normal; +} +.html-hl-gutter { + background-color: #999999; + color: White +} +.html-hl-table { + font-family: courier; + font-size: 12px; + border: solid 1px #505050; +} + +.css-hl-default { + color: Black; +} +.css-hl-code { + color: Gray; +} +.css-hl-brackets { + color: Olive; +} +.css-hl-comment { + color: #808080; + font-style: italic; +} +.css-hl-quotes { + color: red; +} +.css-hl-string { + color: Red; +} +.css-hl-identifier { + color: Blue; +} +.css-hl-builtin { + color: Teal; +} +.css-hl-reserved { + color: Green; +} +.css-hl-inlinedoc { + color: Blue; +} +.css-hl-var { + color: #000020; +} +.css-hl-url { + color: Blue; +} +.css-hl-special { + color: Navy; +} +.css-hl-number { + color: Maroon; +} +.css-hl-inlinetags { + color: Blue; +} +.css-hl-main { + font-family: 'Courier New', Courier, monospace; + font-weight: normal; +} +.css-hl-gutter { + background-color: #999999; + color: White +} +.css-hl-table { + font-family: courier; + font-size: 12px; + border: solid 1px #505050; +} + +.javascript-hl-default { + color: Black; +} +.javascript-hl-code { + color: Gray; +} +.javascript-hl-brackets { + color: Olive; +} +.javascript-hl-comment { + color: #808080; + font-style: italic; +} +.javascript-hl-quotes { + color: red; +} +.javascript-hl-string { + color: Red; +} +.javascript-hl-identifier { + color: Blue; +} +.javascript-hl-builtin { + color: Teal; +} +.javascript-hl-reserved { + color: Green; +} +.javascript-hl-inlinedoc { + color: Blue; +} +.javascript-hl-var { + color: #000020; +} +.javascript-hl-url { + color: Blue; +} +.javascript-hl-special { + color: Navy; +} +.javascript-hl-number { + color: Maroon; +} +.javascript-hl-inlinetags { + color: Blue; +} +.javascript-hl-main { + font-family: 'Courier New', Courier, monospace; + font-weight: normal; +} +.javascript-hl-gutter { + background-color: #999999; + color: White +} +.javascript-hl-table { + font-family: courier; + font-size: 12px; + border: solid 1px #505050; +} + + +.sql-hl-default { + color: Black; +} +.sql-hl-code { + color: Gray; +} +.sql-hl-brackets { + color: Olive; +} +.sql-hl-comment { + color: #808080; + font-style: italic; +} +.sql-hl-quotes { + color: red; +} +.sql-hl-string { + color: Red; +} +.sql-hl-identifier { + color: Blue; +} +.sql-hl-builtin { + color: Teal; +} +.sql-hl-reserved { + color: Green; +} +.sql-hl-inlinedoc { + color: Blue; +} +.sql-hl-var { + color: #000020; +} +.sql-hl-url { + color: Blue; +} +.sql-hl-special { + color: Navy; +} +.sql-hl-number { + color: Maroon; +} +.sql-hl-inlinetags { + color: Blue; +} +.sql-hl-main { + font-family: 'Courier New', Courier, monospace; + font-weight: normal; +} +.sql-hl-gutter { + background-color: #999999; + color: White +} +.sql-hl-table { + font-family: courier; + font-size: 12px; + border: solid 1px #505050; +} + +.source .copycode +{ + text-align: right; + float: right; +} + +.source .copycode a +{ + cursor: pointer; + color: blue; +} + +.source .copycode_hover a +{ + color: red; +} diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index c9607f00..955c8fa3 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -1,5 +1,5 @@ prado_application_singleton_required = Prado.Application must only be set once. -prado_component_unknown = Unknown component type '{0}'. +prado_component_unknown = Unknown component type '{0}'. This may be caused by following parsing error in the {0} class file: {1} prado_using_invalid = '{0}' is not a valid namespace to be used. Make sure '.*' is appended if you want to use a namespace referring to a directory. prado_alias_redefined = Alias '{0}' cannot be redefined. prado_alias_invalid = Alias '{0}' refers to an invalid path '{1}'. Only existing directories can be aliased. diff --git a/framework/PradoBase.php b/framework/PradoBase.php index 9f6d91a0..f2632f9b 100644 --- a/framework/PradoBase.php +++ b/framework/PradoBase.php @@ -246,9 +246,10 @@ class PradoBase * If the namespace corresponds to a directory, the directory will be appended * to the include path. If the namespace corresponds to a file, it will be included (include_once). * @param string namespace to be used + * @param boolean whether to check the existence of the class after the class file is included * @throws TInvalidDataValueException if the namespace is invalid */ - public static function using($namespace) + public static function using($namespace,$checkClassExistence=true) { if(isset(self::$_usings[$namespace]) || class_exists($namespace,false)) return; @@ -260,8 +261,8 @@ class PradoBase } catch(Exception $e) { - if(!class_exists($namespace,false)) - throw new TInvalidOperationException('prado_component_unknown',$namespace); + if($checkClassExistence && !class_exists($namespace,false)) + throw new TInvalidOperationException('prado_component_unknown',$namespace,$e->getMessage()); else throw $e; } @@ -277,7 +278,7 @@ class PradoBase else // a file { self::$_usings[$namespace]=$path; - if(!class_exists($className,false)) + if(!$checkClassExistence || !class_exists($className,false)) { try { @@ -285,8 +286,8 @@ class PradoBase } catch(Exception $e) { - if(!class_exists($className,false)) - throw new TInvalidOperationException('prado_component_unknown',$className); + if($checkClassExistence && !class_exists($className,false)) + throw new TInvalidOperationException('prado_component_unknown',$className,$e->getMessage()); else throw $e; } diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php index 80f6069b..0f221cc2 100644 --- a/framework/Web/UI/WebControls/TTextHighlighter.php +++ b/framework/Web/UI/WebControls/TTextHighlighter.php @@ -10,11 +10,10 @@ * @package System.Web.UI.WebControls */ -/** - * Using GeSHi and TTextProcessor classes - */ -Prado::using('System.3rdParty.geshi.geshi'); -Prado::using('System.Web.UI.WebControls.TTextProcessor'); +Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter',false); +Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter.Renderer.Html',false); +Prado::using('System.Web.UI.WebControls.TTextProcessor'); + /** * TTextHighlighter class. @@ -34,6 +33,8 @@ Prado::using('System.Web.UI.WebControls.TTextProcessor'); */ class TTextHighlighter extends TTextProcessor { + private static $_lineNumberStyle=array(TTextHighlighterLineNumberStyle::Li => HL_NUMBERS_LI, TTextHighlighterLineNumberStyle::Table => HL_NUMBERS_TABLE); + /** * @return string tag name of the panel */ @@ -51,10 +52,12 @@ class TTextHighlighter extends TTextProcessor } /** - * @param string language whose syntax is to be used for highlighting. + * @param string language (case-insensitive) whose syntax is to be used for highlighting. * Valid values are those file names (without suffix) that are contained - * in '3rdParty/geshi/geshi' (e.g. 'php','prado','css','html','javascript', - * 'xml'.) + * in '3rdParty/TextHighlighter/Text/Highlighter'. Currently, the following languages are supported: + * ABAP, CPP, CSS, DIFF, DTD, HTML, JAVA, JAVASCRIPT, + * MYSQL, PERL, PHP, PRADO, PYTHON, RUBY, SQL, XML + * If a language is not supported, it will be displayed as plain text. */ public function setLanguage($value) { @@ -92,7 +95,39 @@ class TTextHighlighter extends TTextProcessor { $this->setViewState('CopyCode', TPropertyValue::ensureBoolean($value), false); } - + + /** + * @return TTextHighlighterLineNumberStyle style of row number, Table by default + */ + public function getLineNumberStyle() + { + return $this->getViewState('LineNumberStyle', TTextHighlighterLineNumberStyle::Table); + } + + /** + * @param TTextHighlighterLineNumberStyle style of row number + */ + public function setLineNumberStyle($value) + { + $this->setViewState('LineNumberStyle', TPropertyValue::ensureEnum($value,'TTextHighlighterLineNumberStyle')); + } + + /** + * @return integer tab size. Defaults to 4. + */ + public function getTabSize() + { + return $this->getViewState('TabSize', 4); + } + + /** + * @param integer tab size + */ + public function setTabSize($value) + { + $this->setViewState('TabSize', TPropertyValue::ensureInteger($value)); + } + /** * Registers css style for the highlighted result. * This method overrides parent implementation. @@ -101,26 +136,21 @@ class TTextHighlighter extends TTextProcessor public function onPreRender($writer) { parent::onPreRender($writer); - $this->registerHighlightScripts(); - } - - /** - * Register CSS stylesheet file and javascript file. - * @throws TConfigurationException if highlight.css file cannot be found - */ - protected function registerHighlightScripts() - { - $cs=$this->getPage()->getClientScript(); - $cssKey='prado:TTextHighlighter'; - if(!$cs->isStyleSheetFileRegistered($cssKey)) - { - if(($cssFile=Prado::getPathOfNamespace('System.3rdParty.geshi.highlight','.css'))===null) - throw new TConfigurationException('texthighlighter_stylesheet_invalid'); - $styleSheet = $this->publishFilePath($cssFile); - $cs->registerStyleSheetFile($cssKey, $styleSheet); - } - $cs->registerPradoScript('prado'); + $this->registerStyleSheet(); + $this->getPage()->getClientScript()->registerPradoScript('prado'); } + + /** + * Registers the stylesheet for presentation. + */ + protected function registerStyleSheet() + { + $cs=$this->getPage()->getClientScript(); + $cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight','.css'); + $cssKey='prado:TTextHighlighter:'.$cssFile; + if(!$cs->isStyleSheetFileRegistered($cssKey)) + $cs->registerStyleSheetFile($cssKey, $this->publishFilePath($cssFile)); + } /** * Processes a text string. @@ -129,15 +159,16 @@ class TTextHighlighter extends TTextProcessor * @return string the processed text result */ public function processText($text) - { - $geshi = new GeSHi(trim($text), $this->getLanguage()); - if($this->getShowLineNumbers()) - $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); - $geshi->enable_classes(); - if($this->getEnableCopyCode()) - $geshi->set_header_content($this->getHeaderTemplate()); - - return $geshi->parse_code(); + { + if(($highlighter=Text_Highlighter::factory($this->getLanguage()))===false) + return ('
'.htmlentities(trim($text)).'
'); + + $options["use_language"]=true; + $options["tabsize"] = $this->getTabSize(); + if ($this->getShowLineNumbers()) + $options["numbers"] = self::$_lineNumberStyle[$this->getLineNumberStyle()]; + $highlighter->setRenderer(new Text_Highlighter_Renderer_Html($options)); + return $highlighter->highlight(trim($text)); } /** @@ -148,5 +179,11 @@ class TTextHighlighter extends TTextProcessor $id = $this->getClientID(); return TJavaScript::renderScriptBlock("new Prado.WebUI.TTextHighlighter('{$id}');"); } +} + +class TTextHighlighterLineNumberStyle extends TEnumerable +{ + const Li='Li'; + const Table='Table'; } ?> \ No newline at end of file -- cgit v1.2.3