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