You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.5 KiB

  1. " Vim syntax file
  2. " Language: EBNF
  3. " Maintainer: Hans Fugal
  4. " Last Change: $Date: 2003/01/28 14:42:09 $
  5. " Version: $Id: ebnf.vim,v 1.1 2003/01/28 14:42:09 fugalh Exp $
  6. " With thanks to Michael Brailsford for the BNF syntax file.
  7. " Quit when a syntax file was already loaded
  8. if version < 600
  9. syntax clear
  10. elseif exists("b:current_syntax")
  11. finish
  12. endif
  13. syn match ebnfMetaIdentifier /[A-Za-z]/ skipwhite skipempty nextgroup=ebnfSeperator
  14. syn match ebnfSeperator "=" contained nextgroup=ebnfProduction skipwhite skipempty
  15. syn region ebnfProduction start=/\zs[^\.;]/ end=/[\.;]/me=e-1 contained contains=ebnfSpecial,ebnfDelimiter,ebnfTerminal,ebnfSpecialSequence,ebnfComment nextgroup=ebnfEndProduction skipwhite skipempty
  16. syn match ebnfDelimiter #[,(|)\]}\[{/!]\|\(\*)\)\|\((\*\)\|\(/)\)\|\(:)\)\|\((/\)\|\((:\)# contained
  17. syn match ebnfSpecial /[\-\*]/ contained
  18. syn region ebnfSpecialSequence matchgroup=Delimiter start=/?/ end=/?/ contained
  19. syn match ebnfEndProduction /[\.;]/ contained
  20. syn region ebnfTerminal matchgroup=delimiter start=/"/ end=/"/ contained
  21. syn region ebnfTerminal matchgroup=delimiter start=/'/ end=/'/ contained
  22. syn region ebnfComment start="(\*" end="\*)"
  23. hi link ebnfComment Comment
  24. hi link ebnfMetaIdentifier Identifier
  25. hi link ebnfSeperator ebnfSpecial
  26. hi link ebnfEndProduction ebnfDelimiter
  27. hi link ebnfDelimiter Delimiter
  28. hi link ebnfSpecial Special
  29. hi link ebnfSpecialSequence Statement
  30. hi link ebnfTerminal Constant