diff options
author | Josh Stone <jistone@redhat.com> | 2009-08-03 15:16:09 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-08-03 15:16:09 -0700 |
commit | 0164a29cfb80344dced2e1683df05f6b62fe6cb3 (patch) | |
tree | f1135402bc2f45e03718733eb8490cd1f9df52f6 /staptree.h | |
parent | 28ad563d57d03e0d21936e394061e3380607d83b (diff) | |
parent | 6fda2dff51c667a8c73545dd397b844108715310 (diff) | |
download | systemtap-steved-0164a29cfb80344dced2e1683df05f6b62fe6cb3.tar.gz systemtap-steved-0164a29cfb80344dced2e1683df05f6b62fe6cb3.tar.xz systemtap-steved-0164a29cfb80344dced2e1683df05f6b62fe6cb3.zip |
Merge branch 'array_index'
Diffstat (limited to 'staptree.h')
-rw-r--r-- | staptree.h | 29 |
1 files changed, 27 insertions, 2 deletions
@@ -58,6 +58,7 @@ std::ostream& operator << (std::ostream& o, const exp_type& e); struct token; struct visitor; +struct update_visitor; struct expression { @@ -227,18 +228,42 @@ struct target_symbol: public symbol enum component_type { comp_struct_member, - comp_literal_array_index + comp_literal_array_index, + comp_expression_array_index, }; + + struct component + { + const token* tok; + component_type type; + std::string member; // comp_struct_member + int64_t num_index; // comp_literal_array_index + expression* expr_index; // comp_expression_array_index + + component(const token* t, const std::string& m): + tok(t), type(comp_struct_member), member(m) {} + component(const token* t, int64_t n): + tok(t), type(comp_literal_array_index), num_index(n) {} + component(const token* t, expression* e): + tok(t), type(comp_expression_array_index), expr_index(e) {} + void print (std::ostream& o) const; + }; + bool addressof; std::string base_name; - std::vector<std::pair<component_type, std::string> > components; + std::vector<component> components; std::string probe_context_var; semantic_error* saved_conversion_error; target_symbol(): addressof(false), saved_conversion_error (0) {} void print (std::ostream& o) const; void visit (visitor* u); + void visit_components (visitor* u); + void visit_components (update_visitor* u); + void assert_no_components(const std::string& tapset); }; +std::ostream& operator << (std::ostream& o, const target_symbol::component& c); + struct cast_op: public target_symbol { |