GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Public Attributes | Private Member Functions | List of all members
octave_base_parser Class Reference

#include "parse.h"

Inheritance diagram for octave_base_parser:
Inheritance graph
[legend]
Collaboration diagram for octave_base_parser:
Collaboration graph
[legend]

Public Member Functions

 octave_base_parser (octave_base_lexer &lxr)
 
 ~octave_base_parser (void)
 
tree_statement_listappend_statement_list (tree_statement_list *list, char sep, tree_statement *stmt, bool warn_missing_semi)
 
void bison_error (const char *s)
 
void end_error (const char *type, token::end_tok_type ettype, int l, int c)
 
bool end_token_ok (token *tok, token::end_tok_type expected)
 
tree_expressionfinish_array_list (tree_array_list *a)
 
tree_expressionfinish_cell (tree_cell *c)
 
tree_function_deffinish_classdef_external_method (octave_user_function *fcn, tree_parameter_list *ret_list, octave_comment_list *cl)
 
tree_expressionfinish_colon_expression (tree_colon_expression *e)
 
tree_function_deffinish_function (tree_parameter_list *ret_list, octave_user_function *fcn, octave_comment_list *lc, int l, int c)
 
tree_if_commandfinish_if_command (token *if_tok, tree_if_command_list *list, token *end_tok, octave_comment_list *lc)
 
tree_expressionfinish_matrix (tree_matrix *m)
 
tree_switch_commandfinish_switch_command (token *switch_tok, tree_expression *expr, tree_switch_case_list *list, token *end_tok, octave_comment_list *lc)
 
octave_user_functionfrob_function (const std::string &fname, octave_user_function *fcn)
 
tree_anon_fcn_handlemake_anon_fcn_handle (tree_parameter_list *param_list, tree_statement *stmt)
 
tree_expressionmake_assign_op (int op, tree_argument_list *lhs, token *eq_tok, tree_expression *rhs)
 
tree_expressionmake_binary_op (int op, tree_expression *op1, token *tok_val, tree_expression *op2)
 
tree_expressionmake_boolean_op (int op, tree_expression *op1, token *tok_val, tree_expression *op2)
 
tree_commandmake_break_command (token *break_tok)
 
tree_classdefmake_classdef (token *tok_val, tree_classdef_attribute_list *a, tree_identifier *id, tree_classdef_superclass_list *sc, tree_classdef_body *body, token *end_tok, octave_comment_list *lc)
 
tree_classdef_enum_blockmake_classdef_enum_block (token *tok_val, tree_classdef_attribute_list *a, tree_classdef_enum_list *elist, token *end_tok, octave_comment_list *lc)
 
tree_classdef_events_blockmake_classdef_events_block (token *tok_val, tree_classdef_attribute_list *a, tree_classdef_events_list *elist, token *end_tok, octave_comment_list *lc)
 
tree_classdef_methods_blockmake_classdef_methods_block (token *tok_val, tree_classdef_attribute_list *a, tree_classdef_methods_list *mlist, token *end_tok, octave_comment_list *lc)
 
tree_classdef_properties_blockmake_classdef_properties_block (token *tok_val, tree_classdef_attribute_list *a, tree_classdef_property_list *plist, token *end_tok, octave_comment_list *lc)
 
tree_constantmake_constant (int op, token *tok_val)
 
tree_commandmake_continue_command (token *continue_tok)
 
tree_decl_commandmake_decl_command (int tok, token *tok_val, tree_decl_init_list *lst)
 
tree_commandmake_do_until_command (token *until_tok, tree_statement_list *body, tree_expression *expr, octave_comment_list *lc)
 
tree_if_clausemake_elseif_clause (token *elseif_tok, tree_expression *expr, tree_statement_list *list, octave_comment_list *lc)
 
tree_statementmake_end (const std::string &type, bool eof, int l, int c)
 
tree_fcn_handlemake_fcn_handle (token *tok_val)
 
tree_commandmake_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, octave_comment_list *lc)
 
tree_index_expressionmake_index_expression (tree_expression *expr, tree_argument_list *args, char type)
 
tree_index_expressionmake_indirect_ref (tree_expression *expr, const std::string &)
 
