ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
HFile_cpp.php
Go to the documentation of this file.
1 <?php
2 $BEAUT_PATH = realpath(".") . "/Services/COPage/syntax_highlight/php";
3 if (!isset($BEAUT_PATH)) {
4  return;
5 }
6 require_once("$BEAUT_PATH/Beautifier/HFile.php");
7 
8 class HFile_cpp extends HFile
9 {
10  public function __construct()
11  {
12  parent::__construct();
13 
14 
15  /*************************************/
16  // Beautifier Highlighting Configuration File
17  // C++ Source
18  /*************************************/
19  // Flags
20 
21  $this->nocase = "0";
22  $this->notrim = "0";
23  $this->perl = "0";
24 
25  // Colours
26 
27  $this->colours = array("blue", "purple", "gray", "brown", "blue");
28  $this->quotecolour = "blue";
29  $this->blockcommentcolour = "green";
30  $this->linecommentcolour = "green";
31 
32  // Indent Strings
33 
34  $this->indent = array("{");
35  $this->unindent = array("}");
36 
37  // String characters and delimiters
38 
39  $this->stringchars = array("\"", "'");
40  $this->delimiters = array("~", "!", "@", "%", "^", "&", "*", "(", ")", "-", "+", "=", "|", "\\", "{", "}", "[", "]", "<", ">", ":", ";", "\"", "'", " ", ",", " ", ".", "?");
41  $this->escchar = "";
42 
43  // Comment settings
44 
45  $this->linecommenton = array("//");
46  $this->blockcommenton = array("/*");
47  $this->blockcommentoff = array("*/");
48 
49  // Keywords (keyword mapping to colour number)
50 
51  $this->keywords = array(
52  "bool" => "1",
53  "char" => "1",
54  "class" => "1",
55  "const" => "1",
56  "case" => "1",
57  "catch" => "1",
58  "const_cast" => "1",
59  "double" => "1",
60  "default" => "1",
61  "do" => "1",
62  "delete" => "1",
63  "dynamic_cast" => "1",
64  "else" => "1",
65  "enum" => "1",
66  "explicit" => "1",
67  "export" => "1",
68  "extern" => "1",
69  "for" => "1",
70  "false" => "1",
71  "float" => "1",
72  "friend" => "1",
73  "if" => "1",
74  "inline" => "1",
75  "int" => "1",
76  "long" => "1",
77  "mutable" => "1",
78  "new" => "1",
79  "namespace" => "1",
80  "operator" => "1",
81  "protected" => "1",
82  "private" => "1",
83  "public" => "1",
84  "reinterpret_cast" => "1",
85  "return" => "1",
86  "short" => "1",
87  "signed" => "1",
88  "sizeof" => "1",
89  "static" => "1",
90  "struct" => "1",
91  "static_cast" => "1",
92  "switch" => "1",
93  "template" => "1",
94  "throw" => "1",
95  "true" => "1",
96  "typedef" => "1",
97  "typename" => "1",
98  "this" => "1",
99  "try" => "1",
100  "typeid" => "1",
101  "union" => "1",
102  "unsigned" => "1",
103  "using" => "1",
104  "virtual" => "1",
105  "void" => "1",
106  "volatile" => "1",
107  "wchar_t" => "1",
108  "while" => "1",
109  "asm" => "2",
110  "auto" => "2",
111  "break" => "2",
112  "continue" => "2",
113  "goto" => "2",
114  "register" => "2",
115  "#define" => "3",
116  "#error" => "3",
117  "#include" => "3",
118  "#elif" => "3",
119  "#if" => "3",
120  "#line" => "3",
121  "#else" => "3",
122  "#ifdef" => "3",
123  "#pragma" => "3",
124  "#endif" => "3",
125  "#ifndef" => "3",
126  "#undef" => "3",
127  "+" => "4",
128  "-" => "4",
129  "=" => "4",
130  "//" => "4",
131  "/" => "4",
132  "%" => "4",
133  "&" => "4",
134  ">" => "4",
135  "<" => "4",
136  "^" => "4",
137  "!" => "4",
138  "|" => "4",
139  "*" => "4",
140  "{" => "5",
141  "}" => "5",
142  ";" => "5",
143  "(" => "5",
144  ")" => "5",
145  "," => "5");
146 
147  // Special extensions
148 
149 
150  // Each category can specify a PHP function that returns an altered
151  // version of the keyword.
152 
153 
154 
155 
156 
157  $this->linkscripts = array(
158  "1" => "donothing",
159  "2" => "donothing",
160  "3" => "donothing",
161  "4" => "donothing",
162  "5" => "donothing");
163  }
164 
165  public function donothing($keywordin)
166  {
167  return $keywordin;
168  }
169 }
$BEAUT_PATH
Definition: HFile_cpp.php:2
__construct()
Definition: HFile_cpp.php:10
donothing($keywordin)
Definition: HFile_cpp.php:165
Create styles array
The data for the language used.
Definition: HFile.php:21