#include "parse.h"
Classes | |
class | parent_scope_info |
Protected Attributes | |
bool | m_autoloading |
std::shared_ptr< tree_classdef > | m_classdef_object |
std::string | m_curr_class_name |
int | m_curr_fcn_depth |
std::string | m_curr_package_name |
bool | m_endfunction_found |
bool | m_fcn_file_from_relative_lookup |
parent_scope_info | m_function_scopes |
base_lexer & | m_lexer |
int | m_max_fcn_depth |
std::string | m_parse_error_msg |
void * | m_parser_state |
bool | m_parsing_local_functions |
bool | m_parsing_subfunctions |
octave_value | m_primary_fcn |
symbol_scope | m_primary_fcn_scope |
std::shared_ptr< tree_statement_list > | m_stmt_list |
std::list< std::string > | m_subfunction_names |
Private Member Functions | |
void | maybe_warn_assign_as_truth_value (tree_expression *expr) |
void | maybe_warn_missing_semi (tree_statement_list *) |
void | maybe_warn_variable_switch_label (tree_expression *expr) |
Friends | |
octave_value | parse_fcn_file (interpreter &interp, const std::string &full_file, const std::string &file, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, bool require_file, bool force_script, bool autoload, bool relative_lookup) |
octave::base_parser::base_parser | ( | base_lexer & | lxr | ) |
Definition at line 6579 of file oct-parse.cc.
|
delete |
octave::base_parser::~base_parser | ( | void | ) |
Definition at line 6589 of file oct-parse.cc.
References m_lexer, m_parser_state, yypstate, and yypstate_delete.
tree_statement_list * octave::base_parser::append_statement_list | ( | tree_statement_list * | list, |
char | sep, | ||
tree_statement * | stmt, | ||
bool | warn_missing_semi | ||
) |
Definition at line 8854 of file oct-parse.cc.
References octave::base_list< elt_type >::append(), and set_stmt_print_flag().
Referenced by octave_push_parse().
|
inline |
Definition at line 168 of file parse.h.
References octave::lexical_feedback::m_end_of_input, and m_lexer.
Referenced by octave::tree_evaluator::eval_string().
void octave::base_parser::bison_error | ( | const std::string & | s | ) |
Definition at line 8900 of file oct-parse.cc.
References octave::lexical_feedback::m_filepos, and m_lexer.
Referenced by bison_error(), end_token_error(), make_anon_fcn_handle(), make_assign_op(), make_break_command(), make_classdef(), make_continue_command(), make_fcn_name(), make_for_command(), make_index_expression(), octave_error(), octave_push_parse(), push_fcn_symtab(), start_classdef_external_method(), validate_array_list(), validate_matrix_for_assignment(), and validate_param_list().
void octave::base_parser::bison_error | ( | const std::string & | s, |
const filepos & | pos | ||
) |
Definition at line 8906 of file oct-parse.cc.
References bison_error(), octave::filepos::column(), and octave::filepos::line().
void octave::base_parser::bison_error | ( | const std::string & | s, |
int | line, | ||
int | column | ||
) |
Definition at line 8912 of file oct-parse.cc.
References octave::get_file_line(), len, octave::lexical_feedback::m_current_input_line, octave::lexical_feedback::m_fcn_file_full_name, m_lexer, m_parse_error_msg, octave::lexical_feedback::m_reading_classdef_file, octave::lexical_feedback::m_reading_fcn_file, and octave::lexical_feedback::m_reading_script_file.
|
inline |
Definition at line 172 of file parse.h.
References m_classdef_object.
|
inline |
Definition at line 177 of file parse.h.
References m_classdef_object.
|
inline |
Definition at line 209 of file parse.h.
References m_curr_fcn_depth.
void octave::base_parser::disallow_command_syntax | ( | void | ) |
Definition at line 8866 of file oct-parse.cc.
References octave::lexical_feedback::m_allow_command_syntax, and m_lexer.
Referenced by octave::tree_evaluator::eval_string().
void octave::base_parser::end_token_error | ( | token * | tok, |
token::end_tok_type | expected | ||
) |
Definition at line 6723 of file oct-parse.cc.
References octave::token::beg_pos(), bison_error(), octave::end_token_as_string(), and octave::token::ettype().
Referenced by finish_if_command(), finish_switch_command(), make_classdef(), make_classdef_enum_block(), make_classdef_events_block(), make_classdef_methods_block(), make_classdef_properties_block(), make_for_command(), make_try_command(), make_unwind_command(), make_while_command(), and octave_push_parse().
bool octave::base_parser::end_token_ok | ( | token * | tok, |
token::end_tok_type | expected | ||
) |
Definition at line 6735 of file oct-parse.cc.
References octave::token::ettype(), and octave::token::simple_end.
Referenced by finish_if_command(), finish_switch_command(), make_classdef(), make_classdef_enum_block(), make_classdef_events_block(), make_classdef_methods_block(), make_classdef_properties_block(), make_for_command(), make_try_command(), make_unwind_command(), make_while_command(), and octave_push_parse().
|
inline |
Definition at line 214 of file parse.h.
References m_endfunction_found.
Referenced by octave_push_parse().
|
inline |
Definition at line 219 of file parse.h.
References m_endfunction_found.
tree_expression * octave::base_parser::finish_array_list | ( | tree_array_list * | a, |
token * | open_delim, | ||
token * | close_delim | ||
) |
Definition at line 8715 of file oct-parse.cc.
References octave::__get_interpreter__(), octave::tree_array_list::accept(), octave::action_container::add_method(), octave::tree_array_list::all_elements_are_constant(), octave::token::column(), octave::error_system::discard_warning_messages(), octave::tree_expression::evaluate(), octave::interpreter::get_error_system(), octave::interpreter::get_evaluator(), octave::error_system::last_warning_message(), octave::token::line(), octave::interpreter::recover_from_exception(), retval, octave::error_system::set_discard_warning_messages(), octave::error_system::set_last_warning_message(), octave::tree::set_location(), and octave::tree_constant::stash_original_text().
Referenced by finish_cell(), and finish_matrix().
tree_expression * octave::base_parser::finish_cell | ( | tree_cell * | c, |
token * | open_delim, | ||
token * | close_delim | ||
) |
Definition at line 8791 of file oct-parse.cc.
References octave::token::column(), finish_array_list(), and octave::token::line().
Referenced by octave_push_parse().
tree_function_def * octave::base_parser::finish_classdef_external_method | ( | octave_user_function * | fcn, |
tree_parameter_list * | ret_list, | ||
comment_list * | cl | ||
) |
Definition at line 8369 of file oct-parse.cc.
References octave_user_function::beginning_column(), octave_user_function::beginning_line(), octave_user_function::define_ret_list(), octave::tree_parameter_list::out, and octave_user_function::stash_leading_comment().
Referenced by octave_push_parse().
void octave::base_parser::finish_classdef_file | ( | tree_classdef * | cls, |
tree_statement_list * | local_fcns | ||
) |
Definition at line 8388 of file oct-parse.cc.
References octave::__get_symbol_table__(), octave_function::fcn_file_name(), octave::tree_function_def::function(), octave_value::function_value(), octave::symbol_table::install_local_function(), m_classdef_object, m_lexer, octave::lexical_feedback::m_reading_classdef_file, and octave_function::name().
Referenced by octave_push_parse().
tree_function_def * octave::base_parser::finish_function | ( | tree_parameter_list * | ret_list, |
octave_user_function * | fcn, | ||
comment_list * | lc, | ||
int | l, | ||
int | c | ||
) |
Definition at line 7938 of file oct-parse.cc.
References octave::symbol_scope::cache_dir_name(), octave::symbol_scope::cache_fcn_file_name(), octave::symbol_scope::cache_fcn_name(), octave_user_code::cache_function_text(), octave::symbol_scope::cache_name(), octave::symbol_scope::cache_parent_fcn_names(), octave_user_function::define_ret_list(), octave_user_code::fcn_file_name(), octave::symbol_scope::fcn_name(), octave::symbol_scope::install_nestfunction(), octave::symbol_scope::install_subfunction(), octave::lexical_feedback::m_buffer_function_text, m_curr_fcn_depth, octave::lexical_feedback::m_dir_name, m_endfunction_found, octave::lexical_feedback::m_fcn_file_name, m_function_scopes, octave::lexical_feedback::m_function_text, m_lexer, m_parsing_subfunctions, m_primary_fcn_scope, octave::lexical_feedback::m_reading_fcn_file, m_subfunction_names, octave::tree_parameter_list::mark_as_formal_parameters(), octave_user_function::mark_as_nested_function(), octave_user_function::mark_as_subfunction(), octave_function::name(), octave::tree_parameter_list::out, octave::symbol_scope::parent_fcn_names(), octave::base_parser::parent_scope_info::parent_scope(), retval, octave_user_code::scope(), octave::symbol_scope::set_nesting_depth(), octave::symbol_scope::set_parent(), octave::symbol_scope::set_primary_parent(), octave::base_parser::parent_scope_info::size(), octave_user_function::stash_fcn_location(), octave_user_function::stash_leading_comment(), octave_user_function::stash_parent_fcn_name(), octave_user_code::time_parsed(), and octave::symbol_scope::update_nest().
Referenced by make_function().
tree_if_command * octave::base_parser::finish_if_command | ( | token * | if_tok, |
tree_if_command_list * | list, | ||
token * | end_tok, | ||
comment_list * | lc | ||
) |
Definition at line 7460 of file oct-parse.cc.
References octave::tree::column(), octave::token::column(), octave::base_list< elt_type >::empty(), end_token_error(), end_token_ok(), octave::base_list< elt_type >::front(), octave::base_lexer::comment_buffer::get_comment(), octave::token::if_end, octave::tree::line(), octave::token::line(), octave::base_lexer::m_comment_buf, m_lexer, and retval.
Referenced by octave_push_parse().
tree_expression * octave::base_parser::finish_matrix | ( | tree_matrix * | m, |
token * | open_delim, | ||
token * | close_delim | ||
) |
Definition at line 8779 of file oct-parse.cc.
References octave::token::column(), finish_array_list(), octave_null_matrix::instance, octave::token::line(), and m.
Referenced by octave_push_parse().
tree_switch_command * octave::base_parser::finish_switch_command | ( | token * | switch_tok, |
tree_expression * | expr, | ||
tree_switch_case_list * | list, | ||
token * | end_tok, | ||
comment_list * | lc | ||
) |
Definition at line 7516 of file oct-parse.cc.
References octave::tree::column(), octave::token::column(), octave::base_list< elt_type >::empty(), end_token_error(), end_token_ok(), octave::base_list< elt_type >::front(), octave::base_lexer::comment_buffer::get_comment(), octave::tree::line(), octave::token::line(), octave::base_lexer::m_comment_buf, m_lexer, retval, and octave::token::switch_end.
Referenced by octave_push_parse().
octave_user_function* octave::base_parser::frob_function | ( | tree_identifier * | id, |
octave_user_function * | fcn | ||
) |
|
inline |
tree_anon_fcn_handle * octave::base_parser::make_anon_fcn_handle | ( | tree_parameter_list * | param_list, |
tree_expression * | expr, | ||
const filepos & | at_pos | ||
) |
Definition at line 6850 of file oct-parse.cc.
References bison_error(), octave::symbol_scope::cache_name(), octave::filepos::column(), octave::anon_fcn_validator::column(), octave::lexical_feedback::symbol_table_context::curr_scope(), octave::base_lexer::input_from_eval_string(), octave::base_lexer::input_from_terminal(), octave::filepos::line(), octave::anon_fcn_validator::line(), octave::lexical_feedback::m_fcn_file_full_name, m_lexer, octave::lexical_feedback::m_symtab_context, octave::symbol_scope::mark_static(), octave::anon_fcn_validator::message(), octave::anon_fcn_validator::ok(), octave::lexical_feedback::symbol_table_context::parent_scope(), octave::lexical_feedback::symbol_table_context::pop(), retval, and octave::tree_expression::set_print_flag().
Referenced by octave_push_parse().
tree_expression * octave::base_parser::make_assign_op | ( | int | op, |
tree_argument_list * | lhs, | ||
token * | eq_tok, | ||
tree_expression * | rhs | ||
) |
Definition at line 7574 of file oct-parse.cc.
References ADD_EQ, AND_EQ, octave::token::beg_pos(), bison_error(), octave::token::column(), DIV_EQ, EDIV_EQ, ELEFTDIV_EQ, EMUL_EQ, EPOW_EQ, octave::tree_expression::is_identifier(), octave::tree_expression::is_index_expression(), octave::tree_argument_list::is_simple_assign_lhs(), octave::iskeyword(), LEFTDIV_EQ, octave::token::line(), MUL_EQ, octave::tree_expression::name(), octave_value::op_add_eq, octave_value::op_asn_eq, octave_value::op_div_eq, octave_value::op_el_and_eq, octave_value::op_el_div_eq, octave_value::op_el_ldiv_eq, octave_value::op_el_mul_eq, octave_value::op_el_or_eq, octave_value::op_el_pow_eq, octave_value::op_ldiv_eq, octave_value::op_mul_eq, octave_value::op_pow_eq, octave_value::op_sub_eq, OR_EQ, panic_impossible, POW_EQ, octave::tree_argument_list::remove_front(), SUB_EQ, octave_value::unknown_assign_op, and octave::tree_argument_list::variable_names().
Referenced by octave_push_parse().
tree_expression * octave::base_parser::make_binary_op | ( | int | op, |
tree_expression * | op1, | ||
token * | tok_val, | ||
tree_expression * | op2 | ||
) |
Definition at line 6996 of file oct-parse.cc.
References octave::token::column(), EDIV, ELEFTDIV, EMUL, EPOW, EXPR_AND, EXPR_EQ, EXPR_GE, EXPR_GT, EXPR_LE, EXPR_LT, EXPR_NE, EXPR_OR, LEFTDIV, octave::token::line(), octave::maybe_compound_binary_expression(), octave_value::op_add, octave_value::op_div, octave_value::op_el_and, octave_value::op_el_div, octave_value::op_el_ldiv, octave_value::op_el_mul, octave_value::op_el_or, octave_value::op_el_pow, octave_value::op_eq, octave_value::op_ge, octave_value::op_gt, octave_value::op_ldiv, octave_value::op_le, octave_value::op_lt, octave_value::op_mul, octave_value::op_ne, octave_value::op_pow, octave_value::op_sub, panic_impossible, POW, and octave_value::unknown_binary_op.
Referenced by octave_push_parse().
tree_expression * octave::base_parser::make_boolean_op | ( | int | op, |
tree_expression * | op1, | ||
token * | tok_val, | ||
tree_expression * | op2 | ||
) |
Definition at line 7089 of file oct-parse.cc.
References octave::tree_boolean_expression::bool_and, octave::tree_boolean_expression::bool_or, octave::token::column(), EXPR_AND_AND, EXPR_OR_OR, octave::token::line(), and panic_impossible.
Referenced by octave_push_parse().
tree_command * octave::base_parser::make_break_command | ( | token * | break_tok | ) |
Definition at line 7402 of file oct-parse.cc.
References bison_error(), octave::token::column(), octave::token::line(), m_lexer, and octave::lexical_feedback::m_looping.
Referenced by octave_push_parse().
tree_classdef * octave::base_parser::make_classdef | ( | token * | tok_val, |
tree_classdef_attribute_list * | a, | ||
tree_identifier * | id, | ||
tree_classdef_superclass_list * | sc, | ||
tree_classdef_body * | body, | ||
token * | end_tok, | ||
comment_list * | lc, | ||
comment_list * | tc | ||
) |
Definition at line 8067 of file oct-parse.cc.
References bison_error(), octave::token::classdef_end, octave::token::column(), octave::lexical_feedback::symbol_table_context::curr_scope(), octave::sys::file_ops::dir_sep_chars(), end_token_error(), end_token_ok(), octave::token::line(), m_curr_package_name, octave::lexical_feedback::m_fcn_file_name, m_lexer, octave::lexical_feedback::m_symtab_context, octave::lexical_feedback::symbol_table_context::pop(), retval, and octave::token::switch_end.
Referenced by octave_push_parse().
tree_classdef_enum_block * octave::base_parser::make_classdef_enum_block | ( | token * | tok_val, |
tree_classdef_attribute_list * | a, | ||
tree_classdef_enum_list * | elist, | ||
token * | end_tok, | ||
comment_list * | lc, | ||
comment_list * | tc | ||
) |
Definition at line 8287 of file oct-parse.cc.
References octave::token::column(), end_token_error(), end_token_ok(), octave::token::enumeration_end, octave::token::line(), and retval.
Referenced by octave_push_parse().
tree_classdef_events_block * octave::base_parser::make_classdef_events_block | ( | token * | tok_val, |
tree_classdef_attribute_list * | a, | ||
tree_classdef_events_list * | elist, | ||
token * | end_tok, | ||
comment_list * | lc, | ||
comment_list * | tc | ||
) |
Definition at line 8244 of file oct-parse.cc.
References octave::token::column(), end_token_error(), end_token_ok(), octave::token::events_end, octave::token::line(), and retval.
Referenced by octave_push_parse().
tree_classdef_methods_block * octave::base_parser::make_classdef_methods_block | ( | token * | tok_val, |
tree_classdef_attribute_list * | a, | ||
tree_classdef_methods_list * | mlist, | ||
token * | end_tok, | ||
comment_list * | lc, | ||
comment_list * | tc | ||
) |
Definition at line 8203 of file oct-parse.cc.
References octave::token::column(), end_token_error(), end_token_ok(), octave::token::line(), octave::token::methods_end, and retval.
Referenced by octave_push_parse().
tree_classdef_properties_block * octave::base_parser::make_classdef_properties_block | ( | token * | tok_val, |
tree_classdef_attribute_list * | a, | ||
tree_classdef_property_list * | plist, | ||
token * | end_tok, | ||
comment_list * | lc, | ||
comment_list * | tc | ||
) |
Definition at line 8142 of file oct-parse.cc.
References octave::base_list< elt_type >::back(), octave::token::column(), octave::tree_classdef_property::doc_string(), end_token_error(), end_token_ok(), octave::base_list< elt_type >::front(), octave::tree_classdef_property::have_doc_string(), octave::comment_elt::is_end_of_line(), octave::token::line(), octave::token::properties_end, retval, and octave::comment_elt::text().
Referenced by octave_push_parse().
tree_expression * octave::base_parser::make_colon_expression | ( | tree_expression * | base, |
tree_expression * | limit, | ||
tree_expression * | incr = nullptr |
||
) |
Definition at line 6916 of file oct-parse.cc.
References octave::__get_interpreter__(), octave::tree_colon_expression::accept(), octave::action_container::add_method(), octave::tree::column(), octave::error_system::discard_warning_messages(), octave::tree_colon_expression::evaluate(), octave::interpreter::get_error_system(), octave::interpreter::get_evaluator(), octave::tree_expression::is_constant(), octave::error_system::last_warning_message(), octave::tree::line(), octave::interpreter::recover_from_exception(), retval, octave::error_system::set_discard_warning_messages(), octave::error_system::set_last_warning_message(), and octave::tree_constant::stash_original_text().
Referenced by octave_push_parse().
tree_constant * octave::base_parser::make_constant | ( | int | op, |
token * | tok_val | ||
) |
Definition at line 6774 of file oct-parse.cc.
References octave::token::column(), DQ_STRING, IMAG_NUM, octave_null_str::instance, octave_null_sq_str::instance, octave::token::line(), NUM, octave::token::number(), panic_impossible, retval, SQ_STRING, octave::token::text(), octave::token::text_rep(), and octave::undo_string_escapes().
Referenced by octave_push_parse().
tree_command * octave::base_parser::make_continue_command | ( | token * | continue_tok | ) |
Definition at line 7419 of file oct-parse.cc.
References bison_error(), octave::token::column(), octave::token::line(), m_lexer, and octave::lexical_feedback::m_looping.
Referenced by octave_push_parse().
tree_decl_command * octave::base_parser::make_decl_command | ( | int | tok, |
token * | tok_val, | ||
tree_decl_init_list * | lst | ||
) |
Definition at line 8523 of file oct-parse.cc.
References octave::token::column(), GLOBAL, octave::token::line(), m_curr_fcn_depth, octave::lexical_feedback::m_fcn_file_full_name, m_lexer, octave::lexical_feedback::m_reading_script_file, octave::lexical_feedback::mark_as_variables(), panic_impossible, PERSISTENT, retval, octave::tree_decl_init_list::variable_names(), and warning().
Referenced by octave_push_parse().
tree_command * octave::base_parser::make_do_until_command | ( | token * | until_tok, |
tree_statement_list * | body, | ||
tree_expression * | expr, | ||
comment_list * | lc | ||
) |
Definition at line 7318 of file oct-parse.cc.
References octave::token::column(), octave::base_lexer::comment_buffer::get_comment(), octave::token::line(), octave::base_lexer::m_comment_buf, m_lexer, octave::lexical_feedback::m_looping, and maybe_warn_assign_as_truth_value().
Referenced by octave_push_parse().
tree_if_clause * octave::base_parser::make_elseif_clause | ( | token * | elseif_tok, |
tree_expression * | expr, | ||
tree_statement_list * | list, | ||
comment_list * | lc | ||
) |
Definition at line 7500 of file oct-parse.cc.
References octave::token::column(), octave::token::line(), and maybe_warn_assign_as_truth_value().
Referenced by octave_push_parse().
tree_statement * octave::base_parser::make_end | ( | const std::string & | type, |
bool | eof, | ||
const filepos & | beg_pos, | ||
const filepos & | end_pos | ||
) |
Definition at line 7928 of file oct-parse.cc.
References octave::filepos::column(), octave::filepos::line(), and make_statement().
Referenced by octave_push_parse().
tree_fcn_handle * octave::base_parser::make_fcn_handle | ( | token * | tok_val | ) |
Definition at line 6837 of file oct-parse.cc.
References octave::token::column(), octave::token::line(), retval, and octave::token::text().
Referenced by octave_push_parse().
tree_identifier * octave::base_parser::make_fcn_name | ( | tree_identifier * | id | ) |
Definition at line 7736 of file oct-parse.cc.
References bison_error(), octave::symbol_scope::cache_name(), octave::tree::column(), octave::lexical_feedback::symbol_table_context::curr_scope(), octave::tree::line(), m_curr_fcn_depth, octave::lexical_feedback::m_fcn_file_name, m_function_scopes, m_lexer, octave::lexical_feedback::m_maybe_classdef_get_set_method, octave::lexical_feedback::m_parsed_function_name, m_parsing_local_functions, octave::lexical_feedback::m_symtab_context, octave::tree_identifier::name(), and octave::base_parser::parent_scope_info::name_current_scope().
Referenced by octave_push_parse().
tree_command * octave::base_parser::make_for_command | ( | int | tok_id, |
token * | for_tok, | ||
tree_argument_list * | lhs, | ||
tree_expression * | expr, | ||
tree_expression * | maxproc, | ||
tree_statement_list * | body, | ||
token * | end_tok, | ||
comment_list * | lc | ||
) |
Definition at line 7338 of file oct-parse.cc.
References bison_error(), octave::token::column(), end_token_error(), end_token_ok(), octave::token::for_end, octave::base_lexer::comment_buffer::get_comment(), octave::base_list< elt_type >::length(), octave::token::line(), octave::base_lexer::m_comment_buf, m_lexer, octave::lexical_feedback::m_looping, octave::tree_expression::mark_as_for_cmd_expr(), PARFOR, octave::token::parfor_end, octave::tree_argument_list::remove_front(), and retval.
Referenced by octave_push_parse().
tree_function_def * octave::base_parser::make_function | ( | token * | fcn_tok, |
tree_parameter_list * | ret_list, | ||
tree_identifier * | id, | ||
tree_parameter_list * | param_list, | ||
tree_statement_list * | body, | ||
tree_statement * | end_fcn_stmt, | ||
comment_list * | lc | ||
) |
Definition at line 7770 of file oct-parse.cc.
References octave::token::column(), finish_function(), octave::token::line(), recover_from_parsing_function(), retval, and start_function().
Referenced by octave_push_parse().
tree_index_expression * octave::base_parser::make_index_expression | ( | tree_expression * | expr, |
tree_argument_list * | args, | ||
char | type | ||
) |
Definition at line 8421 of file oct-parse.cc.
References octave::tree_index_expression::append(), bison_error(), octave::tree::column(), octave::tree_argument_list::has_magic_tilde(), octave::tree_expression::is_index_expression(), octave::tree_expression::is_postfix_indexed(), octave::tree::line(), retval, and octave::tree_expression::set_postfix_index().
Referenced by octave_push_parse().
tree_index_expression * octave::base_parser::make_indirect_ref | ( | tree_expression * | expr, |
const std::string & | elt | ||
) |
Definition at line 8461 of file oct-parse.cc.
References octave::tree_index_expression::append(), octave::tree::column(), octave::tree_expression::is_index_expression(), octave::tree_expression::is_postfix_indexed(), octave::tree::line(), m_lexer, octave::lexical_feedback::m_looking_at_indirect_ref, retval, and octave::tree_expression::set_postfix_index().
Referenced by octave_push_parse().
tree_index_expression * octave::base_parser::make_indirect_ref | ( | tree_expression * | expr, |
tree_expression * | field | ||
) |
Definition at line 8492 of file oct-parse.cc.
References octave::tree_index_expression::append(), octave::tree::column(), octave::tree_expression::is_index_expression(), octave::tree_expression::is_postfix_indexed(), octave::tree::line(), m_lexer, octave::lexical_feedback::m_looking_at_indirect_ref, retval, and octave::tree_expression::set_postfix_index().
tree_expression * octave::base_parser::make_postfix_op | ( | int | op, |
tree_expression * | op1, | ||
token * | tok_val | ||
) |
Definition at line 7158 of file oct-parse.cc.
References octave::token::column(), HERMITIAN, octave::token::line(), MINUS_MINUS, octave_value::op_decr, octave_value::op_hermitian, octave_value::op_incr, octave_value::op_transpose, panic_impossible, PLUS_PLUS, TRANSPOSE, and octave_value::unknown_unary_op.
Referenced by octave_push_parse().
tree_expression * octave::base_parser::make_prefix_op | ( | int | op, |
tree_expression * | op1, | ||
token * | tok_val | ||
) |
Definition at line 7118 of file oct-parse.cc.
References octave::token::column(), EXPR_NOT, octave::token::line(), MINUS_MINUS, octave_value::op_decr, octave_value::op_incr, octave_value::op_not, octave_value::op_uminus, octave_value::op_uplus, panic_impossible, PLUS_PLUS, and octave_value::unknown_unary_op.
Referenced by octave_push_parse().
tree_command * octave::base_parser::make_return_command | ( | token * | return_tok | ) |
Definition at line 7436 of file oct-parse.cc.
References octave::token::column(), and octave::token::line().
Referenced by octave_push_parse().
void octave::base_parser::make_script | ( | tree_statement_list * | cmds, |
tree_statement * | end_script | ||
) |
Definition at line 7705 of file oct-parse.cc.
References octave::base_list< elt_type >::append(), octave::symbol_scope::cache_dir_name(), octave::symbol_scope::cache_fcn_file_name(), octave::symbol_scope::cache_name(), octave::lexical_feedback::symbol_table_context::curr_scope(), octave::lexical_feedback::m_dir_name, octave::lexical_feedback::m_fcn_file_full_name, octave::lexical_feedback::m_fcn_file_name, octave::lexical_feedback::m_help_text, m_lexer, m_primary_fcn, octave::lexical_feedback::m_symtab_context, octave_value(), octave::lexical_feedback::symbol_table_context::pop(), octave_function::stash_dir_name(), and octave_user_code::stash_fcn_file_time().
Referenced by octave_push_parse().
tree_statement * octave::base_parser::make_statement | ( | T * | arg | ) |
Definition at line 8840 of file oct-parse.cc.
References octave::base_lexer::get_comment(), and m_lexer.
Referenced by make_end(), and octave_push_parse().
tree_statement_list * octave::base_parser::make_statement_list | ( | tree_statement * | stmt | ) |
Definition at line 8848 of file oct-parse.cc.
Referenced by octave_push_parse().
tree_switch_case * octave::base_parser::make_switch_case | ( | token * | case_tok, |
tree_expression * | expr, | ||
tree_statement_list * | list, | ||
comment_list * | lc | ||
) |
Definition at line 7558 of file oct-parse.cc.
References octave::token::column(), octave::token::line(), and maybe_warn_variable_switch_label().
Referenced by octave_push_parse().
tree_command * octave::base_parser::make_try_command | ( | token * | try_tok, |
tree_statement_list * | body, | ||
char | catch_sep, | ||
tree_statement_list * | cleanup, | ||
token * | end_tok, | ||
comment_list * | lc, | ||
comment_list * | mc | ||
) |
Definition at line 7227 of file oct-parse.cc.
References octave::token::column(), octave::base_list< elt_type >::empty(), end_token_error(), end_token_ok(), octave::tree_statement::expression(), octave::base_list< elt_type >::front(), octave::base_lexer::comment_buffer::get_comment(), octave::tree_expression::is_identifier(), octave::token::line(), octave::base_lexer::m_comment_buf, m_lexer, octave::base_list< elt_type >::pop_front(), retval, octave::tree_statement::set_expression(), and octave::token::try_catch_end.
Referenced by octave_push_parse().
tree_command * octave::base_parser::make_unwind_command | ( | token * | unwind_tok, |
tree_statement_list * | body, | ||
tree_statement_list * | cleanup, | ||
token * | end_tok, | ||
comment_list * | lc, | ||
comment_list * | mc | ||
) |
Definition at line 7194 of file oct-parse.cc.
References octave::token::column(), end_token_error(), end_token_ok(), octave::base_lexer::comment_buffer::get_comment(), octave::token::line(), octave::base_lexer::m_comment_buf, m_lexer, retval, and octave::token::unwind_protect_end.
Referenced by octave_push_parse().
tree_command * octave::base_parser::make_while_command | ( | token * | while_tok, |
tree_expression * | expr, | ||
tree_statement_list * | body, | ||
token * | end_tok, | ||
comment_list * | lc | ||
) |
Definition at line 7283 of file oct-parse.cc.
References octave::token::column(), end_token_error(), end_token_ok(), octave::base_lexer::comment_buffer::get_comment(), octave::token::line(), octave::base_lexer::m_comment_buf, m_lexer, octave::lexical_feedback::m_looping, maybe_warn_assign_as_truth_value(), retval, and octave::token::while_end.
Referenced by octave_push_parse().
|
private |
Definition at line 9217 of file oct-parse.cc.
References octave::tree::column(), octave::tree_expression::is_assignment_expression(), octave::tree::line(), octave::lexical_feedback::m_fcn_file_full_name, m_lexer, octave::tree_expression::paren_count(), and warning_with_id().
Referenced by make_do_until_command(), make_elseif_clause(), make_while_command(), and start_if_command().
|
private |
Definition at line 9253 of file oct-parse.cc.
References octave::base_list< elt_type >::back(), octave::tree_statement::column(), octave::tree_statement::is_expression(), octave::tree_statement::line(), m_curr_fcn_depth, octave::lexical_feedback::m_fcn_file_full_name, m_lexer, and warning_with_id().
Referenced by set_stmt_print_flag().
|
private |
Definition at line 9237 of file oct-parse.cc.
References octave::tree::column(), octave::tree_expression::is_constant(), octave::tree::line(), octave::lexical_feedback::m_fcn_file_full_name, m_lexer, and warning_with_id().
Referenced by make_switch_case().
|
delete |
|
inline |
Definition at line 199 of file parse.h.
References m_parsing_local_functions.
Referenced by octave_push_parse().
|
inline |
Definition at line 204 of file parse.h.
References m_parsing_local_functions.
|
inline |
Definition at line 189 of file parse.h.
References m_parsing_subfunctions.
|
inline |
Definition at line 194 of file parse.h.
References m_parsing_subfunctions.
bool octave::base_parser::push_fcn_symtab | ( | void | ) |
Definition at line 6743 of file oct-parse.cc.
References bison_error(), octave::lexical_feedback::symbol_table_context::curr_scope(), m_curr_fcn_depth, m_function_scopes, m_lexer, m_max_fcn_depth, m_parsing_subfunctions, m_primary_fcn_scope, octave::lexical_feedback::m_reading_script_file, octave::lexical_feedback::m_symtab_context, octave::symbol_scope::mark_primary_fcn_scope(), octave::lexical_feedback::symbol_table_context::push(), and octave::base_parser::parent_scope_info::push().
Referenced by octave_push_parse().
void octave::base_parser::recover_from_parsing_function | ( | void | ) |
Definition at line 8039 of file oct-parse.cc.
References m_curr_fcn_depth, octave::lexical_feedback::m_defining_func, m_function_scopes, m_lexer, octave::lexical_feedback::m_looking_at_parameter_list, octave::lexical_feedback::m_looking_at_return_list, octave::lexical_feedback::m_parsed_function_name, m_parsing_subfunctions, octave::lexical_feedback::m_reading_fcn_file, octave::lexical_feedback::m_symtab_context, octave::lexical_feedback::symbol_table_context::pop(), and octave::base_parser::parent_scope_info::pop().
Referenced by make_function().
void octave::base_parser::reset | ( | void | ) |
Definition at line 6605 of file oct-parse.cc.
References octave::base_parser::parent_scope_info::clear(), m_autoloading, m_classdef_object, m_curr_class_name, m_curr_fcn_depth, m_curr_package_name, m_endfunction_found, m_fcn_file_from_relative_lookup, m_function_scopes, m_lexer, m_max_fcn_depth, m_parser_state, m_parsing_local_functions, m_parsing_subfunctions, m_primary_fcn, m_primary_fcn_scope, m_stmt_list, m_subfunction_names, octave_value(), octave::base_lexer::reset(), yypstate, yypstate_delete, and yypstate_new.
Referenced by octave::bp_table::condition_valid(), octave::tree_evaluator::eval_string(), octave::text_parser::parse(), and octave::debugger::repl().
|
pure virtual |
Implemented in octave::push_parser, and octave::parser.
tree_statement_list * octave::base_parser::set_stmt_print_flag | ( | tree_statement_list * | list, |
char | sep, | ||
bool | warn_missing_semi | ||
) |
Definition at line 8801 of file oct-parse.cc.
References octave::base_list< elt_type >::back(), octave::tree_statement::is_null_statement(), maybe_warn_missing_semi(), octave::base_list< elt_type >::pop_back(), octave::tree_statement::set_print_flag(), and warning().
Referenced by append_statement_list(), and octave_push_parse().
octave_user_function * octave::base_parser::start_classdef_external_method | ( | tree_identifier * | id, |
tree_parameter_list * | pl | ||
) |
Definition at line 8320 of file oct-parse.cc.
References bison_error(), Array< T >::column(), m_curr_class_name, and retval.
Referenced by octave_push_parse().
octave_user_function * octave::base_parser::start_function | ( | tree_identifier * | id, |
tree_parameter_list * | param_list, | ||
tree_statement_list * | body, | ||
tree_statement * | end_function | ||
) |
Definition at line 7794 of file oct-parse.cc.
References octave::base_list< elt_type >::append(), octave::tree_statement::column(), octave::lexical_feedback::symbol_table_context::curr_scope(), octave::sys::file_ops::dir_sep_chars(), octave_function::document(), octave_user_code::fcn_file_name(), octave::base_lexer::comment_buffer::get_comment(), octave::base_lexer::input_from_tmp_history_file(), octave::sys::base_file_stat::is_newer(), octave::tree_statement::line(), m_autoloading, octave::base_lexer::m_comment_buf, m_curr_class_name, m_curr_fcn_depth, octave::lexical_feedback::m_dir_name, m_fcn_file_from_relative_lookup, octave::lexical_feedback::m_fcn_file_full_name, octave::lexical_feedback::m_fcn_file_name, octave::lexical_feedback::m_force_script, octave::lexical_feedback::m_help_text, m_lexer, octave::lexical_feedback::m_package_name, octave::lexical_feedback::m_parsing_class_method, octave::lexical_feedback::m_parsing_classdef, octave::lexical_feedback::m_parsing_classdef_get_method, octave::lexical_feedback::m_parsing_classdef_set_method, m_parsing_subfunctions, m_primary_fcn, octave::lexical_feedback::m_reading_classdef_file, octave::lexical_feedback::m_reading_fcn_file, octave::lexical_feedback::m_reading_script_file, octave::lexical_feedback::m_symtab_context, octave_user_function::mark_as_classdef_constructor(), octave_user_function::mark_as_classdef_method(), octave_user_function::mark_as_legacy_constructor(), octave_user_function::mark_as_legacy_method(), octave_user_function::mark_as_system_fcn_file(), octave_function::mark_relative(), octave_function::name(), octave_value(), octave_function::stash_dir_name(), octave_function::stash_dispatch_class(), octave_user_function::stash_fcn_end_location(), octave_user_code::stash_fcn_file_name(), octave_user_code::stash_fcn_file_time(), octave_user_function::stash_function_name(), octave_function::stash_package_name(), octave_user_function::stash_trailing_comment(), warning(), and warning_with_id().
Referenced by make_function().
tree_if_command_list * octave::base_parser::start_if_command | ( | tree_expression * | expr, |
tree_statement_list * | list | ||
) |
Definition at line 7447 of file oct-parse.cc.
References maybe_warn_assign_as_truth_value().
Referenced by octave_push_parse().
void octave::base_parser::statement_list | ( | std::shared_ptr< tree_statement_list > & | lst | ) |
Definition at line 6703 of file oct-parse.cc.
References m_stmt_list.
Referenced by octave::bp_table::condition_valid(), octave::tree_evaluator::eval_string(), octave_push_parse(), and octave::debugger::repl().
|
inline |
Definition at line 184 of file parse.h.
References m_stmt_list.
bool octave::base_parser::validate_array_list | ( | tree_expression * | e | ) |
Definition at line 8629 of file oct-parse.cc.
References bison_error(), octave::tree_expression::is_matrix(), and retval.
Referenced by octave_push_parse().
tree_argument_list * octave::base_parser::validate_matrix_for_assignment | ( | tree_expression * | e | ) |
Definition at line 8654 of file oct-parse.cc.
References octave::__get_evaluator__(), bison_error(), octave::tree_expression::evaluate(), octave::base_list< elt_type >::front(), octave::tree_expression::is_constant(), octave::tree_expression::is_matrix(), octave::tree_argument_list::is_valid_lvalue_list(), octave_value::isempty(), m_lexer, octave::lexical_feedback::mark_as_variables(), octave::base_list< elt_type >::pop_front(), retval, octave::base_list< elt_type >::size(), and octave::tree_argument_list::variable_names().
Referenced by octave_push_parse().
bool octave::base_parser::validate_param_list | ( | tree_parameter_list * | lst, |
tree_parameter_list::in_or_out | type | ||
) |
Definition at line 8568 of file oct-parse.cc.
References octave::base_list< elt_type >::back(), bison_error(), octave::base_list< elt_type >::end(), octave::base_list< elt_type >::erase(), octave::tree_decl_elt::ident(), octave::tree_parameter_list::in, octave::tree_identifier::is_black_hole(), len, octave::base_list< elt_type >::length(), octave::tree_parameter_list::mark_varargs(), octave::tree_parameter_list::mark_varargs_only(), name, and octave::tree_identifier::name().
Referenced by octave_push_parse().
|
friend |
Definition at line 9127 of file oct-parse.cc.
|
protected |
Definition at line 511 of file parse.h.
Referenced by reset(), and start_function().
|
protected |
Definition at line 561 of file parse.h.
Referenced by classdef_object(), finish_classdef_file(), and reset().
|
protected |
Definition at line 543 of file parse.h.
Referenced by reset(), start_classdef_external_method(), and start_function().
|
protected |
Definition at line 535 of file parse.h.
Referenced by curr_fcn_depth(), finish_function(), make_decl_command(), make_fcn_name(), maybe_warn_missing_semi(), push_fcn_symtab(), recover_from_parsing_function(), reset(), and start_function().
|
protected |
Definition at line 547 of file parse.h.
Referenced by make_classdef(), and reset().
|
protected |
Definition at line 508 of file parse.h.
Referenced by endfunction_found(), finish_function(), and reset().
|
protected |
Definition at line 515 of file parse.h.
Referenced by reset(), and start_function().
|
protected |
Definition at line 550 of file parse.h.
Referenced by finish_function(), make_fcn_name(), push_fcn_symtab(), recover_from_parsing_function(), and reset().
|
protected |
Definition at line 567 of file parse.h.
Referenced by ~base_parser(), at_end_of_input(), bison_error(), disallow_command_syntax(), finish_classdef_file(), finish_function(), finish_if_command(), finish_switch_command(), get_lexer(), make_anon_fcn_handle(), make_break_command(), make_classdef(), make_continue_command(), make_decl_command(), make_do_until_command(), make_fcn_name(), make_for_command(), make_indirect_ref(), make_script(), make_statement(), make_try_command(), make_unwind_command(), make_while_command(), maybe_warn_assign_as_truth_value(), maybe_warn_missing_semi(), maybe_warn_variable_switch_label(), push_fcn_symtab(), recover_from_parsing_function(), reset(), octave::push_parser::run(), octave::parser::run(), start_function(), and validate_matrix_for_assignment().
|
protected |
Definition at line 528 of file parse.h.
Referenced by push_fcn_symtab(), and reset().
|
protected |
Definition at line 505 of file parse.h.
Referenced by bison_error(), octave::push_parser::run(), and octave::parser::run().
|
protected |
Definition at line 570 of file parse.h.
Referenced by ~base_parser(), reset(), octave::push_parser::run(), and octave::parser::run().
|
protected |
Definition at line 524 of file parse.h.
Referenced by make_fcn_name(), parsing_local_functions(), and reset().
|
protected |
Definition at line 519 of file parse.h.
Referenced by finish_function(), parsing_subfunctions(), push_fcn_symtab(), recover_from_parsing_function(), reset(), and start_function().
|
protected |
Definition at line 553 of file parse.h.
Referenced by make_script(), reset(), and start_function().
|
protected |
Definition at line 539 of file parse.h.
Referenced by finish_function(), push_fcn_symtab(), and reset().
|
protected |
Definition at line 564 of file parse.h.
Referenced by reset(), and statement_list().
|
protected |
Definition at line 558 of file parse.h.
Referenced by finish_function(), and reset().