InternalXbase.g:1925:1: ruleQualifiedNameInStaticImport : ( ( ( rule__QualifiedNameInStaticImport__Group__0 ) ) ( ( rule__QualifiedNameInStaticImport__Group__0 )* ) ) ;
184715
public final void ruleQualifiedNameInStaticImport() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:1929:2: ( ( ( ( rule__QualifiedNameInStaticImport__Group__0 ) ) ( ( rule__QualifiedNameInStaticImport__Group__0 )* ) ) )
            // InternalXbase.g:1930:2: ( ( ( rule__QualifiedNameInStaticImport__Group__0 ) ) ( ( rule__QualifiedNameInStaticImport__Group__0 )* ) )
            {
            // InternalXbase.g:1930:2: ( ( ( rule__QualifiedNameInStaticImport__Group__0 ) ) ( ( rule__QualifiedNameInStaticImport__Group__0 )* ) )
            // InternalXbase.g:1931:3: ( ( rule__QualifiedNameInStaticImport__Group__0 ) ) ( ( rule__QualifiedNameInStaticImport__Group__0 )* )
            {
            // InternalXbase.g:1931:3: ( ( rule__QualifiedNameInStaticImport__Group__0 ) )
            // InternalXbase.g:1932:4: ( rule__QualifiedNameInStaticImport__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getQualifiedNameInStaticImportAccess().getGroup()); 
            }
            // InternalXbase.g:1933:4: ( rule__QualifiedNameInStaticImport__Group__0 )
            // InternalXbase.g:1933:5: rule__QualifiedNameInStaticImport__Group__0
            {
            pushFollow(FOLLOW_3);
            rule__QualifiedNameInStaticImport__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getQualifiedNameInStaticImportAccess().getGroup()); 
            }

            }

            // InternalXbase.g:1936:3: ( ( rule__QualifiedNameInStaticImport__Group__0 )* )
            // InternalXbase.g:1937:4: ( rule__QualifiedNameInStaticImport__Group__0 )*
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getQualifiedNameInStaticImportAccess().getGroup()); 
            }
            // InternalXbase.g:1938:4: ( rule__QualifiedNameInStaticImport__Group__0 )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==RULE_ID) ) {
                    int LA1_2 = input.LA(2);

                    if ( (LA1_2==43) ) {
                        alt1=1;
                    }


                }


                switch (alt1) {
            	case 1 :
            	    // InternalXbase.g:1938:5: rule__QualifiedNameInStaticImport__Group__0
            	    {
            	    pushFollow(FOLLOW_3);
            	    rule__QualifiedNameInStaticImport__Group__0();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);

            if ( state.backtracking==0 ) {
               after(grammarAccess.getQualifiedNameInStaticImportAccess().getGroup()); 
            }

            }


            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
732315
private void computeQualifiedName() {
    if (parent != null) {
      qualifiedName = parent.qualifiedName + "." + field.getName();
    } else {
      qualifiedName = field.getName();
    }
  }
944146
public final void synpred2_InternalXbaseWithAnnotations_fragment() throws RecognitionException {   
        // InternalXbaseWithAnnotations.g:2077:2: ( ( ( rule__XAnnotation__Group_3_1_0__0 ) ) )
        // InternalXbaseWithAnnotations.g:2077:2: ( ( rule__XAnnotation__Group_3_1_0__0 ) )
        {
        // InternalXbaseWithAnnotations.g:2077:2: ( ( rule__XAnnotation__Group_3_1_0__0 ) )
        // InternalXbaseWithAnnotations.g:2078:3: ( rule__XAnnotation__Group_3_1_0__0 )
        {
        if ( state.backtracking==0 ) {
           before(grammarAccess.getXAnnotationAccess().getGroup_3_1_0()); 
        }
        // InternalXbaseWithAnnotations.g:2079:3: ( rule__XAnnotation__Group_3_1_0__0 )
        // InternalXbaseWithAnnotations.g:2079:4: rule__XAnnotation__Group_3_1_0__0
        {
        pushFollow(FOLLOW_2);
        rule__XAnnotation__Group_3_1_0__0();

        state._fsp--;
        if (state.failed) return ;

        }


        }


        }
    }
