IfStatementImpl constructor

IfStatementImpl({
  1. required Token ifKeyword,
  2. required Token leftParenthesis,
  3. required ExpressionImpl condition,
  4. required CaseClauseImpl? caseClause,
  5. required Token rightParenthesis,
  6. required StatementImpl thenStatement,
  7. required Token? elseKeyword,
  8. required StatementImpl? elseStatement,
})

Initialize a newly created if statement. The elseKeyword and elseStatement can be null if there is no else clause.

Implementation

IfStatementImpl({
  required this.ifKeyword,
  required this.leftParenthesis,
  required ExpressionImpl condition,
  required this.caseClause,
  required this.rightParenthesis,
  required StatementImpl thenStatement,
  required this.elseKeyword,
  required StatementImpl? elseStatement,
})  : _condition = condition,
      _thenStatement = thenStatement,
      _elseStatement = elseStatement {
  _becomeParentOf(_condition);
  _becomeParentOf(caseClause);
  _becomeParentOf(_thenStatement);
  _becomeParentOf(_elseStatement);
}