| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package com.google.dart.compiler.ast; | 5 package com.google.dart.compiler.ast; |
| 6 | 6 |
| 7 import com.google.dart.compiler.resolver.ConstructorElement; | 7 import com.google.dart.compiler.resolver.ConstructorNodeElement; |
| 8 import com.google.dart.compiler.resolver.Element; | 8 import com.google.dart.compiler.resolver.Element; |
| 9 | 9 |
| 10 import java.util.List; | 10 import java.util.List; |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * Super constructor invocation AST node. | 13 * Super constructor invocation AST node. |
| 14 */ | 14 */ |
| 15 public class DartSuperConstructorInvocation extends DartInvocation { | 15 public class DartSuperConstructorInvocation extends DartInvocation { |
| 16 | 16 |
| 17 private DartIdentifier name; | 17 private DartIdentifier name; |
| 18 private ConstructorElement element; | 18 private ConstructorNodeElement element; |
| 19 | 19 |
| 20 public DartSuperConstructorInvocation(DartIdentifier name, List<DartExpression
> args) { | 20 public DartSuperConstructorInvocation(DartIdentifier name, List<DartExpression
> args) { |
| 21 super(args); | 21 super(args); |
| 22 this.name = becomeParentOf(name); | 22 this.name = becomeParentOf(name); |
| 23 } | 23 } |
| 24 | 24 |
| 25 public String getConstructorName() { | 25 public String getConstructorName() { |
| 26 if (name == null) { | 26 if (name == null) { |
| 27 return null; | 27 return null; |
| 28 } | 28 } |
| 29 return name.getName(); | 29 return name.getName(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 public DartIdentifier getName() { | 32 public DartIdentifier getName() { |
| 33 return name; | 33 return name; |
| 34 } | 34 } |
| 35 | 35 |
| 36 public void setName(DartIdentifier newName) { | 36 public void setName(DartIdentifier newName) { |
| 37 name = becomeParentOf(newName); | 37 name = becomeParentOf(newName); |
| 38 } | 38 } |
| 39 | 39 |
| 40 @Override | 40 @Override |
| 41 public void setElement(Element element) { | 41 public void setElement(Element element) { |
| 42 this.element = (ConstructorElement) element; | 42 this.element = (ConstructorNodeElement) element; |
| 43 } | 43 } |
| 44 | 44 |
| 45 @Override | 45 @Override |
| 46 public ConstructorElement getElement() { | 46 public ConstructorNodeElement getElement() { |
| 47 return element; | 47 return element; |
| 48 } | 48 } |
| 49 | 49 |
| 50 @Override | 50 @Override |
| 51 public void visitChildren(ASTVisitor<?> visitor) { | 51 public void visitChildren(ASTVisitor<?> visitor) { |
| 52 if (name != null) { | 52 if (name != null) { |
| 53 name.accept(visitor); | 53 name.accept(visitor); |
| 54 } | 54 } |
| 55 visitor.visit(getArguments()); | 55 visitor.visit(getArguments()); |
| 56 } | 56 } |
| 57 | 57 |
| 58 @Override | 58 @Override |
| 59 public <R> R accept(ASTVisitor<R> visitor) { | 59 public <R> R accept(ASTVisitor<R> visitor) { |
| 60 return visitor.visitSuperConstructorInvocation(this); | 60 return visitor.visitSuperConstructorInvocation(this); |
| 61 } | 61 } |
| 62 } | 62 } |
| OLD | NEW |