4 ini_set(
'max_execution_time', 300000);
6 $BEAUT_PATH = realpath(
".").
"/Services/COPage/syntax_highlight/php";
8 require
"$BEAUT_PATH/Beautifier/HFile.php";
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";
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";
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?>";
67 foreach(array_keys($keywords) as $k)
70 if (!in_array($cat, $usedcats)) array_push($usedcats, $cat);
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
87 $linkhash{$c} =
"donothing";
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";
102 array_push($usedcols, $colours[$c-1]);
109 print
$name.
" = \"".addslashes($variable).
"\";\n";
115 print
$name.
" = array(";
116 foreach($array as $a)
118 if (!$first) print
", ";
else $first = 0;
119 print
"\"".addslashes($a).
"\"";
127 print
$name.
" = array(";
128 foreach(array_keys($hash) as $k)
130 if (!$first) print
", ";
else $first = 0;
131 print
"\n \"".addslashes($k).
"\"";
132 print
" => \"".addslashes($hash[$k]).
"\"";
141 $LANGNAME = str_replace(
".txt",
"", $LANGNAME);
143 $fileout =
'../object/'.$LANGNAME .
'.php';
145 print
"Writing $file to $fileout\n";
147 HFile_parse_file(
$file);
150 ob_implicit_flush(0);
153 $out = ob_get_contents();
158 $fd = fopen($fileout,
"w");