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.

296 lines
12KB

  1. <?php
  2. /*************************************************************************************
  3. * gnuplot.php
  4. * ----------
  5. * Author: Milian Wolff (mail@milianw.de)
  6. * Copyright: (c) 2008 Milian Wolff (http://milianw.de)
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2008/07/07
  9. *
  10. * Gnuplot script language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2008/07/07 (1.0.8)
  15. * - Initial import
  16. *
  17. *************************************************************************************
  18. *
  19. * This file is part of GeSHi.
  20. *
  21. * GeSHi is free software; you can redistribute it and/or modify
  22. * it under the terms of the GNU General Public License as published by
  23. * the Free Software Foundation; either version 2 of the License, or
  24. * (at your option) any later version.
  25. *
  26. * GeSHi is distributed in the hope that it will be useful,
  27. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. * GNU General Public License for more details.
  30. *
  31. * You should have received a copy of the GNU General Public License
  32. * along with GeSHi; if not, write to the Free Software
  33. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  34. *
  35. ************************************************************************************/
  36. $language_data = array (
  37. 'LANG_NAME' => 'Gnuplot',
  38. 'COMMENT_SINGLE' => array(1 => '#'),
  39. 'COMMENT_MULTI' => array(),
  40. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  41. 'QUOTEMARKS' => array('`', '"', "'"),
  42. 'ESCAPE_CHAR' => '\\',
  43. 'NUMBERS' =>
  44. GESHI_NUMBER_INT_BASIC |
  45. GESHI_NUMBER_FLT_NONSCI |
  46. GESHI_NUMBER_FLT_SCI_SHORT |
  47. GESHI_NUMBER_FLT_SCI_ZERO,
  48. 'KEYWORDS' => array(
  49. // copy output of help command, indent properly and use this replace regexp:
  50. // ([a-z0-9_\-]+)(( )+|$) => '\1',\3
  51. // commands as found in `help commands`
  52. 1 => array(
  53. 'bind', 'call', 'cd', 'clear',
  54. 'exit', 'fit', 'help', 'history',
  55. 'if', 'load', 'lower', 'pause',
  56. 'plot', 'print', 'pwd', 'quit',
  57. 'raise', 'replot', 'reread', 'reset',
  58. 'save', 'set', 'shell', 'show',
  59. 'splot', 'system', 'test', 'unset',
  60. 'update'
  61. ),
  62. 2 => array(
  63. // set commands as returned by `help set`
  64. 'angles', 'arrow', 'autoscale', 'bars',
  65. 'bmargin', 'border', 'boxwidth', 'cbdata',
  66. 'cbdtics', 'cblabel', 'cbmtics', 'cbrange',
  67. 'cbtics', 'clabel', 'clip', 'cntrparam',
  68. 'colorbox', 'contour', 'datafile', 'date_specifiers',
  69. 'decimalsign', 'dgrid3d', 'dummy', 'encoding',
  70. 'fontpath', 'format', 'grid',
  71. 'hidden3d', 'historysize', 'isosamples', 'key',
  72. 'label', 'lmargin', 'loadpath', 'locale',
  73. 'log', 'logscale', 'macros', 'mapping',
  74. 'margin', 'missing', 'mouse', 'multiplot',
  75. 'mx2tics', 'mxtics', 'my2tics', 'mytics',
  76. 'mztics', 'object', 'offsets', 'origin',
  77. 'output', 'palette', 'parametric', 'pm3d',
  78. 'pointsize', 'polar', 'rmargin',
  79. 'rrange', 'samples', 'size', 'style',
  80. 'surface', 'table', 'term', 'terminal',
  81. 'termoption', 'tics', 'ticscale', 'ticslevel',
  82. 'time_specifiers', 'timefmt', 'timestamp', 'title',
  83. 'trange', 'urange', 'view',
  84. 'vrange', 'x2data', 'x2dtics', 'x2label',
  85. 'x2mtics', 'x2range', 'x2tics', 'x2zeroaxis',
  86. 'xdata', 'xdtics', 'xlabel', 'xmtics',
  87. 'xrange', 'xtics', 'xyplane', 'xzeroaxis',
  88. 'y2data', 'y2dtics', 'y2label', 'y2mtics',
  89. 'y2range', 'y2tics', 'y2zeroaxis', 'ydata',
  90. 'ydtics', 'ylabel', 'ymtics', 'yrange',
  91. 'ytics', 'yzeroaxis', 'zdata', 'zdtics',
  92. 'zero', 'zeroaxis', 'zlabel', 'zmtics',
  93. 'zrange', 'ztics', 'zzeroaxis',
  94. // same but with leading no
  95. 'noangles', 'noarrow', 'noautoscale', 'nobars',
  96. 'nobmargin', 'noborder', 'noboxwidth', 'nocbdata',
  97. 'nocbdtics', 'nocblabel', 'nocbmtics', 'nocbrange',
  98. 'nocbtics', 'noclabel', 'noclip', 'nocntrparam',
  99. 'nocolorbox', 'nocontour', 'nodatafile', 'nodate_specifiers',
  100. 'nodecimalsign', 'nodgrid3d', 'nodummy', 'noencoding',
  101. 'nofit', 'nofontpath', 'noformat', 'nogrid',
  102. 'nohidden3d', 'nohistorysize', 'noisosamples', 'nokey',
  103. 'nolabel', 'nolmargin', 'noloadpath', 'nolocale',
  104. 'nolog', 'nologscale', 'nomacros', 'nomapping',
  105. 'nomargin', 'nomissing', 'nomouse', 'nomultiplot',
  106. 'nomx2tics', 'nomxtics', 'nomy2tics', 'nomytics',
  107. 'nomztics', 'noobject', 'nooffsets', 'noorigin',
  108. 'nooutput', 'nopalette', 'noparametric', 'nopm3d',
  109. 'nopointsize', 'nopolar', 'noprint', 'normargin',
  110. 'norrange', 'nosamples', 'nosize', 'nostyle',
  111. 'nosurface', 'notable', 'noterm', 'noterminal',
  112. 'notermoption', 'notics', 'noticscale', 'noticslevel',
  113. 'notime_specifiers', 'notimefmt', 'notimestamp', 'notitle',
  114. 'notmargin', 'notrange', 'nourange', 'noview',
  115. 'novrange', 'nox2data', 'nox2dtics', 'nox2label',
  116. 'nox2mtics', 'nox2range', 'nox2tics', 'nox2zeroaxis',
  117. 'noxdata', 'noxdtics', 'noxlabel', 'noxmtics',
  118. 'noxrange', 'noxtics', 'noxyplane', 'noxzeroaxis',
  119. 'noy2data', 'noy2dtics', 'noy2label', 'noy2mtics',
  120. 'noy2range', 'noy2tics', 'noy2zeroaxis', 'noydata',
  121. 'noydtics', 'noylabel', 'noymtics', 'noyrange',
  122. 'noytics', 'noyzeroaxis', 'nozdata', 'nozdtics',
  123. 'nozero', 'nozeroaxis', 'nozlabel', 'nozmtics',
  124. 'nozrange', 'noztics', 'nozzeroaxis',
  125. ),
  126. 3 => array(
  127. // predefined variables
  128. 'pi', 'NaN', 'GNUTERM',
  129. 'GPVAL_X_MIN', 'GPVAL_X_MAX', 'GPVAL_Y_MIN', 'GPVAL_Y_MAX',
  130. 'GPVAL_TERM', 'GPVAL_TERMOPTIONS', 'GPVAL_OUTPUT',
  131. 'GPVAL_VERSION', 'GPVAL_PATcHLEVEL', 'GPVAL_COMPILE_OPTIONS',
  132. 'MOUSE_KEY', 'MOUSE_X', 'MOUSE_X2', 'MOUSE_Y', 'MOUSE_Y2',
  133. 'MOUSE_BUTTON', 'MOUSE_SHIFT', 'MOUSE_ALT', 'MOUSE_CTRL'
  134. ),
  135. 4 => array(
  136. // predefined functions `help functions`
  137. 'abs', 'acos', 'acosh', 'arg',
  138. 'asin', 'asinh', 'atan', 'atan2',
  139. 'atanh', 'besj0', 'besj1', 'besy0',
  140. 'besy1', 'ceil', 'column', 'cos',
  141. 'cosh', 'defined', 'erf', 'erfc',
  142. 'exists', 'exp', 'floor', 'gamma',
  143. 'gprintf', 'ibeta', 'igamma', 'imag',
  144. 'int', 'inverf', 'invnorm', 'lambertw',
  145. 'lgamma', 'log10', 'norm',
  146. 'rand', 'random', 'real', 'sgn',
  147. 'sin', 'sinh', 'sprintf', 'sqrt',
  148. 'stringcolumn', 'strlen', 'strstrt', 'substr',
  149. 'tan', 'tanh', 'timecolumn',
  150. 'tm_hour', 'tm_mday', 'tm_min', 'tm_mon',
  151. 'tm_sec', 'tm_wday', 'tm_yday', 'tm_year',
  152. 'valid', 'word', 'words',
  153. ),
  154. 5 => array(
  155. // mixed arguments
  156. // there is no sane way to get these ones easily...
  157. 'autofreq', 'x', 'y', 'z',
  158. 'lt', 'linetype', 'lw', 'linewidth', 'ls', 'linestyle',
  159. 'out', 'rotate by', 'screen',
  160. 'enhanced', 'via',
  161. // `help set key`
  162. 'on', 'off', 'default', 'inside', 'outside', 'tmargin',
  163. 'at', 'left', 'right', 'center', 'top', 'bottom', 'vertical', 'horizontal', 'Left', 'Right',
  164. 'noreverse', 'reverse', 'noinvert', 'invert', 'samplen', 'spacing', 'width', 'height',
  165. 'noautotitle', 'autotitle', 'noenhanced', 'nobox', 'box',
  166. // help set terminal postscript
  167. 'landscape', 'portrait', 'eps', 'defaultplex', 'simplex', 'duplex',
  168. 'fontfile', 'add', 'delete', 'nofontfiles', 'level1', 'leveldefault',
  169. 'color', 'colour', 'monochrome', 'solid', 'dashed', 'dashlength', 'dl',
  170. 'rounded', 'butt', 'palfuncparam', 'blacktext', 'colortext', 'colourtext',
  171. 'font',
  172. // help set terminal png
  173. 'notransparent', 'transparent', 'nointerlace', 'interlace',
  174. 'notruecolor', 'truecolor', 'tiny', 'small', 'medium', 'large', 'giant',
  175. 'nocrop', 'crop',
  176. // `help plot`
  177. 'acsplines', 'bezier', 'binary', 'csplines',
  178. 'every',
  179. 'example', 'frequency', 'index', 'matrix',
  180. 'ranges', 'sbezier', 'smooth',
  181. 'special-filenames', 'thru',
  182. 'unique', 'using', 'with',
  183. // `help plotting styles`
  184. 'boxerrorbars', 'boxes', 'boxxyerrorbars', 'candlesticks',
  185. 'dots', 'errorbars', 'errorlines', 'filledcurves',
  186. 'financebars', 'fsteps', 'histeps', 'histograms',
  187. 'image', 'impulses', 'labels', 'lines',
  188. 'linespoints', 'points', 'rgbimage', 'steps',
  189. 'vectors', 'xerrorbars', 'xerrorlines', 'xyerrorbars',
  190. 'xyerrorlines', 'yerrorbars', 'yerrorlines',
  191. // terminals `help terminals`
  192. 'aed512', 'aed767', 'aifm', 'bitgraph',
  193. 'cgm', 'corel', 'dumb', 'dxf',
  194. 'eepic', 'emf', 'emtex', 'epslatex',
  195. 'epson-180dpi', 'epson-60dpi', 'epson-lx800', 'fig',
  196. 'gif', 'gpic', 'hp2623a', 'hp2648',
  197. 'hp500c', 'hpdj', 'hpgl', 'hpljii',
  198. 'hppj', 'imagen', 'jpeg', 'kc-tek40xx',
  199. 'km-tek40xx', 'latex', 'mf', 'mif',
  200. 'mp', 'nec-cp6', 'okidata', 'pbm',
  201. 'pcl5', 'png', 'pop', 'postscript',
  202. 'pslatex', 'pstex', 'pstricks', 'push',
  203. 'qms', 'regis', 'selanar', 'starc',
  204. 'svg', 'tandy-60dpi', 'tek40xx', 'tek410x',
  205. 'texdraw', 'tgif', 'tkcanvas', 'tpic',
  206. 'vttek', 'x11', 'xlib',
  207. )
  208. ),
  209. 'REGEXPS' => array(
  210. //Variable assignment
  211. 0 => "(?<![?;>\w])([a-zA-Z_][a-zA-Z0-9_]*)\s*=",
  212. //Numbers with unit
  213. 1 => "(?<=^|\s)([0-9]*\.?[0-9]+\s*cm)"
  214. ),
  215. 'SYMBOLS' => array(
  216. '-', '+', '~', '!', '$',
  217. '*', '/', '%', '=', '<', '>', '&',
  218. '^', '|', '.', 'eq', 'ne', '?:', ':', '`', ','
  219. ),
  220. 'CASE_SENSITIVE' => array(
  221. GESHI_COMMENTS => false,
  222. 1 => true,
  223. 2 => true,
  224. 3 => true,
  225. 4 => true,
  226. 5 => true
  227. ),
  228. 'STYLES' => array(
  229. 'KEYWORDS' => array(
  230. 1 => 'color: #b1b100;',
  231. 2 => 'color: #990000;',
  232. 3 => 'color: #550000;',
  233. 4 => 'color: #7a0874;',
  234. 5 => 'color: #448888;'
  235. ),
  236. 'COMMENTS' => array(
  237. 1 => 'color: #adadad; font-style: italic;',
  238. ),
  239. 'ESCAPE_CHAR' => array(
  240. 0 => 'color: #000099; font-weight:bold;'
  241. ),
  242. 'BRACKETS' => array(
  243. 0 => 'color: #000099; font-weight:bold;'
  244. ),
  245. 'STRINGS' => array(
  246. 0 => 'color: #0000ff;',
  247. ),
  248. 'NUMBERS' => array(
  249. 0 => 'color: #cc66cc;'
  250. ),
  251. 'METHODS' => array(
  252. ),
  253. 'SYMBOLS' => array(
  254. 0 => 'color: #000; font-weight: bold;'
  255. ),
  256. 'REGEXPS' => array(
  257. 0 => 'color: #007800;',
  258. 1 => 'color: #cc66cc;'
  259. ),
  260. 'SCRIPT' => array(
  261. )
  262. ),
  263. 'URLS' => array(
  264. 1 => '',
  265. 2 => 'http://www.google.com/search?q=%22set+{FNAME}%22+site%3Ahttp%3A%2F%2Fwww.gnuplot.info%2Fdocs%2F&amp;btnI=lucky',
  266. 3 => '',
  267. 4 => '',
  268. 5 => ''
  269. ),
  270. 'OOLANG' => false,
  271. 'OBJECT_SPLITTERS' => array(
  272. ),
  273. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  274. 'SCRIPT_DELIMITERS' => array(
  275. ),
  276. 'HIGHLIGHT_STRICT_BLOCK' => array(
  277. ),
  278. 'PARSER_CONTROL' => array(
  279. 'KEYWORDS' => array(
  280. 4 => array(
  281. 'DISALLOWED_AFTER' => "(?![\.\-a-zA-Z0-9_%])"
  282. )
  283. )
  284. ),
  285. 'TAB_WIDTH' => 4
  286. );
  287. ?>