" Vim syntax file
" Language:	Xmath (a simulation tool)
" Maintainer:	Dr. Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
" Last change:	1997 April 20

" Remove any old syntax stuff hanging around
syntax clear

" A bunch of useful Xmath keywords
syntax keyword XmathFuncCmd        function endfunction command endcommand Function endFunction endCommand Endfunction EndFunction Command Endcommand EndCommand FUNCTION ENDFUNCTION COMMAND ENDFUNCTION
syntax keyword XmathStatement      abort beep debug default define execute exit pause return undefine Abort Beep Debug Default Define Execute Exit Pause Return Undefine
syntax keyword XmathConditional    if else elseif endif elseIf endIf If Else Elseif ElseIf EndIf IF ELSE ELSEIF
syntax keyword XmathRepeat         while for endwhile endfor endWhile endFor While For Endwhile EndWhile EndFor WHILE FOR ENDWHILE
syntax keyword XmathCmd anigraph deletedatastore keep renamedatastore
syntax keyword XmathCmd autocode deletestd linkhyper renamestd
syntax keyword XmathCmd build deletesuperblock linksim renamesuperblock
syntax keyword XmathCmd comment deletetransition listusertype save
syntax keyword XmathCmd copydatastore deleteusertype load sbadisplay
syntax keyword XmathCmd copystd detailmodel lock set
syntax keyword XmathCmd copysuperblock display minmax_display setsbdefault
syntax keyword XmathCmd createblock documentit modifyblock show
syntax keyword XmathCmd createbubble editcatalog modifybubble showlicense
syntax keyword XmathCmd createconnection erase modifystd showsbdefault
syntax keyword XmathCmd creatertf expandsuperbubble modifysuperblock stop
syntax keyword XmathCmd createstd for modifytransition stopcosim
syntax keyword XmathCmd createsuperblock go modifyusertype syntax
syntax keyword XmathCmd createsuperbubble goto new unalias
syntax keyword XmathCmd createtransition hardcopy next unlock
syntax keyword XmathCmd createusertype help polargraph usertype
syntax keyword XmathCmd delete hyperbuild print whatis
syntax keyword XmathCmd deleteblock if printmodel while
syntax keyword XmathCmd deletebubble ifilter quit who
syntax keyword XmathCmd deleteconnection ipcwc remove xgraph

