codekingpro/portable-devtools
114k
1" Language: ampl (A Mathematical Programming Language)2" Maintainer: Krief David <david.krief@etu.enseeiht.fr> or <david_krief@hotmail.com>3" Last Change: 2003 May 114 5 6" quit when a syntax file was already loaded7if exists("b:current_syntax")8 finish9endif10 11 12 13 14"--15syn match amplEntityKeyword "\(subject to\)\|\(subj to\)\|\(s\.t\.\)"16syn keyword amplEntityKeyword minimize maximize objective17 18syn keyword amplEntityKeyword coeff coef cover obj default19syn keyword amplEntityKeyword from to to_come net_in net_out20syn keyword amplEntityKeyword dimen dimension21 22 23 24"--25syn keyword amplType integer binary set param var26syn keyword amplType node ordered circular reversed symbolic27syn keyword amplType arc28 29 30 31"--32syn keyword amplStatement check close \display drop include33syn keyword amplStatement print printf quit reset restore34syn keyword amplStatement solve update write shell model35syn keyword amplStatement data option let solution fix36syn keyword amplStatement unfix end function pipe format37 38 39 40"--41syn keyword amplConditional if then else and or42syn keyword amplConditional exists forall in not within43 44 45 46"--47syn keyword amplRepeat while repeat for48 49 50 51"--52syn keyword amplOperators union diff difference symdiff sum53syn keyword amplOperators inter intersect intersection cross setof54syn keyword amplOperators by less mod div product55"syn keyword amplOperators min max56"conflict between functions max, min and operators max, min57 58syn match amplBasicOperators "||\|<=\|==\|\^\|<\|=\|!\|-\|\.\.\|:="59syn match amplBasicOperators "&&\|>=\|!=\|\*\|>\|:\|/\|+\|\*\*"60 61 62 63 64"--65syn match amplComment "\#.*"66syn region amplComment start=+\/\*+ end=+\*\/+67 68syn region amplStrings start=+\'+ skip=+\\'+ end=+\'+69syn region amplStrings start=+\"+ skip=+\\"+ end=+\"+70 71syn match amplNumerics "[+-]\=\<\d\+\(\.\d\+\)\=\([dDeE][-+]\=\d\+\)\=\>"72syn match amplNumerics "[+-]\=Infinity"73 74 75"--76syn keyword amplSetFunction card next nextw prev prevw77syn keyword amplSetFunction first last member ord ord078 79syn keyword amplBuiltInFunction abs acos acosh alias asin80syn keyword amplBuiltInFunction asinh atan atan2 atanh ceil81syn keyword amplBuiltInFunction cos exp floor log log1082syn keyword amplBuiltInFunction max min precision round sin83syn keyword amplBuiltInFunction sinh sqrt tan tanh trunc84 85syn keyword amplRandomGenerator Beta Cauchy Exponential Gamma Irand22486syn keyword amplRandomGenerator Normal Poisson Uniform Uniform0187 88 89 90"-- to highlight the 'dot-suffixes'91syn match amplDotSuffix "\h\w*\.\(lb\|ub\)"hs=e-292syn match amplDotSuffix "\h\w*\.\(lb0\|lb1\|lb2\|lrc\|ub0\)"hs=e-393syn match amplDotSuffix "\h\w*\.\(ub1\|ub2\|urc\|val\|lbs\|ubs\)"hs=e-394syn match amplDotSuffix "\h\w*\.\(init\|body\|dinit\|dual\)"hs=e-495syn match amplDotSuffix "\h\w*\.\(init0\|ldual\|slack\|udual\)"hs=e-596syn match amplDotSuffix "\h\w*\.\(lslack\|uslack\|dinit0\)"hs=e-697 98 99 100"--101syn match amplPiecewise "<<\|>>"102 103 104 105"-- Todo.106syn keyword amplTodo contained TODO FIXME XXX107 108 109 110 111 112 113 114 115 116 117 118" The default methods for highlighting. Can be overridden later.119hi def link amplEntityKeyword Keyword120hi def link amplType Type121hi def link amplStatement Statement122hi def link amplOperators Operator123hi def link amplBasicOperators Operator124hi def link amplConditional Conditional125hi def link amplRepeat Repeat126hi def link amplStrings String127hi def link amplNumerics Number128hi def link amplSetFunction Function129hi def link amplBuiltInFunction Function130hi def link amplRandomGenerator Function131hi def link amplComment Comment132hi def link amplDotSuffix Special133hi def link amplPiecewise Special134 135 136let b:current_syntax = "ampl"137 138" vim: ts=8139 140 141 