Stubs for delegation specifiers

This commit is contained in:
Pavel V. Talanov
2014-04-04 18:43:04 +04:00
parent 1f3797ffb2
commit 76608ff01b
7 changed files with 48 additions and 5 deletions
@@ -42,9 +42,9 @@ public interface JetNodeTypes {
IElementType TYPE_PARAMETER_LIST = JetStubElementTypes.TYPE_PARAMETER_LIST;
IElementType TYPE_PARAMETER = JetStubElementTypes.TYPE_PARAMETER;
IElementType DELEGATION_SPECIFIER_LIST = JetStubElementTypes.DELEGATION_SPECIFIER_LIST;
JetNodeType DELEGATOR_BY = new JetNodeType("DELEGATOR_BY", JetDelegatorByExpressionSpecifier.class);
JetNodeType DELEGATOR_SUPER_CALL = new JetNodeType("DELEGATOR_SUPER_CALL", JetDelegatorToSuperCall.class);
JetNodeType DELEGATOR_SUPER_CLASS = new JetNodeType("DELEGATOR_SUPER_CLASS", JetDelegatorToSuperClass.class);
IElementType DELEGATOR_BY = JetStubElementTypes.DELEGATOR_BY;
IElementType DELEGATOR_SUPER_CALL = JetStubElementTypes.DELEGATOR_SUPER_CALL;
IElementType DELEGATOR_SUPER_CLASS = JetStubElementTypes.DELEGATOR_SUPER_CLASS;
JetNodeType PROPERTY_DELEGATE = new JetNodeType("PROPERTY_DELEGATE", JetPropertyDelegate.class);
JetNodeType CONSTRUCTOR_CALLEE = new JetNodeType("CONSTRUCTOR_CALLEE", JetConstructorCalleeExpression.class);
IElementType VALUE_PARAMETER_LIST = JetStubElementTypes.VALUE_PARAMETER_LIST;
@@ -74,7 +74,7 @@ public interface JetNodeTypes {
// TODO: review
JetNodeType PROPERTY_ACCESSOR = new JetNodeType("PROPERTY_ACCESSOR", JetPropertyAccessor.class);
JetNodeType INITIALIZER_LIST = new JetNodeType("INITIALIZER_LIST", JetInitializerList.class);
JetNodeType THIS_CALL = new JetNodeType("THIS_CALL", JetDelegatorToThisCall.class);
IElementType THIS_CALL = JetStubElementTypes.THIS_CALL;
JetNodeType THIS_CONSTRUCTOR_REFERENCE = new JetNodeType("THIS_CONSTRUCTOR_REFERENCE", JetThisReferenceExpression.class);
IElementType TYPE_CONSTRAINT_LIST = JetStubElementTypes.TYPE_CONSTRAINT_LIST;
JetNodeType TYPE_CONSTRAINT = new JetNodeType("TYPE_CONSTRAINT", JetTypeConstraint.class);
@@ -17,15 +17,23 @@
package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import com.intellij.psi.stubs.IStubElementType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
public class JetDelegationSpecifier extends JetElementImpl {
public class JetDelegationSpecifier extends JetElementImplStub<PsiJetPlaceHolderStub<? extends JetDelegationSpecifier>> {
public JetDelegationSpecifier(@NotNull ASTNode node) {
super(node);
}
public JetDelegationSpecifier(
@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub,
@NotNull IStubElementType nodeType) {
super(stub, nodeType);
}
@Override
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
return visitor.visitDelegationSpecifier(this, data);
@@ -19,12 +19,18 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetDelegatorByExpressionSpecifier extends JetDelegationSpecifier {
public JetDelegatorByExpressionSpecifier(@NotNull ASTNode node) {
super(node);
}
public JetDelegatorByExpressionSpecifier(@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
super(stub, JetStubElementTypes.DELEGATOR_BY);
}
@Override
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
return visitor.visitDelegationByExpressionSpecifier(this, data);
@@ -20,6 +20,8 @@ import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Collections;
import java.util.List;
@@ -29,6 +31,10 @@ public class JetDelegatorToSuperCall extends JetDelegationSpecifier implements J
super(node);
}
public JetDelegatorToSuperCall(@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
super(stub, JetStubElementTypes.DELEGATOR_SUPER_CALL);
}
@Override
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
return visitor.visitDelegationToSuperCallSpecifier(this, data);
@@ -18,12 +18,18 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
public class JetDelegatorToSuperClass extends JetDelegationSpecifier {
public JetDelegatorToSuperClass(@NotNull ASTNode node) {
super(node);
}
public JetDelegatorToSuperClass(@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
super(stub, JetStubElementTypes.DELEGATOR_SUPER_CLASS);
}
@Override
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
return visitor.visitDelegationToSuperClassSpecifier(this, data);
@@ -17,9 +17,12 @@
package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import com.intellij.psi.stubs.IStubElementType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import java.util.Collections;
import java.util.List;
@@ -30,6 +33,10 @@ public class JetDelegatorToThisCall extends JetDelegationSpecifier implements Je
super(node);
}
public JetDelegatorToThisCall(@NotNull PsiJetPlaceHolderStub<? extends JetDelegationSpecifier> stub) {
super(stub, JetStubElementTypes.THIS_CALL);
}
@Override
public <R, D> R accept(@NotNull JetVisitor<R, D> visitor, D data) {
return visitor.visitDelegationToThisCall(this, data);
@@ -85,6 +85,16 @@ public interface JetStubElementTypes {
JetPlaceHolderStubElementType<JetDelegationSpecifierList> DELEGATION_SPECIFIER_LIST =
new JetPlaceHolderStubElementType<JetDelegationSpecifierList>("DELEGATION_SPECIFIER_LIST", JetDelegationSpecifierList.class);
JetPlaceHolderStubElementType<JetDelegatorByExpressionSpecifier> DELEGATOR_BY =
new JetPlaceHolderStubElementType<JetDelegatorByExpressionSpecifier>("DELEGATOR_BY", JetDelegatorByExpressionSpecifier.class);
JetPlaceHolderStubElementType<JetDelegatorToSuperCall> DELEGATOR_SUPER_CALL =
new JetPlaceHolderStubElementType<JetDelegatorToSuperCall>("DELEGATOR_SUPER_CALL", JetDelegatorToSuperCall.class);
JetPlaceHolderStubElementType<JetDelegatorToSuperClass> DELEGATOR_SUPER_CLASS =
new JetPlaceHolderStubElementType<JetDelegatorToSuperClass>("DELEGATOR_SUPER_CLASS", JetDelegatorToSuperClass.class);
JetPlaceHolderStubElementType<JetDelegatorToThisCall> THIS_CALL =
new JetPlaceHolderStubElementType<JetDelegatorToThisCall>("THIS_CALL", JetDelegatorToThisCall.class);
TokenSet DECLARATION_TYPES =
TokenSet.create(CLASS, OBJECT_DECLARATION, CLASS_OBJECT, FUNCTION, PROPERTY, ANONYMOUS_INITIALIZER, ENUM_ENTRY);