| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 7 /** |
| 8 * Represents a Dart 'if' statement. | 8 * Represents a Dart 'if' statement. |
| 9 */ | 9 */ |
| 10 public class DartIfStatement extends DartStatement { | 10 public class DartIfStatement extends DartStatement { |
| 11 | 11 |
| 12 private DartExpression condition; | 12 private DartExpression condition; |
| 13 private DartStatement thenStmt; | 13 private DartStatement thenStmt; |
| 14 private DartStatement elseStmt; | 14 private DartStatement elseStmt; |
| 15 private final int closeParenOffset; | 15 private final int closeParenOffset; |
| 16 private final int elseTokenOffset; | 16 private final int elseTokenOffset; |
| 17 | 17 |
| 18 public DartIfStatement(DartExpression condition, int closeParentOffset, DartSt
atement thenStmt, | 18 public DartIfStatement(DartExpression condition, int closeParenOffset, DartSta
tement thenStmt, |
| 19 int elseTokenOffset, DartStatement elseStmt) { | 19 int elseTokenOffset, DartStatement elseStmt) { |
| 20 this.condition = becomeParentOf(condition); | 20 this.condition = becomeParentOf(condition); |
| 21 closeParenOffset = closeParentOffset; | 21 this.closeParenOffset = closeParenOffset; |
| 22 this.thenStmt = becomeParentOf(thenStmt); | 22 this.thenStmt = becomeParentOf(thenStmt); |
| 23 this.elseTokenOffset = elseTokenOffset; | 23 this.elseTokenOffset = elseTokenOffset; |
| 24 this.elseStmt = becomeParentOf(elseStmt); | 24 this.elseStmt = becomeParentOf(elseStmt); |
| 25 } | 25 } |
| 26 | 26 |
| 27 public DartExpression getCondition() { | 27 public DartExpression getCondition() { |
| 28 return condition; | 28 return condition; |
| 29 } | 29 } |
| 30 | 30 |
| 31 public int getCloseParenOffset() { | 31 public int getCloseParenOffset() { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 49 safelyVisitChild(condition, visitor); | 49 safelyVisitChild(condition, visitor); |
| 50 safelyVisitChild(thenStmt, visitor); | 50 safelyVisitChild(thenStmt, visitor); |
| 51 safelyVisitChild(elseStmt, visitor); | 51 safelyVisitChild(elseStmt, visitor); |
| 52 } | 52 } |
| 53 | 53 |
| 54 @Override | 54 @Override |
| 55 public <R> R accept(ASTVisitor<R> visitor) { | 55 public <R> R accept(ASTVisitor<R> visitor) { |
| 56 return visitor.visitIfStatement(this); | 56 return visitor.visitIfStatement(this); |
| 57 } | 57 } |
| 58 } | 58 } |
| OLD | NEW |