1Syntax::Highlight::EngiUnsee:r:KCaotnet:r:iTbeuSmtypenldtaatPxee:(r:3lH)iDgohcluimgehntt:a:tEinognine::Kate::Template(3)
2
3
4
6 Syntax::Highlight::Engine::Kate::Template - a template for syntax
7 highlighting plugins
8
10 Syntax::Highlight::Engine::Kate::Template is a framework to assist
11 authors of plugin modules. All methods to provide highlighting to the
12 Syntax::Highlight::Engine::Kate module are there, Just no syntax
13 definitions and callbacks. An instance of
14 Syntax::Highlight::Engine::Kate::Template should never be created, it's
15 meant to be sub classed only.
16
18 attributes(?$attributesref?);
19 Sets and returns a reference to the attributes hash.
20
21 basecontext(?$context?);
22 Sets and returns the basecontext instance variable. This is the
23 context that is used when highlighting starts.
24
25 captured($cap);
26 Puts $cap in the first element of the stack, the current context.
27 Used when the context is dynamic.
28
29 capturedGet($num);
30 Returns the $num'th element that was captured in the current
31 context.
32
33 capturedParse($string, $mode);
34 If $mode is specified, $string should only be one character long
35 and numeric. capturedParse will return the Nth captured element of
36 the current context.
37
38 If $mode is not specified, all occurrences of %[1-9] will be
39 replaced by the captured element of the current context.
40
41 column
42 returns the column position in the line that is currently
43 highlighted.
44
45 contextdata(\%data);
46 Sets and returns a reference to the contextdata hash.
47
48 contextInfo($context, $item);
49 returns the value of several context options. $item can be
50 callback, attribute, lineending, linebeginning, fallthrough.
51
52 contextParse($plugin, $context);
53 Called by the plugins after a test succeeds. if $context has
54 following values:
55
56 #pop returns to the previous context, removes to top item in the stack. Can
57 also be specified as #pop#pop etc.
58 #stay does nothing.
59 ##.... Switches to the plugin specified in .... and assumes it's basecontext.
60 .... Swtiches to the context specified in ....
61
62 deliminators(?$delim?);
63 Sets and returns a string that is a regular expression for
64 detecting deliminators.
65
66 engine
67 Returns a reference to the Syntax::Highlight::Engine::Kate module
68 that created this plugin.
69
70 firstnonspace($string);
71 returns true if the current line did not contain a non-spatial
72 character so far and the first character in $string is also a
73 spatial character.
74
75 formatTable
76 sets and returns the instance variable format_table. See also the
77 option format_table
78
79 highlight($text);
80 highlights $text. It does so by selecting the proper callback from
81 the commands hash and invoke it. It will do so until $text has been
82 reduced to an empty string. returns a paired list of snippets of
83 text and the attribute with which they should be highlighted.
84
85 highlightText($text);
86 highlights $text and reformats it using the format_table and
87 substitutions
88
89 includePlugin($language, \$text);
90 Includes the plugin for $language in the highlighting.
91
92 includeRules($language, \$text);
93 Includes the plugin for $language in the highlighting.
94
95 keywordscase
96 Sets and returns the keywordscase instance variable.
97
98 lastchar
99 return the last character that was processed.
100
101 lastcharDeliminator
102 returns true if the last character processed was a deliminator.
103
104 linesegment
105 returns the string of text in the current line that has been
106 processed so far,
107
108 linestart
109 returns true if processing is currently at the beginning of a line.
110
111 listAdd('listname', $item1, $item2 ...);
112 Adds a list to the 'lists' hash.
113
114 lists(?\%lists?);
115 sets and returns the instance variable 'lists'.
116
117 out(?\@highlightedlist?);
118 sets and returns the instance variable 'out'.
119
120 parseResult(\$text, $match, $lookahaed, $column, $firstnonspace,
121 $context, $attribute);
122 Called by every one of the test methods below. If the test matches,
123 it will do a couple of subtests. If $column is a defined numerical
124 value it will test if the process is at the requested column. If
125 $firnonspace is true, it will test this also. Ig it is not a look
126 ahead and all tests are passed, $match is then parsed and removed
127 from $$text.
128
129 pluginGet($language);
130 Returns a reference to a plugin object for the specified language.
131 Creating an instance if needed.
132
133 reset
134 Resets the highlight engine to a fresh state, does not change the
135 syntx.
136
137 snippet
138 Contains the current snippet of text that will have one attribute.
139 The moment the attribute changes it will be parsed.
140
141 snippetAppend($string)
142 appends $string to the current snippet.
143
144 snippetAttribute($attribute)
145 Sets and returns the used attribute.
146
147 snippetForce
148 Forces the current snippet to be parsed.
149
150 snippetParse($text, ?$attribute?)
151 If attribute is defined and differs from the current attribute it
152 does a snippetForce and sets the current attribute to $attribute.
153 Then it does a snippetAppend of $text
154
155 stack
156 sets and returns the instance variable 'stack', a reference to an
157 array
158
159 stackPull
160 retrieves the element that is on top of the stack, decrements
161 stacksize by 1.
162
163 stackPush($tagname);
164 puts $tagname on top of the stack, increments stacksize by 1
165
166 stackTop
167 Retrieves the element that is on top of the stack.
168
169 stateCompare(\@state)
170 Compares two lists, \@state and the stack. returns true if they
171 match.
172
173 stateGet
174 Returns a list containing the entire stack.
175
176 stateSet(@list)
177 Accepts @list as the current stack.
178
179 substitutions
180 sets and returns a reference to the substitutions hash.
181
182 The methods below all return a boolean value.
183
184 testAnyChar(\$text, $string, $insensitive, $lookahaed, $column,
185 $firstnonspace, $context, $attribute);
186 testDetectChar(\$text, $char, $insensitive, $dynamic, $lookahaed,
187 $column, $firstnonspace, $context, $attribute);
188 testDetect2Chars(\$text, $char1, $char2, $insensitive, $dynamic,
189 $lookahaed, $column, $firstnonspace, $context, $attribute);
190 testDetectIdentifier(\$text, $lookahaed, $column, $firstnonspace,
191 $context, $attribute);
192 testDetectSpaces(\$text, $lookahaed, $column, $firstnonspace, $context,
193 $attribute);
194 testFloat(\$text, $lookahaed, $column, $firstnonspace, $context,
195 $attribute);
196 testHlCChar(\$text, $lookahaed, $column, $firstnonspace, $context,
197 $attribute);
198 testHlCHex(\$text, $lookahaed, $column, $firstnonspace, $context,
199 $attribute);
200 testHlCOct(\$text, $lookahaed, $column, $firstnonspace, $context,
201 $attribute);
202 testHlCStringChar(\$text, $lookahaed, $column, $firstnonspace,
203 $context, $attribute);
204 testInt(\$text, $lookahaed, $column, $firstnonspace, $context,
205 $attribute);
206 testKeyword(\$text, $list, $insensitive, $lookahaed, $column,
207 $firstnonspace, $context, $attribute);
208 testLineContinue(\$text, $lookahaed, $column, $firstnonspace, $context,
209 $attribute);
210 testRangeDetect(\$text, $char1, $char2, $insensitive, $lookahaed,
211 $column, $firstnonspace, $context, $attribute);
212 testRegExpr(\$text, $reg, $insensitive, $dynamic, $lookahaed, $column,
213 $firstnonspace, $context, $attribute);
214 testStringDetect(\$text, $string, $insensitive, $dynamic, I$lookahaed,
215 $column, $firstnonspace, $context, $attribute);
216
218 All the people who wrote Kate and the syntax highlight xml files.
219
221 This module is written and maintained by:
222
223 Hans Jeuken < haje at toneel dot demon dot nl >
224
225 Copyright (c) 2006 by Hans Jeuken, all rights reserved.
226
227 You may freely distribute and/or modify this module under same terms as
228 Perl itself
229
231 Synax::Highlight::Engine::Kate http:://www.kate-editor.org
232
233
234
235perl v5.32.1 2S0y2n1t-a0x1:-:2H7ighlight::Engine::Kate::Template(3)