Go to the source code of this file.
|
| $BEAUT_PATH = realpath(".")."/Services/COPage/syntax_highlight/php" |
|
◆ convert()
Definition at line 137 of file HFile_conv.php.
137 {
139 global $LANGNAME;
141 $LANGNAME = str_replace(".txt", "", $LANGNAME);
142
143 $fileout = '../object/'.$LANGNAME . '.php';
144
145 print "Writing $file to $fileout\n";
146
147 HFile_parse_file(
$file);
148
149 ob_start();
150 ob_implicit_flush(0);
151
153 $out = ob_get_contents();
154 ob_end_clean();
155
156 if (isset($fileout))
157 {
158 $fd = fopen($fileout, "w");
160 fclose($fd);
161 }
162
163
164
165
166
167
168
169}
HFile_print_php_file($tofile=1)
References $file, $out, HFile_print_php_file(), and print.
Referenced by showHelp().
◆ dump_array()
dump_array |
( |
|
$array, |
|
|
|
$name |
|
) |
| |
◆ dump_colours()
Definition at line 95 of file HFile_conv.php.
96{
97 global $colours;
98
99 $usedcols = array();
100 foreach($cats as $c)
101 {
102 array_push($usedcols, $colours[$c-1]);
103 }
105}
dump_array($array, $name)
References dump_array().
Referenced by HFile_print_php_file().
◆ dump_hash()
dump_hash |
( |
|
$hash, |
|
|
|
$name |
|
) |
| |
◆ dump_linkscripts()
dump_linkscripts |
( |
|
$cats | ) |
|
Definition at line 75 of file HFile_conv.php.
76{
78// Each category can specify a PHP function that returns an altered
79// version of the keyword.
80 # This link is then placed in a <a href=\"...\">foo</a>; structure around keyword 'foo' - which is
81 \n\n";
82
83 $linkhash = array();
84
85 foreach($cats as $c)
86 {
87 $linkhash{$c} = "donothing";
88 }
89
90 dump_hash($linkhash,
"\$this->linkscripts ");
91 print "}\n# DoNothing link function\n\n";
92 print "function donothing(\$keywordin)\n{\n return \$keywordin;\n}\n";
93}
References dump_hash(), and print.
Referenced by HFile_print_php_file().
◆ dump_var()
dump_var |
( |
|
$variable, |
|
|
|
$name |
|
) |
| |
◆ get_categories()
Definition at line 62 of file HFile_conv.php.
63{
64 global $keywords;
65 $usedcats = array();
66
67 foreach(array_keys($keywords) as $k)
68 {
69 $cat = $keywords[$k];
70 if (!in_array($cat, $usedcats)) array_push($usedcats, $cat);
71 }
72 return $usedcats;
73}
Referenced by HFile_print_php_file().
◆ HFile_print_php_file()
HFile_print_php_file |
( |
|
$tofile = 1 | ) |
|
Definition at line 14 of file HFile_conv.php.
15{
16
17global $LANGNAME;
18 global $indent, $unindent, $stringchars, $config, $keywords, $delimiters, $lang_name;
19 global $linecommenton, $blockcommenton, $blockcommentoff;
20 global $perl, $nocase, $notrim;
21 if ($tofile)
print "<?php\n";
else print "<?\n";
22
23 print 'require_once(\'HFile.php\');'.
"\n";
24 print ' class HFile_'.$LANGNAME.
' extends HFile{'.
"\n";
25 print ' function HFile_'.$LANGNAME.
'(){'.
"\n";
26 print ' $this->HFile(); '.
"\n";
27
28
29
30 print "######################################\n";
31 print "# Beautifier Highlighting Configuration File \n";
32 print "# $lang_name\n";
33 print "######################################\n";
35 dump_var($nocase,
"\$this->nocase ");
36 dump_var($notrim,
"\$this->notrim ");
38 print "\n# Colours\n\n";
41 dump_var(
"blue",
"\$this->quotecolour ");
42 dump_var(
"green",
"\$this->blockcommentcolour");
43 dump_var(
"green",
"\$this->linecommentcolour ");
44 print "\n# Indent Strings\n\n";
47 print "\n# String characters and delimiters\n\n";
48 dump_array($stringchars,
"\$this->stringchars ");
49 dump_array($delimiters,
"\$this->delimiters ");
50 dump_var ($escchar,
"\$this->escchar ");
51 print "\n# Comment settings\n\n";
52 dump_var ($linecommenton,
"\$this->linecommenton ");
53 dump_var ($blockcommenton,
"\$this->blockcommenton ");
54 dump_var ($blockcommentoff,
"\$this->blockcommentoff ");
55 print "\n# Keywords (keyword mapping to colour number)\n\n";
56 dump_hash ($keywords,
"\$this->keywords ");
57 print "\n# Special extensions\n";
59 if ($tofile)
print "\n}?>";
else print "}\n?>";
60}
dump_var($variable, $name)
References dump_array(), dump_colours(), dump_hash(), dump_linkscripts(), dump_var(), get_categories(), and print.
Referenced by convert().
◆ $BEAUT_PATH
$BEAUT_PATH = realpath(".")."/Services/COPage/syntax_highlight/php" |