changeset 27725:6388a240de87

move some common actions into tree_walker base class Instead of having most tree_walker class methods be pure virtual functions, define them to be methods that walk the tree but do nothing else. This change allows us to eliminate some duplication in derived classes, and makes it easier to define derived classes that need to walk the parse tree but onny perform actions for a few parse tree elements. * pt-walk.h, pt-walk.cc (class tree_walker): Define most methods to walk the tree. * cdef-class.cc (class ctor_analyzer): Delete methods in base class that are now handled by the base tree_walker class. * pt-anon-scopes.h, pt-anon-scopes.cc (class tree_anon_scopes): Likewise. * pt-bp.h, pt-bp.cc (tree_breakpoint): Likewise. * pt-check.h, pt-check.cc (tree_checker): Likewise. * pt-eval.h, pt-eval.cc (tree_evaluator): Likewise. * pt-jit.cc (jit_convert): Likewise. * pt-pr-code.h, pt-pr-code.cc (tree_print_code): Likewise.
author John W. Eaton <jwe@octave.org>
date Wed, 20 Nov 2019 00:01:18 -0600
parents 19e80f22aa47
children b2c11742b7ec
files libinterp/octave-value/cdef-class.cc libinterp/parse-tree/pt-anon-scopes.cc libinterp/parse-tree/pt-anon-scopes.h libinterp/parse-tree/pt-bp.cc libinterp/parse-tree/pt-bp.h libinterp/parse-tree/pt-check.cc libinterp/parse-tree/pt-check.h libinterp/parse-tree/pt-eval.cc libinterp/parse-tree/pt-eval.h libinterp/parse-tree/pt-jit.cc libinterp/parse-tree/pt-pr-code.cc libinterp/parse-tree/pt-pr-code.h libinterp/parse-tree/pt-walk.cc libinterp/parse-tree/pt-walk.h
diffstat 14 files changed, 613 insertions(+), 1031 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/cdef-class.cc	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/octave-value/cdef-class.cc	Wed Nov 20 00:01:18 2019 -0600
@@ -139,12 +139,6 @@
 
     ~ctor_analyzer (void) = default;
 