syntax keyword XmathFunc abcd eye irea querystdoptions
syntax keyword XmathFunc abs eyepattern is querysuperblock
syntax keyword XmathFunc acos feedback ISID querysuperblockopt
syntax keyword XmathFunc acosh fft ISID Models querytransition
syntax keyword XmathFunc adconversion fftpdm kronecker querytransitionopt
syntax keyword XmathFunc afeedback filter length qz
syntax keyword XmathFunc all find limit rampinvar
syntax keyword XmathFunc ambiguity firparks lin random
syntax keyword XmathFunc amdemod firremez lin30 randpdm
syntax keyword XmathFunc analytic firwind linearfm randpert
syntax keyword XmathFunc analyze fmdemod linfnorm randsys
syntax keyword XmathFunc any forwdiff lintodb rank
syntax keyword XmathFunc append fprintf list rayleigh
syntax keyword XmathFunc argn frac log rcepstrum
syntax keyword XmathFunc argv fracred log10 rcond
syntax keyword XmathFunc arma freq logm rdintegrate
syntax keyword XmathFunc arma2ss freqcircle lognormal read
syntax keyword XmathFunc armax freqcont logspace real
syntax keyword XmathFunc ascii frequencyhop lowpass rectify
syntax keyword XmathFunc asin fsesti lpopt redschur
syntax keyword XmathFunc asinh fslqgcomp lqgcomp reflect
syntax keyword XmathFunc atan fsregu lqgltr regulator
syntax keyword XmathFunc atan2 fwls ls residue
syntax keyword XmathFunc atanh gabor ls2unc riccati
syntax keyword XmathFunc attach_ac100 garb ls2var riccati_eig
syntax keyword XmathFunc backdiff gaussian lsjoin riccati_schur
syntax keyword XmathFunc balance gcexp lu ricean
syntax keyword XmathFunc balmoore gcos lyapunov rifd
syntax keyword XmathFunc bandpass gdfileselection makecontinuous rlinfo
syntax keyword XmathFunc bandstop gdmessage makematrix rlocus
syntax keyword XmathFunc bj gdselection makepoly rms
syntax keyword XmathFunc blknorm genconv margin rootlocus
syntax keyword XmathFunc bode get markoff roots
syntax keyword XmathFunc bpm get_info30 matchedpz round
syntax keyword XmathFunc bpm2inn get_inn max rref
syntax keyword XmathFunc bpmjoin gfdm maxlike rve_get
syntax keyword XmathFunc bpmsplit gfsk mean rve_info
syntax keyword XmathFunc bst gfskernel mergeseg rve_reset
syntax keyword XmathFunc buttconstr gfunction min rve_update
syntax keyword XmathFunc butterworth ggauss minimal samplehold
syntax keyword XmathFunc cancel giv mkpert schur
syntax keyword XmathFunc canform giv2var mkphase sdf
syntax keyword XmathFunc ccepstrum givjoin mma sds
syntax keyword XmathFunc char gpsk mmaget sdtrsp
syntax keyword XmathFunc chebconstr gpulse mmaput sec
syntax keyword XmathFunc chebyshev gqam mod sech
syntax keyword XmathFunc check gqpsk modal siginterp
syntax keyword XmathFunc cholesky gramp modalstate sign
syntax keyword XmathFunc chop gsawtooth modcarrier sim
syntax keyword XmathFunc circonv gsigmoid mreduce sim30
syntax keyword XmathFunc circorr gsin mtxplt simin
syntax keyword XmathFunc clock gsinc mu simin30
syntax keyword XmathFunc clocus gsqpsk mulhank simout
syntax keyword XmathFunc clsys gsquarewave multipath simout30
syntax keyword XmathFunc coherence gstep musynfit simtransform
syntax keyword XmathFunc colorind GuiDialogCreate mxstr2xmstr sin
syntax keyword XmathFunc combinepf GuiDialogDestroy mxstring2xmstring singriccati
syntax keyword XmathFunc commentof GuiFlush names sinh
syntax keyword XmathFunc compare GuiGetValue nichols sinm
syntax keyword XmathFunc complementaryerf GuiManage noisefilt size
syntax keyword XmathFunc complexenvelope GuiPlot none smargin
syntax keyword XmathFunc complexfreqshift GuiPlotGet norm sns2sys
syntax keyword XmathFunc concatseg GuiSetValue numden sort
syntax keyword XmathFunc condition GuiShellCreate nyquist spectrad
syntax keyword XmathFunc conj GuiShellDeiconify obscf spectrum
syntax keyword XmathFunc conmap GuiShellDestroy observable spline
syntax keyword XmathFunc connect GuiShellIconify oe sprintf
syntax keyword XmathFunc conpdm GuiShellLower ones sqrt
syntax keyword XmathFunc constellation GuiShellRaise ophank sqrtm
syntax keyword XmathFunc consys GuiShellRealize optimize sresidualize
syntax keyword XmathFunc controllable GuiShellUnrealize optscale ss2arma
syntax keyword XmathFunc convolve GuiTimer orderfilt sst
syntax keyword XmathFunc correlate GuiToolCreate orderstate ssv
syntax keyword XmathFunc cos GuiToolDestroy orth stable
syntax keyword XmathFunc cosh GuiToolExist oscmd stair
syntax keyword XmathFunc cosm GuiUnmanage oscope starp
syntax keyword XmathFunc cot GuiWidgetExist osscale step
syntax keyword XmathFunc coth h2norm padcrop stepinvar
syntax keyword XmathFunc covariance h2syn partialsum string
syntax keyword XmathFunc csc hadamard pdm stringex
syntax keyword XmathFunc csch hankelsv pdmslice substr
syntax keyword XmathFunc csum hessenberg pem subsys
syntax keyword XmathFunc ctrcf highpass perfplots sum
syntax keyword XmathFunc ctrlplot hilbert period svd
syntax keyword XmathFunc daug hilberttransform pfscale svplot
syntax keyword XmathFunc dbtolin hinfcontr phaseshift sweep
syntax keyword XmathFunc dct hinfnorm pinv symbolmap
syntax keyword XmathFunc decimate hinfsyn plot sys2sns
syntax keyword XmathFunc defFreqRange histogram plot30 sysic
syntax keyword XmathFunc defTimeRange idfreq pmdemod Sysid
syntax keyword XmathFunc delay idimpulse poisson system
syntax keyword XmathFunc delsubstr idsim poissonimpulse tan
syntax keyword XmathFunc det ifft poleplace tanh
syntax keyword XmathFunc detrend imag poles taper
syntax keyword XmathFunc dht impinvar polezero tfid
syntax keyword XmathFunc diagonal impplot poltrend toeplitz
syntax keyword XmathFunc differentiate impulse polyfit trace
syntax keyword XmathFunc directsequence index polynomial tril
syntax keyword XmathFunc discretize indexlist polyval trim
syntax keyword XmathFunc divide initial polyvalm trim30
syntax keyword XmathFunc domain initmodel prbs triu
syntax keyword XmathFunc dst initx0 product trsp
syntax keyword XmathFunc eig inn2bpm psd truncate
syntax keyword XmathFunc ellipconstr inn2pe put_inn tustin
syntax keyword XmathFunc elliptic inn2unc qpopt uniform
syntax keyword XmathFunc erf insertseg qr val
syntax keyword XmathFunc error int quantize variance
syntax keyword XmathFunc estimator integrate queryblock videolines
syntax keyword XmathFunc etfe integratedump queryblockoptions wcbode
syntax keyword XmathFunc exist interp querybubble wcgain
syntax keyword XmathFunc exp interpolate querybubbleoptionswindow
syntax keyword XmathFunc expm inv querycatalog wtbalance
syntax keyword XmathFunc extractchan invhilbert queryconnection zeros
syntax keyword XmathFunc extractseg iqmix querystd