tree_index_expressionmake_indirect_ref (tree_expression *expr, tree_expression *field)
 
tree_funcallmake_meta_class_query (const std::string &class_nm)
 
tree_expressionmake_postfix_op (int op, tree_expression *op1, token *tok_val)
 
tree_expressionmake_prefix_op (int op, tree_expression *op1, token *tok_val)
 
tree_commandmake_return_command (token *return_tok)
 
void make_script (tree_statement_list *cmds, tree_statement *end_script)
 
template<class T >
tree_statementmake_statement (T *arg)
 
tree_statement_listmake_statement_list (tree_statement *stmt)
 
tree_funcallmake_superclass_ref (const std::string &method_nm, const std::string &class_nm)
 
tree_switch_casemake_switch_case (token *case_tok, tree_expression *expr, tree_statement_list *list, octave_comment_list *lc)
 
tree_commandmake_try_command (token *try_tok, tree_statement_list *body, char catch_sep, tree_statement_list *cleanup, token *end_tok, octave_comment_list *lc, octave_comment_list *mc)
 
tree_commandmake_unwind_command (token *unwind_tok, tree_statement_list *body, tree_statement_list *cleanup, token *end_tok, octave_comment_list *lc, octave_comment_list *mc)
 
tree_commandmake_while_command (token *while_tok, tree_expression *expr, tree_statement_list *body, token *end_tok, octave_comment_list *lc)
 
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)
 
void recover_from_parsing_function (void)
 
void reset (void)
 
tree_statement_listset_stmt_print_flag (tree_statement_list *, char, bool)
 
octave_user_functionstart_classdef_external_method (tree_identifier *id, tree_parameter_list *pl)
 
octave_user_functionstart_function (tree_parameter_list *param_list, tree_statement_list *body, tree_statement *end_function)
 
tree_if_command_liststart_if_command (tree_expression *expr, tree_statement_list *list)
 
bool validate_array_list (tree_expression *e)
 
tree_argument_listvalidate_matrix_for_assignment (tree_expression *e)
 

Public Attributes

bool autoloading
 
tree_classdefclassdef_object
 
std::string curr_class_name
 
int curr_fcn_depth
 
std::string curr_package_name
 
bool endfunction_found
 
bool fcn_file_from_relative_lookup
 
std::vector
< symbol_table::scope_id
function_scopes
 
octave_base_lexerlexer
 
int max_fcn_depth
 
bool parsing_subfunctions
 
octave_functionprimary_fcn_ptr
 
symbol_table::scope_id primary_fcn_scope
 
tree_statement_liststmt_list
 
std::list< std::string > subfunction_names
 

Private Member Functions

 octave_base_parser (const octave_base_parser &)
 
octave_base_parseroperator= (const octave_base_parser &)
 

Detailed Description

Definition at line 143 of file parse.h.

Constructor & Destructor Documentation

octave_base_parser::octave_base_parser ( octave_base_lexer lxr)
inline

Definition at line 148 of file parse.h.

octave_base_parser::~octave_base_parser ( void  )

Definition at line 5987 of file oct-parse.cc.

References lexer, and stmt_list.

octave_base_parser::octave_base_parser ( const octave_base_parser )
private

Member Function Documentation

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 7896 of file oct-parse.cc.

References octave_base_list< elt_type >::append(), and set_stmt_print_flag().

Referenced by octave_push_parse().

void octave_base_parser::bison_error ( const char s)
void octave_base_parser::end_error ( const char type,
token::end_tok_type  ettype,
int  l,
int  c 
)
bool octave_base_parser::end_token_ok ( token tok,
token::end_tok_type  expected 
)
tree_expression * octave_base_parser::finish_array_list ( tree_array_list a)
tree_expression * octave_base_parser::finish_cell ( tree_cell c)

Definition at line 7820 of file oct-parse.cc.

References finish_array_list().

Referenced by octave_push_parse().

