ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
HFile_perl.php
Go to the documentation of this file.
1<?php
2
3$BEAUT_PATH = realpath(".") . "/Services/COPage/syntax_highlight/php";
4if (!isset($BEAUT_PATH)) {
5 return;
6}
7require_once("$BEAUT_PATH/Beautifier/HFile.php");
8 class HFile_perl extends HFile
9 {
10 public function HFile_perl()
11 {
12 $this->HFile();
13
14 /*************************************/
15 // Beautifier Highlighting Configuration File
16 // Perl
17 /*************************************/
18 // Flags
19
20 $this->nocase = "0";
21 $this->notrim = "0";
22 $this->perl = "1";
23
24 // Colours
25
26 $this->colours = array("blue", "purple", "gray", "brown");
27 $this->quotecolour = "blue";
28 $this->blockcommentcolour = "green";
29 $this->linecommentcolour = "green";
30
31 // Indent Strings
32
33 $this->indent = array("{");
34 $this->unindent = array("}");
35
36 // String characters and delimiters
37
38 $this->stringchars = array();
39 $this->delimiters = array("~", "!", "@", "$", "%", "^", "&", "*", "(", ")", "+", "=", "|", "\\", "/", "{", "}", "[", "]", ":", ";", "\"", "'", "<", ">", " ", " ", ",", ".", "?", "/", " ");
40 $this->escchar = "";
41
42 // Comment settings
43
44 $this->linecommenton = array("#");
45 $this->blockcommenton = array("");
46 $this->blockcommentoff = array("");
47
48 // Keywords (keyword mapping to colour number)
49
50 $this->keywords = array(
51 "-A" => "1",
52 "-B" => "1",
53 "-C" => "1",
54 "-M" => "1",
55 "-O" => "1",
56 "-R" => "1",
57 "-S" => "1",
58 "-T" => "1",
59 "-W" => "1",
60 "-X" => "1",
61 "-b" => "1",
62 "-c" => "1",
63 "-d" => "1",
64 "-e" => "1",
65 "-f" => "1",
66 "-g" => "1",
67 "-k" => "1",
68 "-l" => "1",
69 "-o" => "1",
70 "-p" => "1",
71 "-r" => "1",
72 "-s" => "1",
73 "-t" => "1",
74 "-u" => "1",
75 "-w" => "1",
76 "-x" => "1",
77 "-z" => "1",
78 "__DATA__" => "1",
79 "__END__" => "1",
80 "__FILE__" => "1",
81 "__LINE__" => "1",
82 "continue" => "1",
83 "do" => "1",
84 "else" => "1",
85 "elsif" => "1",
86 "for" => "1",
87 "foreach" => "1",
88 "goto" => "1",
89 "if" => "1",
90 "last" => "1",
91 "local" => "1",
92 "my" => "1",
93 "next" => "1",
94 "no" => "1",
95 "package" => "1",
96 "redo" => "1",
97 "return" => "1",
98 "require" => "1",
99 "sub" => "1",
100 "until" => "1",
101 "unless" => "1",
102 "use" => "1",
103 "while" => "1",
104 "accept" => "2",
105 "alarm" => "2",
106 "atan2" => "2",
107 "bind" => "2",
108 "binmode" => "2",
109 "bless" => "2",
110 "caller" => "2",
111 "chdir" => "2",
112 "chmod" => "2",
113 "chomp" => "2",
114 "chop" => "2",
115 "chown" => "2",
116 "chr" => "2",
117 "chroot" => "2",
118 "close" => "2",
119 "closedir" => "2",
120 "connect" => "2",
121 "cos" => "2",
122 "crypt" => "2",
123 "dbmclose" => "2",
124 "dbmopen" => "2",
125 "defined" => "2",
126 "delete" => "2",
127 "die" => "2",
128 "dump" => "2",
129 "each" => "2",
130 "endgrent" => "2",
131 "endhostent" => "2",
132 "endnetent" => "2",
133 "endprotoent" => "2",
134 "endpwent" => "2",
135 "endservent" => "2",
136 "eof" => "2",
137 "eval" => "2",
138 "exec" => "2",
139 "exit" => "2",
140 "exp" => "2",
141 "exists" => "2",
142 "fcntl" => "2",
143 "fileno" => "2",
144 "flock" => "2",
145 "fork" => "2",
146 "formline" => "2",
147 "format" => "2",
148 "getc" => "2",
149 "getgrent" => "2",
150 "getgrgid" => "2",
151 "getgrname" => "2",
152 "gethostbyaddr" => "2",
153 "gethostbyname" => "2",
154 "gethostent" => "2",
155 "getlogin" => "2",
156 "getnetbyaddr" => "2",
157 "getnetbyname" => "2",
158 "getnetent" => "2",
159 "getpeername" => "2",
160 "getpgrp" => "2",
161 "getppid" => "2",
162 "getpriority" => "2",
163 "getprotobyname" => "2",
164 "getprotobynumber" => "2",
165 "getprotoent" => "2",
166 "getpwent" => "2",
167 "getpwnam" => "2",
168 "getpwuid" => "2",
169 "getservbyname" => "2",
170 "getservbyport" => "2",
171 "getservent" => "2",
172 "getsockname" => "2",
173 "getsockopt" => "2",
174 "glob" => "2",
175 "gmtime" => "2",
176 "grep" => "2",
177 "hex" => "2",
178 "index" => "2",
179 "int" => "2",
180 "ioctl" => "2",
181 "join" => "2",
182 "keys" => "2",
183 "kill" => "2",
184 "lc" => "2",
185 "lcfirst" => "2",
186 "length" => "2",
187 "link" => "2",
188 "listen" => "2",
189 "localtime" => "2",
190 "log" => "2",
191 "lstat" => "2",
192 "map" => "2",
193 "mkdir" => "2",
194 "msgctl" => "2",
195 "msgget" => "2",
196 "msgrcv" => "2",
197 "msgsnd" => "2",
198 "oct" => "2",
199 "open" => "2",
200 "opendir" => "2",
201 "ord" => "2",
202 "pack" => "2",
203 "pipe" => "2",
204 "pop" => "2",
205 "pos" => "2",
206 "print" => "2",
207 "printf" => "2",
208 "push" => "2",
209 "quotemeta" => "2",
210 "rand" => "2",
211 "read" => "2",
212 "readdir" => "2",
213 "readline" => "2",
214 "readlink" => "2",
215 "recv" => "2",
216 "ref" => "2",
217 "rename" => "2",
218 "reset" => "2",
219 "reverse" => "2",
220 "rewinddir" => "2",
221 "rindex" => "2",
222 "rmdir" => "2",
223 "scalar" => "2",
224 "seek" => "2",
225 "seekdir" => "2",
226 "select" => "2",
227 "semctl" => "2",
228 "semgett" => "2",
229 "semop" => "2",
230 "send" => "2",
231 "setgrent" => "2",
232 "sethostent" => "2",
233 "setnetent" => "2",
234 "setpgrp" => "2",
235 "setpriority" => "2",
236 "setprotoent" => "2",
237 "setpwent" => "2",
238 "setservent" => "2",
239 "setsockopt" => "2",
240 "shift" => "2",
241 "shmctl" => "2",
242 "shmget" => "2",
243 "shmread" => "2",
244 "shmwrite" => "2",
245 "shutdown" => "2",
246 "sin" => "2",
247 "sleep" => "2",
248 "socket" => "2",
249 "socketpair" => "2",
250 "sort" => "2",
251 "splice" => "2",
252 "split" => "2",
253 "sprintf" => "2",
254 "sqrt" => "2",
255 "srand" => "2",
256 "stat" => "2",
257 "study" => "2",
258 "substr" => "2",
259 "symlink" => "2",
260 "syscall" => "2",
261 "sysopen" => "2",
262 "sysread" => "2",
263 "system" => "2",
264 "syswrite" => "2",
265 "tell" => "2",
266 "telldir" => "2",
267 "tie" => "2",
268 "tied" => "2",
269 "time" => "2",
270 "times" => "2",
271 "truncate" => "2",
272 "uc" => "2",
273 "ucfirst" => "2",
274 "umask" => "2",
275 "undef" => "2",
276 "unlink" => "2",
277 "unpack" => "2",
278 "unshift" => "2",
279 "utime" => "2",
280 "untie" => "2",
281 "values" => "2",
282 "vec" => "2",
283 "wait" => "2",
284 "waitpid" => "2",
285 "wantarray" => "2",
286 "warn" => "2",
287 "write" => "2",
288 "AUTOLOAD" => "3",
289 "and" => "3",
290 "BEGIN" => "3",
291 "CORE" => "3",
292 "cmp" => "3",
293 "DESTROY" => "3",
294 "eq" => "3",
295 "END" => "3",
296 "ge" => "3",
297 "gt" => "3",
298 "le" => "3",
299 "lt" => "3",
300 "ne" => "3",
301 "not" => "3",
302 "m" => "3",
303 "or" => "3",
304 "q" => "3",
305 "qq" => "3",
306 "qw" => "3",
307 "qx" => "3",
308 "SUPER" => "3",
309 "s" => "3",
310 "tr" => "3",
311 "UNIVERSAL" => "3",
312 "x" => "3",
313 "xor" => "3",
314 "y" => "3",
315 "$@" => "4",
316 "@" => "4");
317
318 // Special extensions
319
320 // Each category can specify a PHP function that returns an altered
321 // version of the keyword.
322
323
324
325 $this->linkscripts = array(
326 "2" => "dofunction",
327 "1" => "donothing",
328 "3" => "donothing",
329 "4" => "donothing");
330 }
331
332 public function donothing($keywordin)
333 {
334 return $keywordin;
335 }
336
337 public function dofunction($keywordin)
338 {
339 $outlink = "http://perldoc.perl.org/functions/" . $keywordin . ".html";
340 return "<a href=\"$outlink\">$keywordin</a>";
341 }
342 }
$BEAUT_PATH
Definition: HFile_perl.php:3
An exception for terminatinating execution or to throw for unit testing.
donothing($keywordin)
Definition: HFile_perl.php:332
dofunction($keywordin)
Definition: HFile_perl.php:337