#include "parse.h"
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 |
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) |
base_parser::base_parser | ( | base_lexer & | lxr | ) |
Definition at line 6696 of file oct-parse.cc.
|
virtual |
Definition at line 6707 of file oct-parse.cc.
References m_lexer, m_parser_state, yypstate, and yypstate_delete.
tree_args_block_validation_list * base_parser::append_args_validation_list | ( | tree_args_block_validation_list * | list, |
tree_arg_validation * | arg_validation | ||
) |
Definition at line 8396 of file oct-parse.cc.
tree_argument_list * base_parser::append_argument_list | ( | tree_argument_list * | list, |
tree_expression * | expr | ||
) |
Definition at line 9586 of file oct-parse.cc.
tree_cell * base_parser::append_cell_row | ( | tree_cell * | cell, |
tree_argument_list * | row | ||
) |
Definition at line 9468 of file oct-parse.cc.
References make_cell().
tree_classdef_attribute_list * base_parser::append_classdef_attribute | ( | tree_classdef_attribute_list * | list, |
tree_classdef_attribute * | elt | ||
) |
Definition at line 8822 of file oct-parse.cc.
tree_classdef_enum_list * base_parser::append_classdef_enum | ( | tree_classdef_enum_list * | list, |
tree_classdef_enum * | elt | ||
) |
Definition at line 8775 of file oct-parse.cc.
tree_classdef_body * base_parser::append_classdef_enum_block | ( | tree_classdef_body * | body, |
tree_classdef_enum_block * | block | ||
) |
Definition at line 8874 of file oct-parse.cc.
tree_classdef_events_list * base_parser::append_classdef_event | ( | tree_classdef_events_list * | list, |
tree_classdef_event * | elt | ||
) |
Definition at line 8768 of file oct-parse.cc.
tree_classdef_body * base_parser::append_classdef_events_block | ( | tree_classdef_body * | body, |
tree_classdef_events_block * | block | ||
) |
Definition at line 8867 of file oct-parse.cc.
tree_classdef_methods_list * base_parser::append_classdef_method | ( | tree_classdef_methods_list * | list, |
tree_function_def * | fcn_def | ||
) |
Definition at line 8962 of file oct-parse.cc.
References tree_function_def::function().
tree_classdef_body * base_parser::append_classdef_methods_block | ( | tree_classdef_body * | body, |
tree_classdef_methods_block * | block | ||
) |
Definition at line 8860 of file oct-parse.cc.
tree_classdef_body * base_parser::append_classdef_properties_block | ( | tree_classdef_body * | body, |
tree_classdef_properties_block * | block | ||
) |
Definition at line 8853 of file oct-parse.cc.
tree_classdef_property_list * base_parser::append_classdef_property | ( | tree_classdef_property_list * | list, |
tree_classdef_property * | elt | ||
) |
Definition at line 8761 of file oct-parse.cc.
tree_classdef_superclass_list * base_parser::append_classdef_superclass | ( | tree_classdef_superclass_list * | list, |
tree_classdef_superclass * | elt | ||
) |
Definition at line 8794 of file oct-parse.cc.
tree_decl_init_list * base_parser::append_decl_init_list | ( | tree_decl_init_list * | list, |
tree_decl_elt * | elt | ||
) |
Definition at line 9193 of file oct-parse.cc.
tree_statement_list * base_parser::append_function_body | ( | tree_statement_list * | body, |
tree_statement_list * | list | ||
) |
Definition at line 8322 of file oct-parse.cc.
tree_if_command_list * base_parser::append_if_clause | ( | tree_if_command_list * | list, |
tree_if_clause * | clause | ||
) |
Definition at line 7721 of file oct-parse.cc.
tree_matrix * base_parser::append_matrix_row | ( | tree_matrix * | matrix, |
tree_argument_list * | row | ||
) |
Definition at line 9441 of file oct-parse.cc.
References make_matrix().
tree_parameter_list * base_parser::append_parameter_list | ( | tree_parameter_list * | list, |
tree_decl_elt * | t | ||
) |
Definition at line 9613 of file oct-parse.cc.
tree_parameter_list * base_parser::append_parameter_list | ( | tree_parameter_list * | list, |
tree_identifier * | id | ||
) |
Definition at line 9620 of file oct-parse.cc.
tree_statement_list * base_parser::append_statement_list | ( | tree_statement_list * | list, |
char | sep, | ||
tree_statement * | stmt, | ||
bool | warn_missing_semi | ||
) |
Definition at line 9570 of file oct-parse.cc.
References set_stmt_print_flag().
tree_switch_case_list * base_parser::append_switch_case | ( | tree_switch_case_list * | list, |
tree_switch_case * | elt | ||
) |
Definition at line 7802 of file oct-parse.cc.
|
inline |
Definition at line 170 of file parse.h.
Referenced by tree_evaluator::eval_string().
void base_parser::bison_error | ( | const parse_exception & | pe | ) |
Definition at line 9731 of file oct-parse.cc.
References bison_error().
void base_parser::bison_error | ( | const std::list< parse_exception > & | pe | ) |
Definition at line 9737 of file oct-parse.cc.
References bison_error().
void base_parser::bison_error | ( | const std::string & | s | ) |
Definition at line 9661 of file oct-parse.cc.
References lexical_feedback::m_filepos, and m_lexer.
Referenced by bison_error(), finish_classdef_file(), finish_input(), make_anon_fcn_handle(), make_assign_op(), make_break_command(), make_classdef(), make_continue_command(), make_fcn_name(), make_for_command(), make_index_expression(), push_fcn_symtab(), start_classdef_external_method(), validate_array_list(), validate_matrix_for_assignment(), validate_param_list(), and validate_primary_fcn().
void base_parser::bison_error | ( | const std::string & | s, |
const filepos & | pos | ||
) |
Definition at line 9667 of file oct-parse.cc.
References bison_error(), filepos::column(), and filepos::line().
void base_parser::bison_error | ( | const std::string & | s, |
int | line, | ||
int | column | ||
) |
Definition at line 9673 of file oct-parse.cc.
References lexical_feedback::m_fcn_file_full_name, m_lexer, lexical_feedback::m_reading_classdef_file, lexical_feedback::m_reading_fcn_file, and lexical_feedback::m_reading_script_file.
|
inline |
|
inline |
void base_parser::disallow_command_syntax | ( | ) |
Definition at line 9627 of file oct-parse.cc.
References lexical_feedback::m_allow_command_syntax, and m_lexer.
Referenced by tree_evaluator::eval_string().
void base_parser::end_token_error | ( | token * | tok, |
token::end_tok_type | expected | ||
) |
Definition at line 6845 of file oct-parse.cc.
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_spmd_command(), make_try_command(), make_unwind_command(), and make_while_command().
bool base_parser::end_token_ok | ( | token * | tok, |
token::end_tok_type | expected | ||
) |
Definition at line 6857 of file oct-parse.cc.
References token::ettype(), and token::simple_end.
Referenced by finish_if_command(), finish_switch_command(), make_arguments_block(), make_classdef(), make_classdef_enum_block(), make_classdef_events_block(), make_classdef_methods_block(), make_classdef_properties_block(), make_for_command(), make_spmd_command(), make_try_command(), make_unwind_command(), and make_while_command().
tree_expression * base_parser::finish_array_list | ( | tree_array_list * | a, |
token * | open_delim, | ||
token * | close_delim | ||
) |
Definition at line 9361 of file oct-parse.cc.
References tree_array_list::accept(), tree_array_list::all_elements_are_constant(), token::column(), error_system::discard_warning_messages(), tree_expression::evaluate(), interpreter::get_error_system(), interpreter::get_evaluator(), error_system::last_warning_message(), token::line(), lexical_feedback::m_interpreter, m_lexer, interpreter::recover_from_exception(), error_system::set_discard_warning_messages(), error_system::set_last_warning_message(), tree::set_location(), and tree_constant::stash_original_text().
Referenced by finish_cell(), and finish_matrix().
tree_expression * base_parser::finish_cell | ( | tree_cell * | c, |
token * | open_delim, | ||
token * | close_delim | ||
) |
Definition at line 9452 of file oct-parse.cc.
References token::column(), finish_array_list(), and token::line().
tree_function_def * base_parser::finish_classdef_external_method | ( | octave_user_function * | fcn, |
tree_parameter_list * | ret_list, | ||
comment_list * | cl | ||
) |
Definition at line 8930 of file oct-parse.cc.
References octave_user_function::beginning_column(), octave_user_function::beginning_line(), octave_user_function::define_ret_list(), tree_parameter_list::out, and octave_user_function::stash_leading_comment().
bool base_parser::finish_classdef_file | ( | tree_classdef * | cls, |
tree_statement_list * | local_fcns | ||
) |
Definition at line 8978 of file oct-parse.cc.
References tree_classdef::accept(), tree_function_def::accept(), bison_error(), octave_user_code::fcn_file_name(), tree_function_def::function(), interpreter::get_symbol_table(), symbol_table::install_local_function(), m_classdef_object, lexical_feedback::m_interpreter, m_lexer, lexical_feedback::m_reading_classdef_file, octave_function::name(), and octave_value::user_function_value().
tree_function_def * base_parser::finish_function | ( | tree_parameter_list * | ret_list, |
octave_user_function * | fcn, | ||
comment_list * | lc, | ||
int | l, | ||
int | c | ||
) |
Definition at line 8227 of file oct-parse.cc.
References symbol_scope::cache_dir_name(), symbol_scope::cache_fcn_file_name(), symbol_scope::cache_fcn_name(), octave_user_code::cache_function_text(), symbol_scope::cache_name(), octave_user_function::define_ret_list(), octave_user_code::fcn_file_name(), symbol_scope::install_nestfunction(), symbol_scope::install_subfunction(), lexical_feedback::m_buffer_function_text, m_curr_fcn_depth, lexical_feedback::m_dir_name, m_endfunction_found, m_function_scopes, lexical_feedback::m_function_text, m_lexer, m_parsing_subfunctions, m_primary_fcn_scope, lexical_feedback::m_reading_fcn_file, m_subfunction_names, tree_parameter_list::mark_as_formal_parameters(), octave_user_function::mark_as_nested_function(), octave_user_function::mark_as_subfunction(), octave_function::name(), tree_parameter_list::out, octave_user_code::scope(), symbol_scope::set_nesting_depth(), symbol_scope::set_parent(), symbol_scope::set_primary_parent(), octave_user_function::stash_fcn_location(), octave_user_function::stash_leading_comment(), octave_user_code::time_parsed(), and symbol_scope::update_nest().
Referenced by make_function().
tree_if_command * base_parser::finish_if_command | ( | token * | if_tok, |
tree_if_command_list * | list, | ||
token * | end_tok, | ||
comment_list * | lc | ||
) |
Definition at line 7657 of file oct-parse.cc.
References tree::column(), token::column(), base_list< elt_type >::empty(), end_token_error(), end_token_ok(), base_list< elt_type >::front(), base_lexer::comment_buffer::get_comment(), token::if_end, tree::line(), token::line(), base_lexer::m_comment_buf, and m_lexer.
bool base_parser::finish_input | ( | tree_statement_list * | lst, |
bool | at_eof = false |
||
) |
Definition at line 10002 of file oct-parse.cc.
References tree_statement_list::accept(), bison_error(), lexical_feedback::m_end_of_input, m_lexer, and statement_list().
tree_expression * base_parser::finish_matrix | ( | tree_matrix * | m, |
token * | open_delim, | ||
token * | close_delim | ||
) |
Definition at line 9425 of file oct-parse.cc.
References token::column(), finish_array_list(), octave_null_matrix::instance, token::line(), and m.
tree_switch_command * 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 7730 of file oct-parse.cc.
References tree::column(), token::column(), base_list< elt_type >::empty(), end_token_error(), end_token_ok(), base_list< elt_type >::front(), base_lexer::comment_buffer::get_comment(), tree::line(), token::line(), base_lexer::m_comment_buf, m_lexer, and token::switch_end.
octave_user_function* base_parser::frob_function | ( | tree_identifier * | id, |
octave_user_function * | fcn | ||
) |
|
inline |
tree_anon_fcn_handle * base_parser::make_anon_fcn_handle | ( | tree_parameter_list * | param_list, |
tree_expression * | expr, | ||
const filepos & | at_pos | ||
) |
Definition at line 6978 of file oct-parse.cc.
References tree_anon_fcn_handle::accept(), bison_error(), symbol_scope::cache_name(), anon_fcn_validator::column(), filepos::column(), lexical_feedback::symbol_table_context::curr_scope(), base_lexer::input_from_eval_string(), base_lexer::input_from_terminal(), anon_fcn_validator::line(), filepos::line(), lexical_feedback::m_fcn_file_full_name, m_lexer, lexical_feedback::m_symtab_context, symbol_scope::mark_static(), anon_fcn_validator::message(), anon_fcn_validator::ok(), lexical_feedback::symbol_table_context::parent_scope(), lexical_feedback::symbol_table_context::pop(), and tree_expression::set_print_flag().
tree_arg_size_spec * base_parser::make_arg_size_spec | ( | tree_argument_list * | size_args | ) |
Definition at line 8403 of file oct-parse.cc.
tree_arg_validation * base_parser::make_arg_validation | ( | tree_arg_size_spec * | size_spec, |
tree_identifier * | class_name, | ||
tree_arg_validation_fcns * | validation_fcns, | ||
tree_expression * | default_value | ||
) |
Definition at line 8368 of file oct-parse.cc.
tree_arg_validation_fcns * base_parser::make_arg_validation_fcns | ( | tree_argument_list * | fcn_args | ) |
Definition at line 8411 of file oct-parse.cc.
tree_args_block_attribute_list * base_parser::make_args_attribute_list | ( | tree_identifier * | attribute_name | ) |
Definition at line 8381 of file oct-parse.cc.
tree_args_block_validation_list * base_parser::make_args_validation_list | ( | tree_arg_validation * | arg_validation | ) |
Definition at line 8390 of file oct-parse.cc.
tree_argument_list * base_parser::make_argument_list | ( | tree_expression * | expr | ) |
Definition at line 9580 of file oct-parse.cc.
tree_arguments_block * base_parser::make_arguments_block | ( | token * | arguments_tok, |
tree_args_block_attribute_list * | attr_list, | ||
tree_args_block_validation_list * | validation_list, | ||
token * | end_tok, | ||
comment_list * | lc, | ||
comment_list * | tc | ||
) |
Definition at line 8338 of file oct-parse.cc.
References token::arguments_end, token::beg_pos(), filepos::column(), end_token_ok(), and filepos::line().
tree_expression * base_parser::make_assign_op | ( | int | op, |
tree_argument_list * | lhs, | ||
token * | eq_tok, | ||
tree_expression * | rhs | ||
) |
Definition at line 7811 of file oct-parse.cc.
References ADD_EQ, AND_EQ, token::beg_pos(), bison_error(), token::column(), DIV_EQ, EDIV_EQ, ELEFTDIV_EQ, EMUL_EQ, EPOW_EQ, tree_expression::is_identifier(), tree_expression::is_index_expression(), tree_argument_list::is_simple_assign_lhs(), iskeyword(), LEFTDIV_EQ, token::line(), m_lexer, lexical_feedback::mark_as_variable(), lexical_feedback::mark_as_variables(), MUL_EQ, 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, tree_argument_list::remove_front(), SUB_EQ, octave_value::unknown_assign_op, and tree_argument_list::variable_names().
tree_expression * base_parser::make_binary_op | ( | int | op, |
tree_expression * | op1, | ||
token * | tok_val, | ||
tree_expression * | op2 | ||
) |
Definition at line 7124 of file oct-parse.cc.
References token::column(), EDIV, ELEFTDIV, EMUL, EPOW, EXPR_AND, EXPR_EQ, EXPR_GE, EXPR_GT, EXPR_LE, EXPR_LT, EXPR_NE, EXPR_OR, LEFTDIV, token::line(), 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.
tree_black_hole * base_parser::make_black_hole | ( | ) |
Definition at line 6957 of file oct-parse.cc.
tree_expression * base_parser::make_boolean_op | ( | int | op, |
tree_expression * | op1, | ||
token * | tok_val, | ||
tree_expression * | op2 | ||
) |
Definition at line 7252 of file oct-parse.cc.
References tree_boolean_expression::bool_and, tree_boolean_expression::bool_or, token::column(), EXPR_AND_AND, EXPR_OR_OR, token::line(), and panic_impossible.
tree_command * base_parser::make_break_command | ( | token * | break_tok | ) |
Definition at line 7569 of file oct-parse.cc.
References bison_error(), token::column(), token::line(), m_lexer, and lexical_feedback::m_looping.
tree_cell * base_parser::make_cell | ( | tree_argument_list * | row | ) |
Definition at line 9462 of file oct-parse.cc.
Referenced by append_cell_row().
tree_classdef * 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 * | bc, | ||
comment_list * | tc | ||
) |
Definition at line 8447 of file oct-parse.cc.
References bison_error(), token::classdef_end, token::column(), lexical_feedback::symbol_table_context::curr_scope(), dir_sep_chars(), end_token_error(), end_token_ok(), comment_list::find_doc_string(), token::line(), m_curr_package_name, lexical_feedback::m_fcn_file_full_name, lexical_feedback::m_fcn_file_name, m_lexer, lexical_feedback::m_symtab_context, lexical_feedback::symbol_table_context::pop(), and token::switch_end.
tree_classdef_attribute * base_parser::make_classdef_attribute | ( | tree_identifier * | id, |
tree_expression * | expr = nullptr |
||
) |
Definition at line 8807 of file oct-parse.cc.
tree_classdef_attribute_list * base_parser::make_classdef_attribute_list | ( | tree_classdef_attribute * | attr | ) |
Definition at line 8801 of file oct-parse.cc.
tree_classdef_body * base_parser::make_classdef_body | ( | tree_classdef_enum_block * | enb | ) |
Definition at line 8847 of file oct-parse.cc.
tree_classdef_body * base_parser::make_classdef_body | ( | tree_classdef_events_block * | evb | ) |
Definition at line 8841 of file oct-parse.cc.
tree_classdef_body * base_parser::make_classdef_body | ( | tree_classdef_methods_block * | mb | ) |
Definition at line 8835 of file oct-parse.cc.
tree_classdef_body * base_parser::make_classdef_body | ( | tree_classdef_properties_block * | pb | ) |
Definition at line 8829 of file oct-parse.cc.
tree_classdef_enum * base_parser::make_classdef_enum | ( | tree_identifier * | id, |
tree_expression * | expr, | ||
comment_list * | lc | ||
) |
Definition at line 8754 of file oct-parse.cc.
tree_classdef_enum_block * 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 8715 of file oct-parse.cc.
References token::column(), end_token_error(), end_token_ok(), token::enumeration_end, and token::line().
tree_classdef_enum_list * base_parser::make_classdef_enum_list | ( | tree_classdef_enum * | e | ) |
Definition at line 8748 of file oct-parse.cc.
tree_classdef_event * base_parser::make_classdef_event | ( | comment_list * | lc, |
tree_identifier * | id | ||
) |
Definition at line 8699 of file oct-parse.cc.
tree_classdef_events_block * 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 8660 of file oct-parse.cc.
References token::column(), end_token_error(), end_token_ok(), token::events_end, and token::line().
tree_classdef_events_list * base_parser::make_classdef_events_list | ( | tree_classdef_event * | e | ) |
Definition at line 8693 of file oct-parse.cc.
tree_classdef_methods_block * 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 8619 of file oct-parse.cc.
References token::column(), end_token_error(), end_token_ok(), token::line(), and token::methods_end.
tree_classdef_methods_list * base_parser::make_classdef_methods_list | ( | tree_function_def * | fcn_def | ) |
Definition at line 8949 of file oct-parse.cc.
References tree_function_def::function().
tree_classdef_properties_block * 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 8540 of file oct-parse.cc.
References base_list< elt_type >::back(), token::column(), tree_classdef_property::doc_string(), end_token_error(), end_token_ok(), base_list< elt_type >::front(), tree_classdef_property::have_doc_string(), comment_elt::is_end_of_line(), token::line(), token::properties_end, and comment_elt::text().
tree_classdef_property * base_parser::make_classdef_property | ( | comment_list * | lc, |
tree_identifier * | id, | ||
tree_arg_validation * | av | ||
) |
Definition at line 8602 of file oct-parse.cc.
References tree_arg_validation::arg_name(), tree_arg_validation::class_name(), tree_arg_validation::size_spec(), tree_arg_validation::validation_fcns(), and warning().
tree_classdef_property_list * base_parser::make_classdef_property_list | ( | tree_classdef_property * | prop | ) |
Definition at line 8596 of file oct-parse.cc.
tree_classdef_superclass * base_parser::make_classdef_superclass | ( | token * | fqident | ) |
Definition at line 8788 of file oct-parse.cc.
References token::text().
tree_classdef_superclass_list * base_parser::make_classdef_superclass_list | ( | tree_classdef_superclass * | sc | ) |
Definition at line 8782 of file oct-parse.cc.
tree_expression * base_parser::make_colon_expression | ( | tree_expression * | base, |
tree_expression * | limit, | ||
tree_expression * | incr = nullptr |
||
) |
Definition at line 7044 of file oct-parse.cc.
References tree_colon_expression::accept(), tree::column(), error_system::discard_warning_messages(), tree_colon_expression::evaluate(), interpreter::get_error_system(), interpreter::get_evaluator(), tree_expression::is_constant(), error_system::last_warning_message(), tree::line(), lexical_feedback::m_interpreter, m_lexer, interpreter::recover_from_exception(), error_system::set_discard_warning_messages(), error_system::set_last_warning_message(), and tree_constant::stash_original_text().
tree_constant * base_parser::make_constant | ( | token * | tok_val | ) |
Definition at line 6896 of file oct-parse.cc.
References token::column(), DQ_STRING, octave_null_str::instance, octave_null_sq_str::instance, token::line(), octave_value::magic_colon_t, NUMBER, token::number(), panic_impossible, SQ_STRING, tree_constant::stash_original_text(), token::text(), token::text_rep(), token::token_value(), and undo_string_escapes().
tree_command * base_parser::make_continue_command | ( | token * | continue_tok | ) |
Definition at line 7586 of file oct-parse.cc.
References bison_error(), token::column(), token::line(), m_lexer, and lexical_feedback::m_looping.
tree_decl_command * base_parser::make_decl_command | ( | int | tok, |
token * | tok_val, | ||
tree_decl_init_list * | lst | ||
) |
Definition at line 9142 of file oct-parse.cc.
References token::column(), GLOBAL, token::line(), m_curr_fcn_depth, lexical_feedback::m_fcn_file_full_name, m_lexer, lexical_feedback::m_reading_script_file, lexical_feedback::mark_as_variables(), tree_decl_command::mark_global(), tree_decl_command::mark_persistent(), panic_impossible, PERSISTENT, tree_decl_init_list::variable_names(), and warning().
tree_decl_elt * base_parser::make_decl_elt | ( | tree_identifier * | id, |
token * | eq_op = nullptr , |
||
tree_expression * | expr = nullptr |
||
) |
Definition at line 9200 of file oct-parse.cc.
tree_decl_init_list * base_parser::make_decl_init_list | ( | tree_decl_elt * | elt | ) |
Definition at line 9187 of file oct-parse.cc.
tree_switch_case * base_parser::make_default_switch_case | ( | token * | default_tok, |
comment_list * | lc, | ||
tree_statement_list * | list | ||
) |
Definition at line 7792 of file oct-parse.cc.
References token::column(), and token::line().
tree_command * base_parser::make_do_until_command | ( | token * | until_tok, |
tree_statement_list * | body, | ||
tree_expression * | expr, | ||
comment_list * | lc | ||
) |
Definition at line 7482 of file oct-parse.cc.
References token::column(), base_lexer::comment_buffer::get_comment(), token::line(), base_lexer::m_comment_buf, m_lexer, and lexical_feedback::m_looping.
tree_if_clause * base_parser::make_else_clause | ( | token * | else_tok, |
comment_list * | lc, | ||
tree_statement_list * | list | ||
) |
Definition at line 7711 of file oct-parse.cc.
References token::column(), and token::line().
tree_if_clause * base_parser::make_elseif_clause | ( | token * | elseif_tok, |
tree_expression * | expr, | ||
tree_statement_list * | list, | ||
comment_list * | lc | ||
) |
Definition at line 7697 of file oct-parse.cc.
References token::column(), and token::line().
tree_statement * base_parser::make_end | ( | const std::string & | type, |
bool | eof, | ||
const filepos & | beg_pos, | ||
const filepos & | end_pos | ||
) |
Definition at line 8217 of file oct-parse.cc.
References filepos::column(), filepos::line(), and make_statement().
tree_fcn_handle * base_parser::make_fcn_handle | ( | token * | tok_val | ) |
Definition at line 6965 of file oct-parse.cc.
References token::column(), token::line(), and token::text().
tree_identifier * base_parser::make_fcn_name | ( | tree_identifier * | id | ) |
Definition at line 7988 of file oct-parse.cc.
References bison_error(), symbol_scope::cache_name(), tree::column(), lexical_feedback::symbol_table_context::curr_scope(), tree::line(), m_curr_fcn_depth, lexical_feedback::m_fcn_file_name, m_function_scopes, m_lexer, lexical_feedback::m_maybe_classdef_get_set_method, lexical_feedback::m_parsed_function_name, m_parsing_local_functions, lexical_feedback::m_symtab_context, and tree_identifier::name().
tree_command * 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 7502 of file oct-parse.cc.
References bison_error(), token::column(), end_token_error(), end_token_ok(), token::for_end, base_lexer::comment_buffer::get_comment(), base_list< elt_type >::length(), token::line(), base_lexer::m_comment_buf, m_lexer, lexical_feedback::m_looping, tree_expression::mark_as_for_cmd_expr(), lexical_feedback::mark_as_variable(), lexical_feedback::mark_as_variables(), tree_expression::name(), PARFOR, token::parfor_end, tree_argument_list::remove_front(), and tree_argument_list::variable_names().
tree_function_def * 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, | ||
comment_list * | bc | ||
) |
Definition at line 8022 of file oct-parse.cc.
References token::column(), comment_elt::empty(), comment_list::find_doc_comment(), finish_function(), token::line(), m_lexer, lexical_feedback::m_parsing_classdef, recover_from_parsing_function(), start_function(), comment_elt::text(), and comment_elt::uses_hash_char().
tree_identifier * base_parser::make_identifier | ( | token * | ident | ) |
Definition at line 9477 of file oct-parse.cc.
References token::column(), lexical_feedback::symbol_table_context::curr_scope(), symbol_scope::insert(), token::line(), m_lexer, lexical_feedback::m_symtab_context, and token::text().
tree_index_expression * base_parser::make_index_expression | ( | tree_expression * | expr, |
tree_argument_list * | args, | ||
char | type | ||
) |
Definition at line 9046 of file oct-parse.cc.
References tree_index_expression::append(), bison_error(), tree::column(), tree_argument_list::has_magic_tilde(), tree_expression::is_index_expression(), tree_expression::is_postfix_indexed(), tree::line(), and tree_expression::set_postfix_index().
tree_index_expression * base_parser::make_indirect_ref | ( | tree_expression * | expr, |
const std::string & | elt | ||
) |
Definition at line 9084 of file oct-parse.cc.
References tree_index_expression::append(), tree::column(), tree_expression::is_index_expression(), tree_expression::is_postfix_indexed(), tree::line(), m_lexer, lexical_feedback::m_looking_at_indirect_ref, and tree_expression::set_postfix_index().
tree_index_expression * base_parser::make_indirect_ref | ( | tree_expression * | expr, |
tree_expression * | field | ||
) |
Definition at line 9113 of file oct-parse.cc.
References tree::column(), tree_expression::is_index_expression(), tree_expression::is_postfix_indexed(), tree::line(), and tree_expression::set_postfix_index().
tree_matrix * base_parser::make_matrix | ( | tree_argument_list * | row | ) |
Definition at line 9435 of file oct-parse.cc.
Referenced by append_matrix_row().
tree_metaclass_query * base_parser::make_metaclass_query | ( | token * | metaquery | ) |
Definition at line 9506 of file oct-parse.cc.
References token::column(), token::line(), and token::text().
tree_classdef_attribute * base_parser::make_not_classdef_attribute | ( | tree_identifier * | id | ) |
Definition at line 8816 of file oct-parse.cc.
tree_parameter_list * base_parser::make_parameter_list | ( | tree_parameter_list::in_or_out | io | ) |
Definition at line 9593 of file oct-parse.cc.
tree_parameter_list * base_parser::make_parameter_list | ( | tree_parameter_list::in_or_out | io, |
tree_decl_elt * | t | ||
) |
Definition at line 9599 of file oct-parse.cc.
tree_parameter_list * base_parser::make_parameter_list | ( | tree_parameter_list::in_or_out | io, |
tree_identifier * | id | ||
) |
Definition at line 9606 of file oct-parse.cc.
tree_expression * base_parser::make_postfix_op | ( | int | op, |
tree_expression * | op1, | ||
token * | tok_val | ||
) |
Definition at line 7322 of file oct-parse.cc.
References token::column(), HERMITIAN, 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.
tree_expression * base_parser::make_prefix_op | ( | int | op, |
tree_expression * | op1, | ||
token * | tok_val | ||
) |
Definition at line 7281 of file oct-parse.cc.
References token::column(), 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.
tree_command * base_parser::make_return_command | ( | token * | return_tok | ) |
Definition at line 7603 of file oct-parse.cc.
References token::column(), and token::line().
void base_parser::make_script | ( | tree_statement_list * | cmds, |
tree_statement * | end_script | ||
) |
Definition at line 7944 of file oct-parse.cc.
References base_list< elt_type >::append(), symbol_scope::cache_dir_name(), symbol_scope::cache_fcn_file_name(), symbol_scope::cache_name(), tree_statement::comment_text(), lexical_feedback::symbol_table_context::curr_scope(), comment_list::find_doc_string(), base_list< elt_type >::front(), lexical_feedback::m_dir_name, lexical_feedback::m_fcn_file_full_name, lexical_feedback::m_fcn_file_name, m_lexer, m_primary_fcn, lexical_feedback::m_symtab_context, octave_value(), lexical_feedback::symbol_table_context::pop(), octave_function::stash_dir_name(), and octave_user_code::stash_fcn_file_time().
tree_spmd_command * base_parser::make_spmd_command | ( | token * | spmd_tok, |
tree_statement_list * | body, | ||
token * | end_tok, | ||
comment_list * | lc, | ||
comment_list * | tc | ||
) |
Definition at line 7614 of file oct-parse.cc.
References token::column(), end_token_error(), end_token_ok(), token::line(), and token::spmd_end.
tree_statement * base_parser::make_statement | ( | T * | arg | ) |
Definition at line 9556 of file oct-parse.cc.
References base_lexer::get_comment(), and m_lexer.
Referenced by make_end().
tree_statement_list * base_parser::make_statement_list | ( | tree_statement * | stmt | ) |
Definition at line 9564 of file oct-parse.cc.
tree_superclass_ref * base_parser::make_superclass_ref | ( | token * | superclassref | ) |
Definition at line 9494 of file oct-parse.cc.
References token::column(), token::line(), token::superclass_class_name(), and token::superclass_method_name().
tree_switch_case * base_parser::make_switch_case | ( | token * | case_tok, |
tree_expression * | expr, | ||
tree_statement_list * | list, | ||
comment_list * | lc | ||
) |
Definition at line 7778 of file oct-parse.cc.
References token::column(), and token::line().
tree_switch_case_list * base_parser::make_switch_case_list | ( | tree_switch_case * | switch_case | ) |
Definition at line 7770 of file oct-parse.cc.
tree_command * 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 7391 of file oct-parse.cc.
References token::column(), base_list< elt_type >::empty(), end_token_error(), end_token_ok(), tree_statement::expression(), base_list< elt_type >::front(), base_lexer::comment_buffer::get_comment(), tree_expression::is_identifier(), token::line(), base_lexer::m_comment_buf, m_lexer, base_list< elt_type >::pop_front(), tree_statement::set_expression(), and token::try_catch_end.
tree_command * 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 7358 of file oct-parse.cc.
References token::column(), end_token_error(), end_token_ok(), base_lexer::comment_buffer::get_comment(), token::line(), base_lexer::m_comment_buf, m_lexer, and token::unwind_protect_end.
tree_command * base_parser::make_while_command | ( | token * | while_tok, |
tree_expression * | expr, | ||
tree_statement_list * | body, | ||
token * | end_tok, | ||
comment_list * | lc | ||
) |
Definition at line 7447 of file oct-parse.cc.
References token::column(), end_token_error(), end_token_ok(), base_lexer::comment_buffer::get_comment(), token::line(), base_lexer::m_comment_buf, m_lexer, lexical_feedback::m_looping, and token::while_end.
void base_parser::maybe_convert_to_braindead_shortcircuit | ( | tree_expression *& | expr | ) |
Definition at line 7215 of file oct-parse.cc.
References tree::column(), tree_expression::is_binary_expression(), tree_binary_expression::lhs(), tree::line(), octave_value::op_el_and, octave_value::op_el_or, tree_binary_expression::op_type(), tree_binary_expression::preserve_operands(), and tree_binary_expression::rhs().
|
inline |
bool base_parser::push_fcn_symtab | ( | ) |
Definition at line 6865 of file oct-parse.cc.
References bison_error(), 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, lexical_feedback::m_reading_script_file, lexical_feedback::m_symtab_context, symbol_scope::mark_primary_fcn_scope(), and lexical_feedback::symbol_table_context::push().
void base_parser::recover_from_parsing_function | ( | ) |
Definition at line 8419 of file oct-parse.cc.
References m_curr_fcn_depth, lexical_feedback::m_defining_fcn, m_function_scopes, m_lexer, lexical_feedback::m_looking_at_parameter_list, lexical_feedback::m_looking_at_return_list, lexical_feedback::m_parsed_function_name, m_parsing_subfunctions, lexical_feedback::m_reading_fcn_file, lexical_feedback::m_symtab_context, and lexical_feedback::symbol_table_context::pop().
Referenced by make_function().
void base_parser::reset | ( | ) |
Definition at line 6723 of file oct-parse.cc.
References symbol_scope::invalid(), 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(), base_lexer::reset(), yypstate, yypstate_delete, and yypstate_new.
Referenced by bp_table::condition_valid(), tree_evaluator::eval_string(), and text_parser::parse().
|
pure virtual |
Implemented in push_parser, and parser.
tree_statement_list * base_parser::set_stmt_print_flag | ( | tree_statement_list * | list, |
char | sep, | ||
bool | warn_missing_semi | ||
) |
Definition at line 9517 of file oct-parse.cc.
References base_list< elt_type >::back(), tree_statement::is_null_statement(), base_list< elt_type >::pop_back(), tree_statement::set_print_flag(), and warning().
Referenced by append_statement_list().
octave_user_function * base_parser::start_classdef_external_method | ( | tree_identifier * | id, |
tree_parameter_list * | pl | ||
) |
Definition at line 8881 of file oct-parse.cc.
References symbol_scope::anonymous(), bison_error(), m_curr_class_name, octave_function::name(), octave_user_function::stash_fcn_location(), and octave_user_function::stash_function_name().
octave_user_function * base_parser::start_function | ( | tree_identifier * | id, |
tree_parameter_list * | param_list, | ||
tree_statement_list * | body, | ||
tree_statement * | end_function, | ||
const std::string & | doc_string | ||
) |
Definition at line 8085 of file oct-parse.cc.
References base_list< elt_type >::append(), tree_statement::column(), lexical_feedback::symbol_table_context::curr_scope(), dir_sep_chars(), octave_function::document(), octave_user_code::fcn_file_name(), base_lexer::comment_buffer::get_comment(), base_lexer::input_from_tmp_history_file(), tree_statement::line(), m_autoloading, base_lexer::m_comment_buf, m_curr_class_name, m_curr_fcn_depth, lexical_feedback::m_dir_name, m_fcn_file_from_relative_lookup, lexical_feedback::m_fcn_file_full_name, lexical_feedback::m_fcn_file_name, lexical_feedback::m_force_script, m_lexer, lexical_feedback::m_package_name, lexical_feedback::m_parsing_class_method, lexical_feedback::m_parsing_classdef, lexical_feedback::m_parsing_classdef_get_method, lexical_feedback::m_parsing_classdef_set_method, m_parsing_subfunctions, m_primary_fcn, lexical_feedback::m_reading_classdef_file, lexical_feedback::m_reading_fcn_file, lexical_feedback::m_reading_script_file, 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 * base_parser::start_if_command | ( | tree_expression * | expr, |
tree_statement_list * | list | ||
) |
Definition at line 7642 of file oct-parse.cc.
|
inline |
Definition at line 186 of file parse.h.
Referenced by finish_input().
void base_parser::statement_list | ( | std::shared_ptr< tree_statement_list > & | lst | ) |
Definition at line 6825 of file oct-parse.cc.
References m_stmt_list.
Referenced by bp_table::condition_valid(), and tree_evaluator::eval_string().
bool base_parser::validate_array_list | ( | tree_expression * | e | ) |
Definition at line 9274 of file oct-parse.cc.
References bison_error(), and tree_expression::is_matrix().
tree_argument_list * base_parser::validate_matrix_for_assignment | ( | tree_expression * | e | ) |
Definition at line 9299 of file oct-parse.cc.
References bison_error(), tree_expression::evaluate(), base_list< elt_type >::front(), interpreter::get_evaluator(), tree_expression::is_constant(), tree_expression::is_matrix(), tree_argument_list::is_valid_lvalue_list(), octave_value::isempty(), lexical_feedback::m_interpreter, m_lexer, tree_argument_list::mark_as_simple_assign_lhs(), lexical_feedback::mark_as_variables(), base_list< elt_type >::pop_front(), base_list< elt_type >::size(), and tree_argument_list::variable_names().
bool base_parser::validate_param_list | ( | tree_parameter_list * | lst, |
tree_parameter_list::in_or_out | type | ||
) |
Definition at line 9207 of file oct-parse.cc.
References base_list< elt_type >::back(), bison_error(), base_list< elt_type >::end(), base_list< elt_type >::erase(), tree_decl_elt::ident(), tree_parameter_list::in, tree_identifier::is_black_hole(), iskeyword(), len, base_list< elt_type >::length(), tree_parameter_list::mark_varargs(), tree_parameter_list::mark_varargs_only(), and tree_identifier::name().
bool base_parser::validate_primary_fcn | ( | ) |
Definition at line 10031 of file oct-parse.cc.
References octave_function::accept(), bison_error(), m_primary_fcn, and octave_value::user_code_value().
|
friend |
Definition at line 9903 of file oct-parse.cc.
|
protected |
Definition at line 738 of file parse.h.
Referenced by reset(), and start_function().
|
protected |
Definition at line 788 of file parse.h.
Referenced by finish_classdef_file(), and reset().
|
protected |
Definition at line 770 of file parse.h.
Referenced by reset(), start_classdef_external_method(), and start_function().
|
protected |
Definition at line 762 of file parse.h.
Referenced by finish_function(), make_decl_command(), make_fcn_name(), push_fcn_symtab(), recover_from_parsing_function(), reset(), and start_function().
|
protected |
Definition at line 774 of file parse.h.
Referenced by make_classdef(), and reset().
|
protected |
Definition at line 735 of file parse.h.
Referenced by finish_function(), and reset().
|
protected |
Definition at line 742 of file parse.h.
Referenced by reset(), and start_function().
|
protected |
Definition at line 777 of file parse.h.
Referenced by finish_function(), make_fcn_name(), push_fcn_symtab(), recover_from_parsing_function(), and reset().
|
protected |
Definition at line 794 of file parse.h.
Referenced by ~base_parser(), bison_error(), disallow_command_syntax(), finish_array_list(), finish_classdef_file(), finish_function(), finish_if_command(), finish_input(), finish_switch_command(), make_anon_fcn_handle(), make_assign_op(), make_break_command(), make_classdef(), make_colon_expression(), make_continue_command(), make_decl_command(), make_do_until_command(), make_fcn_name(), make_for_command(), make_function(), make_identifier(), make_indirect_ref(), make_script(), make_statement(), make_try_command(), make_unwind_command(), make_while_command(), push_fcn_symtab(), recover_from_parsing_function(), reset(), parser::run(), start_function(), and validate_matrix_for_assignment().
|
protected |
Definition at line 755 of file parse.h.
Referenced by push_fcn_symtab(), and reset().
|
protected |
Definition at line 732 of file parse.h.
Referenced by parser::run().
|
protected |
Definition at line 797 of file parse.h.
Referenced by ~base_parser(), reset(), and parser::run().
|
protected |
Definition at line 751 of file parse.h.
Referenced by make_fcn_name(), and reset().
|
protected |
Definition at line 746 of file parse.h.
Referenced by finish_function(), push_fcn_symtab(), recover_from_parsing_function(), reset(), and start_function().
|
protected |
Definition at line 780 of file parse.h.
Referenced by make_script(), reset(), start_function(), and validate_primary_fcn().
|
protected |
Definition at line 766 of file parse.h.
Referenced by finish_function(), push_fcn_symtab(), and reset().
|
protected |
Definition at line 791 of file parse.h.
Referenced by reset(), and statement_list().
|
protected |
Definition at line 785 of file parse.h.
Referenced by finish_function(), and reset().