" Yacc syntax file
"  Language:	Yacc
"  Maintainer:  Dr Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
"  Last change:	1997 May 14

" Remove any old syntax stuff hanging around
syntax clear

" Read the C syntax to start with
source <sfile>:p:h/c.vim

" Yacc stuff
syntax match  yaccKey	"^[ \t]*%\(token\|type\|union\|left\|right\|start\|ident\)\>"
syntax match  yaccKey	"[ \t]%\(prec\|expect\|nonassoc\)\>"
syntax match  yaccKey	"\$<[a-zA-Z_][a-zA-Z_0-9]*>[\$0-9]"

syntax match  yaccSep	"^[ \t]*%%"
syntax match  yaccSep	"^[ \t]*%{"
syntax match  yaccSep	"^[ \t]*%}"
syntax region yaccUnion	start="%union[ \t]\+" end="}" contains yaccKey yaccComment
syntax match  yaccBrkt	contained "[<>]"
syntax match  yaccType	"<[a-zA-Z_][a-zA-Z0-9_]*>" contains yaccBrkt

syntax match  yaccOper	"[$|;:]"
syntax match  yaccOper	"@[0-9]\+"

" I'd really like to highlight just the outer {}.  Any suggestions???
syntax match  yaccBrace	"[{}]"

if !exists("did_yacc_syntax_inits")
  let did_yacc_syntax_inits = 1

  " YaccStmt allows simple yacc highlighting changes
  highlight link YaccStmt	Statement

  " since Bram doesn't like my Delimiter :|
  highlight link Delimiter	Type

  " The default methods for highlighting.  Can be overridden later
  highlight link yaccBrace	YaccStmt
  highlight link yaccBrkt	YaccStmt
  highlight link yaccInclude	Delimiter
  highlight link yaccKey	YaccStmt
  highlight link yaccOper	YaccStmt
  highlight link yaccSep	Delimiter
  highlight link yaccType	Type
endif
" vim: ts=15
