3 " Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
4 " LastChange: 02 May 2001
5 " Original: Yacc, maintained by Dr. Charles E. Campbell, Jr.
6 " <Charles.Campbell@gsfc.nasa.gov>
7 " Comment: Replaced sourcing c.vim file by ada.vim and rename yacc*
10 " For version 5.x: Clear all syntax items
11 " For version 6.x: Quit when a syntax file was already loaded
14 elseif exists("b:current_syntax")
18 " Read the Ada syntax to start with
20 so <sfile>:p:h/ada.vim
22 runtime! syntax/ada.vim
23 unlet b:current_syntax
27 syn cluster ayaccActionGroup contains=ayaccDelim,cInParen,cTodo,cIncluded,ayaccDelim,ayaccCurlyError,ayaccUnionCurly,ayaccUnion,cUserLabel,cOctalZero,cCppOut2,cCppSkip,cErrInBracket,cErrInParen,cOctalError
28 syn cluster ayaccUnionGroup contains=ayaccKey,cComment,ayaccCurly,cType,cStructure,cStorageClass,ayaccUnionCurly
31 syn match ayaccDelim "^[ \t]*[:|;]"
32 syn match ayaccOper "@\d\+"
34 syn match ayaccKey "^[ \t]*%\(token\|type\|left\|right\|start\|ident\)\>"
35 syn match ayaccKey "[ \t]%\(prec\|expect\|nonassoc\)\>"
36 syn match ayaccKey "\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+"
37 syn keyword ayaccKeyActn yyerrok yyclearin
39 syn match ayaccUnionStart "^%union" skipwhite skipnl nextgroup=ayaccUnion
40 syn region ayaccUnion contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
41 syn region ayaccUnionCurly contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
42 syn match ayaccBrkt contained "[<>]"
43 syn match ayaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=ayaccBrkt
44 syn match ayaccDefinition "^[A-Za-z][A-Za-z0-9_]*[ \t]*:"
46 " special Yacc separators
47 syn match ayaccSectionSep "^[ \t]*%%"
48 syn match ayaccSep "^[ \t]*%{"
49 syn match ayaccSep "^[ \t]*%}"
51 " I'd really like to highlight just the outer {}. Any suggestions???
52 syn match ayaccCurlyError "[{}]"
53 syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup
55 if version >= 508 || !exists("did_ayacc_syntax_inits")
57 let did_ayacc_syntax_inits = 1
58 command -nargs=+ HiLink hi link <args>
60 command -nargs=+ HiLink hi def link <args>
63 " Internal ayacc highlighting links
64 HiLink ayaccBrkt ayaccStmt
65 HiLink ayaccKey ayaccStmt
66 HiLink ayaccOper ayaccStmt
67 HiLink ayaccUnionStart ayaccKey
69 " External ayacc highlighting links
70 HiLink ayaccCurly Delimiter
71 HiLink ayaccCurlyError Error
72 HiLink ayaccDefinition Function
73 HiLink ayaccDelim Function
74 HiLink ayaccKeyActn Special
75 HiLink ayaccSectionSep Todo
76 HiLink ayaccSep Delimiter
77 HiLink ayaccStmt Statement
80 " since Bram doesn't like my Delimiter :|
85 let b:current_syntax = "ayacc"