ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
llvm.php
Go to the documentation of this file.
1 <?php
2 /*************************************************************************************
3  * llvm.php
4  * --------
5  * Author: Benny Baumann (BenBE@geshi.org), Azriel Fasten (azriel.fasten@gmail.com)
6  * Copyright: (c) 2010 Benny Baumann (http://qbnz.com/highlighter/), Azriel Fasten (azriel.fasten@gmail.com)
7  * Release Version: 1.0.8.12
8  * Date Started: 2010/10/14
9  *
10  * LLVM language file for GeSHi.
11  *
12  * CHANGES
13  * -------
14  * 2010/10/14 (1.0.8.10)
15  * - First Release
16  *
17  * TODO (updated 2010/10/14)
18  * -------------------------
19  * * Check if all links aren't broken
20  *
21  *************************************************************************************
22  *
23  * This file is part of GeSHi.
24  *
25  * GeSHi is free software; you can redistribute it and/or modify
26  * it under the terms of the GNU General Public License as published by
27  * the Free Software Foundation; either version 2 of the License, or
28  * (at your option) any later version.
29  *
30  * GeSHi is distributed in the hope that it will be useful,
31  * but WITHOUT ANY WARRANTY; without even the implied warranty of
32  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33  * GNU General Public License for more details.
34  *
35  * You should have received a copy of the GNU General Public License
36  * along with GeSHi; if not, write to the Free Software
37  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38  *
39  ************************************************************************************/
40 
42  'LANG_NAME' => 'LLVM Intermediate Representation',
43  'COMMENT_SINGLE' => array(1 => ';'),
44  'COMMENT_MULTI' => array(),
45  'HARDQUOTE' => array("\"", "\""),
46  'HARDESCAPE' => array("\"", "\\"),
47  'HARDCHAR' => "\\",
48  'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
49  'QUOTEMARKS' => array('"'),
50  'ESCAPE_CHAR' => '',
51  'ESCAPE_REGEXP' => array(
52  //Simple Single Char Escapes
53  // 1 => "#\\\\[nfrtv\$\"\n\\\\]#i",
54  //Hexadecimal Char Specs
55  // 2 => "#\\\\x[\da-fA-F]{1,2}#i",
56  //Octal Char Specs
57  // 3 => "#\\\\[0-7]{1,3}#",
58  //String Parsing of Variable Names
59  // 4 => "#\\$[a-z0-9_]+(?:\\[[a-z0-9_]+\\]|->[a-z0-9_]+)?|(?:\\{\\$|\\$\\{)[a-z0-9_]+(?:\\[('?)[a-z0-9_]*\\1\\]|->[a-z0-9_]+)*\\}#i",
60  //Experimental extension supporting cascaded {${$var}} syntax
61  // 5 => "#\$[a-z0-9_]+(?:\[[a-z0-9_]+\]|->[a-z0-9_]+)?|(?:\{\$|\$\{)[a-z0-9_]+(?:\[('?)[a-z0-9_]*\\1\]|->[a-z0-9_]+)*\}|\{\$(?R)\}#i",
62  //Format String support in ""-Strings
63  // 6 => "#%(?:%|(?:\d+\\\\\\\$)?\\+?(?:\x20|0|'.)?-?(?:\d+|\\*)?(?:\.\d+)?[bcdefFosuxX])#"
64  ),
65  'NUMBERS' =>
67  'KEYWORDS' => array(
68  0 => array(
69  'to', 'nuw', 'nsw', 'align', 'inbounds', 'entry', 'return'
70  ),
71  //Terminator Instructions
72  1 => array(
73  'ret', 'br', 'switch', 'indirectbr', 'invoke', 'unwind', 'unreachable'
74  ),
75  //Binary Operations
76  2 => array(
77  'add', 'fadd', 'sub', 'fsub', 'mul', 'fmul', 'udiv', 'sdiv', 'fdiv', 'urem', 'frem', 'srem'
78  ),
79  //Bitwise Binary Operations
80  3 => array(
81  'shl', 'lshr', 'ashr', 'and', 'or', 'xor'
82  ),
83  //Vector Operations
84  4 => array(
85  'extractelement', 'insertelement', 'shufflevector'
86  ),
87  //Aggregate Operations
88  5 => array(
89  'extractvalue', 'insertvalue'
90  ),
91  //Memory Access and Addressing Operations
92  6 => array(
93  'alloca', 'load', 'store', 'getelementptr'
94  ),
95  //Conversion Operations
96  7 => array(
97  'trunc', 'zext', 'sext', 'fptrunc', 'fpext', 'fptoui', 'fptosi',
98  'uitofp', 'sitofp', 'ptrtoint', 'inttoptr', 'bitcast'
99  ),
100  //Other Operations
101  8 => array(
102  'icmp', 'fcmp', 'phi', 'select', 'call', 'va_arg'
103  ),
104  //Linkage Types
105  9 => array(
106  'private', 'linker_private', 'linker_private_weak', 'linker_private_weak_def_auto',
107  'internal', 'available_externally', 'linkonce', 'common', 'weak', 'appending',
108  'extern_weak', 'linkonce_odr', 'weak_odr', 'externally visible', 'dllimport', 'dllexport',
109  ),
110  //Calling Conventions
111  10 => array(
112  'ccc', 'fastcc', 'coldcc', 'cc 10'
113  ),
114  //Named Types
115  11 => array(
116  'type'
117  ),
118  //Parameter Attributes
119  12 => array(
120  'zeroext', 'signext', 'inreg', 'byval', 'sret', 'noalias', 'nocapture', 'nest'
121  ),
122  //Function Attributes
123  13 => array(
124  'alignstack', 'alwaysinline', 'inlinehint', 'naked', 'noimplicitfloat', 'noinline', 'noredzone', 'noreturn',
125  'nounwind', 'optsize', 'readnone', 'readonly', 'ssp', 'sspreq',
126  ),
127  //Module-Level Inline Assembly
128  14 => array(
129  'module asm'
130  ),
131  //Data Layout
132  15 => array(
133  'target datalayout'
134  ),
135  //Primitive Types
136  16 => array(
137  'x86mmx',
138  'void',
139  'label',
140  'metadata',
141  'opaque'
142  ),
143  //Floating Point Types
144  17 => array(
145  'float', 'double', 'fp128', 'x86_fp80', 'ppc_fp128',
146  ),
147  //Simple Constants
148  18 => array(
149  'false', 'true', 'null'
150  ),
151  //Global Variable and Function Addresses
152  19 => array(
153  'global', 'addrspace', 'constant', 'section'
154  ),
155  //Functions
156  20 => array(
157  'declare', 'define'
158  ),
159  //Complex Constants
160  21 => array(
161  'zeroinitializer'
162  ),
163  //Undefined Values
164  22 => array(
165  'undef'
166  ),
167  //Addresses of Basic Blocks
168  23 => array(
169  'blockaddress'
170  ),
171  //Visibility Styles
172  24 => array(
173  'default', 'hidden', 'protected'
174  ),
175  25 => array(
176  'volatile'
177  ),
178  26 => array(
179  'tail'
180  ),
181  ),
182  'SYMBOLS' => array(
183  0 => array(
184  '(', ')', '[', ']', '{', '}',
185  '!', '@', '%', '&', '|', '/',
186  '<', '>',
187  '=', '-', '+', '*',
188  '.', ':', ',', ';'
189  )
190  ),
191  'CASE_SENSITIVE' => array(
192  GESHI_COMMENTS => false,
193  1 => true,
194  2 => true,
195  3 => true,
196  4 => true,
197  5 => true,
198  6 => true,
199  7 => true,
200  8 => true,
201  9 => true,
202  10 => true,
203  11 => true,
204  12 => true,
205  13 => true,
206  14 => true,
207  15 => true,
208  16 => true,
209  17 => true,
210  18 => true,
211  19 => true,
212  20 => true,
213  21 => true,
214  22 => true,
215  23 => true,
216  24 => true,
217  25 => true,
218  26 => true,
219  ),
220  'STYLES' => array(
221  'KEYWORDS' => array(
222  0 => 'color: #209090;',
223  1 => 'color: #0000F0;',
224  2 => 'color: #00F000; font-weight: bold;',
225  3 => 'color: #F00000;',
226  4 => 'color: #00F0F0; font-weight: bold;',
227  5 => 'color: #F000F0; font-weight: bold;',
228  6 => 'color: #403020; font-weight: bold;',
229  7 => 'color: #909090; font-weight: bold;',
230  8 => 'color: #009090; font-weight: bold;',
231  9 => 'color: #900090; font-weight: bold;',
232  10 => 'color: #909000; font-weight: bold;',
233  11 => 'color: #000090; font-weight: bold;',
234  12 => 'color: #900000; font-weight: bold;',
235  13 => 'color: #009000; font-weight: bold;',
236  14 => 'color: #F0F090; font-weight: bold;',
237  15 => 'color: #F090F0; font-weight: bold;',
238  16 => 'color: #90F0F0; font-weight: bold;',
239  17 => 'color: #9090F0; font-weight: bold;',
240  18 => 'color: #90F090; font-weight: bold;',
241  19 => 'color: #F09090; font-weight: bold;',
242  20 => 'color: #4040F0; font-weight: bold;',
243  21 => 'color: #40F040; font-weight: bold;',
244  22 => 'color: #F04040; font-weight: bold;',
245  23 => 'color: #F0F040; font-weight: bold;',
246  24 => 'color: #F040F0; font-weight: bold;',
247  25 => 'color: #40F0F0; font-weight: bold;',
248  26 => 'color: #904040; font-weight: bold;',
249  ),
250  'COMMENTS' => array(
251  1 => 'color: #666666; font-style: italic;',
252  'MULTI' => 'color: #666666; font-style: italic;'
253  ),
254  'ESCAPE_CHAR' => array(
255  0 => 'color: #000099; font-weight: bold;',
256  1 => 'color: #000099; font-weight: bold;',
257  2 => 'color: #660099; font-weight: bold;',
258  3 => 'color: #660099; font-weight: bold;',
259  4 => 'color: #006699; font-weight: bold;',
260  5 => 'color: #006699; font-weight: bold; font-style: italic;',
261  6 => 'color: #009933; font-weight: bold;',
262  'HARD' => 'color: #000099; font-weight: bold;'
263  ),
264  'BRACKETS' => array(
265  0 => 'color: #009900;'
266  ),
267  'STRINGS' => array(
268  0 => 'color: #0000ff;',
269  'HARD' => 'color: #0000ff;'
270  ),
271  'NUMBERS' => array(
272  0 => 'color: #cc66cc;',
273  GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
274  GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
275  GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
276  ),
277  'METHODS' => array(
278  1 => 'color: #004000;',
279  2 => 'color: #004000;'
280  ),
281  'SYMBOLS' => array(
282  0 => 'color: #339933;',
283  ),
284  'REGEXPS' => array(
285  0 => 'color: #007088;',
286  1 => 'color: #007088;',
287  // 2 => 'color: #000088;',
288  3 => 'color: #700088;',
289  4 => 'color: #010088;',
290  // 5 => 'color: #610088;',
291  // 6 => 'color: #616088;',
292  // 7 => 'color: #616988;',
293  // 8 => 'color: #616908;',
294  9 => 'color: #6109F8;',
295  ),
296  'SCRIPT' => array(
297  0 => '',
298  1 => '',
299  2 => '',
300  3 => '',
301  4 => '',
302  5 => ''
303  )
304  ),
305  'URLS' => array(
306  0 => '',
307  1 => 'http://llvm.org/docs/LangRef.html#i_{FNAME}',
308  2 => 'http://llvm.org/docs/LangRef.html#i_{FNAME}',
309  3 => 'http://llvm.org/docs/LangRef.html#i_{FNAME}',
310  4 => 'http://llvm.org/docs/LangRef.html#i_{FNAME}',
311  5 => 'http://llvm.org/docs/LangRef.html#i_{FNAME}',
312  6 => 'http://llvm.org/docs/LangRef.html#i_{FNAME}',
313  7 => 'http://llvm.org/docs/LangRef.html#i_{FNAME}',
314  8 => 'http://llvm.org/docs/LangRef.html#i_{FNAME}',
315  9 => 'http://llvm.org/docs/LangRef.html#linkage_{FNAME}',
316  10 => 'http://llvm.org/docs/LangRef.html#callingconv',
317  11 => 'http://llvm.org/docs/LangRef.html#namedtypes',
318  12 => 'http://llvm.org/docs/LangRef.html#paramattrs',
319  13 => 'http://llvm.org/docs/LangRef.html#fnattrs',
320  14 => 'http://llvm.org/docs/LangRef.html#moduleasm',
321  15 => 'http://llvm.org/docs/LangRef.html#datalayout',
322  16 => 'http://llvm.org/docs/LangRef.html#t_{FNAME}',
323  17 => 'http://llvm.org/docs/LangRef.html#t_floating',
324  18 => 'http://llvm.org/docs/LangRef.html#simpleconstants',
325  19 => 'http://llvm.org/docs/LangRef.html#globalvars',
326  20 => 'http://llvm.org/docs/LangRef.html#functionstructure',
327  21 => 'http://llvm.org/docs/LangRef.html#complexconstants',
328  22 => 'http://llvm.org/docs/LangRef.html#undefvalues',
329  23 => 'http://llvm.org/docs/LangRef.html#blockaddress',
330  24 => 'http://llvm.org/docs/LangRef.html#visibility',
331  25 => 'http://llvm.org/docs/LangRef.html#volatile',
332  26 => 'http://llvm.org/docs/LangRef.html#i_call',
333  ),
334  'OOLANG' => false,
335  'OBJECT_SPLITTERS' => array(
336  ),
337  'REGEXPS' => array(
338  //Variables
339  0 => '%[-a-zA-Z$\._][-a-zA-Z$\._0-9]*',
340  //Labels
341  // 1 => '[-a-zA-Z$\._0-9]+:',
342  1 => '(?<!\w)[\-\w\$\.]+:(?![^">]*<)',
343  //Strings
344  // 2 => '"[^"]+"',
345  //Unnamed variable slots
346  3 => '%[-]?[0-9]+',
347  //Integer Types
348  4 => array(
349  GESHI_SEARCH => '(?<!\w)i\d+(?!\w)',
350  GESHI_REPLACE => '\\0',
351  GESHI_MODIFIERS => '',
352  GESHI_BEFORE => '<a href="http://llvm.org/docs/LangRef.html#t_integer">',
353  GESHI_AFTER => '</a>'
354  ),
355  //Comments
356  // 5 => ';.*',
357  //Integer literals
358  // 6 => '\\b[-]?[0-9]+\\b',
359  //Floating point constants
360  // 7 => '\\b[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\b',
361  //Hex constants
362  // 8 => '\\b0x[0-9A-Fa-f]+\\b',
363  //Global variables
364  9 => array(
365  GESHI_SEARCH => '@[-a-zA-Z$\._][-a-zA-Z$\._0-9]*',
366  GESHI_REPLACE => '\\0',
367  GESHI_MODIFIERS => '',
368  GESHI_BEFORE => '<a href="http://llvm.org/docs/LangRef.html#globalvars">',
369  GESHI_AFTER => '</a>'
370  ),
371  ),
372  'STRICT_MODE_APPLIES' => GESHI_MAYBE,
373  'HIGHLIGHT_STRICT_BLOCK' => array(
374  0 => true,
375  1 => true,
376  2 => true,
377  3 => true,
378  4 => true,
379  5 => true
380  ),
381  'SCRIPT_DELIMITERS' => array(),
382  'TAB_WIDTH' => 4
383 );
const GESHI_MODIFIERS
The key of the regex array defining any modifiers to the regular expression.
Definition: geshi.php:138
const GESHI_NUMBER_FLT_SCI_ZERO
Number format to highlight floating-point numbers with support for scientific notation (E) and requir...
Definition: geshi.php:229
const GESHI_BEFORE
The key of the regex array defining what bracket group in a matched search to put before the replacem...
Definition: geshi.php:141
const GESHI_COMMENTS
Used in language files to mark comments.
Definition: geshi.php:150
const GESHI_REPLACE
The key of the regex array defining what bracket group in a matched search to use as a replacement...
Definition: geshi.php:136
const GESHI_NUMBER_HEX_PREFIX
Number format to highlight hex numbers with a prefix 0x.
Definition: geshi.php:217
const GESHI_SEARCH
The key of the regex array defining what to search for.
Definition: geshi.php:133
Create styles array
The data for the language used.
$language_data
Definition: llvm.php:41
const GESHI_MAYBE
Strict mode might apply, and can be enabled or disabled by GeSHi->enable_strict_mode().
Definition: geshi.php:127
const GESHI_NUMBER_INT_BASIC
Basic number format for integers.
Definition: geshi.php:199
const GESHI_CAPS_NO_CHANGE
Lowercase keywords found.
Definition: geshi.php:95
const GESHI_NUMBER_OCT_PREFIX
Number format to highlight octal numbers with a leading zero.
Definition: geshi.php:209
const GESHI_AFTER
The key of the regex array defining what bracket group in a matched search to put after the replaceme...
Definition: geshi.php:144