tree_function_def * octave_base_parser::finish_classdef_external_method ( octave_user_function fcn,
tree_parameter_list ret_list,
octave_comment_list cl 
)
tree_expression * octave_base_parser::finish_colon_expression ( tree_colon_expression e)
tree_function_def * octave_base_parser::finish_function ( tree_parameter_list ret_list,
octave_user_function fcn,
octave_comment_list lc,
int  l,
int  c 
)
tree_if_command * octave_base_parser::finish_if_command ( token if_tok,
tree_if_command_list list,
token end_tok,
octave_comment_list lc 
)
tree_expression * octave_base_parser::finish_matrix ( tree_matrix m)

Definition at line 7810 of file oct-parse.cc.

References finish_array_list(), and octave_null_matrix::instance.

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,
octave_comment_list lc 
)
octave_user_function * octave_base_parser::frob_function ( const std::string &  fname,
octave_user_function fcn 
)
tree_anon_fcn_handle * octave_base_parser::make_anon_fcn_handle ( tree_parameter_list param_list,
tree_statement stmt 
)
tree_expression * octave_base_parser::make_assign_op ( int  op,
tree_argument_list lhs,
token eq_tok,
tree_expression rhs 
)
tree_expression * octave_base_parser::make_binary_op ( int  op,
tree_expression op1,
token tok_val,
tree_expression op2 
)
tree_expression * octave_base_parser::make_boolean_op ( int  op,
tree_expression op1,
token tok_val,
tree_expression op2 
)
tree_command * octave_base_parser::make_break_command ( token break_tok)

Definition at line 6782 of file oct-parse.cc.

References token::column(), and token::line().

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,
octave_comment_list lc 
)
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,
octave_comment_list lc 
)
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,
octave_comment_list lc 
)
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,
octave_comment_list lc 
)
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,
octave_comment_list lc 
)
tree_constant * octave_base_parser::make_constant ( int  op,
token tok_val 
)
tree_command * octave_base_parser::make_continue_command ( token continue_tok)

Definition at line 6793 of file oct-parse.cc.

References token::column(), and token::line().

Referenced by octave_push_parse().

tree_decl_command * octave_base_parser::make_decl_command ( int  tok,
token tok_val,
tree_decl_init_list lst 
)
tree_command * octave_base_parser::make_do_until_command ( token until_tok,
tree_statement_list body,
tree_expression expr,
octave_comment_list lc 
)
tree_if_clause * octave_base_parser::make_elseif_clause ( token elseif_tok,
tree_expression expr,
tree_statement_list list,
octave_comment_list lc 
)

Definition at line 6864 of file oct-parse.cc.

References token::column(), 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,
int  l,
int  c 
)

Definition at line 7085 of file oct-parse.cc.

References make_statement().

Referenced by octave_push_parse().

tree_fcn_handle * octave_base_parser::make_fcn_handle ( token tok_val)

Definition at line 6337 of file oct-parse.cc.

References token::column(), token::line(), and token::text().

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,
octave_comment_list lc 
)
tree_index_expression * octave_base_parser::make_index_expression ( tree_expression expr,
tree_argument_list args,
char  type 
)
tree_index_expression * octave_base_parser::make_indirect_ref ( tree_expression expr,
const std::string &  elt 
)
tree_index_expression * octave_base_parser::make_indirect_ref ( tree_expression expr,
tree_expression field 
)
tree_funcall * octave_base_parser::make_meta_class_query ( const std::string &  class_nm)

Definition at line 7295 of file oct-parse.cc.

References symbol_table::find_built_in_function().

Referenced by octave_push_parse().

tree_expression * octave_base_parser::make_postfix_op ( int  op,
tree_expression op1,
token tok_val 
)
tree_expression * octave_base_parser::make_prefix_op ( int  op,
tree_expression op1,
token tok_val 
)
tree_command * octave_base_parser::make_return_command ( token return_tok)

Definition at line 6804 of file oct-parse.cc.

References token::column(), and token::line().

Referenced by octave_push_parse().

void octave_base_parser::make_script ( tree_statement_list cmds,
tree_statement end_script 
)
template<class T >
tree_statement * octave_base_parser::make_statement ( T *  arg)

Definition at line 7882 of file oct-parse.cc.

References octave_base_lexer::get_comment(), and lexer.

Referenced by make_end(), and octave_push_parse().

tree_statement_list * octave_base_parser::make_statement_list ( tree_statement stmt)

Definition at line 7890 of file oct-parse.cc.

Referenced by octave_push_parse().

