docs: public final void compilationUnit() throws RecognitionException {
  		int compilationUnit_StartIndex = input.index();
  
  		try {
  			if ( state.backtracking>0 && alreadyParsedRule(input, 1) ) { return; }
  
  			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:270:5: ( ( annotations )? ( packageDeclaration )? ( importDeclaration )* ( typeDeclaration )* )
  			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:270:7: ( annotations )? ( packageDeclaration )? ( importDeclaration )* ( typeDeclaration )*
  			{
  			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:270:7: ( annotations )?
  			int alt1=2;
  			int LA1_0 = input.LA(1);
  			if ( (LA1_0==58) ) {
  				int LA1_1 = input.LA(2);
  				if ( (LA1_1==Identifier) ) {
  					int LA1_21 = input.LA(3);
  					if ( (synpred1_Java()) ) {
  						alt1=1;
  					}
  				}
  			}
  			switch (alt1) {
  				case 1 :
  					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:270:7: annotations
  					{
  					pushFollow(FOLLOW_annotations_in_compilationUnit81);
  					annotations();
  					state._fsp--;
  					if (state.failed) return;
  					}
  					break;
  
  			}
  
  			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:271:9: ( packageDeclaration )?
  			int alt2=2;
  			int LA2_0 = input.LA(1);
  			if ( (LA2_0==99) ) {
  				alt2=1;
  			}
  			switch (alt2) {
  				case 1 :
  					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:271:9: packageDeclaration
  					{
  					pushFollow(FOLLOW_packageDeclaration_in_compilationUnit92);
  					packageDeclaration();
  					state._fsp--;
  					if (state.failed) return;
  					}
  					break;
  
  			}
  
  			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:272:9: ( importDeclaration )*
  			loop3:
  			while (true) {
  				int alt3=2;
  				int LA3_0 = input.LA(1);
  				if ( (LA3_0==89) ) {
  					alt3=1;
  				}
  
  				switch (alt3) {
  				case 1 :
  					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:272:9: importDeclaration
  					{
  					pushFollow(FOLLOW_importDeclaration_in_compilationUnit103);
  					importDeclaration();
  					state._fsp--;
  					if (state.failed) return;
  					}
  					break;
  
  				default :
  					break loop3;
  				}
  			}
  
  			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:273:9: ( typeDeclaration )*
  			loop4:
  			while (true) {
  				int alt4=2;
  				int LA4_0 = input.LA(1);
  				if ( (LA4_0==ENUM||LA4_0==52||LA4_0==58||LA4_0==63||LA4_0==72||LA4_0==83||LA4_0==93||LA4_0==96||(LA4_0 >= 100 && LA4_0 <= 102)||(LA4_0 >= 106 && LA4_0 <= 107)||LA4_0==110||LA4_0==114||LA4_0==119) ) {
  					alt4=1;
  				}
  
  				switch (alt4) {
  				case 1 :
  					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:273:9: typeDeclaration
  					{
  					pushFollow(FOLLOW_typeDeclaration_in_compilationUnit114);
  					typeDeclaration();
  					state._fsp--;
  					if (state.failed) return;
  					}
  					break;
  
  				default :
  					break loop4;
  				}
  			}
  
  			}
  
  		}
  		catch (RecognitionException re) {
  			reportError(re);
  			recover(input,re);
  		}
  		finally {
  			// do for sure before leaving
  			if ( state.backtracking>0 ) { memoize(input, 1, compilationUnit_StartIndex); }
  
  		}
  	}