2 " Language: NASTRAN input/DMAP
3 " Maintainer: Tom Kowalski (tom.kowalski@mscsoftware.com)
4 " Last change: April 27, 2001
5 " Thanks to the authors and maintainers of fortran.vim.
6 " Since DMAP shares some traits with fortran, this syntax file
7 " is based on the fortran.vim syntax file.
8 "----------------------------------------------------------------------
9 " Remove any old syntax stuff hanging around
13 elseif exists("b:current_syntax")
16 " DMAP is not case dependent
19 "--------------------DMAP SYNTAX---------------------------------------
21 " -------Executive Modules and Statements
23 syn keyword nastranDmapexecmod call dbview delete end equiv equivx exit
24 syn keyword nastranDmapexecmod file message purge purgex return subdmap
25 syn keyword nastranDmapType type
26 syn keyword nastranDmapLabel go to goto
27 syn keyword nastranDmapRepeat if else elseif endif then
28 syn keyword nastranDmapRepeat do while
29 syn region nastranDmapString start=+"+ end=+"+ oneline
30 syn region nastranDmapString start=+'+ end=+'+ oneline
31 " If you don't like initial tabs in dmap (or at all)
32 "syn match nastranDmapIniTab "^\t.*$"
33 "syn match nastranDmapTab "\t"
36 syn match nastranDmapNumber "-\=\<[0-9]\+\>"
37 " floating point number, with dot, optional exponent
38 syn match nastranDmapFloat "\<[0-9]\+\.[0-9]*\([edED][-+]\=[0-9]\+\)\=\>"
39 " floating point number, starting with a dot, optional exponent
40 syn match nastranDmapFloat "\.[0-9]\+\([edED][-+]\=[0-9]\+\)\=\>"
41 " floating point number, without dot, with exponent
42 syn match nastranDmapFloat "\<[0-9]\+[edED][-+]\=[0-9]\+\>"
44 syn match nastranDmapLogical "\(true\|false\)"
46 syn match nastranDmapPreCondit "^#define\>"
47 syn match nastranDmapPreCondit "^#include\>"
49 " -------Comments may be contained in another line.
51 syn match nastranDmapComment "^[\$].*$"
52 syn match nastranDmapComment "\$.*$"
53 syn match nastranDmapComment "^[\$].*$" contained
54 syn match nastranDmapComment "\$.*$" contained
55 " Treat all past 72nd column as a comment. Do not work with tabs!
56 " Breaks down when 72-73rd column is in another match (eg number or keyword)
57 syn match nastranDmapComment "^.\{-72}.*$"lc=72 contained
60 " -------Utility Modules
62 syn keyword nastranDmapUtilmod append copy dbc dbdict dbdir dmin drms1
63 syn keyword nastranDmapUtilmod dtiin eltprt ifp ifp1 inputt2 inputt4 lamx
64 syn keyword nastranDmapUtilmod matgen matgpr matmod matpch matprn matprt
65 syn keyword nastranDmapUtilmod modtrl mtrxin ofp output2 output4 param
66 syn keyword nastranDmapUtilmod paraml paramr prtparam pvt scalar
67 syn keyword nastranDmapUtilmod seqp setval tabedit tabprt tabpt vec vecplot
68 syn keyword nastranDmapUtilmod xsort
70 " -------Matrix Modules
72 syn keyword nastranDmapMatmod add add5 cead dcmp decomp diagonal fbs merge
73 syn keyword nastranDmapMatmod mpyad norm read reigl smpyad solve solvit
74 syn keyword nastranDmapMatmod trnsp umerge umerge1 upartn dmiin partn
75 syn region nastranDmapMatmod start=+^ *[Dd][Mm][Ii]+ end=+[\/]+
77 " -------Implicit Functions
79 syn keyword nastranDmapImplicit abs acos acosh andl asin asinh atan atan2
80 syn keyword nastranDmapImplicit atanh atanh2 char clen clock cmplx concat1
81 syn keyword nastranDmapImplicit concat2 concat3 conjg cos cosh dble diagoff
82 syn keyword nastranDmapImplicit diagon dim dlablank dlxblank dprod eqvl exp
83 syn keyword nastranDmapImplicit getdiag getsys ichar imag impl index indexstr
84 syn keyword nastranDmapImplicit int itol leq lge lgt lle llt lne log log10
85 syn keyword nastranDmapImplicit logx ltoi mcgetsys mcputsys max min mod neqvl
86 syn keyword nastranDmapImplicit nint noop normal notl numeq numge numgt numle
87 syn keyword nastranDmapImplicit numlt numne orl pi precison putdiag putsys
88 syn keyword nastranDmapImplicit rand rdiagon real rtimtogo setcore sign sin
89 syn keyword nastranDmapImplicit sinh sngl sprod sqrt substrin tan tanh
90 syn keyword nastranDmapImplicit timetogo wlen xorl
93 "--------------------INPUT FILE SYNTAX---------------------------------------
96 " -------Nastran Statement
98 syn keyword nastranNastranCard nastran
100 " -------The File Management Section (FMS)
102 syn region nastranFMSCard start=+^ *[Aa][Cc][Qq][Uu][Ii]+ end=+$+ oneline
103 syn region nastranFMSCard start=+^ *[Aa][Ss][Ss][Ii][Gg]+ end=+$+ oneline
104 syn region nastranFMSCard start=+^ *[Cc][oO][Nn][Nn][Ee]+ end=+$+ oneline
105 syn region nastranFMSCard start=+^ *[Dd][Bb][Cc][Ll][Ee]+ end=+$+ oneline
106 syn region nastranFMSCard start=+^ *[Dd][Bb][Dd][Ii][Cc]+ end=+$+ oneline
107 syn region nastranFMSCard start=+^ *[Dd][Bb][Dd][Ii][Rr]+ end=+$+ oneline
108 syn region nastranFMSCard start=+^ *[Dd][Bb][Ff][Ii][Xx]+ end=+$+ oneline
109 syn region nastranFMSCard start=+^ *[Dd][Bb][Ll][Oo][Aa]+ end=+$+ oneline
110 syn region nastranFMSCard start=+^ *[Dd][Bb][Ll][Oo][Cc]+ end=+$+ oneline
111 syn region nastranFMSCard start=+^ *[Dd][Bb][Ss][Ee][Tt]+ end=+$+ oneline
112 syn region nastranFMSCard start=+^ *[Dd][Bb][Uu][Nn][Ll]+ end=+$+ oneline
113 syn region nastranFMSCard start=+^ *[Dd][Bb][Uu][Pp][Dd]+ end=+$+ oneline
114 syn region nastranFMSCard start=+^ *[Dd][Ee][Ff][Ii][Nn]+ end=+$+ oneline
115 syn region nastranFMSCard start=+^ *[Ee][Nn][Dd][Jj][Oo]+ end=+$+ oneline
116 syn region nastranFMSCard start=+^ *[Ee][Xx][Pp][Aa][Nn]+ end=+$+ oneline
117 syn region nastranFMSCard start=+^ *[Ii][Nn][Cc][Ll][Uu]+ end=+$+ oneline
118 syn region nastranFMSCard start=+^ *[Ii][Nn][Ii][Tt]+ end=+$+ oneline
119 syn region nastranFMSCard start=+^ *[Pp][Rr][Oo][Jj]+ end=+$+ oneline
120 syn region nastranFMSCard start=+^ *[Rr][Ee][Ss][Tt]+ end=+$+ oneline
121 syn match nastranDmapUtilmod "^ *[Rr][Ee][Ss][Tt][Aa].*,.*," contains=nastranDmapComment
123 " -------Executive Control Section
125 syn region nastranECSCard start=+^ *[Aa][Ll][Tt][Ee][Rr]+ end=+$+ oneline
126 syn region nastranECSCard start=+^ *[Aa][Pp][Pp]+ end=+$+ oneline
127 syn region nastranECSCard start=+^ *[Cc][Oo][Mm][Pp][Ii]+ end=+$+ oneline
128 syn region nastranECSCard start=+^ *[Dd][Ii][Aa][Gg] + end=+$+ oneline
129 syn region nastranECSCard start=+^ *[Ee][Cc][Hh][Oo]+ end=+$+ oneline
130 syn region nastranECSCard start=+^ *[Ee][Nn][Dd][Aa][Ll]+ end=+$+ oneline
131 syn region nastranECSCard start=+^ *[Ii][Dd]+ end=+$+ oneline
132 syn region nastranECSCard start=+^ *[Ii][Nn][Cc][Ll][Uu]+ end=+$+ oneline
133 syn region nastranECSCard start=+^ *[Ll][Ii][Nn][Kk]+ end=+$+ oneline
134 syn region nastranECSCard start=+^ *[Mm][Aa][Ll][Tt][Ee]+ end=+$+ oneline
135 syn region nastranECSCard start=+^ *[Ss][Oo][Ll] + end=+$+ oneline
136 syn region nastranECSCard start=+^ *[Tt][Ii][Mm][Ee]+ end=+$+ oneline
140 syn match nastranDelimiter "[Cc][Ee][Nn][Dd]" contained
141 syn match nastranDelimiter "[Bb][Ee][Gg][Ii][Nn]" contained
142 syn match nastranDelimiter " *[Bb][Uu][Ll][Kk]" contained
143 syn match nastranDelimiter "[Ee][Nn][Dd] *[dD][Aa][Tt][Aa]" contained
145 " -------Case Control section
147 syn region nastranCC start=+^ *[Cc][Ee][Nn][Dd]+ end=+^ *[Bb][Ee][Gg][Ii][Nn]+ contains=nastranDelimiter,nastranBulkData,nastranDmapComment
150 " -------Bulk Data section
152 syn region nastranBulkData start=+ *[Bb][Uu][Ll][Kk] *$+ end=+^ [Ee][Nn][Dd] *[Dd]+ contains=nastranDelimiter,nastranDmapComment
154 " -------The following cards may appear in multiple sections of the file
156 syn keyword nastranUtilCard ECHOON ECHOOFF INCLUDE PARAM
159 if version >= 508 || !exists("did_nastran_syntax_inits")
161 let did_nastran_syntax_inits = 1
162 command -nargs=+ HiLink hi link <args>
164 command -nargs=+ HiLink hi link <args>
166 " The default methods for highlighting. Can be overridden later
167 HiLink nastranDmapexecmod Statement
168 HiLink nastranDmapType Type
169 HiLink nastranDmapPreCondit Error
170 HiLink nastranDmapUtilmod PreProc
171 HiLink nastranDmapMatmod nastranDmapUtilmod
172 HiLink nastranDmapString String
173 HiLink nastranDmapNumber Constant
174 HiLink nastranDmapFloat nastranDmapNumber
175 HiLink nastranDmapInitTab nastranDmapNumber
176 HiLink nastranDmapTab nastranDmapNumber
177 HiLink nastranDmapLogical nastranDmapExecmod
178 HiLink nastranDmapImplicit Identifier
179 HiLink nastranDmapComment Comment
180 HiLink nastranDmapRepeat nastranDmapexecmod
181 HiLink nastranNastranCard nastranDmapPreCondit
182 HiLink nastranECSCard nastranDmapUtilmod
183 HiLink nastranFMSCard nastranNastranCard
184 HiLink nastranCC nastranDmapexecmod
185 HiLink nastranDelimiter Special
186 HiLink nastranBulkData nastranDmapType
187 HiLink nastranUtilCard nastranDmapexecmod
191 let b:current_syntax = "nastran"
193 "EOF vim: ts=8 noet tw=120 sw=8 sts=0