Definition at line 21 of file HFile.php.
◆ __construct()
Definition at line 24 of file HFile.php.
References array.
27 $this->lang_name =
"";
28 # Language configuration hashtable. 29 $this->indent_depth = 8;
31 $this->config =
array();
34 $this->validkeys =
array();
36 $this->indent =
array();
37 $this->unindent =
array();
38 $this->blockcommenton =
array();
39 $this->blockcommentoff =
array();
40 $this->linecommenton =
array();
41 $this->preprocessors =
array();
44 $this->zones =
array();
46 # Hashtable of keywords - maps from keyword to colour. 47 $this->keywords =
array();
49 # Used for conversion from keyword -> regexp. 50 $this->keypats =
array();
52 # Which colours to use for each 'level'. 53 $this->colours =
array(
"blue",
"purple",
"gray",
"brown",
"blue",
"purple",
"gray",
"brown");
54 $this->quotecolour =
"blue";
55 $this->blockcommentcolour =
"green";
56 $this->linecommentcolour =
"green";
57 $this->stringchars =
array();
58 $this->delimiters =
array();
59 $this->escchar =
"\\";
61 # Caches for the harvesters. 63 $this->stringcache =
"";
Create styles array
The data for the language used.
◆ _dump_array()
HFile::_dump_array |
( |
|
$array, |
|
|
|
$name |
|
) |
| |
Definition at line 232 of file HFile.php.
Referenced by _dump_colours(), and to_php().
235 print $name.
" = array(";
236 foreach($array as $a)
238 if (!$first) print
", ";
else $first = 0;
239 print
"\"".addslashes($a).
"\"";
◆ _dump_colours()
Definition at line 217 of file HFile.php.
References _dump_array(), and array.
Referenced by to_php().
220 foreach($this->used_categories as $c)
222 array_push($usedcols, $this->colours[$c-1]);
_dump_array($array, $name)
Create styles array
The data for the language used.
◆ _dump_hash()
HFile::_dump_hash |
( |
|
$hash, |
|
|
|
$name |
|
) |
| |
Definition at line 256 of file HFile.php.
Referenced by _dump_linkscripts(), and to_php().
259 print $name.
" = array(";
260 foreach(array_keys($hash) as $k)
262 if (!$first) print
", ";
else $first = 0;
263 print
"\n \"".addslashes($k).
"\"";
264 print
" => \"".addslashes($hash[$k]).
"\"";
◆ _dump_linkscripts()
HFile::_dump_linkscripts |
( |
| ) |
|
Definition at line 177 of file HFile.php.
References _dump_hash(), and array.
Referenced by to_php().
180 # Each category can specify a PHP function that takes in the function name, and returns a string 181 # to put in its place. This can be used to generate links, images, etc.\n\n";
185 foreach($this->used_categories as $c)
187 $linkhash{$c} =
"donothing";
190 $this->
_dump_hash($linkhash,
"\$this->linkscripts ");
192 print
"\n# DoNothing link function\n\n";
193 print
"function donothing(\$keywordin)\n{\n return \$keywordin;\n}\n";
Create styles array
The data for the language used.
◆ _dump_perl_array()
HFile::_dump_perl_array |
( |
|
$array, |
|
|
|
$name |
|
) |
| |
Definition at line 244 of file HFile.php.
Referenced by to_perl().
248 foreach($array as $a)
250 if (!$first) print
", ";
else $first = 0;
251 print
"\"".addslashes($a).
"\"";
◆ _dump_perl_defaultscripts()
HFile::_dump_perl_defaultscripts |
( |
| ) |
|
Definition at line 211 of file HFile.php.
Referenced by to_perl().
213 print
"\n# DoNothing link function\n\n";
214 print
"sub donothing\n{\nmy ( \$self ) = @_;\nreturn;\n}\n";
◆ _dump_perl_hash()
HFile::_dump_perl_hash |
( |
|
$hash, |
|
|
|
$name |
|
) |
| |
Definition at line 269 of file HFile.php.
Referenced by _dump_perl_linkscripts(), and to_perl().
273 foreach(array_keys($hash) as $k)
275 if (!$first) print
", ";
else $first = 0;
276 print
"\n \"".addslashes($k).
"\"";
277 print
" => \"".addslashes($hash[$k]).
"\"";
◆ _dump_perl_linkscripts()
HFile::_dump_perl_linkscripts |
( |
| ) |
|
Definition at line 196 of file HFile.php.
References _dump_perl_hash(), and array.
Referenced by to_perl().
199 # Each category can specify a Perl function that takes in the function name, and returns a string 200 # to put in its place. This can be used to generate links, images, etc.\n\n";
203 foreach($this->used_categories as $c)
205 $linkhash{$c} =
"donothing";
Create styles array
The data for the language used.
_dump_perl_hash($hash, $name)
◆ _dump_var()
HFile::_dump_var |
( |
|
$variable, |
|
|
|
$name |
|
) |
| |
◆ _get_categories()
HFile::_get_categories |
( |
| ) |
|
Definition at line 165 of file HFile.php.
References array.
Referenced by to_perl(), and to_php().
169 foreach(array_keys($this->keywords) as $k)
171 $cat = $this->keywords[$k];
172 if (!in_array($cat, $usedcats)) array_push($usedcats, $cat);
Create styles array
The data for the language used.
◆ parse_file()
HFile::parse_file |
( |
|
$file | ) |
|
Definition at line 71 of file HFile.php.
73 print
"This method should not be called from here, but from an extending configuration class.<br>";
◆ to_perl()
HFile::to_perl |
( |
|
$stub, |
|
|
|
$tofile = 1 |
|
) |
| |
Definition at line 76 of file HFile.php.
References _dump_perl_array(), _dump_perl_defaultscripts(), _dump_perl_hash(), _dump_perl_linkscripts(), _dump_var(), and _get_categories().
82 ############################### 84 # Beautifier Perl HFile 87 ############################### 89 use Beautifier::HFile; 95 bless \$self, \$class; 99 $this->
_dump_var($this->nocase,
" \$self->{nocase} ");
100 $this->
_dump_var($this->notrim,
" \$self->{notrim} ");
101 $this->
_dump_var($this->perl,
" \$self->{perl} ");
106 $this->
_dump_var($this->escchar,
" \$self->{escchar} ");
108 $this->
_dump_perl_array($this->blockcommenton,
" \$self->{blockcommenton} ");
109 $this->
_dump_perl_array($this->blockcommentoff,
" \$self->{blockcommentoff}");
_dump_var($variable, $name)
_dump_perl_defaultscripts()
_dump_perl_array($array, $name)
_dump_perl_hash($hash, $name)
◆ to_php()
HFile::to_php |
( |
|
$stub, |
|
|
|
$tofile = 1 |
|
) |
| |
Definition at line 122 of file HFile.php.
References _dump_array(), _dump_colours(), _dump_hash(), _dump_linkscripts(), _dump_var(), and _get_categories().
128 if ($tofile) print
"<?php\n";
else print
"<?\n";
129 print
"require_once('psh.php');\n";
130 print
"class psh_$stub extends psh\n{\n";
131 print
"function psh_$stub(){\n";
132 print
"\$this->psh();\n";
133 print
"######################################\n";
134 print
"# Beautifier Highlighting Configuration File \n";
135 print
"# $this->lang_name\n";
136 print
"######################################\n";
138 $this->
_dump_var($this->nocase,
"\$this->nocase ");
139 $this->
_dump_var($this->notrim,
"\$this->notrim ");
140 $this->
_dump_var($this->perl,
"\$this->perl ");
141 print
"\n# Colours\n\n";
143 $this->
_dump_var(
"blue",
"\$this->quotecolour ");
144 $this->
_dump_var(
"green",
"\$this->blockcommentcolour");
145 $this->
_dump_var(
"green",
"\$this->linecommentcolour ");
146 print
"\n# Indent Strings\n\n";
147 $this->
_dump_array($this->indent,
"\$this->indent ");
148 $this->
_dump_array($this->unindent,
"\$this->unindent ");
149 print
"\n# String characters and delimiters\n\n";
150 $this->
_dump_array($this->stringchars,
"\$this->stringchars ");
151 $this->
_dump_array($this->delimiters,
"\$this->delimiters ");
152 $this->
_dump_var ($this->escchar,
"\$this->escchar ");
153 print
"\n# Comment settings\n\n";
154 $this->
_dump_array($this->linecommenton,
"\$this->linecommenton ");
155 $this->
_dump_var ($this->blockcommenton,
"\$this->blockcommenton ");
156 $this->
_dump_var ($this->blockcommentoff,
"\$this->blockcommentoff ");
157 print
"\n# Keywords (keyword mapping to colour number)\n\n";
158 $this->
_dump_hash ($this->keywords,
"\$this->keywords ");
159 print
"\n# Special extensions\n";
162 if ($tofile) print
"\n?>";
else print
"\n?>";
_dump_array($array, $name)
_dump_var($variable, $name)
The documentation for this class was generated from the following file:
- Services/COPage/syntax_highlight/php/Beautifier/HFile.php