001    /*
002     * Copyright 2010-2015 JetBrains s.r.o.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.jetbrains.kotlin.psi.stubs.elements;
018    
019    import com.intellij.psi.tree.TokenSet;
020    import org.jetbrains.kotlin.psi.*;
021    
022    public interface KtStubElementTypes {
023        KtFileElementType FILE = new KtFileElementType();
024    
025        KtClassElementType CLASS = new KtClassElementType("CLASS");
026        KtFunctionElementType FUNCTION = new KtFunctionElementType("FUN");
027        KtPropertyElementType PROPERTY = new KtPropertyElementType("PROPERTY");
028        KtPropertyAccessorElementType PROPERTY_ACCESSOR = new KtPropertyAccessorElementType("PROPERTY_ACCESSOR");
029        KtTypeAliasElementType TYPEALIAS = new KtTypeAliasElementType("TYPEALIAS");
030    
031        KtClassElementType ENUM_ENTRY = new KtClassElementType("ENUM_ENTRY");
032        KtObjectElementType OBJECT_DECLARATION = new KtObjectElementType("OBJECT_DECLARATION");
033        KtPlaceHolderStubElementType<KtClassInitializer> CLASS_INITIALIZER =
034                new KtPlaceHolderStubElementType<KtClassInitializer>("CLASS_INITIALIZER", KtClassInitializer.class);
035        KtPlaceHolderStubElementType<KtSecondaryConstructor> SECONDARY_CONSTRUCTOR =
036                new KtPlaceHolderStubElementType<KtSecondaryConstructor>("SECONDARY_CONSTRUCTOR", KtSecondaryConstructor.class);
037        KtPlaceHolderStubElementType<KtPrimaryConstructor> PRIMARY_CONSTRUCTOR =
038                new KtPlaceHolderStubElementType<KtPrimaryConstructor>("PRIMARY_CONSTRUCTOR", KtPrimaryConstructor.class);
039    
040        KtParameterElementType VALUE_PARAMETER = new KtParameterElementType("VALUE_PARAMETER");
041        KtPlaceHolderStubElementType<KtParameterList> VALUE_PARAMETER_LIST =
042                new KtPlaceHolderStubElementType<KtParameterList>("VALUE_PARAMETER_LIST", KtParameterList.class);
043    
044        KtTypeParameterElementType TYPE_PARAMETER = new KtTypeParameterElementType("TYPE_PARAMETER");
045        KtPlaceHolderStubElementType<KtTypeParameterList> TYPE_PARAMETER_LIST =
046                new KtPlaceHolderStubElementType<KtTypeParameterList>("TYPE_PARAMETER_LIST", KtTypeParameterList.class);
047    
048        KtAnnotationEntryElementType ANNOTATION_ENTRY = new KtAnnotationEntryElementType("ANNOTATION_ENTRY");
049        KtPlaceHolderStubElementType<KtAnnotation> ANNOTATION =
050                new KtPlaceHolderStubElementType<KtAnnotation>("ANNOTATION", KtAnnotation.class);
051    
052        KtAnnotationUseSiteTargetElementType ANNOTATION_TARGET = new KtAnnotationUseSiteTargetElementType("ANNOTATION_TARGET");
053    
054        KtPlaceHolderStubElementType<KtClassBody> CLASS_BODY =
055                new KtPlaceHolderStubElementType<KtClassBody>("CLASS_BODY", KtClassBody.class);
056    
057        KtPlaceHolderStubElementType<KtImportList> IMPORT_LIST =
058                new KtPlaceHolderStubElementType<KtImportList>("IMPORT_LIST", KtImportList.class);
059    
060        KtPlaceHolderStubElementType<KtFileAnnotationList> FILE_ANNOTATION_LIST =
061                new KtPlaceHolderStubElementType<KtFileAnnotationList>("FILE_ANNOTATION_LIST", KtFileAnnotationList.class);
062    
063        KtImportDirectiveElementType IMPORT_DIRECTIVE = new KtImportDirectiveElementType("IMPORT_DIRECTIVE");
064    
065        KtPlaceHolderStubElementType<KtPackageDirective> PACKAGE_DIRECTIVE =
066                new KtPlaceHolderStubElementType<KtPackageDirective>("PACKAGE_DIRECTIVE", KtPackageDirective.class);
067    
068        KtModifierListElementType<KtDeclarationModifierList> MODIFIER_LIST =
069                new KtModifierListElementType<KtDeclarationModifierList>("MODIFIER_LIST", KtDeclarationModifierList.class);
070    
071        KtPlaceHolderStubElementType<KtTypeConstraintList> TYPE_CONSTRAINT_LIST =
072                new KtPlaceHolderStubElementType<KtTypeConstraintList>("TYPE_CONSTRAINT_LIST", KtTypeConstraintList.class);
073    
074        KtPlaceHolderStubElementType<KtTypeConstraint> TYPE_CONSTRAINT =
075                new KtPlaceHolderStubElementType<KtTypeConstraint>("TYPE_CONSTRAINT", KtTypeConstraint.class);
076    
077        KtPlaceHolderStubElementType<KtNullableType> NULLABLE_TYPE =
078                new KtPlaceHolderStubElementType<KtNullableType>("NULLABLE_TYPE", KtNullableType.class);
079    
080        KtPlaceHolderStubElementType<KtTypeReference> TYPE_REFERENCE =
081                new KtPlaceHolderStubElementType<KtTypeReference>("TYPE_REFERENCE", KtTypeReference.class);
082    
083        KtUserTypeElementType USER_TYPE = new KtUserTypeElementType("USER_TYPE");
084        KtPlaceHolderStubElementType<KtDynamicType> DYNAMIC_TYPE =
085                new KtPlaceHolderStubElementType<KtDynamicType>("DYNAMIC_TYPE", KtDynamicType.class);
086    
087        KtPlaceHolderStubElementType<KtFunctionType> FUNCTION_TYPE =
088                new KtPlaceHolderStubElementType<KtFunctionType>("FUNCTION_TYPE", KtFunctionType.class);
089    
090        KtTypeProjectionElementType TYPE_PROJECTION = new KtTypeProjectionElementType("TYPE_PROJECTION");
091    
092        KtPlaceHolderStubElementType<KtFunctionTypeReceiver> FUNCTION_TYPE_RECEIVER =
093                new KtPlaceHolderStubElementType<KtFunctionTypeReceiver>("FUNCTION_TYPE_RECEIVER", KtFunctionTypeReceiver.class);
094    
095        KtNameReferenceExpressionElementType REFERENCE_EXPRESSION = new KtNameReferenceExpressionElementType("REFERENCE_EXPRESSION");
096        KtDotQualifiedExpressionElementType DOT_QUALIFIED_EXPRESSION = new KtDotQualifiedExpressionElementType("DOT_QUALIFIED_EXPRESSION");
097        KtEnumEntrySuperClassReferenceExpressionElementType
098                ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION = new KtEnumEntrySuperClassReferenceExpressionElementType("ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION");
099        KtPlaceHolderStubElementType<KtTypeArgumentList> TYPE_ARGUMENT_LIST =
100                new KtPlaceHolderStubElementType<KtTypeArgumentList>("TYPE_ARGUMENT_LIST", KtTypeArgumentList.class);
101    
102        KtPlaceHolderStubElementType<KtSuperTypeList> SUPER_TYPE_LIST =
103                new KtPlaceHolderStubElementType<KtSuperTypeList>("SUPER_TYPE_LIST", KtSuperTypeList.class);
104    
105        KtPlaceHolderStubElementType<KtInitializerList> INITIALIZER_LIST =
106                new KtPlaceHolderStubElementType<KtInitializerList>("INITIALIZER_LIST", KtInitializerList.class);
107    
108        KtPlaceHolderStubElementType<KtDelegatedSuperTypeEntry> DELEGATED_SUPER_TYPE_ENTRY =
109                new KtPlaceHolderStubElementType<KtDelegatedSuperTypeEntry>("DELEGATED_SUPER_TYPE_ENTRY", KtDelegatedSuperTypeEntry.class);
110    
111        KtPlaceHolderStubElementType<KtSuperTypeCallEntry> SUPER_TYPE_CALL_ENTRY =
112                new KtPlaceHolderStubElementType<KtSuperTypeCallEntry>("SUPER_TYPE_CALL_ENTRY", KtSuperTypeCallEntry.class);
113        KtPlaceHolderStubElementType<KtSuperTypeEntry> SUPER_TYPE_ENTRY =
114                new KtPlaceHolderStubElementType<KtSuperTypeEntry>("SUPER_TYPE_ENTRY", KtSuperTypeEntry.class);
115        KtPlaceHolderStubElementType<KtConstructorCalleeExpression> CONSTRUCTOR_CALLEE =
116                new KtPlaceHolderStubElementType<KtConstructorCalleeExpression>("CONSTRUCTOR_CALLEE", KtConstructorCalleeExpression.class);
117    
118        KtScriptElementType SCRIPT = new KtScriptElementType("SCRIPT");
119    
120        TokenSet DECLARATION_TYPES =
121                TokenSet.create(CLASS, OBJECT_DECLARATION, FUNCTION, PROPERTY, TYPEALIAS, CLASS_INITIALIZER, SECONDARY_CONSTRUCTOR, ENUM_ENTRY);
122    
123        TokenSet SUPER_TYPE_LIST_ENTRIES = TokenSet.create(DELEGATED_SUPER_TYPE_ENTRY, SUPER_TYPE_CALL_ENTRY, SUPER_TYPE_ENTRY);
124    
125        TokenSet TYPE_ELEMENT_TYPES = TokenSet.create(USER_TYPE, NULLABLE_TYPE, FUNCTION_TYPE, DYNAMIC_TYPE);
126    
127        TokenSet INSIDE_DIRECTIVE_EXPRESSIONS = TokenSet.create(REFERENCE_EXPRESSION, DOT_QUALIFIED_EXPRESSION);
128    }