annotate runtime/syntax/javacc.vim @ 1621:82b5078be2dd

updated for version 7.2a
author vimboss
date Tue, 24 Jun 2008 21:56:24 +0000
parents 3fc0f57ecb91
children aa51675adf7e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: JavaCC, a Java Compiler Compiler written by JavaSoft
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " URL: http://www.fleiner.com/vim/syntax/javacc.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Last Change: 2001 Jun 20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Uses java.vim, and adds a few special things for JavaCC Parser files.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " Those files usually have the extension *.jj
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " source the java.vim file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 source <sfile>:p:h/java.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 runtime! syntax/java.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 unlet b:current_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 "remove catching errors caused by wrong parenthesis (does not work in javacc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 "files) (first define them in case they have not been defined in java)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match javaParen "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match javaParenError "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match javaInParen "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match javaError2 "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn clear javaParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn clear javaParenError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn clear javaInParen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn clear javaError2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " remove function definitions (they look different) (first define in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " in case it was not defined in java.vim)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 "syn match javaFuncDef "--"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn clear javaFuncDef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match javaFuncDef "[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)[ \t]*:" contains=javaType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword javaccPackages options DEBUG_PARSER DEBUG_LOOKAHEAD DEBUG_TOKEN_MANAGER
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword javaccPackages COMMON_TOKEN_ACTION IGNORE_CASE CHOICE_AMBIGUITY_CHECK
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn keyword javaccPackages OTHER_AMBIGUITY_CHECK STATIC LOOKAHEAD ERROR_REPORTING
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn keyword javaccPackages USER_TOKEN_MANAGER USER_CHAR_STREAM JAVA_UNICODE_ESCAPE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword javaccPackages UNICODE_INPUT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match javaccPackages "PARSER_END([^)]*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match javaccPackages "PARSER_BEGIN([^)]*)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match javaccSpecToken "<EOF>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " the dot is necessary as otherwise it will be matched as a keyword.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match javaccSpecToken ".LOOKAHEAD("ms=s+1,me=e-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match javaccToken "<[^> \t]*>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn keyword javaccActionToken TOKEN SKIP MORE SPECIAL_TOKEN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn keyword javaccError DEBUG IGNORE_IN_BNF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 if version >= 508 || !exists("did_css_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 let did_css_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 HiLink javaccSpecToken Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 HiLink javaccActionToken Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink javaccPackages javaScopeDecl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink javaccToken String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 HiLink javaccError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 let b:current_syntax = "javacc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 " vim: ts=8