632138
public final boolean isQualifiedName() {
    switch (this.getToken()) {
      case NAME:
        return !getString().isEmpty();
      case THIS:
      case SUPER:
        return true;
      case GETPROP:
        return getFirstChild().isQualifiedName();

      case MEMBER_FUNCTION_DEF:
        // These are explicitly *not* qualified name components.
      default:
        return false;
    }
  }
360391
public final void ruleXSwitchExpression() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:921:2: ( ( ( rule__XSwitchExpression__Group__0 ) ) )
            // InternalXbase.g:922:2: ( ( rule__XSwitchExpression__Group__0 ) )
            {
            // InternalXbase.g:922:2: ( ( rule__XSwitchExpression__Group__0 ) )
            // InternalXbase.g:923:3: ( rule__XSwitchExpression__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXSwitchExpressionAccess().getGroup()); 
            }
            // InternalXbase.g:924:3: ( rule__XSwitchExpression__Group__0 )
            // InternalXbase.g:924:4: rule__XSwitchExpression__Group__0
            {
            pushFollow(FOLLOW_2);
            rule__XSwitchExpression__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getXSwitchExpressionAccess().getGroup()); 
            }

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
1008323
public final void synpred25_InternalXbase_fragment() throws RecognitionException {   
        // InternalXbase.g:2195:2: ( ( ( rule__OpOther__Group_6_1_0__0 ) ) )
        // InternalXbase.g:2195:2: ( ( rule__OpOther__Group_6_1_0__0 ) )
        {
        // InternalXbase.g:2195:2: ( ( rule__OpOther__Group_6_1_0__0 ) )
        // InternalXbase.g:2196:3: ( rule__OpOther__Group_6_1_0__0 )
        {
        if ( state.backtracking==0 ) {
           before(grammarAccess.getOpOtherAccess().getGroup_6_1_0()); 
        }
        // InternalXbase.g:2197:3: ( rule__OpOther__Group_6_1_0__0 )
        // InternalXbase.g:2197:4: rule__OpOther__Group_6_1_0__0
        {
        pushFollow(FOLLOW_2);
        rule__OpOther__Group_6_1_0__0();

        state._fsp--;
        if (state.failed) return ;

        }


        }


        }
    }
1107607
private static void qualifiedNameFix(
      final SuggestedFix.Builder fix, final Symbol owner, VisitorState state) {
    fix.addImport(owner.getQualifiedName().toString());
    final JCCompilationUnit unit = (JCCompilationUnit) state.getPath().getCompilationUnit();
    new TreePathScanner<Void, Void>() {
      @Override
      public Void visitIdentifier(IdentifierTree tree, Void unused) {
        Symbol sym = ASTHelpers.getSymbol(tree);
        if (sym == null) {
          return null;
        }
        Tree parent = getCurrentPath().getParentPath().getLeaf();
        if (parent.getKind() == Tree.Kind.CASE
            && ((CaseTree) parent).getExpression().equals(tree)
            && sym.owner.getKind() == ElementKind.ENUM) {
          // switch cases can refer to enum constants by simple name without importing them
          return null;
        }
        if (sym.owner.equals(owner) && unit.starImportScope.includes(sym)) {
          fix.prefixWith(tree, owner.getSimpleName() + ".");
        }
        return null;
      }
    }.scan(unit, null);
  }
