2908
|
1 " Vim syntax file
|
|
2 " Language: JOVIAL J73
|
|
3 " Version: 1.2
|
|
4 " Maintainer: Paul McGinnis <paulmcg@aol.com>
|
|
5 " Last Change: 2011/06/17
|
|
6 " Remark: Based on MIL-STD-1589C for JOVIAL J73 language
|
|
7
|
|
8 " Quit when a (custom) syntax file was already loaded
|
|
9 if exists("b:current_syntax")
|
|
10 finish
|
|
11 endif
|
|
12
|
|
13 syn case ignore
|
|
14
|
|
15 syn keyword jovialTodo TODO FIXME XXX contained
|
|
16
|
|
17 " JOVIAL beads - first digit is number of bits, [0-9A-V] is the bit value
|
|
18 " representing 0-31 (for 5 bits on the bead)
|
|
19 syn match jovialBitConstant "[1-5]B'[0-9A-V]'"
|
|
20
|
|
21 syn match jovialNumber "\<\d\+\>"
|
|
22
|
|
23 syn match jovialFloat "\d\+E[-+]\=\d\+"
|
|
24 syn match jovialFloat "\d\+\.\d*\(E[-+]\=\d\+\)\="
|
|
25 syn match jovialFloat "\.\d\+\(E[-+]\=\d\+\)\="
|
|
26
|
|
27 syn region jovialComment start=/"/ end=/"/ contains=jovialTodo
|
|
28 syn region jovialComment start=/%/ end=/%/ contains=jovialTodo
|
|
29
|
|
30 " JOVIAL variable names. This rule is to prevent conflicts with strings.
|
|
31 " Handle special case where ' character can be part of a JOVIAL variable name.
|
|
32 syn match jovialIdentifier "[A-Z\$][A-Z0-9'\$]\+"
|
|
33
|
|
34 syn region jovialString start="\s*'" skip=/''/ end=/'/ oneline
|
|
35
|
|
36 " JOVIAL compiler directives -- see Section 9 in MIL-STD-1589C
|
|
37 syn region jovialPreProc start="\s*![A-Z]\+" end=/;/
|
|
38
|
|
39 syn keyword jovialOperator AND OR NOT XOR EQV MOD
|
|
40
|
|
41 " See Section 2.1 in MIL-STD-1589C for data types
|
|
42 syn keyword jovialType ITEM B C P V
|
|
43 syn match jovialType "\<S\(,R\|,T\|,Z\)\=\>"
|
|
44 syn match jovialType "\<U\(,R\|,T\|,Z\)\=\>"
|
|
45 syn match jovialType "\<F\(,R\|,T\|,Z\)\=\>"
|
|
46 syn match jovialType "\<A\(,R\|,T\|,Z\)\=\>"
|
|
47
|
|
48 syn keyword jovialStorageClass STATIC CONSTANT PARALLEL BLOCK N M D W
|
|
49
|
|
50 syn keyword jovialStructure TABLE STATUS
|
|
51
|
|
52 syn keyword jovialConstant NULL
|
|
53
|
|
54 syn keyword jovialBoolean FALSE TRUE
|
|
55
|
|
56 syn keyword jovialTypedef TYPE
|
|
57
|
|
58 syn keyword jovialStatement ABORT BEGIN BY BYREF BYRES BYVAL CASE COMPOOL
|
|
59 syn keyword jovialStatement DEF DEFAULT DEFINE ELSE END EXIT FALLTHRU FOR
|
|
60 syn keyword jovialStatement GOTO IF INLINE INSTANCE LABEL LIKE OVERLAY POS
|
|
61 syn keyword jovialStatement PROC PROGRAM REC REF RENT REP RETURN START STOP
|
|
62 syn keyword jovialStatement TERM THEN WHILE
|
|
63
|
|
64 " JOVIAL extensions, see section 8.2.2 in MIL-STD-1589C
|
|
65 syn keyword jovialStatement CONDITION ENCAPSULATION EXPORTS FREE HANDLER IN INTERRUPT NEW
|
|
66 syn keyword jovialStatement PROTECTED READONLY REGISTER SIGNAL TO UPDATE WITH WRITEONLY ZONE
|
|
67
|
|
68 " implementation specific constants and functions, see section 1.4 in MIL-STD-1589C
|
|
69 syn keyword jovialConstant BITSINBYTE BITSINWORD LOCSINWORD
|
|
70 syn keyword jovialConstant BYTESINWORD BITSINPOINTER INTPRECISION
|
|
71 syn keyword jovialConstant FLOATPRECISION FIXEDPRECISION FLOATRADIX
|
|
72 syn keyword jovialConstant MAXFLOATPRECISION MAXFIXEDPRECISION
|
|
73 syn keyword jovialConstant MAXINTSIZE MAXBYTES MAXBITS
|
|
74 syn keyword jovialConstant MAXTABLESIZE MAXSTOP MINSTOP MAXSIGDIGITS
|
|
75 syn keyword jovialFunction BYTEPOS MAXINT MININT
|
|
76 syn keyword jovialFunction IMPLFLOATPRECISION IMPLFIXEDPRECISION IMPLINTSIZE
|
|
77 syn keyword jovialFunction MINSIZE MINFRACTION MINSCALE MINRELPRECISION
|
|
78 syn keyword jovialFunction MAXFLOAT MINFLOAT FLOATRELPRECISION
|
|
79 syn keyword jovialFunction FLOATUNDERFLOW MAXFIXED MINFIXED
|
|
80
|
|
81 " JOVIAL built-in functions
|
|
82 syn keyword jovialFunction LOC NEXT BIT BYTE SHIFTL SHIFTR ABS SGN BITSIZE
|
|
83 syn keyword jovialFunction BYTESIZE WORDSIZE LBOUND UBOUND NWDSEN FIRST
|
|
84 syn keyword jovialFunction LAST NENT
|
|
85
|
|
86 " Define the default highlighting.
|
|
87 hi def link jovialBitConstant Number
|
|
88 hi def link jovialBoolean Boolean
|
|
89 hi def link jovialComment Comment
|
|
90 hi def link jovialConstant Constant
|
|
91 hi def link jovialFloat Float
|
|
92 hi def link jovialFunction Function
|
|
93 " No color highlighting for JOVIAL identifiers. See above,
|
|
94 " this is to prevent confusion with JOVIAL strings
|
|
95 "hi def link jovialIdentifier Identifier
|
|
96 hi def link jovialNumber Number
|
|
97 hi def link jovialOperator Operator
|
|
98 hi def link jovialPreProc PreProc
|
|
99 hi def link jovialStatement Statement
|
|
100 hi def link jovialStorageClass StorageClass
|
|
101 hi def link jovialString String
|
|
102 hi def link jovialStructure Structure
|
|
103 hi def link jovialTodo Todo
|
|
104 hi def link jovialType Type
|
|
105 hi def link jovialTypedef Typedef
|
|
106
|
|
107
|
|
108 let b:current_syntax = "jovial"
|
|
109
|
|
110 " vim: ts=8
|