49 param_list->
accept (*
this);
63 while (p != lst.
end ())
89 os <<
" " << expr.
oper () <<
" ";
158 init_list->
accept (*
this);
196 while (p != lst.
end ())
359 int len = ret_list->
length ();
361 if (len > 1 || takes_var_return)
369 if (takes_var_return)
377 if (len > 1 || takes_var_return)
386 std::string fcn_name = fcn.
name ();
388 os << (fcn_name.empty () ? std::string (
"(empty)") : fcn_name) <<
" ";
396 int len = param_list->length ();
398 if (len > 0 || takes_varargs)
404 param_list->accept (*
this);
414 if (len > 0 || takes_varargs)
456 std::string nm =
id.name ();
457 os << (nm.empty () ? std::string (
"(empty)") : nm);
510 bool first_elt =
true;
512 while (p != lst.
end ())
549 std::list<tree_argument_list *> arg_lists = expr.
arg_lists ();
550 std::string type_tags = expr.
type_tags ();
551 std::list<string_vector> arg_names = expr.
arg_names ();
553 int n = type_tags.length ();
555 std::list<tree_argument_list *>::iterator p_arg_lists = arg_lists.begin ();
556 std::list<string_vector>::iterator p_arg_names = arg_names.begin ();
558 for (
int i = 0; i < n; i++)
560 switch (type_tags[i])
565 if ((nc ==
'[' || nc ==
'{') && expr.
paren_count () == 0)
583 if ((nc ==
'[' || nc ==
'{') && expr.
paren_count () == 0)
603 assert (nm.
length () == 1);
631 while (p != lst.
end ())
662 while (p != lst.
end ())
709 os <<
" " << expr.
oper () <<
" ";
768 while (p != lst.
end ())
829 while (p != lst.
end ())
855 os <<
" " << expr.
oper () <<
" ";
953 while (p != lst.
end ())
1014 try_code->
accept (*
this);
1039 catch_code->
accept (*
this);
1048 os <<
"end_try_catch";
1058 os <<
"unwind_protect";
1064 if (unwind_protect_code)
1068 unwind_protect_code->
accept (*
this);
1077 os <<
"unwind_protect_cleanup";
1087 cleanup_code->
accept (*
this);
1096 os <<
"end_unwind_protect";
1174 assert (b->
length () == 1);
1180 if (s->is_expression ())
1254 for (
int i = 0; i < n; i++)
1261 bool printed_something =
false;
1263 bool prev_char_was_newline =
false;
1265 std::string comment = elt.
text ();
1267 size_t len = comment.length ();
1271 while (i < len && comment[i++] ==
'\n')
1277 char c = comment[i++];
1281 if (prev_char_was_newline)
1283 printed_something =
true;
1292 prev_char_was_newline =
true;
1298 printed_something =
true;
1304 if (! (isspace (c) || c ==
'!'))
1308 os << static_cast<char> (c);
1310 prev_char_was_newline =
false;
1325 while (p != comment_list->
end ())
1331 if (p != comment_list->
end ())
tree_expression * operand(void)
void visit_unwind_protect_command(tree_unwind_protect_command &)
void visit_statement(tree_statement &)
octave_comment_list * leading_comment(void)
octave_comment_list * trailing_comment(void)
tree_identifier * identifier(void)
void visit_if_command_list(tree_if_command_list &)
size_t length(void) const
octave_comment_list * leading_comment(void)
octave_comment_list * comment_text(void)
bool takes_var_return(void) const
void accept(tree_walker &tw)
void visit_parameter_list(tree_parameter_list &)
tree_statement_list * cleanup(void)
void visit_funcall(tree_funcall &)
int paren_count(void) const
void decrement_indent_level(void)
tree_expression * left_hand_side(void)
void visit_return_command(tree_return_command &)
tree_expression * switch_value(void)
octave_comment_list * middle_comment(void)
tree_parameter_list * parameter_list(void)
void visit_octave_user_function_header(octave_user_function &)
tree_expression * control_expr(void)
tree_argument_list * left_hand_side(void)
void accept(tree_walker &tw)
std::string original_command(void)
void print_raw(std::ostream &os, bool pr_as_read_syntax=false, bool pr_orig_txt=true)
void visit_identifier(tree_identifier &)
void visit_statement_list(tree_statement_list &)
bool is_default_case(void)
tree_command * command(void)
void print_comment_list(octave_comment_list *comment_list)
void visit_multi_assignment(tree_multi_assignment &)
std::string name(void) const
tree_switch_case_list * case_list(void)
octave_comment_list * trailing_comment(void)
void visit_if_clause(tree_if_clause &)
void visit_try_catch_command(tree_try_catch_command &)
octave_comment_list * trailing_comment(void)
octave_comment_list * leading_comment(void)
void visit_binary_expression(tree_binary_expression &)
tree_statement_list * commands(void)
octave_comment_list * trailing_comment(void)
octave_comment_list * leading_comment(void)
tree_expression * expression(void)
tree_expression * case_label(void)
octave_comment_list * leading_comment(void)
void increment_indent_level(void)
void visit_decl_elt(tree_decl_elt &)
void visit_decl_init_list(tree_decl_init_list &)
void visit_while_command(tree_while_command &)
std::string type_tags(void)
std::list< string_vector > arg_names(void)
tree_argument_list * left_hand_side(void)
bool takes_varargs(void) const
void visit_octave_user_function(octave_user_function &)
tree_identifier * ident(void)
tree_decl_init_list * initializer_list(void)
octave_comment_list * leading_comment(void)
void visit_complex_for_command(tree_complex_for_command &)
void visit_cell(tree_cell &)
tree_statement_list * body(void)
tree_expression * increment(void)
tree_if_command_list * cmd_list(void)
tree_statement_list * body(void)
octave_comment_list * leading_comment(void)
std::string oper(void) const
std::list< tree_expression * >::iterator iterator
tree_expression * maxproc_expr(void)
void visit_no_op_command(tree_no_op_command &)
void visit_prefix_expression(tree_prefix_expression &)
void accept(tree_walker &tw)
void visit_octave_user_script(octave_user_script &)
tree_expression * right_hand_side(void)
std::list< tree_argument_list * > arg_lists(void)
void visit_persistent_command(tree_persistent_command &)
tree_expression * condition(void)
F77_RET_T const double const double * f
void visit_argument_list(tree_argument_list &)
void visit_fcn_handle(tree_fcn_handle &)
tree_expression * control_expr(void)
std::string oper(void) const
tree_parameter_list * return_list(void)
void accept(tree_walker &tw)
void visit_switch_command(tree_switch_command &)
void visit_index_expression(tree_index_expression &)
void visit_function_def(tree_function_def &)
void visit_anon_fcn_handle(tree_anon_fcn_handle &)
void visit_postfix_expression(tree_postfix_expression &)
tree_expression * limit(void)
octave_value function(void)
std::string oper(void) const
tree_statement_list * body(void)
#define panic_impossible()
tree_expression * lhs(void)
tree_expression * left_hand_side(void)
tree_statement_list * body(void)
void accept(tree_walker &tw)
void visit_switch_case(tree_switch_case &)
void accept(tree_walker &tw)
octave_comment_list * middle_comment(void)
tree_statement_list * commands(void)
tree_statement_list * cleanup(void)
void print_parens(const tree_expression &expr, const char *txt)
void visit_colon_expression(tree_colon_expression &)
octave_function * function_value(bool silent=false) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false, bool pr_orig_txt=true)
std::string oper(void) const
octave_comment_list * trailing_comment(void)
octave_comment_list * trailing_comment(void)
void accept(tree_walker &tw)
octave_idx_type length(void) const
Number of elements in the array.
void visit_octave_user_function_trailer(octave_user_function &)
tree_statement_list * body(void)
void visit_switch_case_list(tree_switch_case_list &)
tree_expression * rhs(void)
bool is_else_clause(void)
octave_comment_list * trailing_comment(void)
void visit_return_list(tree_return_list &)
void print_comment_elt(const octave_comment_elt &comment_elt)
void visit_global_command(tree_global_command &)
tree_expression * expression(void)
void accept(tree_walker &tw)
tree_statement_list * body(void) const
void visit_continue_command(tree_continue_command &)
void accept(tree_walker &tw)
octave_comment_list * leading_comment(void)
tree_expression * expression(void)
void visit_constant(tree_constant &)
void accept(tree_walker &tw)
void visit_do_until_command(tree_do_until_command &)
void visit_simple_assignment(tree_simple_assignment &)
octave_comment_list * leading_comment(void)
void do_decl_command(tree_decl_command &cmd)
void newline(const char *alt_txt=", ")
void accept(tree_walker &tw)
virtual void accept(tree_walker &)
void visit_break_command(tree_break_command &)
std::stack< char > nesting
tree_parameter_list * parameter_list(void) const
tree_expression * base(void)
tree_statement_list * body(void)
void print_raw(std::ostream &os, bool pr_as_read_syntax=false, bool pr_orig_txt=true)
octave_comment_list * leading_comment(void)
void visit_if_command(tree_if_command &)
void print_fcn_handle_body(tree_statement_list *)
void visit_simple_for_command(tree_simple_for_command &)
tree_statement_list * body(void)
int curr_print_indent_level
tree_expression * right_hand_side(void)
octave_base_list< tree_argument_list * >::iterator iterator
virtual void accept(tree_walker &tw)=0
void print_indented_comment(octave_comment_list *comment_list)
void accept(tree_walker &tw)
void visit_matrix(tree_matrix &)
tree_expression * condition(void)