diff src/pt-cmd.h @ 7715:5b4d278ec828

parse scripts completely before executing
author John W. Eaton <jwe@octave.org>
date Wed, 16 Apr 2008 15:09:56 -0400
parents 745a8299c2b5
children 71f068b22fcc
line wrap: on
line diff
--- a/src/pt-cmd.h
+++ b/src/pt-cmd.h
@@ -28,6 +28,7 @@
 
 class tree_walker;
 
+#include "ov-fcn.h"
 #include "pt.h"
 #include "pt-bp.h"
 #include "symtab.h"
@@ -88,6 +89,40 @@
   tree_no_op_command& operator = (const tree_no_op_command&);
 };
 
+// Function definition.
+
+class
+tree_function_def : public tree_command
+{
+public:
+
+  tree_function_def (octave_function *f, int l = -1, int c = -1)
+    : tree_command (l, c), fcn (f) { }
+
+  ~tree_function_def (void) { }
+
+  void eval (void);
+
+  tree_command *dup (symbol_table::scope_id scope);
+
+  void accept (tree_walker& tw);
+
+  octave_function *function (void) { return fcn.function_value (); }
+
+private:
+
+  octave_value fcn;
+
+  tree_function_def (const octave_value& v, int l = -1, int c = -1)
+    : tree_command (l, c), fcn (v) { }
+
+  // No copying!
+
+  tree_function_def (const tree_function_def&);
+
+  tree_function_def& operator = (const tree_function_def&);
+};
+
 #endif
 
 /*