Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_tree_index_h)
00024 #define octave_tree_index_h 1
00025
00026 #include <list>
00027
00028 class tree_argument_list;
00029
00030 class tree_walker;
00031
00032 class octave_map;
00033 class octave_value;
00034 class octave_value_list;
00035 class octave_lvalue;
00036
00037 #include "str-vec.h"
00038
00039 #include "pt-exp.h"
00040 #include "symtab.h"
00041
00042
00043
00044 class
00045 tree_index_expression : public tree_expression
00046 {
00047 public:
00048
00049 tree_index_expression (tree_expression *e = 0, tree_argument_list *lst = 0,
00050 int l = -1, int c = -1, char t = '(');
00051
00052 tree_index_expression (tree_expression *e, const std::string& n,
00053 int l = -1, int c = -1);
00054
00055 tree_index_expression (tree_expression *e, tree_expression* df,
00056 int l = -1, int c = -1);
00057
00058 ~tree_index_expression (void);
00059
00060 bool has_magic_end (void) const;
00061
00062 void append (tree_argument_list *lst = 0, char t = '(');
00063
00064 void append (const std::string& n);
00065
00066 void append (tree_expression *df);
00067
00068 bool is_index_expression (void) const { return true; }
00069
00070 std::string name (void) const;
00071
00072 tree_expression *expression (void) { return expr; }
00073
00074 std::list<tree_argument_list *> arg_lists (void) { return args; }
00075
00076 std::string type_tags (void) { return type; }
00077
00078 std::list<string_vector> arg_names (void) { return arg_nm; }
00079
00080 bool lvalue_ok (void) const { return expr->lvalue_ok (); }
00081
00082 bool rvalue_ok (void) const { return true; }
00083
00084 octave_value rvalue1 (int nargout = 1);
00085
00086 octave_value_list rvalue (int nargout);
00087
00088 octave_value_list rvalue (int nargout, const std::list<octave_lvalue> *lvalue_list);
00089
00090 octave_lvalue lvalue (void);
00091
00092 tree_index_expression *dup (symbol_table::scope_id scope,
00093 symbol_table::context_id context) const;
00094
00095 void accept (tree_walker& tw);
00096
00097 private:
00098
00099
00100 tree_expression *expr;
00101
00102
00103 std::list<tree_argument_list *> args;
00104
00105
00106 std::string type;
00107
00108
00109
00110 std::list<string_vector> arg_nm;
00111
00112
00113 std::list<tree_expression *> dyn_field;
00114
00115 tree_index_expression (int l, int c);
00116
00117 octave_map make_arg_struct (void) const;
00118
00119 std::string
00120 get_struct_index
00121 (std::list<string_vector>::const_iterator p_arg_nm,
00122 std::list<tree_expression *>::const_iterator p_dyn_field) const;
00123
00124
00125
00126 tree_index_expression (const tree_index_expression&);
00127
00128 tree_index_expression& operator = (const tree_index_expression&);
00129 };
00130
00131 #endif