mirror of https://github.com/friendica/friendica
parent
76abade4d8
commit
0167a2bd61
@ -0,0 +1,455 @@
|
||||
# $Id$
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
Text_Highlighter is a class for syntax highlighting. 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.
|
||||
|
||||
|
||||
This document does not contain a formal description of API - it is very
|
||||
simple, and I believe providing some examples of code is sufficient.
|
||||
|
||||
|
||||
Highlighter XML source
|
||||
======================
|
||||
|
||||
Basics
|
||||
------
|
||||
|
||||
Creating a new syntax highlighter begins with describing the highlighting
|
||||
rules. There are two basic elements: block and region. A block is just a
|
||||
portion of text matching a regular expression and highlighted with a single
|
||||
color. Keyword is an example of a block. A region is defined by two regular
|
||||
expressions: one for start of region, and another for the end. The main
|
||||
difference from a block is that a region can contain blocks and regions
|
||||
(including same-named regions). An example of a region is a group of
|
||||
statements enclosed in curly brackets (this is used in many languages, for
|
||||
example PHP and C). Also, characters matching start and end of a region may be
|
||||
highlighted with their own color, and region contents with another.
|
||||
|
||||
Blocks and regions may be declared as contained. Contained blocks and regions
|
||||
can only appear inside regions. If a region or a block is not declared as
|
||||
contained, it can appear both on top level and inside regions. Block or region
|
||||
declared as not-contained can only appear on top level.
|
||||
|
||||
For any region, a list of blocks and regions that can appear inside this
|
||||
region can be specified.
|
||||
|
||||
In this document, the term "color group" is used. Chunks of text assigned to
|
||||
same color group will be highlighted with same color. Note that in versions
|
||||
prior 0.5.0 color goups were refered as CSS classes, but since 0.5.0 not only
|
||||
HTML output is supported, so "color group" is more appropriate term.
|
||||
|
||||
Elements
|
||||
--------
|
||||
|
||||
The toplevel element is <highlight>. Attribute lang is required and denotes
|
||||
the name of the language. Its value is used as a part of generated class name,
|
||||
and must only contain letters, digits and underscores. Optional attribute
|
||||
case, when given value yes, makes the language case sensitive (default is case
|
||||
insensitive). Allowed subelements are:
|
||||
|
||||
* <authors>: Information about the authors of the file.
|
||||
<author>: Information about a single author of the file. (May be used
|
||||
multiple times, one per author.)
|
||||
- name="...": Author's name. Required.
|
||||
- email="...": Author's email address. Optional.
|
||||
|
||||
* <default>: Default color group.
|
||||
- innerGroup="...": color group name. Required.
|
||||
|
||||
* <region>: Region definition
|
||||
- name="...": Region name. Required.
|
||||
- innerGroup="...": Default color group of region contents. Required.
|
||||
- delimGroup="...": color group of start and end of region. Optional,
|
||||
defaults to value of innerGroup attribute.
|
||||
- start="...", end="...": Regular expression matching start and end
|
||||
of region. Required. Regular expression delimiters are optional, but
|
||||
if you need to specify delimiter, use /. The only case when the
|
||||
delimiters are needed, is specifying regular expression modifiers,
|
||||
such as m or U. Examples: \/\* or /$/m.
|
||||
- contained="yes": Marks region as contained.
|
||||
- never-contained="yes": Marks region as not-contained.
|
||||
- <contains>: Elements allowed inside this region.
|
||||
- all="yes" Region can contain any other region or block
|
||||
(except not-contained). May be used multiple times.
|
||||
- <but> Do not allow certain regions or blocks.
|
||||
- region="..." Name of region not allowed within
|
||||
current region.
|
||||
- block="..." Name of block not allowed within
|
||||
current region.
|
||||
- region="..." Name of region allowed within current region.
|
||||
- block="..." Name of block allowed within current region.
|
||||
- <onlyin> Only allow this region within certain regions. May be
|
||||
used multiple times.
|
||||
- block="..." Name of parent region
|
||||
|
||||
* <block>: Block definition
|
||||
- name="...": Block name. Required.
|
||||
- innerGroup="...": color group of block contents. Optional. If not
|
||||
specified, color group of parent region or default color group will be
|
||||
used. One would only want to omit this attribute if there are
|
||||
keyword groups (see below) inherited from this block, and no special
|
||||
highlighting should apply when the block does not match the keyword.
|
||||
- match="..." Regular expression matching the block. Required.
|
||||
Regular expression delimiters are optional, but if you need to
|
||||
specify delimiter, use /. The only case when the delimiters are
|
||||
needed, is specifying regular expression modifiers, such as m or U.
|
||||
Examples: #|\/\/ or /$/m.
|
||||
- contained="yes": Marks block as contained.
|
||||
- never-contained="yes": Marks block as not-contained.
|
||||
- <onlyin> Only allow this block within certain regions. May be used
|
||||
multiple times.
|
||||
- block="..." Name of parent region
|
||||
- multiline="yes": Marks block as multi-line. By default, whole
|
||||
blocks are assumed to reside in a single line. This make the things
|
||||
faster. If you need to declare a multi-line block, use this
|
||||
attribute.
|
||||
- <partgroup>: Assigns another color group to a part of the block that
|
||||
matched a subpattern.
|
||||
- index="n": Subpattern index. Required.
|
||||
- innerGroup="...": color group name. Required.
|
||||
|
||||
This is an example from CSS highlighter: the measure is matched as
|
||||
a whole, but the measurement units are highlighted with different
|
||||
color.
|
||||
|
||||
<block name="measure" match="\d*\.?\d+(\%|em|ex|pc|pt|px|in|mm|cm)"
|
||||
innerGroup="number" contained="yes">
|
||||
<onlyin region="property"/>
|
||||
<partGroup index="1" innerGroup="string" />
|
||||
</block>
|
||||
|
||||
* <keywords>: Keyword group definition. Keyword groups are useful when you
|
||||
want to highlight some words that match a condition for a block with a
|
||||
different color. Keywords are defined with literal match, not regular
|
||||
expressions. For example, you have a block named identifier matching a
|
||||
general identifier, and want to highlight reserved words (which match
|
||||
this block as well) with different color. You inherit a keyword group
|
||||
"reserved" from "identifier" block.
|
||||
- name="...": Keyword group. Required.
|
||||
- ifdef="...", ifndef="..." : Conditional declaration. See
|
||||
"Conditions" below.
|
||||
- inherits="...": Inherited block name. Required.
|
||||
- innerGroup="...": color group of keyword group. Required.
|
||||
- case="yes|no": Overrides case-sensitivity of the language.
|
||||
Optional, defaults to global value.
|
||||
- <keyword>: Single keyword definition.
|
||||
- match="..." The keyword. Note: this is not a regular
|
||||
expression, but literal match (possibly case insensitive).
|
||||
|
||||
Note that for BC reasons element partClass is alias for partGroup, and
|
||||
attributes innerClass and delimClass are aliases of innerGroup and
|
||||
delimGroup, respectively.
|
||||
|
||||
|
||||
Conditions
|
||||
----------
|
||||
|
||||
Conditional declarations allow enabling or disabling certain highlighting
|
||||
rules at runtime. For example, Java highlighter has a very big list of
|
||||
keywords matching Java standard classes. Finding a match in this list can take
|
||||
much time. For that reason, corresponding keyword group is declared with
|
||||
"ifdef" attribute :
|
||||
|
||||
<keywords name="builtin" inherits="identifier" innerClass="builtin"
|
||||
case="yes" ifdef="java.builtins">
|
||||
<keyword match="AbstractAction" />
|
||||
<keyword match="AbstractBorder" />
|
||||
<keyword match="AbstractButton" />
|
||||
...
|
||||
...
|
||||
<keyword match="_Remote_Stub" />
|
||||
<keyword match="_ServantActivatorStub" />
|
||||
<keyword match="_ServantLocatorStub" />
|
||||
</keywords>
|
||||
|
||||
This keyword group will be only enabled when "java.builtins" is passed as an
|
||||
element of "defines" option:
|
||||
|
||||
$options = array(
|
||||
'defines' => array(
|
||||
'java.builtins',
|
||||
),
|
||||
'numbers' => HL_NUMBERS_TABLE,
|
||||
);
|
||||
$highlighter = Text_Highlighter::factory('java', $options);
|
||||
|
||||
"ifndef" attribute has reverse meaning.
|
||||
|
||||
Currently, "ifdef" and "ifndef" attributes are only supported for <keywords>
|
||||
tag.
|
||||
|
||||
|
||||
|
||||
Class generation
|
||||
================
|
||||
|
||||
Creating XML description of highlighting rules is the most complicated part of
|
||||
the process. To generate the class, you need just few lines of code:
|
||||
|
||||
<?php
|
||||
require_once 'Text/Highlighter/Generator.php';
|
||||
$generator = new Text_Highlighter_Generator('php.xml');
|
||||
$generator->generate();
|
||||
$generator->saveCode('PHP.php');
|
||||
?>
|
||||
|
||||
|
||||
|
||||
Command-line class generation tool
|
||||
==================================
|
||||
|
||||
Example from previous section looks pretty simple, but it does not handle any
|
||||
errors which may occur during parsing of XML source. The package provides a
|
||||
command-line script to make generation of classes even more simple, and takes
|
||||
care of possible errors. It is called generate (on Unix/Linux) or generate.bat
|
||||
(on Windows). This script is able to process multiple files in one run, and
|
||||
also to process XML from standard input and write generated code to standard
|
||||
output.
|
||||
|
||||
Usage:
|
||||
generate options
|
||||
|
||||
Options:
|
||||
-x filename, --xml=filename
|
||||
source XML file. Multiple input files can be specified, in which
|
||||
case each -x option must be followed by -p unless -d is specified
|
||||
Defaults to stdin
|
||||
-p filename, --php=filename
|
||||
destination PHP file. Defaults to stdout. If specied multiple times,
|
||||
each -p must follow -x
|
||||
-d dirname, --dir=dirname
|
||||
Default destination directory. File names will be taken from XML input
|
||||
("lang" attribute of <highlight> tag)
|
||||
-h, --help
|
||||
This help
|
||||
|
||||
Examples
|
||||
|
||||
Read from php.xml, write to PHP.php
|
||||
|
||||
generate -x php.xml -p PHP.php
|
||||
|
||||
Read from php.xml, write to standard output
|
||||
|
||||
generate -x php.xml
|
||||
|
||||
Read from php.xml, write to PHP.php, read from xml.xml, write to XML.php
|
||||
|
||||
generate -x php.xml -p PHP.php -x xml.xml -p XML.php
|
||||
|
||||
Read from php.xml, write to /some/dir/PHP.php, read from xml.xml, write to
|
||||
/some/dir/XML.php (assuming that xml.xml contains <highlight lang="xml">, and
|
||||
php.xml contains <highlight lang="php">)
|
||||
|
||||
generate -x php.xml -x xml.xml -d /some/dir/
|
||||
|
||||
|
||||
|
||||
Renderers
|
||||
=========
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Text_Highlighter supports renderes. Using renderers, you can get output in
|
||||
different formats. Two renderers are included in the package:
|
||||
|
||||
- HTML renderer. Generates HTML output. A style sheet should be linked to
|
||||
the document to display colored text
|
||||
|
||||
- Console renderer. Can be used to output highlighted text to
|
||||
color-capable terminals, either directly or trough less -r
|
||||
|
||||
|
||||
Renderers API
|
||||
-------------
|
||||
|
||||
Renderers are subclasses of Text_Highlighter_Renderer. Renderer should
|
||||
override at least two methods - acceptToken and getOutput. Overriding other
|
||||
methods is optional, depending on the nature of renderer's output and details
|
||||
of implementation.
|
||||
|
||||
string reset()
|
||||
resets renderer state. This method is called every time before a new
|
||||
source file is highlighted.
|
||||
|
||||
string preprocess(string $code)
|
||||
preprocesses code. Can be used, for example, to normalize whitespace
|
||||
before highlighting. Returns preprocessed string.
|
||||
|
||||
void acceptToken(string $group, string $content)
|
||||
the core method of the renderer. Highlighter passes chunks of text to
|
||||
this method in $content, and color group in $group
|
||||
|
||||
void finalize()
|
||||
signals the renderer that no more tokens are available.
|
||||
|
||||
mixed getOutput()
|
||||
returns generated output.
|
||||
|
||||
|
||||
Setting renderer options
|
||||
--------------------------------
|
||||
|
||||
Renderers accept an optional argument to their constructor - options array.
|
||||
Elements of this array are renderer-specific.
|
||||
|
||||
HTML renderer
|
||||
-------------
|
||||
|
||||
HTML renderer produces HTML output with optional line numbering. The renderer
|
||||
itself does not provide information about actual colors of highlighted text.
|
||||
Instead, <span class="hl-XXX"> is used, where XXX is replaced with color group
|
||||
name (hl-var, hl-string, etc.). It is up to you to create a CSS stylesheet.
|
||||
If 'use_language' option with value evaluating to true was passed, class names
|
||||
will be formatted as "LANG-hl-XXX", where LANG is language name as defined in
|
||||
highlighter XML source ("lang" attribute of <highlight> tag) in lower case.
|
||||
|
||||
There are 3 special CSS classes:
|
||||
|
||||
hl-main - this class applies to whole output or right table column,
|
||||
depending on 'numbers' option
|
||||
hl-gutter - applies to left column in table
|
||||
hl-table - applies to whole table
|
||||
|
||||
HTML renderer accepts following options (each being optional):
|
||||
|
||||
* numbers - line numbering style.
|
||||
0 - no numbering (default)
|
||||
HL_NUMBERS_LI - use <ol></ol> for line numbering
|
||||
HL_NUMBERS_TABLE - create a 2-column table, with line numbers in left
|
||||
column and highlighted text in right column
|
||||
|
||||
* tabsize - tabulation size. Defaults to 4
|
||||
|
||||
Example:
|
||||
|
||||
require_once 'Text/Highlighter/Renderer/Html.php';
|
||||
$options = array(
|
||||
'numbers' => HL_NUMBERS_LI,
|
||||
'tabsize' => 8,
|
||||
);
|
||||
$renderer = new Text_Highlighter_Renderer_HTML($options);
|
||||
|
||||
Console renderer
|
||||
----------------
|
||||
|
||||
Console renderer produces output for displaying on a color-capable terminal,
|
||||
either directly or through less -r, using ANSI escape sequences. By default,
|
||||
this renderer only highlights most common color groups. Additional colors
|
||||
can be specified using 'colors' option. This renderer also accepts 'numbers'
|
||||
option - a boolean value, and 'tabsize' option.
|
||||
|
||||
Example :
|
||||
|
||||
require_once 'Text/Highlighter/Renderer/Console.php';
|
||||
$colors = array(
|
||||
'prepro' => "\033[35m",
|
||||
'types' => "\033[32m",
|
||||
);
|
||||
$options = array(
|
||||
'numbers' => true,
|
||||
'tabsize' => 8,
|
||||
'colors' => $colors,
|
||||
);
|
||||
$renderer = new Text_Highlighter_Renderer_Console($options);
|
||||
|
||||
|
||||
ANSI color escape sequences have the following format:
|
||||
|
||||
ESC[#;#;....;#m
|
||||
|
||||
where ESC is character with ASCII code 27 (033 octal, 0x1B hexadecimal). # is
|
||||
one of the following:
|
||||
|
||||
0 for normal display
|
||||
1 for bold on
|
||||
4 underline (mono only)
|
||||
5 blink on
|
||||
7 reverse video on
|
||||
8 nondisplayed (invisible)
|
||||
30 black foreground
|
||||
31 red foreground
|
||||
32 green foreground
|
||||
33 yellow foreground
|
||||
34 blue foreground
|
||||
35 magenta foreground
|
||||
36 cyan foreground
|
||||
37 white foreground
|
||||
40 black background
|
||||
41 red background
|
||||
42 green background
|
||||
43 yellow background
|
||||
44 blue background
|
||||
45 magenta background
|
||||
46 cyan background
|
||||
47 white background
|
||||
|
||||
|
||||
How to use Text_Highlighter class
|
||||
=================================
|
||||
|
||||
Creating a highlighter object
|
||||
-----------------------------
|
||||
|
||||
To create a highlighter for a certain language, use Text_Highlighter::factory()
|
||||
static method:
|
||||
|
||||
require_once 'Text/Highlighter.php';
|
||||
$hl = Text_Highlighter::factory('php');
|
||||
|
||||
|
||||
Setting a renderer
|
||||
------------------
|
||||
|
||||
Actual output is produced by a renderer.
|
||||
|
||||
require_once 'Text/Highlighter.php';
|
||||
require_once 'Text/Highlighter/Renderer/Html.php';
|
||||
$options = array(
|
||||
'numbers' => HL_NUMBERS_LI,
|
||||
'tabsize' => 8,
|
||||
);
|
||||
$renderer = new Text_Highlighter_Renderer_HTML($options);
|
||||
$hl = Text_Highlighter::factory('php');
|
||||
$hl->setRenderer($renderer);
|
||||
|
||||
Note that for BC reasons, it is possible to use highlighter without setting a
|
||||
renderer. If no renderer is set, HTML renderer will be used by default. In
|
||||
this case, you should pass options as second parameter to factory method. The
|
||||
following example works exactly as previous one:
|
||||
|
||||
require_once 'Text/Highlighter.php';
|
||||
$options = array(
|
||||
'numbers' => HL_NUMBERS_LI,
|
||||
'tabsize' => 8,
|
||||
);
|
||||
$hl = Text_Highlighter::factory('php', $options);
|
||||
|
||||
|
||||
Getting output
|
||||
--------------
|
||||
|
||||
And finally, do the highlighting and get the output:
|
||||
|
||||
require_once 'Text/Highlighter.php';
|
||||
require_once 'Text/Highlighter/Renderer/Html.php';
|
||||
$options = array(
|
||||
'numbers' => HL_NUMBERS_LI,
|
||||
'tabsize' => 8,
|
||||
);
|
||||
$renderer = new Text_Highlighter_Renderer_HTML($options);
|
||||
$hl = Text_Highlighter::factory('php');
|
||||
$hl->setRenderer($renderer);
|
||||
$html = $hl->highlight(file_get_contents('example.php'));
|
||||
|
||||
# vim: set autoindent tabstop=4 shiftwidth=4 softtabstop=4 tw=78: */
|
||||
|
@ -0,0 +1,12 @@
|
||||
# $Id$
|
||||
|
||||
Major issues to solve (but I currently have no idea how) :
|
||||
|
||||
- speedup highlighting process
|
||||
|
||||
- switching between highlighters depending on context, for example :
|
||||
PHP code -> HTML -> (JavaScript|CSS)
|
||||
|
||||
|
||||
# vim: set autoindent tabstop=4 shiftwidth=4 softtabstop=4 tw=78: */
|
||||
|
@ -0,0 +1,398 @@
|
||||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
/**
|
||||
* Highlighter base class
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This source file is subject to version 3.0 of the PHP license
|
||||
* that is available through the world-wide-web at the following URI:
|
||||
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
|
||||
* the PHP License and are unable to obtain it through the web, please
|
||||
* send a note to license@php.net so we can mail you a copy immediately.
|
||||
*
|
||||
* @category Text
|
||||
* @package Text_Highlighter
|
||||
* @author Andrey Demenev <demenev@gmail.com>
|
||||
* @copyright 2004-2006 Andrey Demenev
|
||||
* @license http://www.php.net/license/3_0.txt PHP License
|
||||
* @version CVS: $Id$
|
||||
* @link http://pear.php.net/package/Text_Highlighter
|
||||
*/
|
||||
|
||||
// require_once 'PEAR.php';
|
||||
|
||||
// {{{ 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 <demenev@gmail.com>
|
||||
* @copyright 2004-2006 Andrey Demenev
|
||||
* @license http://www.php.net/license/3_0.txt PHP License
|
||||
* @version Release: @package_version@
|
||||
* @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
|
||||
* <code>
|
||||
*require_once 'Text/Highlighter.php';
|
||||
*$hlSQL = Text_Highlighter::factory('SQL',array('numbers'=>true));
|
||||
*echo $hlSQL->highlight('SELECT * FROM table a WHERE id = 12');
|
||||
* </code>
|
||||
*
|
||||
* @author Andrey Demenev <demenev@gmail.com>
|
||||
* @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
|
||||
*/
|
||||
function &factory($lang, $options = array())
|
||||
{
|
||||
$lang = strtoupper($lang);
|
||||
@include_once 'Text/Highlighter/' . $lang . '.php';
|
||||
|
||||
$classname = 'Text_Highlighter_' . $lang;
|
||||
|
||||
if (!class_exists($classname)) {
|
||||
return PEAR::raiseError('Highlighter for ' . $lang . ' not found');
|
||||
}
|
||||
|
||||
$obj = new $classname($options);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ 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:
|
||||
*/
|
||||
|
||||
?>
|
@ -0,0 +1,519 @@
|
||||
<?php
|
||||
/**
|
||||
* Auto-generated class. ABAP syntax highlighting
|
||||
*
|
||||
* PHP version 4 and 5
|
||||
*
|
||||
* LICENSE: This source file is subject to version 3.0 of the PHP license
|
||||
* that is available through the world-wide-web at the following URI:
|
||||
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
|
||||
* the PHP License and are unable to obtain it through the web, please
|
||||
* send a note to license@php.net so we can mail you a copy immediately.
|
||||
*
|
||||
* @copyright 2004-2006 Andrey Demenev
|
||||
* @license http://www.php.net/license/3_0.txt PHP License
|
||||
* @link http://pear.php.net/package/Text_Highlighter
|
||||
* @category Text
|
||||
* @package Text_Highlighter
|
||||
* @version generated from: : abap.xml,v 1.1 2007/06/03 02:35:28 ssttoo Exp
|
||||
* @author Stoyan Stefanov <ssttoo@gmail.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
|
||||
require_once 'Text/Highlighter.php';
|
||||
|
||||
/**
|
||||
* Auto-generated class. ABAP syntax highlighting
|
||||
*
|
||||
* @author Stoyan Stefanov <ssttoo@gmail.com>
|
||||
* @category Text
|
||||
* @package Text_Highlighter
|
||||
* @copyright 2004-2006 Andrey Demenev
|
||||
* @license http://www.php.net/license/3_0.txt PHP License
|
||||
* @version Release: @package_version@
|
||||
* @link http://pear.php.net/package/Text_Highlighter
|
||||
*/
|
||||
class Text_Highlighter_ABAP extends Text_Highlighter
|
||||
{
|
||||
var $_language = 'abap';
|
||||
|
||||
/**
|
||||
* PHP4 Compatible Constructor
|
||||
*
|
||||
* @param array $options
|
||||
* @access public
|
||||
*/
|
||||
function Text_Highlighter_ABAP($options=array())
|
||||
{
|
||||
$this->__construct($options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,894 @@
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Auto-generated class. AVRC syntax highlighting
|
||||
*
|
||||
*
|
||||
* C/C++ highlighter specific to Atmel AVR microcontrollers
|
||||
*
|
||||
*
|
||||
* PHP version 4 and 5
|
||||
*
|
||||
* LICENSE: This source file is subject to version 3.0 of the PHP license
|
||||
* that is available through the world-wide-web at the following URI:
|
||||
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
|
||||
* the PHP License and are unable to obtain it through the web, please
|
||||
* send a note to license@php.net so we can mail you a copy immediately.
|
||||
*
|
||||
* @copyright 2004-2006 Andrey Demenev
|
||||
* @license http://www.php.net/license/3_0.txt PHP License
|
||||
* @link http://pear.php.net/package/Text_Highlighter
|
||||
* @category Text
|
||||
* @package Text_Highlighter
|
||||
* @version generated from: avrc.xml
|
||||
* @author Andrey Demenev <demenev@gmail.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
|
||||
require_once 'Text/Highlighter.php';
|
||||
|
||||
/**
|
||||
* Auto-generated class. AVRC syntax highlighting
|
||||
*
|
||||
* @author Andrey Demenev <demenev@gmail.com>
|
||||
* @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_AVRC extends Text_Highlighter
|
||||
{
|
||||
var $_language = 'avrc';
|
||||
|
||||
/**
|
||||
* PHP4 Compatible Constructor
|
||||
*
|
||||
* @param array $options
|
||||
* @access public
|
||||
*/
|
||||
function Text_Highlighter_AVRC($options=array())
|
||||
{
|
||||
$this->__construct($options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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*)|((?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)\\/\\/.+)/',
|
||||
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 => 2,
|
||||
9 => 0,
|
||||
10 => 0,
|
||||
11 => 0,
|
||||
12 => 0,
|
||||
13 => 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 => '',
|
||||
6 => '',
|
||||
7 => '',
|
||||
8 => '',
|
||||
9 => 'prepro',
|
||||
10 => 'prepro',
|
||||
11 => '',
|
||||
12 => 'mlcomment',
|
||||
13 => '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 => '',
|
||||
),
|
||||
);
|
||||