code: private ParseTree parseForStatement(SourcePosition start, ParseTree initializer) {
      if (initializer == null) {
        initializer = new NullTree(getTreeLocation(getTreeStartLocation()));
      }
      eat(TokenType.SEMI_COLON);
  
      ParseTree condition;
      if (!peek(TokenType.SEMI_COLON)) {
        condition = parseExpression();
      } else {
        condition = new NullTree(getTreeLocation(getTreeStartLocation()));
      }
      eat(TokenType.SEMI_COLON);
  
      ParseTree increment;
      if (!peek(TokenType.CLOSE_PAREN)) {
        increment = parseExpression();
      } else {
        increment = new NullTree(getTreeLocation(getTreeStartLocation()));
      }
      eat(TokenType.CLOSE_PAREN);
      ParseTree body = parseStatement();
      return new ForStatementTree(getTreeLocation(start), initializer, condition, increment, body);
    }
docs: 12.6.3 The for Statement