# -*- coding: iso-8859-1 -*-
"""
	MoinMoin - Scilab Source Parser

    @copyright: INRIA 2007 by Pierre MARECHAL <pierre.marechal@inria.fr>

css:

pre.sciarea     { font-style: sans-serif; color: #000000; }

pre.sciarea span.ID       { color: #000000; }
pre.sciarea span.Char     { color: #004080; }
pre.sciarea span.Comment  { color: #808080; }
pre.sciarea span.Number   { color: #008080; font-weight: bold; }
pre.sciarea span.String   { color: #004080; }
pre.sciarea span.SPChar   { color: #0000C0; }
pre.sciarea span.ResWord  { color: #4040ff; font-weight: bold; }
pre.sciarea span.ConsWord { color: #008080; font-weight: bold; }
pre.sciarea span.ResWord2 { color: #0080ff; font-weight: bold; }
pre.sciarea span.Special  { color: #0000ff; }
pre.sciarea span.Preprc   { color: #804000; }

"""

from MoinMoin.util.ParserBase import ParserBase

Dependencies = []

class Parser(ParserBase):

    parsername = "ColorizedScilab"
    extensions = ['.sci']
    Dependencies = []

    def setupRules(self):
        ParserBase.setupRules(self)

        self.addRule("Comment","//.*$")
        self.addRulePair("String",'L?"',r'$|[^\\](\\\\)*"')
        self.addRule("Char",r"'\\.'|'[^\\]'")
        self.addRule("Number",r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?")
        self.addRule("Preprc",r"^\s*#(.*\\\n)*(.*(?!\\))$")
        self.addRule("ID","[a-zA-Z_][0-9a-zA-Z_]*")
        self.addRule("SPChar",r"[~!^&*()+=|\[\]:;,.<>/?{}-]")

        reserved_words = [ 'abort',
                           'apropos',
                           'break',
                           'case',
                           'catch',
                           'clc',
                           'clear',
                           'continue',
                           'do',
                           'else',
                           'elseif',
                           'end',
                           'endfunction',
                           'exit',
                           'for',
                           'function',
                           'help',
                           'if',
                           'pause',
                           'pwd',
                           'quit',
                           'resume',
                           'return',
                           'select',
                           'then',
                           'try',
                           'what',
                           'while',
                           'who']

        reserved_words2 = ['Calendar',
                           'ClipBoard',
                           'Matplot',
                           'Matplot1',
                           'NumTokens',
                           'PlaySound',
                           'StringBox',
                           'TCL_CreateSlave',
                           'TCL_DeleteInterp',
                           'TCL_DoOneEvent',
                           'TCL_EvalFile',
                           'TCL_EvalStr',
                           'TCL_ExistInterp',
                           'TCL_ExistVar',
                           'TCL_GetVar',
                           'TCL_GetVersion',
                           'TCL_SetVar',
                           'TCL_UnsetVar',
                           'TCL_UpVar',
                           'TCL_gcf',
                           'TCL_scf',
                           'UImenu',
                           'about',
                           'abs',
                           'acos',
                           'addcb',
                           'addf',
                           'addinter',
                           'addmenu_old',
                           'amell',
                           'and',
                           'argn',
                           'arl2_ius',
                           'ascii',
                           'asin',
                           'atan',
                           'backslash',
                           'balanc',
                           'banner',
                           'bdiag',
                           'beep',
                           'besselh',
                           'besseli',
                           'besselj',
                           'besselk',
                           'bessely',
                           'beta',
                           'bezout',
                           'bfinit',
                           'blkfc1i',
                           'blkslvi',
                           'bool2s',
                           'bsplin3val',
                           'bvode',
                           'c_link',
                           'calerf',
                           'call',
                           'cdfbet',
                           'cdfbin',
                           'cdfchi',
                           'cdfchn',
                           'cdff',
                           'cdffnc',
                           'cdfgam',
                           'cdfnbn',
                           'cdfnor',
                           'cdfpoi',
                           'cdft',
                           'ceil',
                           'champ',
                           'champ1',
                           'chartooem',
                           'chdir',
                           'chol',
                           'clean',
                           'clearfun',
                           'clearglobal',
                           'close',
                           'code2str',
                           'coeff',
                           'comp',
                           'conj',
                           'console',
                           'contour2di',
                           'contr',
                           'convstr',
                           'copy',
                           'corr',
                           'cos',
                           'cshep2d',
                           'ctree2',
                           'ctree3',
                           'ctree4',
                           'cumprod',
                           'cumsum',
                           'curblock',
                           'dasrt',
                           'dassl',
                           'ddeclose',
                           'ddeexec',
                           'ddeisopen',
                           'ddeopen',
                           'ddepoke',
                           'ddereq',
                           'debug',
                           'deff',
                           'definedfields',
                           'degree',
                           'delbpt',
                           'delete',
                           'delip',
                           'delmenu_old',
                           'det',
                           'dhinf',
                           'diag',
                           'diary',
                           'diffobjs',
                           'disp',
                           'dispbpt',
                           'dlgamma',
                           'dnaupd',
                           'dneupd',
                           'double',
                           'draw',
                           'drawaxis',
                           'drawlater',
                           'drawnow',
                           'driver',
                           'dsaupd',
                           'dsearch',
                           'dseupd',
                           'duplicate',
                           'emptystr',
                           'ereduc',
                           'errcatch',
                           'errclear',
                           'error',
                           'eval_cshep2d',
                           'exec',
                           'execstr',
                           'exists',
                           'exp',
                           'expm',
                           'eye',
                           'fadj2sp',
                           'fec',
                           'feval',
                           'fft',
                           'file',
                           'fileinfo',
                           'filesassociationbox',
                           'find',
                           'findBD',
                           'findobj',
                           'floor',
                           'format',
                           'fort',
                           'fprintfMat',
                           'freq',
                           'frexp',
                           'fromc',
                           'fromjava',
                           'fscanfMat',
                           'fsolve',
                           'fstair',
                           'full',
                           'funcprot',
                           'funptr',
                           'gamma',
                           'gammaln',
                           'geom3d',
                           'get',
                           'getblocklabel',
                           'getcwd',
                           'getdate',
                           'getenv',
                           'getf',
                           'getfield',
                           'gethistory',
                           'getio',
                           'getlongpathname',
                           'getmemory',
                           'getos',
                           'getpid',
                           'getscicosvars',
                           'getshortpathname',
                           'getversion',
                           'glist',
                           'global',
                           'glue',
                           'grand',
                           'grayplot',
                           'grep',
                           'gsort',
                           'gstacksize',
                           'handle',
                           'havewindow',
                           'help_gtk',
                           'hess',
                           'hidetoolbar',
                           'hinf',
                           'host',
                           'iconvert',
                           'ieee',
                           'imag',
                           'impl',
                           'imult',
                           'inpnvi',
                           'int',
                           'int16',
                           'int2d',
                           'int32',
                           'int3d',
                           'int8',
                           'interp',
                           'interp2d',
                           'interp3d',
                           'intg',
                           'intppty',
                           'inttype',
                           'inv',
                           'isdef',
                           'isequal',
                           'iserror',
                           'isglobal',
                           'isreal',
                           'kron',
                           'lasterror',
                           'ldiv',
                           'ldivf',
                           'legendre',
                           'length',
                           'lib',
                           'linear_interpn',
                           'lines',
                           'link',
                           'linmeq',
                           'list',
                           'load',
                           'loadhistory',
                           'loadwave',
                           'log',
                           'log1p',
                           'lsq',
                           'lsq_splin',
                           'lsqrsolve',
                           'lsslist',
                           'lstcat',
                           'lstsize',
                           'ltitr',
                           'lu',
                           'ludel',
                           'lufact',
                           'luget',
                           'lusolve',
                           'm6bandred',
                           'm6bmatch',
                           'm6busack',
                           'm6cent',
                           'm6chcm',
                           'm6clique',
                           'm6clique1',
                           'm6compc',
                           'm6compfc',
                           'm6concom',
                           'm6deumesh',
                           'm6dfs',
                           'm6dfs2',
                           'm6diam',
                           'm6dijkst',
                           'm6dmtree',
                           'm6edge2st',
                           'm6findiso',
                           'm6flomax',
                           'm6floqua',
                           'm6ford',
                           'm6fordfulk',
                           'm6frang',
                           'm6hamil',
                           'm6hullcvex',
                           'm6johns',
                           'm6kilter',
                           'm6knapsk',
                           'm6loadg',
                           'm6lp2tad',
                           'm6lp2tau',
                           'm6mesh2b',
                           'm6meshmesh',
                           'm6ns2p',
                           'm6p2ns',
                           'm6pcchna',
                           'm6permuto',
                           'm6prevn2p',
                           'm6prevn2st',
                           'm6prfmatch',
                           'm6relax',
                           'm6saveg',
                           'm6sconcom',
                           'm6ta2lpd',
                           'm6ta2lpu',
                           'm6tconex',
                           'm6transc',
                           'm6umtree',
                           'm6umtree1',
                           'm6visitor',
                           'macr2lst',
                           'macr2tree',
                           'matrix',
                           'max',
                           'maxi',
                           'mcisendstring',
                           'mclearerr',
                           'mclose',
                           'meof',
                           'mfprintf',
                           'mfscanf',
                           'mget',
                           'mgeti',
                           'mgetl',
                           'mgetstr',
                           'min',
                           'mini',
                           'mlist',
                           'mode',
                           'mopen',
                           'move',
                           'mprintf',
                           'mput',
                           'mputstr',
                           'mscanf',
                           'mseek',
                           'msprintf',
                           'msscanf',
                           'mtell',
                           'mtlb_mode',
                           'mtlb_sparse',
                           'mucomp',
                           'mulf',
                           'nearfloat',
                           'newaxes',
                           'newfun',
                           'nnz',
                           'number_properties',
                           'ode',
                           'odedc',
                           'oemtochar',
                           'oldbesseli',
                           'oldbesselj',
                           'oldbesselk',
                           'oldbessely',
                           'oldcontour',
                           'oldload',
                           'oldsave',
                           'oldxclear',
                           'ones',
                           'opentk',
                           'optim',
                           'or',
                           'ordmmd',
                           'param3d',
                           'param3d1',
                           'part',
                           'phase_simulation',
                           'plot2d',
                           'plot2d1',
                           'plot2d2',
                           'plot2d3',
                           'plot2d4',
                           'plot3d',
                           'plot3d1',
                           'pointer_xproperty',
                           'poly',
                           'ppol',
                           'pppdiv',
                           'predef',
                           'print',
                           'printsetupbox',
                           'prod',
                           'pvm_addhosts',
                           'pvm_barrier',
                           'pvm_bcast',
                           'pvm_bufinfo',
                           'pvm_config',
                           'pvm_delhosts',
                           'pvm_error',
                           'pvm_error_mode',
                           'pvm_exit',
                           'pvm_f772sci',
                           'pvm_get_timer',
                           'pvm_getinst',
                           'pvm_gettid',
                           'pvm_gsize',
                           'pvm_halt',
                           'pvm_joingroup',
                           'pvm_kill',
                           'pvm_lvgroup',
                           'pvm_mytid',
                           'pvm_parent',
                           'pvm_probe',
                           'pvm_recv',
                           'pvm_recv_var',
                           'pvm_reduce',
                           'pvm_sci2f77',
                           'pvm_send',
                           'pvm_send_var',
                           'pvm_set_timer',
                           'pvm_spawn',
                           'pvm_spawn_independent',
                           'pvm_start',
                           'pvm_tasks',
                           'pvm_tidtohost',
                           'qld',
                           'qpqpqp',
                           'qr',
                           'rand',
                           'rankqr',
                           'rat',
                           'rcond',
                           'rdivf',
                           'read',
                           'read4b',
                           'readb',
                           'readmps',
                           'readxbm',
                           'real',
                           'realtime',
                           'realtimeinit',
                           'remez',
                           'resethistory',
                           'residu',
                           'ricc',
                           'ricc_old',
                           'rlist',
                           'roots',
                           'round',
                           'rpem',
                           'rtitr',
                           'save',
                           'savehistory',
                           'savewave',
                           'schur',
                           'sci_tree2',
                           'sci_tree3',
                           'sci_tree4',
                           'sciargs',
                           'scicos_cpass2',
                           'scicos_debug',
                           'scicos_debug_count',
                           'scicos_time',
                           'scicosim',
                           'sctree',
                           'semidef',
                           'set',
                           'set_blockerror',
                           'set_posfig_dim',
                           'set_xproperty',
                           'setbpt',
                           'setenv',
                           'seteventhandler',
                           'setfield',
                           'setlanguagemenu',
                           'setmenu_old',
                           'setscicosvars',
                           'settextbackgroundcolor',
                           'settextcolor',
                           'sfact',
                           'sfinit',
                           'show_window',
                           'showalluimenushandles',
                           'sident',
                           'sign',
                           'simp',
                           'simp_mode',
                           'sin',
                           'size',
                           'slash',
                           'sleep',
                           'sorder',
                           'sort',
                           'sparse',
                           'spchol',
                           'spcompack',
                           'spec',
                           'spget',
                           'splin',
                           'splin2d',
                           'splin3d',
                           'spones',
                           'sqrt',
                           'stacksize',
                           'str2code',
                           'strcat',
                           'strindex',
                           'string',
                           'strsplit',
                           'strsubst',
                           'subf',
                           'sum',
                           'svd',
                           'symfcti',
                           'syredi',
                           'tan',
                           'testmatrix',
                           'timer',
                           'tlist',
                           'tohome',
                           'tokens',
                           'toolbar',
                           'toprint',
                           'tr_zer',
                           'tril',
                           'triu',
                           'type',
                           'typename',
                           'uint16',
                           'uint32',
                           'uint8',
                           'ulink',
                           'unglue',
                           'unix',
                           'unsetmenu_old',
                           'unzoom',
                           'user',
                           'var2vec',
                           'varn',
                           'vec2var',
                           'where',
                           'whereis',
                           'winopen',
                           'winqueryreg',
                           'winsid',
                           'writb',
                           'write',
                           'write4b',
                           'x_choose',
                           'x_dialog',
                           'x_mdialog',
                           'x_message',
                           'x_message_modeless',
                           'x_print_dialog',
                           'xarc',
                           'xarcs',
                           'xarrows',
                           'xaxis',
                           'xchange',
                           'xchoicesi',
                           'xclea',
                           'xclick',
                           'xdel',
                           'xend',
                           'xfarc',
                           'xfarcs',
                           'xfpoly',
                           'xfpolys',
                           'xfrect',
                           'xg2ps',
                           'xget',
                           'xgetech',
                           'xgetfile',
                           'xgetmouse',
                           'xgraduate',
                           'xgrid',
                           'xinfo',
                           'xinit',
                           'xlfont',
                           'xload',
                           'xls_open',
                           'xls_read',
                           'xname',
                           'xpause',
                           'xpoly',
                           'xpolys',
                           'xrect',
                           'xrects',
                           'xs2bmp',
                           'xs2emf',
                           'xs2fig',
                           'xs2gif',
                           'xs2ppm',
                           'xs2ps',
                           'xsave',
                           'xsegs',
                           'xselect',
                           'xset',
                           'xsetech',
                           'xsnative',
                           'xstring',
                           'xstringb',
                           'xstringl',
                           'xtape',
                           'xtitle',
                           'zeros',
                           'znaupd',
                           'zneupd',
                           'zoom_rect',
                           'addmenu',
                           'delmenu',
                           'setmenu',
                           'unsetmenu',
                           'gmres',
                           'pcg',
                           'qmr',
                           'addcolor',
                           'black',
                           'bar',
                           'barhomogenize',
                           'barh',
                           'bode',
                           'clear_pixmap',
                           'color',
                           'check2dFun',
                           'colordef',
                           'checkXYPair',
                           'clf',
                           'contour',
                           'chart',
                           'contourf',
                           'contour2d',
                           'colorbar',
                           'dragrect',
                           'eval3d',
                           'eval3dp',
                           'edit_curv',
                           'errbar',
                           'evans',
                           'fplot3d',
                           'fplot3d1',
                           'fplot2d',
                           'fcontour',
                           'fchamp',
                           'fgrayplot',
                           'fac3d',
                           'fac3d1',
                           'fcontour2d',
                           'graycolormap',
                           'graduate',
                           'gcf',
                           'gca',
                           'gce',
                           'gdf',
                           'gda',
                           'graypolarplot',
                           'getPlotPropertyName',
                           'getLineSpec',
                           'getColorIndex',
                           'ghdl2tree',
                           'ghdl_fields',
                           'gr_menu',
                           'getlinestyle',
                           'genfac3d',
                           'getmark',
                           'getSurfPropertyName',
                           'getfont',
                           'getTitleLabelPropertyNam',
                           'getsymbol',
                           'getcolor',
                           'gainplot',
                           'hotcolormap',
                           'hsv2rgb',
                           'hsvcolormap',
                           'histplot',
                           'hist3d',
                           'isoview',
                           'jetcolormap',
                           'legends',
                           'locate',
                           'loadplots',
                           'legend',
                           'milk_drop',
                           'm_circle',
                           'mesh',
                           'nf3d',
                           'nyquist',
                           'name2rgb',
                           'oldplot',
                           'plzr',
                           'plot3d3',
                           'plot3d2',
                           'polarplot',
                           'paramfplot2d',
                           'pie',
                           'plot',
                           'plotframe',
                           'rgb2name',
                           'replot',
                           'rubberbox',
                           'rotate',
                           'square',
                           'sgrid',
                           'secto3d',
                           'scaling',
                           'sdf',
                           'sda',
                           'show_pixmap',
                           'scf',
                           'sca',
                           'setDefaultColor',
                           'sd2sci',
                           'setSurfProperty',
                           'setPlotProperty',
                           'surf',
                           'Sgrayplot',
                           'Sfgrayplot',
                           'subplot',
                           'setTitleLabelProperty',
                           'stringbox',
                           'titlepage',
                           'twinkle',
                           'title',
                           'TitleLabel',
                           'xsetm',
                           'xrpoly',
                           'xclip',
                           'xbasimp',
                           'xnumb',
                           'xbasr',
                           'xclear',
                           'xbasc',
                           'xlabel',
                           'ylabel',
                           'zgrid',
                           'zlabel',
                           '%3d_i_h',
                           'colcompr',
                           'coffg',
                           'cmndred',
                           'diophant',
                           'detr',
                           'derivat',
                           'denom',
                           'determ',
                           'factors',
                           'gcd',
                           'htrianr',
                           'hrmt',
                           'hermit',
                           'horner',
                           'invr',
                           'inv_coeff',
                           'lcmdiag',
                           'lcm',
                           'numer',
                           'polfact',
                           'pol2str',
                           'pol2des',
                           'pfactors',
                           'pdiv',
                           'rowcompr',
                           'routh_t',
                           'systmat',
                           'sylm',
                           'atanm',
                           'atanh',
                           'atanhm',
                           'asinm',
                           'asinh',
                           'asinhm',
                           'acosm',
                           'acosh',
                           'acoshm',
                           'binomial',
                           'convertindex',
                           'cellstr',
                           'cell2mat',
                           'coth',
                           'cothm',
                           'cotg',
                           'cosm',
                           'cosh',
                           'coshm',
                           'cat',
                           'complex',
                           'erf',
                           'erfcx',
                           'erfc',
                           'fix',
                           'factor',
                           'factorial',
                           'GLoad',
                           'isnan',
                           'isinf',
                           'isempty',
                           'inttrap',
                           'intsplin',
                           'intersect',
                           'interpln',
                           'integrate',
                           'intc',
                           'intl',
                           'ind2sub',
                           'isvector',
                           'iscellstr',
                           'interp1',
                           'logm',
                           'log10',
                           'lex_sort',
                           'log2',
                           'modulo',
                           'meshgrid',
                           'null',
                           'nextpow2',
                           'num2cell',
                           'pertrans',
                           'pmodulo',
                           'permute',
                           'perms',
                           'primes',
                           'squarewave',
                           'sqrtm',
                           'spzeros',
                           'speye',
                           'smooth',
                           'signm',
                           'setdiff',
                           'sinc',
                           'sub2ind',
                           'sinm',
                           'sinh',
                           'sinhm',
                           'sprand',
                           'toeplitz',
                           'tanm',
                           'tanhm',
                           'tanh',
                           'union',
                           'unique',
                           'vectorfind',
                           'adj2sp',
                           'ascii2string',
                           'apropos',
                           'add_demo',
                           'arobasestring2strings',
                           'add_palette',
                           'add_help_chapter',
                           'bloc2ss',
                           'bloc2exp',
                           'base2dec',
                           'basename',
                           'browsehelp',
                           'createfun',
                           'change_old_man',
                           'cmb_lin',
                           'cat_code',
                           'copyfile',
                           'calendar',
                           'cd',
                           'clipboard',
                           'create_palette',
                           'configure_msvc',
                           'dispfiles',
                           'dec2hex',
                           'date',
                           'derivative',
                           'dirname',
                           'datevec',
                           'dir',
                           'datenum',
                           'eval',
                           'excel2sci',
                           'evstr',
                           'etime',
                           'editor',
                           'edit',
                           'edit_error',
                           'expression2code',
                           'fscanf',
                           'fprintf',
                           'fileparts',
                           'fullfile',
                           'find_links',
                           'format_txt',
                           'formatman',
                           'findmsvccompiler',
                           'fun2string',
                           'get_profile',
                           'get_function_path',
                           'gethelpfile',
                           'getscilabkeywords',
                           'ged_insert',
                           'getshell',
                           'genlib_old',
                           'genlib',
                           'G_make',
                           'get_file_path',
                           'getd',
                           'get_absolute_file_path',
                           'getvalue',
                           'ged',
                           'gettklib',
                           'hex2dec',
                           'halt',
                           'head_comments',
                           'help_menu',
                           'haveacompiler',
                           'help_skeleton',
                           'hypermat',
                           'help',
                           'isdir',
                           'ilib_mex_build',
                           'ilib_gen_gateway',
                           'ilib_build',
                           'input',
                           'isfield',
                           'isstruct',
                           'iscell',
                           'ilib_gen_loader',
                           'issparse',
                           'initial_scicosnew_tables',
                           'ilib_unix_soname',
                           'initial_demos_tables',
                           'isLeapYear',
                           'ilib_gen_Make',
                           'ilib_compile',
                           'initial_help_chapters',
                           'instruction2code',
                           'initial_scicos_tables',
                           'ilib_for_link',
                           'justify',
                           'lin',
                           'linspace',
                           'ls',
                           'loadmatfile',
                           'listvarinfile',
                           'loaddefaultbrowser',
                           'listfiles',
                           'logspace',
                           'mputl',
                           'menubar',
                           'maxindex',
                           'matfile2sci',
                           'mps2linpro',
                           'make_help_index',
                           'manedit',
                           'm2sci_gui',
                           'mkdir',
                           'macrovar',
                           'mfile2sci',
                           'mdelete',
                           'ndims',
                           'ndgrid',
                           'newest',
                           'oct2dec',
                           'OS_Version',
                           'odeoptions',
                           'old2newinstr',
                           'projaff',
                           'profile',
                           'printf',
                           'pol2tex',
                           'perl',
                           'pathconvert',
                           'plotprofile',
                           'readc_',
                           'rhs2code',
                           'rmdir',
                           'readxls',
                           'ReadmiMatrix',
                           'syssize',
                           'sysdiag',
                           'sysconv',
                           'ssrand',
                           'ssprint',
                           'sprintf',
                           'solve',
                           'showprofile',
                           'sci2map',
                           'sci2excel',
                           'scanf',
                           'syslin',
                           'sscanf',
                           'sp2adj',
                           'stripblanks',
                           'sethomedirectory',
                           'savedefaultbrowser',
                           'setlanguage',
                           'sci2exp',
                           'show_startupinfo',
                           'savematfile',
                           'scitest',
                           'scipad',
                           'trisolve',
                           'trianfml',
                           'trfmod',
                           'tokenpos',
                           'texprint',
                           'toc',
                           'tic',
                           'typeof',
                           'tree2code',
                           'toolboxes',
                           'translatepaths',
                           'unix_x',
                           'unix_w',
                           'unix_s',
                           'unix_g',
                           'VCtoLCCLib',
                           'whereami',
                           'who_user',
                           'with_pvm',
                           'with_gtk',
                           'with_texmacs',
                           'with_tk',
                           'with_ocaml',
                           'with_modelica_compiler',
                           'with_lcc',
                           'with_atlas',
                           'with_javasci',
                           'whos',
                           'WritemiMatrix',
                           'x_matrix',
                           'xs2eps',
                           'xmltohtml',
                           'x_choices',
                           'xmlfiletohtml',
                           'center',
                           'correl',
                           'cmoment',
                           'covar',
                           'ftuneq',
                           'ftest',
                           'geomean',
                           'harmean',
                           'iqr',
                           'mvvacov',
                           'mvcorrel',
                           'meanf',
                           'moment',
                           'mean',
                           'median',
                           'msd',
                           'mad',
                           'nfreq',
                           'nanmeanf',
                           'nand2mean',
                           'nansum',
                           'nanstdev',
                           'nanmin',
                           'nanmedian',
                           'nanmean',
                           'nancumsum',
                           'nanmax',
                           'perctl',
                           'pca',
                           'quart',
                           'regress',
                           'strange',
                           'sample',
                           'samplef',
                           'samwr',
                           'st_deviation',
                           'stdev',
                           'stdevf',
                           'trimmean',
                           'thrownan',
                           'tabul',
                           'variance',
                           'variancef',
                           'wcenter',
                           'aff2ab',
                           'cond',
                           'companion',
                           'colcomp',
                           'coff',
                           'classmarkov',
                           'chsolve',
                           'chfact',
                           'diff',
                           'eigenmarkov',
                           'fullrf',
                           'fullrfk',
                           'gspec',
                           'gschur',
                           'glever',
                           'givens',
                           'genmarkov',
                           'householder',
                           'im_inv',
                           'kroneck',
                           'kernel',
                           'linsolve',
                           'norm',
                           'nlev',
                           'orth',
                           'pinv',
                           'projspec',
                           'psmall',
                           'proj',
                           'polar',
                           'penlaur',
                           'pencan',
                           'pen2ea',
                           'pbig',
                           'quaskro',
                           'rank',
                           'rref',
                           'rowshuff',
                           'randpencil',
                           'rowcomp',
                           'range',
                           'sva',
                           'sqroot',
                           'spantwo',
                           'spaninter',
                           'spanplus',
                           'trace',
                           '%asn',
                           'analpf',
                           'buttmag',
                           'bilt',
                           'czt',
                           'cspect',
                           'convol',
                           'chepol',
                           'cheb2mag',
                           'cheb1mag',
                           'cepstrum',
                           'casc',
                           'dft',
                           'detrend',
                           'eqfir',
                           'ell1mag',
                           'eqiir',
                           'fsfirlin',
                           'frmag',
                           'frfit',
                           'findm',
                           'find_freq',
                           'faurre',
                           'ffilt',
                           'fftshift',
                           'fft2',
                           'group',
                           'hilb',
                           'hank',
                           'intdec',
                           'iir',
                           'iirmod',
                           'iirlp',
                           'iirgroup',
                           'ifft',
                           'jmat',
                           '%k',
                           'kalm',
                           'lindquist',
                           'lgfft',
                           'lev',
                           'levin',
                           'lattn',
                           'mrfit',
                           'mfft',
                           'mese',
                           'pspect',
                           'phc',
                           'remezb',
                           'system',
                           'sskf',
                           'srkf',
                           'srfaur',
                           '%sn',
                           'sincd',
                           'trans',
                           'wigner',
                           'wiener',
                           'wfir',
                           'window',
                           'yulewalk',
                           'zpell',
                           'zpch1',
                           'zpbutt',
                           'zpch2',
                           'aplat',
                           'bvodeS',
                           'datafit',
                           'fit_dat',
                           'karmarkar',
                           'lmisolver',
                           'list2vec',
                           'linpro',
                           'leastsq',
                           'lmitool',
                           'numdiff',
                           'NDcost',
                           'pencost',
                           'pack',
                           'quapro',
                           'unpack',
                           'vec2list',
                           'arl2',
                           'arhnk',
                           'abcd',
                           'abinv',
                           'bilin',
                           'balreal',
                           'ctr_gram',
                           'contrss',
                           'cont_mat',
                           'cont_frm',
                           'cls2dls',
                           'canon',
                           'colregul',
                           'cainv',
                           'calfrq',
                           'csim',
                           'dt_ility',
                           'dsimul',
                           'dscr',
                           'des2tf',
                           'dbphi',
                           'ddp',
                           'equil',
                           'equil1',
                           'findR',
                           'freson',
                           'flts',
                           'frep2tf',
                           'findx0BD',
                           'findBDK',
                           'findAC',
                           'findABCD',
                           'g_margin',
                           'gfrancis',
                           'invsyslin',
                           'invrs',
                           'imrep2ss',
                           'inistate',
                           'krac2',
                           'kpure',
                           'lqg2stan',
                           'lqe',
                           'lqr',
                           'lqg',
                           'lyap',
                           'lincos',
                           'minss',
                           'minreal',
                           'markp2ss',
                           'obsvss',
                           'obsv_mat',
                           'obs_gram',
                           'observer',
                           'obscont',
                           'projsl',
                           'p_margin',
                           'pfss',
                           'phasemag',
                           'repfreq',
                           'rowregul',
                           'sysfact',
                           'svplot',
                           'statgain',
                           'ss2ss',
                           'ss2des',
                           'specfact',
                           'sm2ss',
                           'sm2des',
                           'sylv',
                           'ss2tf',
                           'st_ility',
                           'stabil',
                           'steadycos',
                           'scicos_simulate',
                           'scicos',
                           'time_id',
                           'trzeros',
                           'tf2ss',
                           'unobs',
                           'ui_observer',
                           'zeropen',
                           'augment',
                           'bstap',
                           'copfac',
                           'colinout',
                           'cfspec',
                           'ccontrg',
                           'dcf',
                           'dtsi',
                           'des2ss',
                           'dhnorm',
                           'entropy',
                           'fstabst',
                           'fspec',
                           'fspecg',
                           'fourplan',
                           'gtild',
                           'gfare',
                           'gcare',
                           'gamitg',
                           'h_inf_st',
                           'h_cl',
                           'hankelsv',
                           'h2norm',
                           'h_norm',
                           'h_inf',
                           'lqg_ltr',
                           'linf',
                           'lft',
                           'leqe',
                           'lcf',
                           'leqr',
                           'linfn',
                           'macglov',
                           'nehari',
                           'parrot',
                           'rowinout',
                           'ric_desc',
                           'riccati',
                           'smga',
                           'sensi',
                           'tf2des',
                           'analyze',
                           'auwrite',
                           'auread',
                           'lin2mu',
                           'mapsound',
                           'mu2lin',
                           'playsnd',
                           'soundsec',
                           'sound',
                           'wavread',
                           'wavwrite',
                           'arc_number',
                           'arc_graph',
                           'add_node',
                           'add_edge',
                           'articul',
                           'adj_lists',
                           'best_match',
                           'bandwr',
                           'convex_hull',
                           'con_nodes',
                           'check_graph',
                           'connex',
                           'circuit',
                           'chain_struct',
                           'cycle_basis',
                           'contract_edge',
                           'dist2polylines',
                           'delete_arcs',
                           'delete_nodes',
                           'edge_number',
                           'editgraph_ver',
                           'editgraph_node',
                           'editgraph_diagram',
                           'editgraph_arc',
                           'edit_graph',
                           'find_path',
                           'graph_union',
                           'graph_sum',
                           'graph_simp',
                           'graph_power',
                           'graph_complement',
                           'graph_2_mat',
                           'girth',
                           'ge_node_fields',
                           'ge_font',
                           'ge_draw_std_arcs',
                           'ge_drawarcs',
                           'ge_do_version',
                           'ge_do_paste',
                           'ge_do_move_region',
                           'ge_delete_node',
                           'ge_delete_arc',
                           'ge_clear_history',
                           'ge_arc_fields',
                           'ge_arc_coordinates',
                           'ge_add_history',
                           'ge_add_arc',
                           'ge_draw_loop_arcs',
                           'ge_getarc',
                           'ge_check_before_quit',
                           'gen_net',
                           'ge_do_SaveAs',
                           'ge_set_nodes_id',
                           'ge_set_arcs_id',
                           'ge_set_winsize',
                           'ge_newarc',
                           'ge_hilite_nodes',
                           'ge_hilite_arcs',
                           'ge_get_region',
                           'ge_getobj',
                           'ge_get_nodes_in_rect',
                           'ge_getnode',
                           'ge_get_new_window',
                           'ge_get_info',
                           'ge_drawtitle',
                           'ge_drawobjs',
                           'ge_drawobj',
                           'ge_do_save',
                           'ge_do_region2node',
                           'ge_do_properties',
                           'ge_do_move',
                           'ge_do_load',
                           'ge_do_copy',
                           'ge_do_copy_region',
                           'ge_copy_region_to_cb',
                           'ge_add_node',
                           'ge_add_node_copy',
                           'graph_diameter',
                           'graph_center',
                           'ge_check_names',
                           'ge_dig_bound',
                           'ge_shortcut',
                           'ge_help',
                           'ge_graph',
                           'ge_get_arcs_id',
                           'ge_enablemenus',
                           'ge_edit',
                           'ge_drawnodes',
                           'ge_do_zoom',
                           'ge_do_undo',
                           'ge_do_shortestpath',
                           'ge_do_settings',
                           'ge_do_select',
                           'ge_do_options',
                           'ge_do_new',
                           'ge_do_information',
                           'ge_do_find',
                           'ge_do_delete',
                           'ge_do_delete_region',
                           'ge_do_default_names',
                           'ge_disablemenus',
                           'ge_compute',
                           'ge_do_replot',
                           'ge_create_menus',
                           'ge_eventhandler',
                           'ge_show_new',
                           'ge_do_quit',
                           'ge_do_export',
                           'ge_complete_defaults',
                           'hamilton',
                           'initial_editgraph_tables',
                           'is_connex',
                           'knapsack',
                           'line_graph',
                           'load_graph',
                           'min_lcost_flow2',
                           'mesh2d',
                           'max_flow',
                           'mat_2_graph',
                           'metanet',
                           'message',
                           'min_weight_tree',
                           'min_qcost_flow',
                           'min_lcost_flow1',
                           'min_lcost_cflow',
                           'max_clique',
                           'max_cap_path',
                           'make_graph',
                           'node_number',
                           'neighbors',
                           'netwindows',
                           'netwindow',
                           'netclose',
                           'nodes_degrees',
                           'nodes_2_path',
                           'predecessors',
                           'pipe_network',
                           'perfect_match',
                           'path_2_nodes',
                           'plot_graph',
                           'qassign',
                           'successors',
                           'strong_con_nodes',
                           'split_edge',
                           'salesman',
                           'show_arcs',
                           'show_nodes',
                           'save_graph',
                           'splitfilepath',
                           'strong_connex',
                           'shortest_path',
                           'subgraph',
                           'supernode',
                           'show_graph',
                           'trans_closure',
                           'arsimul',
                           'armax',
                           'armax1',
                           'armac',
                           'arma2p',
                           'acf',
                           'epred',
                           'noisegen',
                           'narsimul',
                           'prbs_a',
                           'reglin',
                           'sdiff',
                           'buttondialog',
                           'browsevar',
                           'config',
                           'demoplay',
                           'editvar_get',
                           'editvar',
                           'figure',
                           'GetUiControlStyleName',
                           'GetUiControlValueType',
                           'GetUiControlPropertyName',
                           'IsAScalar',
                           'progressionbar',
                           'sciGUI_init',
                           'sciGUIhelp',
                           'TK_SetVar',
                           'TK_GetVar',
                           'TK_EvalStr',
                           'TK_EvalFile',
                           'tk_choose',
                           'tk_savefile',
                           'tk_getfile',
                           'tk_getdir',
                           'uimenu',
                           'uicontrol',
                           'winlist',
                           'winclose',
                           'waitbar',
                           'artest',
                           'BInit',
                           'bifish',
                           'boucle',
                           'comric',
                           'chaintest',
                           'exemple',
                           'finit',
                           'gpeche',
                           'gainobs',
                           'gaincom',
                           'logr',
                           'lotest',
                           'mineInit',
                           'obsric',
                           'obscont1',
                           'portr3d',
                           'portrait',
                           'recur',
                           'systems',
                           'test_d',
                           'tdinit',
                           'tangent',
                           'adderr',
                           'basparam',
                           'cla2for',
                           'callfun',
                           'cod2for',
                           'dclfun',
                           'exp2for',
                           'f_zeros',
                           'func2f',
                           'f_type',
                           'f_tan',
                           'f_svd',
                           'f_sqrt',
                           'f_size',
                           'f_sin',
                           'freewrk',
                           'f_rank',
                           'forparam',
                           'f_ones',
                           'f_log',
                           'f_eye',
                           'f_exp',
                           'f_expm',
                           'f_error',
                           'f_ent',
                           'f_cos',
                           'f_cond',
                           'f_argn',
                           'f_abs',
                           'f_gener',
                           'f_min',
                           'f_mini',
                           'f_max',
                           'f_maxi',
                           'f_norm',
                           'getwrk',
                           'getlocal',
                           'get2f',
                           'genif',
                           'gencall',
                           'isnum',
                           'ins2for',
                           'indent',
                           'indentfor',
                           'lin2for',
                           'modlst',
                           'mltopsfor',
                           'makeargs',
                           'num2f',
                           'newlab',
                           'outname',
                           'op2for',
                           'str2f',
                           'setparam',
                           'sci2for',
                           'typconv',
                           'warning',
                           'asciimat',
                           'cell',
                           'createstruct',
                           'char',
                           'enlarge_shape',
                           'fseek_origin',
                           'firstnonsingleton',
                           'generic_i_st',
                           'generic_i_ce',
                           'mtlb_subplot',
                           'mtlb_std',
                           'mtlb_sscanf',
                           'mtlb_sprintf',
                           'mtlb_semilogy',
                           'mtlb_semilogx',
                           'mtlb',
                           'mtlb_qz',
                           'mtlb_mesh',
                           'mtlb_meshdom',
                           'mtlb_median',
                           'mtlb_mean',
                           'mtlb_loglog',
                           'mtlb_is',
                           'mtlb_i',
                           'mtlb_get',
                           'mtlb_findstr',
                           'mtlb_choices',
                           'mtlb_axes',
                           'mtlb_image',
                           'mtlb_pcolor',
                           'mtlb_cumsum',
                           'mtlb_cumprod',
                           'mtlb_any',
                           'mtlb_all',
                           'mtlb_eig',
                           'mtlb_double',
                           'mtlb_diag',
                           'mtlb_eval',
                           'mtlb_exist',
                           'mtlb_eye',
                           'mtlb_false',
                           'mtlb_find',
                           'mtlb_fscanf',
                           'mtlb_fwrite',
                           'mtlb_fread',
                           'mtlb_min',
                           'mtlb_max',
                           'mtlb_zeros',
                           'mtlb_ones',
                           'mtlb_sum',
                           'mtlb_prod',
                           'mtlb_rand',
                           'mtlb_upper',
                           'mtlb_uint8',
                           'mtlb_uint32',
                           'mtlb_uint16',
                           'mtlb_type',
                           'mtlb_true',
                           'mtlb_triu',
                           'mtlb_tril',
                           'mtlb_strrep',
                           'mtlb_strcmp',
                           'mtlb_strcmpi',
                           'mtlb_size',
                           'mtlb_setstr',
                           'mtlb_rcond',
                           'mtlb_randn',
                           'mtlb_qr',
                           'mtlb_more',
                           'mtlb_lower',
                           'mtlb_logical',
                           'mtlb_isspace',
                           'mtlb_isletter',
                           'mtlb_int8',
                           'mtlb_int32',
                           'mtlb_int16',
                           'mtlb_full',
                           'mtlb_format',
                           'mtlb_fopen',
                           'mtlb_imp',
                           'mstr2sci',
                           'mtlb_diff',
                           'mtlb_isa',
                           'mtlb_delete',
                           'mtlb_colordef',
                           'mtlb_box',
                           'makecell',
                           'mtlb_strfind',
                           'mtlb_dec2hex',
                           'mtlb_conv',
                           'mtlb_plot',
                           'mtlb_hold',
                           'mtlb_num2str',
                           'mtlb_close',
                           'mtlb_toeplitz',
                           'mtlb_grid',
                           'mtlb_fftshift',
                           'mtlb_fliplr',
                           'mtlb_isfield',
                           'mtlb_load',
                           'mtlb_repmat',
                           'mtlb_linspace',
                           'mtlb_save',
                           'mtlb_e',
                           'mtlb_realmin',
                           'mtlb_realmax',
                           'mtlb_echo',
                           'mtlb_filter',
                           'mtlb_beta',
                           'mtlb_ifft',
                           'mtlb_fft',
                           'mtlb_t',
                           'mtlb_s',
                           'mtlb_l',
                           'mtlb_logic',
                           'mtlb_a',
                           'mtlb_0',
                           'mtlb_cond',
                           'mtlb_error',
                           'mtlb_axis',
                           'mtlb_legendre',
                           'mtlb_sortrows',
                           'mtlb_cov',
                           'mtlb_dir',
                           'mtlb_sort',
                           'mtlb_fprintf',
                           'struct',
                           'sci_sparse',
                           'st_i_generic',
                           'add_palette',
                           'analyse',
                           'adjust_s_ports',
                           'Aspect_',
                           'Align_',
                           'Addnewblock_',
                           'Addcolor_',
                           'adjust',
                           'build_scs_tree',
                           'bad_connection',
                           'build_modelica_block',
                           'Backgroundcolor_',
                           'build_block',
                           'ctree',
                           'change_tree_elt',
                           'Calc_',
                           'connected_links',
                           'changeports',
                           'check_mac',
                           'CFORTR',
                           'c_block',
                           'cos2cosf',
                           'countblocks',
                           'choosefile',
                           'create_modelica',
                           'check_io',
                           'c_pass1',
                           'create_modelica1',
                           'CFORTR2',
                           'check_edge',
                           'Cut_',
                           'cosclick',
                           'Copy_',
                           'Compile_',
                           'Color_',
                           'clickin',
                           'CopyRegion_',
                           'c_pass3',
                           'Context_',
                           'compile_modelica',
                           'CodeGeneration_',
                           'c_pass2',
                           'do_xsetech',
                           'do_set_info',
                           'do_edit_pal',
                           'do_context',
                           'dist2polyline',
                           'dialog',
                           'drawobj',
                           'drawlink',
                           'drawblock',
                           'do_window',
                           'do_newblk',
                           'drawtitle',
                           'do_zoomout',
                           'do_zoomin',
                           'do_view',
                           'do_rename',
                           'do_navigator',
                           'disablemenus',
                           'draw',
                           'drawobjs',
                           'do_purge',
                           'do_focus',
                           'do_delete2',
                           'default_color',
                           'do_Displaymode',
                           'Displaymode_',
                           'default_options',
                           'do_exit',
                           'dig_bound',
                           'do_update',
                           'do_setup',
                           'do_save',
                           'do_SaveAs',
                           'do_delete1',
                           'do_compile',
                           'do_terminate',
                           'do_run',
                           'delete_unconnected',
                           'do_export',
                           'do_load',
                           'do_version',
                           'Duplicate_',
                           'do_duplicate',
                           'disconnect_ports',
                           'DuplicateRegion_',
                           'do_tild',
                           'do_resize',
                           'do_replace',
                           'do_region2block',
                           'do_label',
                           'do_icon_edit',
                           'do_help',
                           'do_doc',
                           'do_delete',
                           'do_delete_region',
                           'Documentation_',
                           'do_copy_region',
                           'do_block',
                           'do_block_info',
                           'Delete_',
                           'DeleteRegion_',
                           'Defaultlinkcolors_',
                           'DebugLevel_',
                           'do_ident',
                           'do_color',
                           'do_palettes',
                           'do_stupidmove',
                           'do_move',
                           'do_copy',
                           'do_eval',
                           'do_addnew',
                           'do_options',
                           'do_load_as_palette',
                           'Export_',
                           'ExportAll_',
                           'enablemenus',
                           'extract_implicit',
                           'Eval_',
                           'FORTR',
                           'fortran_block',
                           'Flip_',
                           'gridpoint',
                           'get_tree_elt',
                           'get_region',
                           'get_new_window',
                           'get_info',
                           'genmac',
                           'genfunc1',
                           'getportsiz',
                           'getoutputs',
                           'getorigin',
                           'getinputs',
                           'genfunc',
                           'get_subobj_path',
                           'getgeom',
                           'generic_block',
                           'getblocktext',
                           'get_blocks_in_rect',
                           'getblock',
                           'getoutputports',
                           'gen_modelica',
                           'get_region2',
                           'get_connected',
                           'getinputports',
                           'getparpath',
                           'genmoc',
                           'get_block_info',
                           'get_selection',
                           'get_inside',
                           'get_rectangle',
                           'getobj',
                           'GetInfo_',
                           'getblocklink',
                           'getlink',
                           'generic_block2',
                           'hilite_path',
                           'hilite_obj',
                           'Help_',
                           'init_agenda',
                           'is_split',
                           'is_modelica_block',
                           'IDfonts_',
                           'Icon_',
                           'IconEditor_',
                           'Identification_',
                           'lstfiles',
                           'lnkptrcomp',
                           'loadpallibs',
                           'Load_',
                           'LoadasPalette_',
                           'Link_',
                           'Label_',
                           'mkvect',
                           'message',
                           'mark_newpars',
                           'modelica',
                           'mark_prt',
                           'modipar',
                           'MoveLink_',
                           'Move_',
                           'Modelica_',
                           'menu_stuff',
                           'Nyquist_',
                           'newc_pass2',
                           'New_',
                           'Navigator_',
                           'OpenSet_',
                           'point2pixel',
                           'Popup_',
                           'Paste_',
                           'Purge_',
                           'prt_align',
                           'Palettes_',
                           'Paleditor_',
                           'pwindow_set_size',
                           'replayifnecessary',
                           'restore_scs_gc',
                           'Run_',
                           'Resize_',
                           'Replot_',
                           'Replace_',
                           'Rename_',
                           'RegiontoSuperBlock_',
                           'splitfilepath',
                           'shiftcors',
                           'standard_origin',
                           'set_background',
                           'scicos_link',
                           'scicos_block',
                           'scicos_diagram',
                           'set_cmap',
                           'save_scs_gc',
                           'scicos_cpr',
                           'systshow',
                           'systexport',
                           'sci2tcl',
                           'show_info',
                           'standard_draw_ports_up',
                           'scs_full_path',
                           'scicos_flat',
                           'standard_outputs',
                           'standard_inputs',
                           'standard_etiquette',
                           's_port_names',
                           'splitted_links',
                           'standard_draw_ports',
                           'scicos_sim',
                           'scicos_model',
                           'scicos_state',
                           'scicos_graphics',
                           'scs_show',
                           'standard_draw',
                           'standard_define',
                           'SaveasInterfFunc_',
                           'scicos_block_link',
                           'select_unhilite',
                           'SelectRegion_',
                           'SelectLink_',
                           'select_hilite2',
                           'SmartMove_',
                           'Setup_',
                           'SetDiagramInfo_',
                           'Save_',
                           'SaveAs_',
                           'SaveasPalette_',
                           'script2var',
                           'Shortcuts_',
                           'standard_document',
                           'setvalue',
                           'scicos_params',
                           'save_super',
                           'save_csuper',
                           'tabule',
                           'tk_choose',
                           'tk_mpopupX',
                           'tk_mpopup',
                           'tk_getcolor',
                           'tk_getvalue',
                           'update_redraw_obj',
                           'update_scicos_pal',
                           'under_connection',
                           'unhilite_obj',
                           'Undo_',
                           'value2modelica',
                           'whereintree',
                           'width2pixel',
                           'window_set_size',
                           'Window_',
                           'Zoomout_',
                           'Zoomin_']

        constant_words = [ 'home',
                           'SCIHOME',
                           'PWD',
                           'TMPDIR',
                           'MSDOS',
                           'SCI',
                           'COMPILER']

        self.addRule("ConsWord",r"(%helps)")
        self.addRule("ConsWord",r"(%F)")
        self.addRule("ConsWord",r"(%T)")
        self.addRule("ConsWord",r"(%z)")
        self.addRule("ConsWord",r"(%s)")
        self.addRule("ConsWord",r"(%nan)")
        self.addRule("ConsWord",r"(%inf)")
        self.addRule("ConsWord",r"(%gtk)")
        self.addRule("ConsWord",r"(%gui)")
        self.addRule("ConsWord",r"(%pvm)")
        self.addRule("ConsWord",r"(%tk)")
        self.addRule("ConsWord",r"(%t)")
        self.addRule("ConsWord",r"(%f)")
        self.addRule("ConsWord",r"(%eps)")
        self.addRule("ConsWord",r"(%io)")
        self.addRule("ConsWord",r"(%i)")
        self.addRule("ConsWord",r"(%e)")
        self.addRule("ConsWord",r"(%pi)")

        self.addReserved(reserved_words)
        self.addConstant(constant_words)

        self.addWords(reserved_words2,'ResWord2')
