diff src/pt-id.h @ 10206:37a08e0ce2dc

support Matlab-style empty output/input arguments
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 27 Jan 2010 12:41:49 +0100
parents cd96d29c5efa
children f3b65e1ae355
line wrap: on
line diff
--- a/src/pt-id.h	Wed Jan 27 02:24:17 2010 -0500
+++ b/src/pt-id.h	Wed Jan 27 12:41:49 2010 +0100
@@ -66,7 +66,9 @@
 
   bool is_defined (void) { return xsym().is_defined (); }
 
-  bool is_variable (void) { return xsym().is_variable (); }
+  virtual bool is_variable (void) { return xsym().is_variable (); }
+
+  virtual bool is_black_hole (void) { return false; }
 
   // Try to find a definition for an identifier.  Here's how:
   //
@@ -143,4 +145,26 @@
   tree_identifier& operator = (const tree_identifier&);
 };
 
+class tree_black_hole : public tree_identifier
+{
+public:
+
+  tree_black_hole (int l = -1, int c = -1)
+    : tree_identifier (l, c) { }
+
+  std::string name (void) const { return "~"; }
+
+  bool is_variable (void) { return false; }
+
+  bool is_black_hole (void) { return true; }
+
+  tree_black_hole *dup (void) const
+    { return new tree_black_hole; }
+
+  octave_lvalue lvalue (void)
+    {
+      return octave_lvalue (0); // black hole lvalue
+    }
+};
+
 #endif