3 " Language: AfLex (from Lex syntax file)
4 " Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
5 " LastChange: 02 May 2001
6 " Original: Lex, maintained by Dr. Charles E. Campbell, Jr.
7 " <Charles.Campbell@gsfc.nasa.gov>
8 " Comment: Replaced sourcing c.vim file by ada.vim and rename lex*
11 " For version 5.x: Clear all syntax items
12 " For version 6.x: Quit when a syntax file was already loaded
15 elseif exists("b:current_syntax")
19 " Read the Ada syntax to start with
21 so <sfile>:p:h/ada.vim
23 runtime! syntax/ada.vim
24 unlet b:current_syntax
30 "I'd prefer to use aflex.* , but it doesn't handle forward definitions yet
31 syn cluster aflexListGroup contains=aflexAbbrvBlock,aflexAbbrv,aflexAbbrv,aflexAbbrvRegExp,aflexInclude,aflexPatBlock,aflexPat,aflexBrace,aflexPatString,aflexPatTag,aflexPatTag,aflexPatComment,aflexPatCodeLine,aflexMorePat,aflexPatSep,aflexSlashQuote,aflexPatCode,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2
32 syn cluster aflexListPatCodeGroup contains=aflexAbbrvBlock,aflexAbbrv,aflexAbbrv,aflexAbbrvRegExp,aflexInclude,aflexPatBlock,aflexPat,aflexBrace,aflexPatTag,aflexPatTag,aflexPatComment,aflexPatCodeLine,aflexMorePat,aflexPatSep,aflexSlashQuote,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2
34 " Abbreviations Section
35 syn region aflexAbbrvBlock start="^\([a-zA-Z_]\+\t\|%{\)" end="^%%$"me=e-2 skipnl nextgroup=aflexPatBlock contains=aflexAbbrv,aflexInclude,aflexAbbrvComment
36 syn match aflexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=aflexAbbrvRegExp
37 syn match aflexAbbrv "^%[sx]" contained
38 syn match aflexAbbrvRegExp "\s\S.*$"lc=1 contained nextgroup=aflexAbbrv,aflexInclude
39 syn region aflexInclude matchgroup=aflexSep start="^%{" end="%}" contained contains=ALLBUT,@aflexListGroup
40 syn region aflexAbbrvComment start="^\s\+/\*" end="\*/"
42 "%% : Patterns {Actions}
43 syn region aflexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite contains=aflexPat,aflexPatTag,aflexPatComment
44 syn region aflexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 contained nextgroup=aflexMorePat,aflexPatSep contains=aflexPatString,aflexSlashQuote,aflexBrace
45 syn region aflexBrace start="\[" skip=+\\\\\|\\+ end="]" contained
46 syn region aflexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained
47 syn match aflexPatTag "^<\I\i*\(,\I\i*\)*>*" contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
48 syn match aflexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
49 syn region aflexPatComment start="^\s*/\*" end="\*/" skipnl contained contains=cTodo nextgroup=aflexPatComment,aflexPat,aflexPatString,aflexPatTag
50 syn match aflexPatCodeLine ".*$" contained contains=ALLBUT,@aflexListGroup
51 syn match aflexMorePat "\s*|\s*$" skipnl contained nextgroup=aflexPat,aflexPatTag,aflexPatComment
52 syn match aflexPatSep "\s\+" contained nextgroup=aflexMorePat,aflexPatCode,aflexPatCodeLine
53 syn match aflexSlashQuote +\(\\\\\)*\\"+ contained
54 syn region aflexPatCode matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" skipnl contained contains=ALLBUT,@aflexListPatCodeGroup
56 syn keyword aflexCFunctions BEGIN input unput woutput yyleng yylook yytext
57 syn keyword aflexCFunctions ECHO output winput wunput yyless yymore yywrap
59 " <c.vim> includes several ALLBUTs; these have to be treated so as to exclude aflex* groups
60 syn cluster cParenGroup add=aflex.*
61 syn cluster cDefineGroup add=aflex.*
62 syn cluster cPreProcGroup add=aflex.*
63 syn cluster cMultiGroup add=aflex.*
68 syn sync match aflexSyncPat grouphere aflexPatBlock "^%[a-zA-Z]"
69 syn sync match aflexSyncPat groupthere aflexPatBlock "^<$"
70 syn sync match aflexSyncPat groupthere aflexPatBlock "^%%$"
72 " Define the default highlighting.
73 " For version 5.7 and earlier: only when not done already
74 " For version 5.8 and later: only when an item doesn't have highlighting yet
76 if version >= 508 || !exists("did_aflex_syntax_inits")
78 let did_aflex_syntax_inits = 1
79 command -nargs=+ HiLink hi link <args>
81 command -nargs=+ HiLink hi def link <args>
83 HiLink aflexSlashQuote aflexPat
84 HiLink aflexBrace aflexPat
85 HiLink aflexAbbrvComment aflexPatComment
87 HiLink aflexAbbrv SpecialChar
88 HiLink aflexAbbrvRegExp Macro
89 HiLink aflexCFunctions Function
90 HiLink aflexMorePat SpecialChar
91 HiLink aflexPat Function
92 HiLink aflexPatComment Comment
93 HiLink aflexPatString Function
94 HiLink aflexPatTag Special
95 HiLink aflexSep Delimiter
99 let b:current_syntax = "aflex"