From octave-maintainers-request at bevo dot che dot wisc dot edu Fri Dec 13 16:25:06 2002 Subject: Patch for pt-check.cc/.h From: JD Cole To: "John W. Eaton" CC: octave-maintainers at bevo dot che dot wisc dot edu Date: Fri, 13 Dec 2002 14:36:15 -0800 This is a multi-part message in MIME format. --------------060000070802010305080203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I added visit_subplot_axes and visit_do_until_command. Since tree_checker is not instantiated anywhere in the code, the missing function don't show up upon compilation ... I think. Also, I was wondering curious about the current state of tree_checker, does it probably "gripe" about script syntax? If so, would it be usefull for anyone else to add some functionality which allows the following: tree_checker tc(tree_checker::non_verbose); stmt->accept(tc); if (tc.valid_syntax ()) go_on_my_way (); else try_again_man(); If not, I will just use tree_checker under another name. Thanks, JD --------------060000070802010305080203 Content-Type: text/plain; name="pt-check.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pt-check.patch" Index: src/pt-check.cc =================================================================== RCS file: /cvs/octave/src/pt-check.cc,v retrieving revision 1.11 diff -c -r1.11 pt-check.cc *** src/pt-check.cc 2002/12/06 21:29:18 1.11 --- src/pt-check.cc 2002/12/13 22:13:27 *************** *** 481,486 **** --- 481,491 ---- } void + tree_checker::visit_subplot_axes (subplot_axes& cmd) + { + } + + void tree_checker::visit_subplot_list (subplot_list& lst) { subplot_list::iterator p = lst.begin (); *************** *** 615,620 **** --- 620,639 ---- 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 Index: src/pt-check.h =================================================================== RCS file: /cvs/octave/src/pt-check.h,v retrieving revision 1.9 diff -c -r1.9 pt-check.h *** src/pt-check.h 2002/12/06 21:29:18 1.9 --- src/pt-check.h 2002/12/13 22:13:27 *************** *** 107,112 **** --- 107,114 ---- void visit_subplot (subplot&); + void visit_subplot_axes (subplot_axes&); + void visit_subplot_list (subplot_list&); void visit_subplot_style (subplot_style&); *************** *** 124,129 **** --- 126,133 ---- 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: --------------060000070802010305080203--