Mercurial > hg > octave-lyh
diff src/pt-misc.cc @ 2942:026f342c2019
[project @ 1997-05-08 02:20:57 by jwe]
author | jwe |
---|---|
date | Thu, 08 May 1997 02:28:50 +0000 |
parents | 8303749672be |
children | 56be458e237f |
line wrap: on
line diff
--- a/src/pt-misc.cc +++ b/src/pt-misc.cc @@ -29,6 +29,7 @@ #endif #include <iostream.h> +#include <strstream.h> #ifdef HAVE_UNISTD_H #ifdef HAVE_SYS_TYPES_H @@ -37,6 +38,8 @@ #include <unistd.h> #endif +#include "str-vec.h" + #include "defun.h" #include "error.h" #include "input.h" @@ -298,6 +301,37 @@ return args; } +string_vector +tree_argument_list::get_arg_names (void) const +{ + int len = length (); + + string_vector retval (len); + + int k = 0; + + for (Pix p = first (); p; next (p)) + { + tree_expression *elt = this->operator () (p); + + strstream str_buf; + + tree_print_code pc_buf (str_buf); + + elt->accept (pc_buf); + + str_buf << ends; + + const char *s = str_buf.str (); + + retval(k++) = s; + + delete [] s; + } + + return retval; +} + void tree_argument_list::accept (tree_walker& tw) {