tree_funcall * octave_base_parser::make_superclass_ref ( const std::string &  method_nm,
const std::string &  class_nm 
)

Definition at line 7280 of file oct-parse.cc.

References symbol_table::find_built_in_function().

Referenced by octave_push_parse().

tree_switch_case * octave_base_parser::make_switch_case ( token case_tok,
tree_expression expr,
tree_statement_list list,
octave_comment_list lc 
)

Definition at line 6920 of file oct-parse.cc.

References token::column(), 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,
octave_comment_list lc,
octave_comment_list mc 
)
tree_command * octave_base_parser::make_unwind_command ( token unwind_tok,
tree_statement_list body,
tree_statement_list cleanup,
token end_tok,
octave_comment_list lc,
octave_comment_list mc 
)
tree_command * octave_base_parser::make_while_command ( token while_tok,
tree_expression expr,
tree_statement_list body,
token end_tok,
octave_comment_list lc 
)
void octave_base_parser::maybe_warn_assign_as_truth_value ( tree_expression expr)
void octave_base_parser::maybe_warn_missing_semi ( tree_statement_list t)
void octave_base_parser::maybe_warn_variable_switch_label ( tree_expression expr)
octave_base_parser& octave_base_parser::operator= ( const octave_base_parser )
private
void octave_base_parser::recover_from_parsing_function ( void  )
void octave_base_parser::reset ( void  )
tree_statement_list * octave_base_parser::set_stmt_print_flag ( tree_statement_list list,
char  sep,
bool  warn_missing_semi 
)
octave_user_function * octave_base_parser::start_classdef_external_method ( tree_identifier id,
tree_parameter_list pl 
)
octave_user_function * octave_base_parser::start_function ( tree_parameter_list param_list,
tree_statement_list body,
tree_statement end_function 
)
tree_if_command_list * octave_base_parser::start_if_command ( tree_expression expr,
tree_statement_list list 
)

Definition at line 6815 of file oct-parse.cc.

References maybe_warn_assign_as_truth_value().

Referenced by octave_push_parse().

bool octave_base_parser::validate_array_list ( tree_expression e)
tree_argument_list * octave_base_parser::validate_matrix_for_assignment ( tree_expression e)

Member Data Documentation

bool octave_base_parser::autoloading

Definition at line 406 of file parse.h.

Referenced by frob_function(), parse_fcn_file(), and reset().

tree_classdef* octave_base_parser::classdef_object

Definition at line 453 of file parse.h.

Referenced by octave_push_parse(), and parse_fcn_file().

std::string octave_base_parser::curr_class_name

Definition at line 433 of file parse.h.

Referenced by frob_function(), parse_fcn_file(), reset(), and start_classdef_external_method().

int octave_base_parser::curr_fcn_depth
std::string octave_base_parser::curr_package_name

Definition at line 437 of file parse.h.

Referenced by make_classdef(), parse_fcn_file(), and reset().

bool octave_base_parser::endfunction_found

Definition at line 403 of file parse.h.

Referenced by finish_function(), octave_push_parse(), parse_fcn_file(), and reset().

bool octave_base_parser::fcn_file_from_relative_lookup

Definition at line 410 of file parse.h.

Referenced by frob_function(), parse_fcn_file(), and reset().

std::vector<symbol_table::scope_id> octave_base_parser::function_scopes
octave_base_lexer& octave_base_parser::lexer
int octave_base_parser::max_fcn_depth

Definition at line 418 of file parse.h.

Referenced by octave_push_parse(), and reset().

bool octave_base_parser::parsing_subfunctions
octave_function* octave_base_parser::primary_fcn_ptr

Definition at line 445 of file parse.h.

Referenced by frob_function(), make_script(), parse_fcn_file(), and reset().

symbol_table::scope_id octave_base_parser::primary_fcn_scope

Definition at line 429 of file parse.h.

Referenced by finish_function(), frob_function(), octave_push_parse(), and reset().

tree_statement_list* octave_base_parser::stmt_list
std::list<std::string> octave_base_parser::subfunction_names

Definition at line 450 of file parse.h.

Referenced by finish_function(), parse_fcn_file(), and reset().


The documentation for this class was generated from the following files: