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 import static org.jetbrains.kotlin.KtNodeTypes.SELF_TYPE;
023
024 public interface KtStubElementTypes {
025 KtFileElementType FILE = new KtFileElementType();
026
027 KtClassElementType CLASS = new KtClassElementType("CLASS");
028 KtFunctionElementType FUNCTION = new KtFunctionElementType("FUN");
029 KtPropertyElementType PROPERTY = new KtPropertyElementType("PROPERTY");
030 KtPropertyAccessorElementType PROPERTY_ACCESSOR = new KtPropertyAccessorElementType("PROPERTY_ACCESSOR");
031
032 KtClassElementType ENUM_ENTRY = new KtClassElementType("ENUM_ENTRY");
033 KtObjectElementType OBJECT_DECLARATION = new KtObjectElementType("OBJECT_DECLARATION");
034 KtPlaceHolderStubElementType<KtClassInitializer> ANONYMOUS_INITIALIZER =
035 new KtPlaceHolderStubElementType<KtClassInitializer>("ANONYMOUS_INITIALIZER", KtClassInitializer.class);
036 KtPlaceHolderStubElementType<KtSecondaryConstructor> SECONDARY_CONSTRUCTOR =
037 new KtPlaceHolderStubElementType<KtSecondaryConstructor>("SECONDARY_CONSTRUCTOR", KtSecondaryConstructor.class);
038 KtPlaceHolderStubElementType<KtPrimaryConstructor> PRIMARY_CONSTRUCTOR =
039 new KtPlaceHolderStubElementType<KtPrimaryConstructor>("PRIMARY_CONSTRUCTOR", KtPrimaryConstructor.class);
040
041 KtParameterElementType VALUE_PARAMETER = new KtParameterElementType("VALUE_PARAMETER");
042 KtPlaceHolderStubElementType<KtParameterList> VALUE_PARAMETER_LIST =
043 new KtPlaceHolderStubElementType<KtParameterList>("VALUE_PARAMETER_LIST", KtParameterList.class);
044
045 KtTypeParameterElementType TYPE_PARAMETER = new KtTypeParameterElementType("TYPE_PARAMETER");
046 KtPlaceHolderStubElementType<KtTypeParameterList> TYPE_PARAMETER_LIST =
047 new KtPlaceHolderStubElementType<KtTypeParameterList>("TYPE_PARAMETER_LIST", KtTypeParameterList.class);
048
049 KtAnnotationEntryElementType ANNOTATION_ENTRY = new KtAnnotationEntryElementType("ANNOTATION_ENTRY");
050 KtPlaceHolderStubElementType<KtAnnotation> ANNOTATION =
051 new KtPlaceHolderStubElementType<KtAnnotation>("ANNOTATION", KtAnnotation.class);
052
053 KtAnnotationUseSiteTargetElementType ANNOTATION_TARGET = new KtAnnotationUseSiteTargetElementType("ANNOTATION_TARGET");
054
055 KtPlaceHolderStubElementType<KtClassBody> CLASS_BODY =
056 new KtPlaceHolderStubElementType<KtClassBody>("CLASS_BODY", KtClassBody.class);
057
058 KtPlaceHolderStubElementType<KtImportList> IMPORT_LIST =
059 new KtPlaceHolderStubElementType<KtImportList>("IMPORT_LIST", KtImportList.class);
060
061 KtPlaceHolderStubElementType<KtFileAnnotationList> FILE_ANNOTATION_LIST =
062 new KtPlaceHolderStubElementType<KtFileAnnotationList>("FILE_ANNOTATION_LIST", KtFileAnnotationList.class);
063
064 KtImportDirectiveElementType IMPORT_DIRECTIVE = new KtImportDirectiveElementType("IMPORT_DIRECTIVE");
065
066 KtPlaceHolderStubElementType<KtPackageDirective> PACKAGE_DIRECTIVE =
067 new KtPlaceHolderStubElementType<KtPackageDirective>("PACKAGE_DIRECTIVE", KtPackageDirective.class);
068
069 KtModifierListElementType<KtDeclarationModifierList> MODIFIER_LIST =
070 new KtModifierListElementType<KtDeclarationModifierList>("MODIFIER_LIST", KtDeclarationModifierList.class);
071
072 KtPlaceHolderStubElementType<KtTypeConstraintList> TYPE_CONSTRAINT_LIST =
073 new KtPlaceHolderStubElementType<KtTypeConstraintList>("TYPE_CONSTRAINT_LIST", KtTypeConstraintList.class);
074
075 KtPlaceHolderStubElementType<KtTypeConstraint> TYPE_CONSTRAINT =
076 new KtPlaceHolderStubElementType<KtTypeConstraint>("TYPE_CONSTRAINT", KtTypeConstraint.class);
077
078 KtPlaceHolderStubElementType<KtNullableType> NULLABLE_TYPE =
079 new KtPlaceHolderStubElementType<KtNullableType>("NULLABLE_TYPE", KtNullableType.class);
080
081 KtPlaceHolderStubElementType<KtTypeReference> TYPE_REFERENCE =
082 new KtPlaceHolderStubElementType<KtTypeReference>("TYPE_REFERENCE", KtTypeReference.class);
083
084 KtUserTypeElementType USER_TYPE = new KtUserTypeElementType("USER_TYPE");
085 KtPlaceHolderStubElementType<KtDynamicType> DYNAMIC_TYPE =
086 new KtPlaceHolderStubElementType<KtDynamicType>("DYNAMIC_TYPE", KtDynamicType.class);
087
088 KtPlaceHolderStubElementType<KtFunctionType> FUNCTION_TYPE =
089 new KtPlaceHolderStubElementType<KtFunctionType>("FUNCTION_TYPE", KtFunctionType.class);
090
091 KtTypeProjectionElementType TYPE_PROJECTION = new KtTypeProjectionElementType("TYPE_PROJECTION");
092
093 KtPlaceHolderStubElementType<KtFunctionTypeReceiver> FUNCTION_TYPE_RECEIVER =
094 new KtPlaceHolderStubElementType<KtFunctionTypeReceiver>("FUNCTION_TYPE_RECEIVER", KtFunctionTypeReceiver.class);
095
096 KtNameReferenceExpressionElementType REFERENCE_EXPRESSION = new KtNameReferenceExpressionElementType("REFERENCE_EXPRESSION");
097 KtDotQualifiedExpressionElementType DOT_QUALIFIED_EXPRESSION = new KtDotQualifiedExpressionElementType("DOT_QUALIFIED_EXPRESSION");
098 KtEnumEntrySuperClassReferenceExpressionElementType
099 ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION = new KtEnumEntrySuperClassReferenceExpressionElementType("ENUM_ENTRY_SUPERCLASS_REFERENCE_EXPRESSION");
100 KtPlaceHolderStubElementType<KtTypeArgumentList> TYPE_ARGUMENT_LIST =
101 new KtPlaceHolderStubElementType<KtTypeArgumentList>("TYPE_ARGUMENT_LIST", KtTypeArgumentList.class);
102
103 KtPlaceHolderStubElementType<KtDelegationSpecifierList> DELEGATION_SPECIFIER_LIST =
104 new KtPlaceHolderStubElementType<KtDelegationSpecifierList>("DELEGATION_SPECIFIER_LIST", KtDelegationSpecifierList.class);
105
106 KtPlaceHolderStubElementType<KtInitializerList> INITIALIZER_LIST =
107 new KtPlaceHolderStubElementType<KtInitializerList>("INITIALIZER_LIST", KtInitializerList.class);
108
109 KtPlaceHolderStubElementType<KtDelegatorByExpressionSpecifier> DELEGATOR_BY =
110 new KtPlaceHolderStubElementType<KtDelegatorByExpressionSpecifier>("DELEGATOR_BY", KtDelegatorByExpressionSpecifier.class);
111
112 KtPlaceHolderStubElementType<KtDelegatorToSuperCall> DELEGATOR_SUPER_CALL =
113 new KtPlaceHolderStubElementType<KtDelegatorToSuperCall>("DELEGATOR_SUPER_CALL", KtDelegatorToSuperCall.class);
114 KtPlaceHolderStubElementType<KtDelegatorToSuperClass> DELEGATOR_SUPER_CLASS =
115 new KtPlaceHolderStubElementType<KtDelegatorToSuperClass>("DELEGATOR_SUPER_CLASS", KtDelegatorToSuperClass.class);
116 KtPlaceHolderStubElementType<KtConstructorCalleeExpression> CONSTRUCTOR_CALLEE =
117 new KtPlaceHolderStubElementType<KtConstructorCalleeExpression>("CONSTRUCTOR_CALLEE", KtConstructorCalleeExpression.class);
118
119 TokenSet DECLARATION_TYPES =
120 TokenSet.create(CLASS, OBJECT_DECLARATION, FUNCTION, PROPERTY, ANONYMOUS_INITIALIZER, SECONDARY_CONSTRUCTOR, ENUM_ENTRY);
121
122 TokenSet DELEGATION_SPECIFIER_TYPES = TokenSet.create(DELEGATOR_BY, DELEGATOR_SUPER_CALL, DELEGATOR_SUPER_CLASS);
123
124 TokenSet TYPE_ELEMENT_TYPES = TokenSet.create(USER_TYPE, NULLABLE_TYPE, FUNCTION_TYPE, DYNAMIC_TYPE, SELF_TYPE);
125
126 TokenSet INSIDE_DIRECTIVE_EXPRESSIONS = TokenSet.create(REFERENCE_EXPRESSION, DOT_QUALIFIED_EXPRESSION);
127 }