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