-    void visit_statement_list (tree_statement_list& t)
-    {
-      for (const auto& stmt_p : t)
-        stmt_p->accept (*this);
-    }
-
     void visit_statement (tree_statement& t)
     {
       if (t.is_expression ())
--- a/libinterp/parse-tree/pt-anon-scopes.cc	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-anon-scopes.cc	Wed Nov 20 00:01:18 2019 -0600
@@ -34,7 +34,7 @@
 namespace octave
 {
   tree_anon_scopes::tree_anon_scopes (tree_anon_fcn_handle& anon_fh)
-    : m_params (), m_vars ()
+    : tree_walker (), m_params (), m_vars ()
   {
     visit_anon_fcn_handle (anon_fh);
   }
@@ -74,115 +74,6 @@
   // e.g. identifiers and left hand sides of assignments are ignored).
 
   void
-  tree_anon_scopes::visit_argument_list (tree_argument_list& lst)
-  {
-    tree_argument_list::iterator p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_expression *elt = *p++;
-
-        if (elt)
-          {
-            elt->accept (*this);
-          }
-      }
-  }
-
-  void
-  tree_anon_scopes::visit_binary_expression (tree_binary_expression& expr)
-  {
-    tree_expression *op1 = expr.lhs ();
-
-    if (op1)
-      op1->accept (*this);
-
-    tree_expression *op2 = expr.rhs ();
-
-    if (op2)
-      op2->accept (*this);
-  }
-
-  void
-  tree_anon_scopes::visit_break_command (tree_break_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_colon_expression (tree_colon_expression& expr)
-  {
-    tree_expression *op1 = expr.base ();
-
-    if (op1)
-      op1->accept (*this);
-
-    tree_expression *op3 = expr.increment ();
-
-    if (op3)
-      op3->accept (*this);
-
-    tree_expression *op2 = expr.limit ();
-
-    if (op2)
-      op2->accept (*this);
-  }
-
-  void
-  tree_anon_scopes::visit_continue_command (tree_continue_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_decl_command (tree_decl_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_decl_elt (tree_decl_elt&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_decl_init_list (tree_decl_init_list&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_simple_for_command (tree_simple_for_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_complex_for_command (tree_complex_for_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_octave_user_script (octave_user_script&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_octave_user_function (octave_user_function&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_function_def (tree_function_def&)
-  {
-    panic_impossible ();
-  }
-
-  void
   tree_anon_scopes::visit_identifier (tree_identifier& id)
   {
     std::string nm = id.name ();
@@ -192,116 +83,6 @@
   }
 
   void
-  tree_anon_scopes::visit_if_clause (tree_if_clause&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_if_command (tree_if_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_if_command_list (tree_if_command_list&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_switch_case (tree_switch_case&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_switch_case_list (tree_switch_case_list&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_switch_command (tree_switch_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_index_expression (tree_index_expression& expr)
-  {
-    tree_expression *e = expr.expression ();
-
-    if (e)
-      e->accept (*this);
-
-    std::list<tree_argument_list *> lst = expr.arg_lists ();
-
-    std::list<tree_argument_list *>::iterator p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_argument_list *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_anon_scopes::visit_matrix (tree_matrix& lst)
-  {
-    tree_matrix::iterator p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_argument_list *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_anon_scopes::visit_cell (tree_cell& lst)
-  {
-    tree_matrix::iterator p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_argument_list *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_anon_scopes::visit_multi_assignment (tree_multi_assignment& expr)
-  {
-    tree_expression *rhs = expr.right_hand_side ();
-
-    if (rhs)
-      rhs->accept (*this);
-  }
-
-  void
-  tree_anon_scopes::visit_no_op_command (tree_no_op_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_constant (tree_constant& /* val */)
-  {
-  }
-
-  void
-  tree_anon_scopes::visit_fcn_handle (tree_fcn_handle& /* fh */)
-  {
-  }
-
-  void
   tree_anon_scopes::visit_parameter_list (tree_parameter_list&)
   {
     // In visit_anon_fcn_handle we only accept/visit the body of
@@ -311,53 +92,6 @@
   }
 
   void
-  tree_anon_scopes::visit_postfix_expression (tree_postfix_expression& expr)
-  {
-    tree_expression *e = expr.operand ();
-
-    if (e)
-      e->accept (*this);
-  }
-
-  void
-  tree_anon_scopes::visit_prefix_expression (tree_prefix_expression& expr)
-  {
-    tree_expression *e = expr.operand ();
-
-    if (e)
-      e->accept (*this);
-  }
-
-  void
-  tree_anon_scopes::visit_return_command (tree_return_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_return_list (tree_return_list& lst)
-  {
-    tree_return_list::iterator p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_index_expression *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_anon_scopes::visit_simple_assignment (tree_simple_assignment& expr)
-  {
-    tree_expression *rhs = expr.right_hand_side ();
-
-    if (rhs)
-      rhs->accept (*this);
-  }
-
-  void
   tree_anon_scopes::visit_statement (tree_statement& stmt)
   {
     tree_command *cmd = stmt.command ();
@@ -384,29 +118,5 @@
           elt->accept (*this);
       }
   }
-
-  void
-  tree_anon_scopes::visit_try_catch_command (tree_try_catch_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_unwind_protect_command (tree_unwind_protect_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_while_command (tree_while_command&)
-  {
-    panic_impossible ();
-  }
-
-  void
-  tree_anon_scopes::visit_do_until_command (tree_do_until_command&)
-  {
-    panic_impossible ();
-  }
 }
 
--- a/libinterp/parse-tree/pt-anon-scopes.h	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-anon-scopes.h	Wed Nov 20 00:01:18 2019 -0600
@@ -60,84 +60,14 @@
 
     void visit_anon_fcn_handle (tree_anon_fcn_handle&);
 
-    void visit_argument_list (tree_argument_list&);
-
-    void visit_binary_expression (tree_binary_expression&);
-
-    void visit_break_command (tree_break_command&);
-
-    void visit_colon_expression (tree_colon_expression&);
-
-    void visit_continue_command(tree_continue_command&);
-
-    void visit_decl_command (tree_decl_command&);
-
-    void visit_decl_elt (tree_decl_elt&);
-
-    void visit_decl_init_list (tree_decl_init_list&);
-
-    void visit_simple_for_command (tree_simple_for_command&);
-
-    void visit_complex_for_command (tree_complex_for_command&);
-
-    void visit_octave_user_script (octave_user_script&);
-
-    void visit_octave_user_function (octave_user_function&);
-
-    void visit_function_def (tree_function_def&);
-
     void visit_identifier (tree_identifier&);
 
-    void visit_if_clause (tree_if_clause&);
-
-    void visit_if_command (tree_if_command&);
-
-    void visit_if_command_list (tree_if_command_list&);
-
-    void visit_switch_case (tree_switch_case&);
-
-    void visit_switch_case_list (tree_switch_case_list&);
-
-    void visit_switch_command (tree_switch_command&);
-
-    void visit_index_expression (tree_index_expression&);
-
-    void visit_matrix (tree_matrix&);
-
-    void visit_cell (tree_cell&);
-
-    void visit_multi_assignment (tree_multi_assignment&);
-
-    void visit_no_op_command (tree_no_op_command&);
-
-    void visit_constant (tree_constant&);
-
-    void visit_fcn_handle (tree_fcn_handle&);
-
     void visit_parameter_list (tree_parameter_list&);
 
-    void visit_postfix_expression (tree_postfix_expression&);
-
-    void visit_prefix_expression (tree_prefix_expression&);
-
-    void visit_return_command (tree_return_command&);
-
-    void visit_return_list (tree_return_list&);
-
-    void visit_simple_assignment (tree_simple_assignment&);
-
     void visit_statement (tree_statement&);
 
     void visit_statement_list (tree_statement_list&);
 
-    void visit_try_catch_command (tree_try_catch_command&);
-
-    void visit_unwind_protect_command (tree_unwind_protect_command&);
-
-    void visit_while_command (tree_while_command&);
-
-    void visit_do_until_command (tree_do_until_command&);
-
   private:
 
     // Variable names that are function parameters.
--- a/libinterp/parse-tree/pt-bp.cc	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-bp.cc	Wed Nov 20 00:01:18 2019 -0600
@@ -145,24 +145,6 @@
   }
 
   void
-  tree_breakpoint::visit_octave_user_script (octave_user_script& fcn)
-  {
-    tree_statement_list *cmd_list = fcn.body ();
-
-    if (cmd_list)
-      cmd_list->accept (*this);
-  }
-
-  void
-  tree_breakpoint::visit_octave_user_function (octave_user_function& fcn)
-  {
-    tree_statement_list *cmd_list = fcn.body ();
-
-    if (cmd_list)
-      cmd_list->accept (*this);
-  }
-
-  void
   tree_breakpoint::visit_octave_user_function_header (octave_user_function&)
   {
     panic_impossible ();
@@ -175,17 +157,6 @@
   }
 
   void
-  tree_breakpoint::visit_function_def (tree_function_def& fdef)
-  {
-    octave_value fcn = fdef.function ();
-
-    octave_function *f = fcn.function_value ();
-
-    if (f)
-      f->accept (*this);
-  }
-
-  void
   tree_breakpoint::visit_identifier (tree_identifier&)
   {
     panic_impossible ();
@@ -198,15 +169,6 @@
   }
 
   void
-  tree_breakpoint::visit_if_command (tree_if_command& cmd)
-  {
-    tree_if_command_list *lst = cmd.cmd_list ();
-
-    if (lst)
-      lst->accept (*this);
-  }
-
-  void
   tree_breakpoint::visit_if_command_list (tree_if_command_list& lst)
   {
     for (tree_if_clause *t : lst)
--- a/libinterp/parse-tree/pt-bp.h	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-bp.h	Wed Nov 20 00:01:18 2019 -0600
@@ -81,22 +81,15 @@
 
     void visit_complex_for_command (tree_complex_for_command&);
 
-    void visit_octave_user_script (octave_user_script&);
-
-    void visit_octave_user_function (octave_user_function&);
-
     void visit_octave_user_function_header (octave_user_function&);
 
     void visit_octave_user_function_trailer (octave_user_function&);
 
-    void visit_function_def (tree_function_def&);
 
     void visit_identifier (tree_identifier&);
 
     void visit_if_clause (tree_if_clause&);
 
-    void visit_if_command (tree_if_command&);
-
     void visit_if_command_list (tree_if_command_list&);
 
     void visit_index_expression (tree_index_expression&);
--- a/libinterp/parse-tree/pt-check.cc	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-check.cc	Wed Nov 20 00:01:18 2019 -0600
@@ -49,84 +49,6 @@
   }
 
   void
-  tree_checker::visit_binary_expression (tree_binary_expression& expr)
-  {
-    tree_expression *op1 = expr.lhs ();
-
-    if (op1)
-      op1->accept (*this);
-
-    tree_expression *op2 = expr.rhs ();
-
-    if (op2)
-      op2->accept (*this);
-  }
-
-  void
-  tree_checker::visit_break_command (tree_break_command&)
-  { }
-
-  void
-  tree_checker::visit_colon_expression (tree_colon_expression& expr)
-  {
-    tree_expression *op1 = expr.base ();
-
-    if (op1)
-      op1->accept (*this);
-
-    tree_expression *op3 = expr.increment ();
-
-    if (op3)
-      op3->accept (*this);
-
-    tree_expression *op2 = expr.limit ();
-
-    if (op2)
-      op2->accept (*this);
-  }
-
-  void
-  tree_checker::visit_continue_command (tree_continue_command&)
-  { }
-
-  void
-  tree_checker::visit_decl_command (tree_decl_command& cmd)
-  {
-    tree_decl_init_list *init_list = cmd.initializer_list ();
-
-    if (init_list)
-      init_list->accept (*this);
-  }
-
-  void
-  tree_checker::visit_decl_init_list (tree_decl_init_list& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_decl_elt *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_checker::visit_decl_elt (tree_decl_elt& cmd)
-  {
-    tree_identifier *id = cmd.ident ();
-
-    if (id)
-      id->accept (*this);
-
-    tree_expression *expr = cmd.expression ();
-
-    if (expr)
-      expr->accept (*this);
-  }
-
-  void
   tree_checker::visit_simple_for_command (tree_simple_for_command& cmd)
   {
     tree_expression *lhs = cmd.left_hand_side ();
@@ -185,125 +107,6 @@
   }
 
   void
-  tree_checker::visit_octave_user_script (octave_user_script& fcn)
-  {
-    tree_statement_list *cmd_list = fcn.body ();
-
-    if (cmd_list)
-      cmd_list->accept (*this);
-  }
-
-  void
-  tree_checker::visit_octave_user_function (octave_user_function& fcn)
-  {
-    tree_statement_list *cmd_list = fcn.body ();
-
-    if (cmd_list)
-      cmd_list->accept (*this);
-  }
-
-  void
-  tree_checker::visit_function_def (tree_function_def& fdef)
-  {
-    octave_value fcn = fdef.function ();
-
-    octave_function *f = fcn.function_value ();
-
-    if (f)
-      f->accept (*this);
-  }
-
-  void
-  tree_checker::visit_identifier (tree_identifier& /* id */)
-  { }
-
-  void
-  tree_checker::visit_if_clause (tree_if_clause& cmd)
-  {
-    tree_expression *expr = cmd.condition ();
-
-    if (expr)
-      expr->accept (*this);
-
-    tree_statement_list *list = cmd.commands ();
-
-    if (list)
-      list->accept (*this);
-  }
-
-  void
-  tree_checker::visit_if_command (tree_if_command& cmd)
-  {
-    tree_if_command_list *list = cmd.cmd_list ();
-
-    if (list)
-      list->accept (*this);
-  }
-
-  void
-  tree_checker::visit_if_command_list (tree_if_command_list& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_if_clause *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_checker::visit_index_expression (tree_index_expression& expr)
-  {
-    tree_expression *e = expr.expression ();
-
-    if (e)
-      e->accept (*this);
-
-    std::list<tree_argument_list *> lst = expr.arg_lists ();
-
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_argument_list *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_checker::visit_matrix (tree_matrix& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_argument_list *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_checker::visit_cell (tree_cell& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_argument_list *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
   tree_checker::visit_multi_assignment (tree_multi_assignment& expr)
   {
     tree_argument_list *lhs = expr.left_hand_side ();
@@ -324,72 +127,6 @@
   }
 
   void
-  tree_checker::visit_no_op_command (tree_no_op_command& /* cmd */)
-  { }
-
-  void
-  tree_checker::visit_anon_fcn_handle (tree_anon_fcn_handle& /* afh */)
-  { }
-
-  void
-  tree_checker::visit_constant (tree_constant& /* val */)
-  { }
-
-  void
-  tree_checker::visit_fcn_handle (tree_fcn_handle& /* fh */)
-  { }
-
-  void
-  tree_checker::visit_parameter_list (tree_parameter_list& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_decl_elt *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_checker::visit_postfix_expression (tree_postfix_expression& expr)
-  {
-    tree_expression *e = expr.operand ();
-
-    if (e)
-      e->accept (*this);
-  }
-
-  void
-  tree_checker::visit_prefix_expression (tree_prefix_expression& expr)
-  {
-    tree_expression *e = expr.operand ();
-
-    if (e)
-      e->accept (*this);
-  }
-
-  void
-  tree_checker::visit_return_command (tree_return_command&)
-  { }
-
-  void
-  tree_checker::visit_return_list (tree_return_list& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_index_expression *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
   tree_checker::visit_simple_assignment (tree_simple_assignment& expr)
   {
     tree_expression *lhs = expr.left_hand_side ();
@@ -407,74 +144,6 @@
   }
 
   void
-  tree_checker::visit_statement (tree_statement& stmt)
-  {
-    tree_command *cmd = stmt.command ();
-
-    if (cmd)
-      cmd->accept (*this);
-    else
-      {
-        tree_expression *expr = stmt.expression ();
-
-        if (expr)
-          expr->accept (*this);
-      }
-  }
-
-  void
-  tree_checker::visit_statement_list (tree_statement_list& lst)
-  {
-    for (tree_statement *elt : lst)
-      {
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_checker::visit_switch_case (tree_switch_case& cs)
-  {
-    tree_expression *label = cs.case_label ();
-
-    if (label)
-      label->accept (*this);
-
-    tree_statement_list *list = cs.commands ();
-
-    if (list)
-      list->accept (*this);
-  }
-
-  void
-  tree_checker::visit_switch_case_list (tree_switch_case_list& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_switch_case *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
-  tree_checker::visit_switch_command (tree_switch_command& cmd)
-  {
-    tree_expression *expr = cmd.switch_value ();
-
-    if (expr)
-      expr->accept (*this);
-
-    tree_switch_case_list *list = cmd.case_list ();
-
-    if (list)
-      list->accept (*this);
-  }
-
-  void
   tree_checker::visit_try_catch_command (tree_try_catch_command& cmd)
   {
     tree_statement_list *try_code = cmd.body ();
@@ -498,48 +167,6 @@
   }
 
   void
-  tree_checker::visit_unwind_protect_command (tree_unwind_protect_command& cmd)
-  {
-    tree_statement_list *unwind_protect_code = cmd.body ();
-
-    if (unwind_protect_code)
-      unwind_protect_code->accept (*this);
-
-    tree_statement_list *cleanup_code = cmd.cleanup ();
-
-    if (cleanup_code)
-      cleanup_code->accept (*this);
-  }
-
-  void
-  tree_checker::visit_while_command (tree_while_command& cmd)
-  {
-    tree_expression *expr = cmd.condition ();
-
-    if (expr)
-      expr->accept (*this);
-
-    tree_statement_list *list = cmd.body ();
-
-    if (list)
-      list->accept (*this);
-  }
-
-  void
-  tree_checker::visit_do_until_command (tree_do_until_command& cmd)
-  {
-    tree_statement_list *list = cmd.body ();
-
-    if (list)
-      list->accept (*this);
-
-    tree_expression *expr = cmd.condition ();
-
-    if (expr)
-      expr->accept (*this);
-  }
-
-  void
   tree_checker::errmsg (const std::string& msg, int line)
   {
     if (m_file_name.empty ())
--- a/libinterp/parse-tree/pt-check.h	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-check.h	Wed Nov 20 00:01:18 2019 -0600
@@ -52,84 +52,16 @@
 
     void visit_argument_list (tree_argument_list&);
 
-    void visit_binary_expression (tree_binary_expression&);
-
-    void visit_break_command (tree_break_command&);
-
-    void visit_colon_expression (tree_colon_expression&);
-
-    void visit_continue_command(tree_continue_command&);
-
-    void visit_decl_command (tree_decl_command&);
-
-    void visit_decl_init_list (tree_decl_init_list&);
-
-    void visit_decl_elt (tree_decl_elt&);
-
     void visit_simple_for_command (tree_simple_for_command&);
 
     void visit_complex_for_command (tree_complex_for_command&);
 
-    void visit_octave_user_script (octave_user_script&);
-
-    void visit_octave_user_function (octave_user_function&);
-
-    void visit_function_def (tree_function_def&);
-
-    void visit_identifier (tree_identifier&);
-
-    void visit_if_clause (tree_if_clause&);
-
-    void visit_if_command (tree_if_command&);
-
-    void visit_if_command_list (tree_if_command_list&);
-
-    void visit_index_expression (tree_index_expression&);
-
-    void visit_matrix (tree_matrix&);
-
-    void visit_cell (tree_cell&);
-
     void visit_multi_assignment (tree_multi_assignment&);
 
-    void visit_no_op_command (tree_no_op_command&);
-
-    void visit_anon_fcn_handle (tree_anon_fcn_handle&);
-
-    void visit_constant (tree_constant&);
-
-    void visit_fcn_handle (tree_fcn_handle&);
-
-    void visit_parameter_list (tree_parameter_list&);
-
-    void visit_postfix_expression (tree_postfix_expression&);
-
-    void visit_prefix_expression (tree_prefix_expression&);
-
-    void visit_return_command (tree_return_command&);
-
-    void visit_return_list (tree_return_list&);
-
     void visit_simple_assignment (tree_simple_assignment&);
 
-    void visit_statement (tree_statement&);
-
-    void visit_statement_list (tree_statement_list&);
-
-    void visit_switch_case (tree_switch_case&);
-
-    void visit_switch_case_list (tree_switch_case_list&);
-
-    void visit_switch_command (tree_switch_command&);
-
     void visit_try_catch_command (tree_try_catch_command&);
 
-    void visit_unwind_protect_command (tree_unwind_protect_command&);
-
-    void visit_while_command (tree_while_command&);
-
-    void visit_do_until_command (tree_do_until_command&);
-
   private:
 
     bool m_do_lvalue_check;
--- a/libinterp/parse-tree/pt-eval.cc	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-eval.cc	Wed Nov 20 00:01:18 2019 -0600
@@ -2016,16 +2016,6 @@
   }
 
   void
-  tree_evaluator::visit_decl_init_list (tree_decl_init_list& lst)
-  {
-    // FIXME: tree_decl_elt is not derived from tree, so should it
-    // really have an accept method?
-
-    for (tree_decl_elt *elt : lst)
-      elt->accept (*this);
-  }
-
-  void
   tree_evaluator::visit_decl_elt (tree_decl_elt& elt)
   {
     tree_identifier *id = elt.ident ();
--- a/libinterp/parse-tree/pt-eval.h	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-eval.h	Wed Nov 20 00:01:18 2019 -0600
@@ -192,8 +192,6 @@
 
     void visit_decl_command (tree_decl_command&);
 
-    void visit_decl_init_list (tree_decl_init_list&);
-
     void visit_decl_elt (tree_decl_elt&);
 
     void visit_simple_for_command (tree_simple_for_command&);
--- a/libinterp/parse-tree/pt-jit.cc	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-jit.cc	Wed Nov 20 00:01:18 2019 -0600
@@ -580,14 +580,6 @@
   }
 
   void
-  jit_convert::visit_if_command (tree_if_command& cmd)
-  {
-    tree_if_command_list *lst = cmd.cmd_list ();
-    assert (lst); // jwe: Can this be null?
-    lst->accept (*this);
-  }
-
-  void
   jit_convert::visit_if_command_list (tree_if_command_list& lst)
   {
     tree_if_clause *last = lst.back ();
@@ -849,18 +841,6 @@
   }
 
   void
-  jit_convert::visit_statement_list (tree_statement_list& lst)
-  {
-    for (auto iter = lst.begin (); iter != lst.end(); ++iter)
-      {
-        tree_statement *elt = *iter;
-        // jwe: Can this ever be null?
-        assert (elt);
-        elt->accept (*this);
-      }
-  }
-
-  void
   jit_convert::visit_switch_case (tree_switch_case&)
   {
     throw jit_fail_exception ("No visit_switch_case implementation");
--- a/libinterp/parse-tree/pt-pr-code.cc	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-pr-code.cc	Wed Nov 20 00:01:18 2019 -0600
@@ -912,20 +912,6 @@
   }
 
   void
-  tree_print_code::visit_switch_case_list (tree_switch_case_list& lst)
-  {
-    auto p = lst.begin ();
-
-    while (p != lst.end ())
-      {
-        tree_switch_case *elt = *p++;
-
-        if (elt)
-          elt->accept (*this);
-      }
-  }
-
-  void
   tree_print_code::visit_switch_command (tree_switch_command& cmd)
   {
     print_comment_list (cmd.leading_comment ());
--- a/libinterp/parse-tree/pt-pr-code.h	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-pr-code.h	Wed Nov 20 00:01:18 2019 -0600
@@ -135,8 +135,6 @@
 
     void visit_switch_case (tree_switch_case&);
 
-    void visit_switch_case_list (tree_switch_case_list&);
-
     void visit_switch_command (tree_switch_command&);
 
     void visit_try_catch_command (tree_try_catch_command&);
--- a/libinterp/parse-tree/pt-walk.cc	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-walk.cc	Wed Nov 20 00:01:18 2019 -0600
@@ -24,21 +24,564 @@
 #  include "config.h"
 #endif
 
-#include "pt-binop.h"
-#include "pt-cbinop.h"
-#include "pt-walk.h"
+#include "pt-all.h"
 
 namespace octave
 {
-  void
-  tree_walker::visit_boolean_expression (tree_boolean_expression& expr)
+  void tree_walker::visit_anon_fcn_handle (tree_anon_fcn_handle&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_argument_list (tree_argument_list& lst)
+  {
+    auto p = lst.begin ();
+
+    while (p != lst.end ())
+      {
+        tree_expression *elt = *p++;
+
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_binary_expression (tree_binary_expression& expr)
+  {
+    tree_expression *op1 = expr.lhs ();
+
+    if (op1)
+      op1->accept (*this);
+
+    tree_expression *op2 = expr.rhs ();
+
+    if (op2)
+      op2->accept (*this);
+  }
+
+  void tree_walker::visit_boolean_expression (tree_boolean_expression& expr)
+  {
+    visit_binary_expression (expr);
+  }
+
+  void tree_walker::visit_compound_binary_expression (tree_compound_binary_expression& expr)
   {
     visit_binary_expression (expr);
   }
 
-  void
-  tree_walker::visit_compound_binary_expression (tree_compound_binary_expression& expr)
+  void tree_walker::visit_break_command (tree_break_command&)
+  {
+    // Nothing to do.
+  }
+
+  void tree_walker::visit_colon_expression (tree_colon_expression& expr)
+  {
+    tree_expression *op1 = expr.base ();
+
+    if (op1)
+      op1->accept (*this);
+
+    tree_expression *op3 = expr.increment ();
+
+    if (op3)
+      op3->accept (*this);
+
+    tree_expression *op2 = expr.limit ();
+
+    if (op2)
+      op2->accept (*this);
+  }
+
+  void tree_walker::visit_continue_command (tree_continue_command&)
+  {
+    // Nothing to do.
+  }
+
+  void tree_walker::visit_decl_command (tree_decl_command& cmd)
+  {
+    tree_decl_init_list *init_list = cmd.initializer_list ();
+
+    if (init_list)
+      init_list->accept (*this);
+  }
+
+  void tree_walker::visit_decl_elt (tree_decl_elt& cmd)
+  {
+    tree_identifier *id = cmd.ident ();
+
+    if (id)
+      id->accept (*this);
+
+    tree_expression *expr = cmd.expression ();
+
+    if (expr)
+      expr->accept (*this);
+  }
+
+  void tree_walker::visit_decl_init_list (tree_decl_init_list& lst)
+  {
+    // FIXME: tree_decl_elt is not derived from tree, so should it
+    // really have an accept method?
+
+    for (tree_decl_elt *elt : lst)
+      {
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_simple_for_command (tree_simple_for_command& cmd)
+  {
+    tree_expression *lhs = cmd.left_hand_side ();
+
+    if (lhs)
+      lhs->accept (*this);
+
+    tree_expression *expr = cmd.control_expr ();
+
+    if (expr)
+      expr->accept (*this);
+
+    tree_expression *maxproc = cmd.maxproc_expr ();
+
+    if (maxproc)
+      maxproc->accept (*this);
+
+    tree_statement_list *list = cmd.body ();
+
+    if (list)
+      list->accept (*this);
+  }
+
+  void tree_walker::visit_complex_for_command (tree_complex_for_command& cmd)
+  {
+    tree_argument_list *lhs = cmd.left_hand_side ();
+
+    if (lhs)
+      lhs->accept (*this);
+
+    tree_expression *expr = cmd.control_expr ();
+
+    if (expr)
+      expr->accept (*this);
+
+    tree_statement_list *list = cmd.body ();
+
+    if (list)
+      list->accept (*this);
+  }
+
+  void tree_walker::visit_octave_user_script (octave_user_script& fcn)
+  {
+    tree_statement_list *cmd_list = fcn.body ();
+
+    if (cmd_list)
+      cmd_list->accept (*this);
+  }
+
+  void tree_walker::visit_octave_user_function (octave_user_function& fcn)
+  {
+    tree_statement_list *cmd_list = fcn.body ();
+
+    if (cmd_list)
+      cmd_list->accept (*this);
+  }
+
+  void tree_walker::visit_function_def (tree_function_def& fdef)
+  {
+    octave_value fcn = fdef.function ();
+
+    octave_function *f = fcn.function_value ();
+
+    if (f)
+      f->accept (*this);
+  }
+
+  void tree_walker::visit_identifier (tree_identifier&)
+  {
+    // Nothing to do.
+  }
+
+  void tree_walker::visit_if_clause (tree_if_clause& cmd)
+  {
+    tree_expression *expr = cmd.condition ();
+
+    if (expr)
+      expr->accept (*this);
+
+    tree_statement_list *list = cmd.commands ();
+
+    if (list)
+      list->accept (*this);
+  }
+
+  void tree_walker::visit_if_command (tree_if_command& cmd)
+  {
+    tree_if_command_list *list = cmd.cmd_list ();
+
+    if (list)
+      list->accept (*this);
+  }
+
+  void tree_walker::visit_if_command_list (tree_if_command_list& lst)
+  {
+    auto p = lst.begin ();
+
+    while (p != lst.end ())
+      {
+        tree_if_clause *elt = *p++;
+
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_switch_case (tree_switch_case& cs)
+  {
+    tree_expression *label = cs.case_label ();
+
+    if (label)
+      label->accept (*this);
+
+    tree_statement_list *list = cs.commands ();
+
+    if (list)
+      list->accept (*this);
+  }
+
+  void tree_walker::visit_switch_case_list (tree_switch_case_list& lst)
+  {
+    auto p = lst.begin ();
+
+    while (p != lst.end ())
+      {
+        tree_switch_case *elt = *p++;
+
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_switch_command (tree_switch_command& cmd)
+  {
+    tree_expression *expr = cmd.switch_value ();
+
+    if (expr)
+      expr->accept (*this);
+
+    tree_switch_case_list *list = cmd.case_list ();
+
+    if (list)
+      list->accept (*this);
+  }
+
+  void tree_walker::visit_index_expression (tree_index_expression& expr)
+  {
+    tree_expression *e = expr.expression ();
+
+    if (e)
+      e->accept (*this);
+
+    std::list<tree_argument_list *> lst = expr.arg_lists ();
+
+    auto p = lst.begin ();
+
+    while (p != lst.end ())
+      {
+        tree_argument_list *elt = *p++;
+
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_matrix (tree_matrix& lst)
+  {
+    auto p = lst.begin ();
+
+    while (p != lst.end ())
+      {
+        tree_argument_list *elt = *p++;
+
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_cell (tree_cell& lst)
+  {
+    auto p = lst.begin ();
+
+    while (p != lst.end ())
+      {
+        tree_argument_list *elt = *p++;
+
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_multi_assignment (tree_multi_assignment& expr)
   {
-    visit_binary_expression (expr);
+    tree_argument_list *lhs = expr.left_hand_side ();
+
+    if (lhs)
+      lhs->accept (*this);
+
+    tree_expression *rhs = expr.right_hand_side ();
+
+    if (rhs)
+      rhs->accept (*this);
+  }
+
+  void tree_walker::visit_no_op_command (tree_no_op_command&)
+  {
+    // Nothing to do.
+  }
+
+  void tree_walker::visit_constant (tree_constant&)
+  {
+    // Nothing to do.
+  }
+
+  void tree_walker::visit_fcn_handle (tree_fcn_handle&)
+  {
+    // Nothing to do.
+  }
+
+  void tree_walker::visit_parameter_list (tree_parameter_list& lst)
+  {
+    auto p = lst.begin ();
+
+    while (p != lst.end ())
+      {
+        tree_decl_elt *elt = *p++;
+
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_postfix_expression (tree_postfix_expression& expr)
+  {
+    tree_expression *e = expr.operand ();
+
+    if (e)
+      e->accept (*this);
+  }
+
+  void tree_walker::visit_prefix_expression (tree_prefix_expression& expr)
+  {
+    tree_expression *e = expr.operand ();
+
+    if (e)
+      e->accept (*this);
+  }
+
+  void tree_walker::visit_return_command (tree_return_command&)
+  {
+    // Nothing to do.
+  }
+
+  void tree_walker::visit_return_list (tree_return_list& lst)
+  {
+    auto p = lst.begin ();
+
+    while (p != lst.end ())
+      {
+        tree_index_expression *elt = *p++;
+
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_simple_assignment (tree_simple_assignment& expr)
+  {
+    tree_expression *lhs = expr.left_hand_side ();
+
+    if (lhs)
+      lhs->accept (*this);
+
+    tree_expression *rhs = expr.right_hand_side ();
+
+    if (rhs)
+      rhs->accept (*this);
+  }
+
+  void tree_walker::visit_statement (tree_statement& stmt)
+  {
+    tree_command *cmd = stmt.command ();
+
+    if (cmd)
+      cmd->accept (*this);
+    else
+      {
+        tree_expression *expr = stmt.expression ();
+
+        if (expr)
+          expr->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_statement_list (tree_statement_list& lst)
+  {
+    for (tree_statement *elt : lst)
+      {
+        if (elt)
+          elt->accept (*this);
+      }
+  }
+
+  void tree_walker::visit_try_catch_command (tree_try_catch_command& cmd)
+  {
+    tree_statement_list *try_code = cmd.body ();
+
+    if (try_code)
+      try_code->accept (*this);
+
+    tree_identifier *expr_id = cmd.identifier ();
+
+    if (expr_id)
+      expr_id->accept (*this);
+
+    tree_statement_list *catch_code = cmd.cleanup ();
+
+    if (catch_code)
+      catch_code->accept (*this);
+  }
+
+  void tree_walker::visit_unwind_protect_command (tree_unwind_protect_command& cmd)
+  {
+    tree_statement_list *unwind_protect_code = cmd.body ();
+
+    if (unwind_protect_code)
+      unwind_protect_code->accept (*this);
+
+    tree_statement_list *cleanup_code = cmd.cleanup ();
+
+    if (cleanup_code)
+      cleanup_code->accept (*this);
+  }
+
+  void tree_walker::visit_while_command (tree_while_command& cmd)
+  {
+    tree_expression *expr = cmd.condition ();
+
+    if (expr)
+      expr->accept (*this);
+
+    tree_statement_list *list = cmd.body ();
+
+    if (list)
+      list->accept (*this);
+  }
+
+  void tree_walker::visit_do_until_command (tree_do_until_command& cmd)
+  {
+    tree_statement_list *list = cmd.body ();
+
+    if (list)
+      list->accept (*this);
+
+    tree_expression *expr = cmd.condition ();
+
+    if (expr)
+      expr->accept (*this);
+  }
+
+  void tree_walker::visit_superclass_ref (tree_superclass_ref&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_metaclass_query (tree_metaclass_query&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_attribute (tree_classdef_attribute&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_attribute_list (tree_classdef_attribute_list&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_superclass (tree_classdef_superclass&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_superclass_list (tree_classdef_superclass_list&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_property (tree_classdef_property&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_property_list (tree_classdef_property_list&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_properties_block (tree_classdef_properties_block&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_methods_list (tree_classdef_methods_list&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_methods_block (tree_classdef_methods_block&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_event (tree_classdef_event&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_events_list (tree_classdef_events_list&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_events_block (tree_classdef_events_block&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_enum (tree_classdef_enum&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_enum_list (tree_classdef_enum_list&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_enum_block (tree_classdef_enum_block&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef_body (tree_classdef_body&)
+  {
+    // FIXME?
+  }
+
+  void tree_walker::visit_classdef (tree_classdef&)
+  {
+    // FIXME?
   }
 }
--- a/libinterp/parse-tree/pt-walk.h	Wed Nov 20 07:33:24 2019 +0100
+++ b/libinterp/parse-tree/pt-walk.h	Wed Nov 20 00:01:18 2019 -0600
@@ -114,188 +114,127 @@
 
     tree_walker& operator = (const tree_walker&) = delete;
 
-    virtual void
-    visit_anon_fcn_handle (tree_anon_fcn_handle&) = 0;
+    virtual void visit_anon_fcn_handle (tree_anon_fcn_handle&);
 
-    virtual void
-    visit_argument_list (tree_argument_list&) = 0;
+    virtual void visit_argument_list (tree_argument_list&);
 
-    virtual void
-    visit_binary_expression (tree_binary_expression&) = 0;
+    virtual void visit_binary_expression (tree_binary_expression&);
 
-    virtual void
-    visit_boolean_expression (tree_boolean_expression& expr);
+    virtual void visit_boolean_expression (tree_boolean_expression&);
 
-    virtual void
-    visit_compound_binary_expression (tree_compound_binary_expression& expr);
+    virtual void visit_compound_binary_expression (tree_compound_binary_expression&);
 
-    virtual void
-    visit_break_command (tree_break_command&) = 0;
+    virtual void visit_break_command (tree_break_command&);
 
-    virtual void
-    visit_colon_expression (tree_colon_expression&) = 0;
+    virtual void visit_colon_expression (tree_colon_expression&);
 
-    virtual void
-    visit_continue_command (tree_continue_command&) = 0;
+    virtual void visit_continue_command (tree_continue_command&);
 
-    virtual void
-    visit_decl_command (tree_decl_command&) = 0;
+    virtual void visit_decl_command (tree_decl_command&);
 
-    virtual void
-    visit_decl_elt (tree_decl_elt&) = 0;
+    virtual void visit_decl_elt (tree_decl_elt&);
 
-    virtual void
-    visit_decl_init_list (tree_decl_init_list&) = 0;
+    virtual void visit_decl_init_list (tree_decl_init_list&);
 
-    virtual void
-    visit_simple_for_command (tree_simple_for_command&) = 0;
+    virtual void visit_simple_for_command (tree_simple_for_command&);
 
-    virtual void
-    visit_complex_for_command (tree_complex_for_command&) = 0;
+    virtual void visit_complex_for_command (tree_complex_for_command&);
 
-    virtual void
-    visit_octave_user_script (octave_user_script&) = 0;
+    virtual void visit_octave_user_script (octave_user_script&);
 
-    virtual void
-    visit_octave_user_function (octave_user_function&) = 0;
+    virtual void visit_octave_user_function (octave_user_function&);
 
-    virtual void
-    visit_function_def (tree_function_def&) = 0;
+    virtual void visit_function_def (tree_function_def&);
 
-    virtual void
-    visit_identifier (tree_identifier&) = 0;
+    virtual void visit_identifier (tree_identifier&);
 
-    virtual void
-    visit_if_clause (tree_if_clause&) = 0;
+    virtual void visit_if_clause (tree_if_clause&);
 
-    virtual void
-    visit_if_command (tree_if_command&) = 0;
+    virtual void visit_if_command (tree_if_command&);
 
-    virtual void
-    visit_if_command_list (tree_if_command_list&) = 0;
+    virtual void visit_if_command_list (tree_if_command_list&);
 
-    virtual void
-    visit_switch_case (tree_switch_case&) = 0;
+    virtual void visit_switch_case (tree_switch_case&);
 
-    virtual void
-    visit_switch_case_list (tree_switch_case_list&) = 0;
+    virtual void visit_switch_case_list (tree_switch_case_list&);
 
-    virtual void
-    visit_switch_command (tree_switch_command&) = 0;
+    virtual void visit_switch_command (tree_switch_command&);
 
-    virtual void
-    visit_index_expression (tree_index_expression&) = 0;
+    virtual void visit_index_expression (tree_index_expression&);
 
-    virtual void
-    visit_matrix (tree_matrix&) = 0;
+    virtual void visit_matrix (tree_matrix&);
 
-    virtual void
-    visit_cell (tree_cell&) = 0;
+    virtual void visit_cell (tree_cell&);
 
-    virtual void
-    visit_multi_assignment (tree_multi_assignment&) = 0;
+    virtual void visit_multi_assignment (tree_multi_assignment&);
 
-    virtual void
-    visit_no_op_command (tree_no_op_command&) = 0;
+    virtual void visit_no_op_command (tree_no_op_command&);
 
-    virtual void
-    visit_constant (tree_constant&) = 0;
+    virtual void visit_constant (tree_constant&);
 
-    virtual void
-    visit_fcn_handle (tree_fcn_handle&) = 0;
+    virtual void visit_fcn_handle (tree_fcn_handle&);
 
-    virtual void
-    visit_parameter_list (tree_parameter_list&) = 0;
+    virtual void visit_parameter_list (tree_parameter_list&);
 
-    virtual void
-    visit_postfix_expression (tree_postfix_expression&) = 0;
+    virtual void visit_postfix_expression (tree_postfix_expression&);
 
-    virtual void
-    visit_prefix_expression (tree_prefix_expression&) = 0;
+    virtual void visit_prefix_expression (tree_prefix_expression&);
 
-    virtual void
-    visit_return_command (tree_return_command&) = 0;
+    virtual void visit_return_command (tree_return_command&);
 
-    virtual void
-    visit_return_list (tree_return_list&) = 0;
+    virtual void visit_return_list (tree_return_list&);
 
-    virtual void
-    visit_simple_assignment (tree_simple_assignment&) = 0;
+    virtual void visit_simple_assignment (tree_simple_assignment&);
 
-    virtual void
-    visit_statement (tree_statement&) = 0;
+    virtual void visit_statement (tree_statement&);
 
-    virtual void
-    visit_statement_list (tree_statement_list&) = 0;
+    virtual void visit_statement_list (tree_statement_list&);
 
-    virtual void
-    visit_try_catch_command (tree_try_catch_command&) = 0;
+    virtual void visit_try_catch_command (tree_try_catch_command&);
 
-    virtual void
-    visit_unwind_protect_command (tree_unwind_protect_command&) = 0;
+    virtual void visit_unwind_protect_command (tree_unwind_protect_command&);
 
-    virtual void
-    visit_while_command (tree_while_command&) = 0;
+    virtual void visit_while_command (tree_while_command&);
 
-    virtual void
-    visit_do_until_command (tree_do_until_command&) = 0;
+    virtual void visit_do_until_command (tree_do_until_command&);
 
-    virtual void
-    visit_superclass_ref (tree_superclass_ref&) { } /* = 0; */
+    virtual void visit_superclass_ref (tree_superclass_ref&);
 
-    virtual void
-    visit_metaclass_query (tree_metaclass_query&) { } /* = 0; */
+    virtual void visit_metaclass_query (tree_metaclass_query&);
 
-    virtual void
-    visit_classdef_attribute (tree_classdef_attribute&) { } /* = 0; */
+    virtual void visit_classdef_attribute (tree_classdef_attribute&);
 
-    virtual void
-    visit_classdef_attribute_list (tree_classdef_attribute_list&) { } // = 0;
+    virtual void visit_classdef_attribute_list (tree_classdef_attribute_list&);
 
-    virtual void
-    visit_classdef_superclass (tree_classdef_superclass&) { } // = 0;
+    virtual void visit_classdef_superclass (tree_classdef_superclass&);
 
-    virtual void
-    visit_classdef_superclass_list (tree_classdef_superclass_list&) { } // = 0;
+    virtual void visit_classdef_superclass_list (tree_classdef_superclass_list&);
 
-    virtual void
-    visit_classdef_property (tree_classdef_property&) { } // = 0;
+    virtual void visit_classdef_property (tree_classdef_property&);
 
-    virtual void
-    visit_classdef_property_list (tree_classdef_property_list&) { } // = 0;
+    virtual void visit_classdef_property_list (tree_classdef_property_list&);
 
-    virtual void
-    visit_classdef_properties_block (tree_classdef_properties_block&) { } // = 0;
+    virtual void visit_classdef_properties_block (tree_classdef_properties_block&);
 
-    virtual void
-    visit_classdef_methods_list (tree_classdef_methods_list&) { } // = 0;
+    virtual void visit_classdef_methods_list (tree_classdef_methods_list&);
 
-    virtual void
-    visit_classdef_methods_block (tree_classdef_methods_block&) { } // = 0;
+    virtual void visit_classdef_methods_block (tree_classdef_methods_block&);
 
-    virtual void
-    visit_classdef_event (tree_classdef_event&) { } // = 0;
+    virtual void visit_classdef_event (tree_classdef_event&);
 
-    virtual void
-    visit_classdef_events_list (tree_classdef_events_list&) { } // = 0;
+    virtual void visit_classdef_events_list (tree_classdef_events_list&);
 
-    virtual void
-    visit_classdef_events_block (tree_classdef_events_block&) { } // = 0;
+    virtual void visit_classdef_events_block (tree_classdef_events_block&);
 
-    virtual void
-    visit_classdef_enum (tree_classdef_enum&) { } // = 0;
+    virtual void visit_classdef_enum (tree_classdef_enum&);
 
-    virtual void
-    visit_classdef_enum_list (tree_classdef_enum_list&) { } // = 0;
+    virtual void visit_classdef_enum_list (tree_classdef_enum_list&);
 
-    virtual void
-    visit_classdef_enum_block (tree_classdef_enum_block&) { } // = 0;
+    virtual void visit_classdef_enum_block (tree_classdef_enum_block&);
 
-    virtual void
-    visit_classdef_body (tree_classdef_body&) { } // = 0;
+    virtual void visit_classdef_body (tree_classdef_body&);
 
-    virtual void
-    visit_classdef (tree_classdef&) { } // = 0;
+    virtual void visit_classdef (tree_classdef&);
   };
 }