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