2 " Language: Modsim III, by compuware corporation (www.compuware.com)
3 " Maintainer: Philipp Jocham <flip@sbox.tu-graz.ac.at>
5 " Last Change: 2001 May 10
8 " - Modsim III is a registered trademark from compuware corporation
9 " - made compatible with Vim 6.0
11 " 1999 Apr 22 : Changed modsim3Literal from region to match
13 " very basic things only (based on the modula2 and c files).
16 " Remove any old syntax stuff hanging around
18 elseif exists("b:current_syntax")
23 " syn case match " case sensitiv match is default
26 syn keyword modsim3Keyword ACTID ALL AND AS ASK
27 syn keyword modsim3Keyword BY CALL CASE CLASS CONST DIV
28 syn keyword modsim3Keyword DOWNTO DURATION ELSE ELSIF EXIT FALSE FIXED FOR
29 syn keyword modsim3Keyword FOREACH FORWARD IF IN INHERITED INOUT
30 syn keyword modsim3Keyword INTERRUPT LOOP
31 syn keyword modsim3Keyword MOD MONITOR NEWVALUE
32 syn keyword modsim3Keyword NONMODSIM NOT OBJECT OF ON OR ORIGINAL OTHERWISE OUT
33 syn keyword modsim3Keyword OVERRIDE PRIVATE PROTO REPEAT
34 syn keyword modsim3Keyword RETURN REVERSED SELF STRERR TELL
35 syn keyword modsim3Keyword TERMINATE THISMETHOD TO TRUE TYPE UNTIL VALUE VAR
36 syn keyword modsim3Keyword WAIT WAITFOR WHEN WHILE WITH
38 " Builtin functions and procedures
39 syn keyword modsim3Builtin ABS ACTIVATE ADDMONITOR CAP CHARTOSTR CHR CLONE
40 syn keyword modsim3Builtin DEACTIVATE DEC DISPOSE FLOAT GETMONITOR HIGH INC
41 syn keyword modsim3Builtin INPUT INSERT INTTOSTR ISANCESTOR LOW LOWER MAX MAXOF
42 syn keyword modsim3Builtin MIN MINOF NEW OBJTYPEID OBJTYPENAME OBJVARID ODD
43 syn keyword modsim3Builtin ONERROR ONEXIT ORD OUTPUT POSITION PRINT REALTOSTR
44 syn keyword modsim3Builtin REPLACE REMOVEMONITOR ROUND SCHAR SIZEOF SPRINT
45 syn keyword modsim3Builtin STRLEN STRTOCHAR STRTOINT STRTOREAL SUBSTR TRUNC
46 syn keyword modsim3Builtin UPDATEVALUE UPPER VAL
48 syn keyword modsim3BuiltinNoParen HALT TRACE
51 syn keyword modsim3Block PROCEDURE METHOD MODULE MAIN DEFINITION IMPLEMENTATION
52 syn keyword modsim3Block BEGIN END
54 syn keyword modsim3Include IMPORT FROM
56 syn keyword modsim3Type ANYARRAY ANYOBJ ANYREC ARRAY BOOLEAN CHAR INTEGER
57 syn keyword modsim3Type LMONITORED LRMONITORED NILARRAY NILOBJ NILREC REAL
58 syn keyword modsim3Type RECORD RMONITOR RMONITORED STRING
60 " catch errros cause by wrong parenthesis
61 " slight problem with "( *)" or "(* )". Hints?
62 syn region modsim3Paren transparent start='(' end=')' contains=ALLBUT,modsim3ParenError
63 syn match modsim3ParenError ")"
66 syn region modsim3Comment1 start="{" end="}" contains=modsim3Comment1,modsim3Comment2
67 syn region modsim3Comment2 start="(\*" end="\*)" contains=modsim3Comment1,modsim3Comment2
68 " highlighting is wrong for constructs like "{ (* } *)",
69 " which are allowed in Modsim III, but
70 " I think something like that shouldn't be used anyway.
73 syn region modsim3String start=+"+ end=+"+
76 "syn region modsim3Literal start=+'+ end=+'+
77 syn match modsim3Literal "'[^']'\|''''"
79 " Define the default highlighting.
80 " For version 5.7 and earlier: only when not done already
81 " For version 5.8 and later: only when an item doesn't have highlighting yet
82 if version >= 508 || !exists("did_modsim3_syntax_inits")
84 let did_modsim3_syntax_inits = 1
85 command -nargs=+ HiLink hi link <args>
87 command -nargs=+ HiLink hi def link <args>
90 " The default methods for highlighting. Can be overridden later
91 HiLink modsim3Keyword Statement
92 HiLink modsim3Block Statement
93 HiLink modsim3Comment1 Comment
94 HiLink modsim3Comment2 Comment
95 HiLink modsim3String String
96 HiLink modsim3Literal Character
97 HiLink modsim3Include Statement
98 HiLink modsim3Type Type
99 HiLink modsim3ParenError Error
100 HiLink modsim3Builtin Function
101 HiLink modsim3BuiltinNoParen Function
106 let b:current_syntax = "modsim3"