private void statement(Symbol function) throws ParserException {
    enterRule(NonTerminal.STATEMENT);

    if (have(NonTerminal.ASSIGNMENT)) assignment();
    else if (have(NonTerminal.INPUT)) input();
    else if (have(NonTerminal.OUTPUT)) output();
    else if (have(NonTerminal.IF_STATEMENT)) ifStatement();
    else if (have(NonTerminal.WHILE_STATEMENT)) whileStatement();
    else if (have(NonTerminal.RETURN_STATEMENT)) returnStatement(function);
    else if (have(NonTerminal.PROCEDURE_STATEMENT)) procedureStatement();
    else expect(NonTerminal.STATEMENT);

    exitRule(NonTerminal.STATEMENT);
  }