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