542484
public final void ruleXDoWhileExpression() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:1046:2: ( ( ( rule__XDoWhileExpression__Group__0 ) ) )
            // InternalXbase.g:1047:2: ( ( rule__XDoWhileExpression__Group__0 ) )
            {
            // InternalXbase.g:1047:2: ( ( rule__XDoWhileExpression__Group__0 ) )
            // InternalXbase.g:1048:3: ( rule__XDoWhileExpression__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getXDoWhileExpressionAccess().getGroup()); 
            }
            // InternalXbase.g:1049:3: ( rule__XDoWhileExpression__Group__0 )
            // InternalXbase.g:1049:4: rule__XDoWhileExpression__Group__0
            {
            pushFollow(FOLLOW_2);
            rule__XDoWhileExpression__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getXDoWhileExpressionAccess().getGroup()); 
            }

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
1009021
public final AntlrDatatypeRuleToken ruleQualifiedName() throws RecognitionException {
        AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();

        Token kw=null;
        AntlrDatatypeRuleToken this_ValidID_0 = null;

        AntlrDatatypeRuleToken this_ValidID_2 = null;



        	enterRule();

        try {
            // InternalSARL.g:15753:2: ( (this_ValidID_0= ruleValidID ( ( ( '.' )=>kw= '.' ) this_ValidID_2= ruleValidID )* ) )
            // InternalSARL.g:15754:2: (this_ValidID_0= ruleValidID ( ( ( '.' )=>kw= '.' ) this_ValidID_2= ruleValidID )* )
            {
            // InternalSARL.g:15754:2: (this_ValidID_0= ruleValidID ( ( ( '.' )=>kw= '.' ) this_ValidID_2= ruleValidID )* )
            // InternalSARL.g:15755:3: this_ValidID_0= ruleValidID ( ( ( '.' )=>kw= '.' ) this_ValidID_2= ruleValidID )*
            {
            if ( state.backtracking==0 ) {

              			newCompositeNode(grammarAccess.getQualifiedNameAccess().getValidIDParserRuleCall_0());
              		
            }
            pushFollow(FOLLOW_93);
            this_ValidID_0=ruleValidID();

            state._fsp--;
            if (state.failed) return current;
            if ( state.backtracking==0 ) {

              			current.merge(this_ValidID_0);
              		
            }
            if ( state.backtracking==0 ) {

              			afterParserOrEnumRuleCall();
              		
            }
            // InternalSARL.g:15765:3: ( ( ( '.' )=>kw= '.' ) this_ValidID_2= ruleValidID )*
            loop360:
            do {
                int alt360=2;
                alt360 = dfa360.predict(input);
                switch (alt360) {
            	case 1 :
            	    // InternalSARL.g:15766:4: ( ( '.' )=>kw= '.' ) this_ValidID_2= ruleValidID
            	    {
            	    // InternalSARL.g:15766:4: ( ( '.' )=>kw= '.' )
            	    // InternalSARL.g:15767:5: ( '.' )=>kw= '.'
            	    {
            	    kw=(Token)match(input,77,FOLLOW_3); if (state.failed) return current;
            	    if ( state.backtracking==0 ) {

            	      					current.merge(kw);
            	      					newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getFullStopKeyword_1_0());
            	      				
            	    }

            	    }

            	    if ( state.backtracking==0 ) {

            	      				newCompositeNode(grammarAccess.getQualifiedNameAccess().getValidIDParserRuleCall_1_1());
            	      			
            	    }
            	    pushFollow(FOLLOW_93);
            	    this_ValidID_2=ruleValidID();

            	    state._fsp--;
            	    if (state.failed) return current;
            	    if ( state.backtracking==0 ) {

            	      				current.merge(this_ValidID_2);
            	      			
            	    }
            	    if ( state.backtracking==0 ) {

            	      				afterParserOrEnumRuleCall();
            	      			
            	    }

            	    }
            	    break;

            	default :
            	    break loop360;
                }
            } while (true);


            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
31389
public final void synpred2_InternalXbaseWithAnnotations_fragment() throws RecognitionException {   
        // InternalXbaseWithAnnotations.g:121:7: ( ( ( ( ruleValidID ) ) '=' ) )
        // InternalXbaseWithAnnotations.g:121:8: ( ( ( ruleValidID ) ) '=' )
        {
        // InternalXbaseWithAnnotations.g:121:8: ( ( ( ruleValidID ) ) '=' )
        // InternalXbaseWithAnnotations.g:122:8: ( ( ruleValidID ) ) '='
        {
        // InternalXbaseWithAnnotations.g:122:8: ( ( ruleValidID ) )
        // InternalXbaseWithAnnotations.g:123:9: ( ruleValidID )
        {
        // InternalXbaseWithAnnotations.g:123:9: ( ruleValidID )
        // InternalXbaseWithAnnotations.g:124:10: ruleValidID
        {
        pushFollow(FOLLOW_8);
        ruleValidID();

        state._fsp--;
        if (state.failed) return ;

        }


        }

        match(input,17,FOLLOW_2); if (state.failed) return ;

        }


        }
    }
352002
public final void ruleQualifiedName() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbaseWithAnnotations.g:1671:2: ( ( ( rule__QualifiedName__Group__0 ) ) )
            // InternalXbaseWithAnnotations.g:1672:2: ( ( rule__QualifiedName__Group__0 ) )
            {
            // InternalXbaseWithAnnotations.g:1672:2: ( ( rule__QualifiedName__Group__0 ) )
            // InternalXbaseWithAnnotations.g:1673:3: ( rule__QualifiedName__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getQualifiedNameAccess().getGroup()); 
            }
            // InternalXbaseWithAnnotations.g:1674:3: ( rule__QualifiedName__Group__0 )
            // InternalXbaseWithAnnotations.g:1674:4: rule__QualifiedName__Group__0
            {
            pushFollow(FOLLOW_2);
            rule__QualifiedName__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getQualifiedNameAccess().getGroup()); 
            }

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
920642
public final String entryRuleQualifiedName() throws RecognitionException {
        String current = null;

        AntlrDatatypeRuleToken iv_ruleQualifiedName = null;


        try {
            // InternalXtype.g:762:53: (iv_ruleQualifiedName= ruleQualifiedName EOF )
            // InternalXtype.g:763:2: iv_ruleQualifiedName= ruleQualifiedName EOF
            {
            if ( state.backtracking==0 ) {
               newCompositeNode(grammarAccess.getQualifiedNameRule()); 
            }
            pushFollow(FOLLOW_1);
            iv_ruleQualifiedName=ruleQualifiedName();

            state._fsp--;
            if (state.failed) return current;
            if ( state.backtracking==0 ) {
               current =iv_ruleQualifiedName.getText(); 
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return current;

            }

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
1219169
def qualified_name_import(cls):
    

    parts = qualified_name(cls).split('.')

    return "from {} import {}".format('.'.join(parts[:-1]), parts[-1])
679118
function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration, dontResolveAlias) {
            // There are three things we might try to look for. In the following examples,
            // the search term is enclosed in |...|:
            //
            //     import a = |b|; // Namespace
            //     import a = |b.c|; // Value, type, namespace
            //     import a = |b.c|.d; // Namespace
            if (entityName.kind === 69 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
                entityName = entityName.parent;
            }
            // Check for case 1 and 3 in the above example
            if (entityName.kind === 69 /* Identifier */ || entityName.parent.kind === 139 /* QualifiedName */) {
                return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias);
            }
            else {
                // Case 2 in above example
                // entityName.kind could be a QualifiedName or a Missing identifier
                ts.Debug.assert(entityName.parent.kind === 229 /* ImportEqualsDeclaration */);
                return resolveEntityName(entityName, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias);
            }
        }
729146
public final void ruleUnorderedGroup() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:383:2: ( ( ( rule__UnorderedGroup__Group__0 ) ) )
            // InternalXtext.g:384:2: ( ( rule__UnorderedGroup__Group__0 ) )
            {
            // InternalXtext.g:384:2: ( ( rule__UnorderedGroup__Group__0 ) )
            // InternalXtext.g:385:3: ( rule__UnorderedGroup__Group__0 )
            {
             before(grammarAccess.getUnorderedGroupAccess().getGroup()); 
            // InternalXtext.g:386:3: ( rule__UnorderedGroup__Group__0 )
            // InternalXtext.g:386:4: rule__UnorderedGroup__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__UnorderedGroup__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getUnorderedGroupAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
551449
public final AntlrDatatypeRuleToken ruleQualifiedNameInStaticImport() throws RecognitionException {
        AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();

        Token kw=null;
        AntlrDatatypeRuleToken this_ValidID_0 = null;



        	enterRule();

        try {
            // InternalXbaseWithAnnotations.g:6829:2: ( (this_ValidID_0= ruleValidID kw= '.' )+ )
            // InternalXbaseWithAnnotations.g:6830:2: (this_ValidID_0= ruleValidID kw= '.' )+
            {
            // InternalXbaseWithAnnotations.g:6830:2: (this_ValidID_0= ruleValidID kw= '.' )+
            int cnt122=0;
            loop122:
            do {
                int alt122=2;
                int LA122_0 = input.LA(1);

                if ( (LA122_0==RULE_ID) ) {
                    int LA122_2 = input.LA(2);

                    if ( (LA122_2==52) ) {
                        alt122=1;
                    }


                }


                switch (alt122) {
            	case 1 :
            	    // InternalXbaseWithAnnotations.g:6831:3: this_ValidID_0= ruleValidID kw= '.'
            	    {
            	    if ( state.backtracking==0 ) {

            	      			newCompositeNode(grammarAccess.getQualifiedNameInStaticImportAccess().getValidIDParserRuleCall_0());
            	      		
            	    }
            	    pushFollow(FOLLOW_80);
            	    this_ValidID_0=ruleValidID();

            	    state._fsp--;
            	    if (state.failed) return current;
            	    if ( state.backtracking==0 ) {

            	      			current.merge(this_ValidID_0);
            	      		
            	    }
            	    if ( state.backtracking==0 ) {

            	      			afterParserOrEnumRuleCall();
            	      		
            	    }
            	    kw=(Token)match(input,52,FOLLOW_86); if (state.failed) return current;
            	    if ( state.backtracking==0 ) {

            	      			current.merge(kw);
            	      			newLeafNode(kw, grammarAccess.getQualifiedNameInStaticImportAccess().getFullStopKeyword_1());
            	      		
            	    }

            	    }
            	    break;

            	default :
            	    if ( cnt122 >= 1 ) break loop122;
            	    if (state.backtracking>0) {state.failed=true; return current;}
                        EarlyExitException eee =
                            new EarlyExitException(122, input);
                        throw eee;
                }
                cnt122++;
            } while (true);


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
828978
public final void synpred37_InternalPureXbase_fragment() throws RecognitionException {   
        // InternalPureXbase.g:4542:5: ( ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) ) )
        // InternalPureXbase.g:4542:6: ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) )
        {
        // InternalPureXbase.g:4542:6: ( ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) ) )
        // InternalPureXbase.g:4543:6: ( ( ruleJvmTypeReference ) ) ( ( ruleValidID ) )
        {
        // InternalPureXbase.g:4543:6: ( ( ruleJvmTypeReference ) )
        // InternalPureXbase.g:4544:7: ( ruleJvmTypeReference )
        {
        // InternalPureXbase.g:4544:7: ( ruleJvmTypeReference )
        // InternalPureXbase.g:4545:8: ruleJvmTypeReference
        {
        pushFollow(FOLLOW_12);
        ruleJvmTypeReference();

        state._fsp--;
        if (state.failed) return ;

        }


        }

        // InternalPureXbase.g:4548:6: ( ( ruleValidID ) )
        // InternalPureXbase.g:4549:7: ( ruleValidID )
        {
        // InternalPureXbase.g:4549:7: ( ruleValidID )
        // InternalPureXbase.g:4550:8: ruleValidID
        {
        pushFollow(FOLLOW_2);
        ruleValidID();

        state._fsp--;
        if (state.failed) return ;

        }


        }


        }


        }
    }