syntax keyword XmathTodo contained TODO
syntax match   XmathLabel             "^[ 	]*<[a-zA-Z_][a-zA-Z0-9]*>"

" String and Character constants
" Highlight special characters (those which have a backslash) differently
syntax match     XmathSpecial           contained "\\[0-9][0-9][0-9]\|\\."
syntax region    XmathString            start=+"+  skip=+\\\\\|\\"+  end=+"+  contains XmathSpecial
syntax match     XmathCharacter         "'[^\\]'"
syntax match     XmathSpecialCharacter  "'\\.'"

syntax match     XmathNumber          "-\=\<[0-9]\+L\=\>\|0[xX][0-9a-fA-F]\+\>"

"syntax match    XmathIdentifier      "\<[a-zA-Z_][a-zA-Z0-9_]*\>"

" Comments:
" Xmath supports #...  (like Unix shells)
"       and      #{ ... }# comment blocks
syntax match   XmathCommentSkip      contained "^[ 	]*\*\($\|[ 	]\+\)"
syntax region  XmathCommentString    contained start=+"+  skip=+\\\\\|\\"+  end=+"+ end=+\*/+S-1s-1 contains XmathSpecial XmathCommentSkip
syntax region  XmathComment2String   contained start=+"+  skip=+\\\\\|\\"+  end=+$\|"+  contains XmathSpecial
syntax region  XmathCommentBlock     start="#{" end="}#" contains XmathCommentString XmathComment2String XmathTodo
syntax match   XmathComment          "#.*$" contains XmathCommentString XmathComment2String XmathTodo


" synchronizing
syntax sync match XmathSyncComment groupthere NONE "}#"
syntax sync match XmathSyncComment grouphere XmathCommentBlock "#{"

if !exists("did_xmatch_syntax_inits")
  let did_xmatch_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later
  highlight link XmathFuncCmd		XmathStatement
  highlight link XmathConditional	Conditional
  highlight link XmathRepeat		Repeat
  highlight link XmathCmd		XmathStatement
  highlight link XmathFunc		Function
  highlight link XmathCharacter		Character
  highlight link XmathSpecialCharacter	XmathSpecial
  highlight link XmathNumber		Number
  highlight link XmathCommentString	XmathComment
  highlight link XmathComment2String	XmathComment
  highlight link XmathCommentSkip	XmathComment
  highlight link XmathStatement		Statement
  highlight link XmathString		String
  highlight link XmathComment		Comment
  highlight link XmathSpecial		Type
  highlight link XmathLabel		PreProc
  highlight link XmathTodo		Todo
  highlight link XmathCommentBlock	Comment
  "highlight link XmathIdentifier	Identifier
endif
