octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for pt-check.cc/.h


From: JD Cole
Subject: Patch for pt-check.cc/.h
Date: Fri, 13 Dec 2002 14:36:15 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827

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
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:
  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]