Refactor codegen hierarchy

- pull generate() and a bunch of abstract methods from ClassBodyCodegen up to
  MemberCodegen
- implement these methods in ScriptCodegen and PackagePartCodegen
- make MemberCodegen generic on the type of the element it is generating
This commit is contained in:
Alexander Udalov
2014-04-23 21:50:01 +04:00
parent ff8e282c4a
commit 1efdd33dbd
18 changed files with 166 additions and 164 deletions
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.List;
// SCRIPT: Script declaration
public class JetScript extends JetDeclarationImpl {
public class JetScript extends JetDeclarationImpl implements JetDeclarationContainer {
public JetScript(@NotNull ASTNode node) {
super(node);
@@ -34,6 +34,7 @@ public class JetScript extends JetDeclarationImpl {
return findNotNullChildByClass(JetBlockExpression.class);
}
@Override
@NotNull
public List<JetDeclaration> getDeclarations() {
return PsiTreeUtil.getChildrenOfTypeAsList(getBlockExpression(), JetDeclaration.class);