docs: public final EObject ruleSarlScript() throws RecognitionException {
          EObject current = null;
  
          Token otherlv_1=null;
          Token otherlv_3=null;
          AntlrDatatypeRuleToken lv_package_2_0 = null;
  
          EObject lv_importSection_4_0 = null;
  
          EObject lv_xtendTypes_5_0 = null;
  
  
  
          	enterRule();
  
          try {
              // InternalSARL.g:97:2: ( ( () (otherlv_1= 'package' ( (lv_package_2_0= ruleQualifiedName ) ) (otherlv_3= ';' )? )? ( (lv_importSection_4_0= ruleXImportSection ) )? ( (lv_xtendTypes_5_0= ruleType ) )* ) )
              // InternalSARL.g:98:2: ( () (otherlv_1= 'package' ( (lv_package_2_0= ruleQualifiedName ) ) (otherlv_3= ';' )? )? ( (lv_importSection_4_0= ruleXImportSection ) )? ( (lv_xtendTypes_5_0= ruleType ) )* )
              {
              // InternalSARL.g:98:2: ( () (otherlv_1= 'package' ( (lv_package_2_0= ruleQualifiedName ) ) (otherlv_3= ';' )? )? ( (lv_importSection_4_0= ruleXImportSection ) )? ( (lv_xtendTypes_5_0= ruleType ) )* )
              // InternalSARL.g:99:3: () (otherlv_1= 'package' ( (lv_package_2_0= ruleQualifiedName ) ) (otherlv_3= ';' )? )? ( (lv_importSection_4_0= ruleXImportSection ) )? ( (lv_xtendTypes_5_0= ruleType ) )*
              {
              // InternalSARL.g:99:3: ()
              // InternalSARL.g:100:4: 
              {
              if ( state.backtracking==0 ) {
  
                				current = forceCreateModelElement(
                					grammarAccess.getSarlScriptAccess().getSarlScriptAction_0(),
                					current);
                			
              }
  
              }
  
              // InternalSARL.g:106:3: (otherlv_1= 'package' ( (lv_package_2_0= ruleQualifiedName ) ) (otherlv_3= ';' )? )?
              int alt2=2;
              int LA2_0 = input.LA(1);
  
              if ( (LA2_0==25) ) {
                  int LA2_1 = input.LA(2);
  
                  if ( (LA2_1==44) ) {
                      int LA2_3 = input.LA(3);
  
                      if ( (LA2_3==44) ) {
                          int LA2_5 = input.LA(4);
  
                          if ( (LA2_5==RULE_ID||LA2_5==44||(LA2_5>=92 && LA2_5<=95)) ) {
                              alt2=1;
                          }
                      }
                      else if ( (LA2_3==EOF||(LA2_3>=25 && LA2_3<=27)||LA2_3==31||(LA2_3>=33 && LA2_3<=35)||(LA2_3>=37 && LA2_3<=39)||(LA2_3>=42 && LA2_3<=43)||(LA2_3>=77 && LA2_3<=89)||LA2_3==96||LA2_3==105) ) {
                          alt2=1;
                      }
                  }
                  else if ( (LA2_1==RULE_ID||(LA2_1>=92 && LA2_1<=95)) ) {
                      alt2=1;
                  }
              }
              switch (alt2) {
                  case 1 :
                      // InternalSARL.g:107:4: otherlv_1= 'package' ( (lv_package_2_0= ruleQualifiedName ) ) (otherlv_3= ';' )?
                      {
                      otherlv_1=(Token)match(input,25,FOLLOW_3); if (state.failed) return current;
                      if ( state.backtracking==0 ) {
  
                        				newLeafNode(otherlv_1, grammarAccess.getSarlScriptAccess().getPackageKeyword_1_0());
                        			
                      }
                      // InternalSARL.g:111:4: ( (lv_package_2_0= ruleQualifiedName ) )
                      // InternalSARL.g:112:5: (lv_package_2_0= ruleQualifiedName )
                      {
                      // InternalSARL.g:112:5: (lv_package_2_0= ruleQualifiedName )
                      // InternalSARL.g:113:6: lv_package_2_0= ruleQualifiedName
                      {
                      if ( state.backtracking==0 ) {
  
                        						newCompositeNode(grammarAccess.getSarlScriptAccess().getPackageQualifiedNameParserRuleCall_1_1_0());
                        					
                      }
                      pushFollow(FOLLOW_4);
                      lv_package_2_0=ruleQualifiedName();
  
                      state._fsp--;
                      if (state.failed) return current;
                      if ( state.backtracking==0 ) {
  
                        						if (current==null) {
                        							current = createModelElementForParent(grammarAccess.getSarlScriptRule());
                        						}
                        						set(
                        							current,
                        							"package",
                        							lv_package_2_0,
                        							"org.eclipse.xtext.xbase.Xbase.QualifiedName");
                        						afterParserOrEnumRuleCall();
                        					
                      }
  
                      }
  
  
                      }
  
                      // InternalSARL.g:130:4: (otherlv_3= ';' )?
                      int alt1=2;
                      int LA1_0 = input.LA(1);
  
                      if ( (LA1_0==26) ) {
                          alt1=1;
                      }
                      switch (alt1) {
                          case 1 :
                              // InternalSARL.g:131:5: otherlv_3= ';'
                              {
                              otherlv_3=(Token)match(input,26,FOLLOW_5); if (state.failed) return current;
                              if ( state.backtracking==0 ) {
  
                                					newLeafNode(otherlv_3, grammarAccess.getSarlScriptAccess().getSemicolonKeyword_1_2());
                                				
                              }
  
                              }
                              break;
  
                      }
  
  
                      }
                      break;
  
              }
  
              // InternalSARL.g:137:3: ( (lv_importSection_4_0= ruleXImportSection ) )?
              int alt3=2;
              int LA3_0 = input.LA(1);
  
              if ( (LA3_0==96) ) {
                  alt3=1;
              }
              switch (alt3) {
                  case 1 :
                      // InternalSARL.g:138:4: (lv_importSection_4_0= ruleXImportSection )
                      {
                      // InternalSARL.g:138:4: (lv_importSection_4_0= ruleXImportSection )
                      // InternalSARL.g:139:5: lv_importSection_4_0= ruleXImportSection
                      {
                      if ( state.backtracking==0 ) {
  
                        					newCompositeNode(grammarAccess.getSarlScriptAccess().getImportSectionXImportSectionParserRuleCall_2_0());
                        				
                      }
                      pushFollow(FOLLOW_6);
                      lv_importSection_4_0=ruleXImportSection();
  
                      state._fsp--;
                      if (state.failed) return current;
                      if ( state.backtracking==0 ) {
  
                        					if (current==null) {
                        						current = createModelElementForParent(grammarAccess.getSarlScriptRule());
                        					}
                        					set(
                        						current,
                        						"importSection",
                        						lv_importSection_4_0,
                        						"org.eclipse.xtext.xbase.Xtype.XImportSection");
                        					afterParserOrEnumRuleCall();
                        				
                      }
  
                      }
  
  
                      }
                      break;
  
              }
  
              // InternalSARL.g:156:3: ( (lv_xtendTypes_5_0= ruleType ) )*
              loop4:
              do {
                  int alt4=2;
                  int LA4_0 = input.LA(1);
  
                  if ( (LA4_0==25||LA4_0==27||LA4_0==31||(LA4_0>=33 && LA4_0<=35)||(LA4_0>=37 && LA4_0<=39)||(LA4_0>=42 && LA4_0<=44)||(LA4_0>=78 && LA4_0<=89)||LA4_0==105) ) {
                      alt4=1;
                  }
  
  
                  switch (alt4) {
              	case 1 :
              	    // InternalSARL.g:157:4: (lv_xtendTypes_5_0= ruleType )
              	    {
              	    // InternalSARL.g:157:4: (lv_xtendTypes_5_0= ruleType )
              	    // InternalSARL.g:158:5: lv_xtendTypes_5_0= ruleType
              	    {
              	    if ( state.backtracking==0 ) {
  
              	      					newCompositeNode(grammarAccess.getSarlScriptAccess().getXtendTypesTypeParserRuleCall_3_0());
              	      				
              	    }
              	    pushFollow(FOLLOW_6);
              	    lv_xtendTypes_5_0=ruleType();
  
              	    state._fsp--;
              	    if (state.failed) return current;
              	    if ( state.backtracking==0 ) {
  
              	      					if (current==null) {
              	      						current = createModelElementForParent(grammarAccess.getSarlScriptRule());
              	      					}
              	      					add(
              	      						current,
              	      						"xtendTypes",
              	      						lv_xtendTypes_5_0,
              	      						"io.sarl.lang.SARL.Type");
              	      					afterParserOrEnumRuleCall();
              	      				
              	    }
  
              	    }
  
  
              	    }
              	    break;
  
              	default :
              	    break loop4;
                  }
              } while (true);
  
  
              }
  
  
              }
  
              if ( state.backtracking==0 ) {
  
                	leaveRule();
  
              }
          }
  
              catch (RecognitionException re) {
                  recover(input,re);
                  appendSkippedTokens();
              }
          finally {
          }
          return current;
      }