KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

385 lines
13KB

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