| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim syntax file | 
					
						
							|  |  |  | " Language:	JavaCC, a Java Compiler Compiler written by JavaSoft | 
					
						
							|  |  |  | " Maintainer:	Claudio Fleiner <claudio@fleiner.com> | 
					
						
							|  |  |  | " URL:		http://www.fleiner.com/vim/syntax/javacc.vim | 
					
						
							| 
									
										
										
										
											2012-10-05 22:26:30 +02:00
										 |  |  | " Last Change:	2012 Oct 05 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Uses java.vim, and adds a few special things for JavaCC Parser files. | 
					
						
							|  |  |  | " Those files usually have the extension  *.jj | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " quit when a syntax file was already loaded | 
					
						
							|  |  |  | if exists("b:current_syntax") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-05 22:26:30 +02:00
										 |  |  | let s:cpo_save = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " source the java.vim file | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | runtime! syntax/java.vim | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | unlet b:current_syntax | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | "remove catching errors caused by wrong parenthesis (does not work in javacc | 
					
						
							|  |  |  | "files) (first define them in case they have not been defined in java) | 
					
						
							|  |  |  | syn match	javaParen "--" | 
					
						
							|  |  |  | syn match	javaParenError "--" | 
					
						
							|  |  |  | syn match	javaInParen "--" | 
					
						
							|  |  |  | syn match	javaError2 "--" | 
					
						
							|  |  |  | syn clear	javaParen | 
					
						
							|  |  |  | syn clear	javaParenError | 
					
						
							|  |  |  | syn clear	javaInParen | 
					
						
							|  |  |  | syn clear	javaError2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " remove function definitions (they look different) (first define in | 
					
						
							|  |  |  | " in case it was not defined in java.vim) | 
					
						
							|  |  |  | "syn match javaFuncDef "--" | 
					
						
							|  |  |  | syn clear javaFuncDef | 
					
						
							|  |  |  | syn match javaFuncDef "[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)[ \t]*:" contains=javaType | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | syn keyword javaccPackages options DEBUG_PARSER DEBUG_LOOKAHEAD DEBUG_TOKEN_MANAGER | 
					
						
							|  |  |  | syn keyword javaccPackages COMMON_TOKEN_ACTION IGNORE_CASE CHOICE_AMBIGUITY_CHECK | 
					
						
							|  |  |  | syn keyword javaccPackages OTHER_AMBIGUITY_CHECK STATIC LOOKAHEAD ERROR_REPORTING | 
					
						
							|  |  |  | syn keyword javaccPackages USER_TOKEN_MANAGER  USER_CHAR_STREAM JAVA_UNICODE_ESCAPE | 
					
						
							| 
									
										
										
										
											2012-10-05 22:26:30 +02:00
										 |  |  | syn keyword javaccPackages UNICODE_INPUT JDK_VERSION | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | syn match javaccPackages "PARSER_END([^)]*)" | 
					
						
							|  |  |  | syn match javaccPackages "PARSER_BEGIN([^)]*)" | 
					
						
							|  |  |  | syn match javaccSpecToken "<EOF>" | 
					
						
							|  |  |  | " the dot is necessary as otherwise it will be matched as a keyword. | 
					
						
							|  |  |  | syn match javaccSpecToken ".LOOKAHEAD("ms=s+1,me=e-1 | 
					
						
							|  |  |  | syn match javaccToken "<[^> \t]*>" | 
					
						
							|  |  |  | syn keyword javaccActionToken TOKEN SKIP MORE SPECIAL_TOKEN | 
					
						
							|  |  |  | syn keyword javaccError DEBUG IGNORE_IN_BNF | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Define the default highlighting. | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Only when an item doesn't have highlighting yet | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  | hi def link javaccSpecToken Statement | 
					
						
							|  |  |  | hi def link javaccActionToken Type | 
					
						
							|  |  |  | hi def link javaccPackages javaScopeDecl | 
					
						
							|  |  |  | hi def link javaccToken String | 
					
						
							|  |  |  | hi def link javaccError Error | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | let b:current_syntax = "javacc" | 
					
						
							| 
									
										
										
										
											2012-10-05 22:26:30 +02:00
										 |  |  | let &cpo = s:cpo_save | 
					
						
							|  |  |  | unlet s:cpo_save | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " vim: ts=8 |