From 54dfabe9e604ec06cdb5550f58420c60d0cbdbd9 Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 26 Jul 2005 22:40:14 +0000 Subject: 2005-07-26 Frank Ch. Eigler Support %{ embedded-c %} * staptree.h (embeddedcode): New statement subtype. Stub support in visitors. * staptree.cxx: Ditto. * parse.cxx: Parse %{ / %}. Accept "_" as identifier leading char. (parse_probe): Simplify calling convention. * elaborate.h: Store embedded code. * elaborate.cxx: Pass it. * translate.cxx: Transcribe it. Return some dropped module init/exit code. * Makefile.am: Add buildok/buildko tests. * Makefile.in: Regenerated. * main.cxx: Return EXIT_SUCCESS/FAILURE even for weird rc. * testsuite/parseok/nine.stp: Test _identifiers. * testsuite/transko/*.stp: Tweak to force -p3 rather than -p2 errors. * testsuite/semok/transko.stp: ... and keep it that way in the future. * testsuite/parse*/*: Some new tests for %{ %}. * testsuite/build*/*: New tests for -p4. --- elaborate.h | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'elaborate.h') diff --git a/elaborate.h b/elaborate.h index a4c9f2cf..599bc230 100644 --- a/elaborate.h +++ b/elaborate.h @@ -65,9 +65,10 @@ struct typeresolution_info: public visitor exp_type t; // implicit parameter for nested visit call; may clobber - void visit_block (block *s); - void visit_null_statement (null_statement *s); - void visit_expr_statement (expr_statement *s); + void visit_block (block* s); + void visit_embeddedcode (embeddedcode* s); + void visit_null_statement (null_statement* s); + void visit_expr_statement (expr_statement* s); void visit_if_statement (if_statement* s); void visit_for_loop (for_loop* s); void visit_foreach_loop (foreach_loop* s); @@ -140,11 +141,11 @@ struct derived_probe_builder { virtual void build(systemtap_session & sess, - probe * base, - probe_point * location, - std::map const & parameters, - std::vector & results_to_expand_further, - std::vector & finished_results) = 0; + probe* base, + probe_point* location, + std::map const & parameters, + std::vector & results_to_expand_further, + std::vector & finished_results) = 0; virtual ~derived_probe_builder() {} }; @@ -169,20 +170,20 @@ match_key class match_node { - std::map sub; - derived_probe_builder * end; + std::map sub; + derived_probe_builder* end; public: match_node(); - derived_probe_builder * find_builder(std::vector const & components, + derived_probe_builder* find_builder(std::vector const & components, unsigned pos, - std::vector< std::pair > & parameters); + std::vector< std::pair > & parameters); - match_node * bind(match_key const & k); - match_node * bind(std::string const & k); - match_node * bind_str(std::string const & k); - match_node * bind_num(std::string const & k); - void bind(derived_probe_builder * e); + match_node* bind(match_key const & k); + match_node* bind(std::string const & k); + match_node* bind_str(std::string const & k); + match_node* bind_num(std::string const & k); + void bind(derived_probe_builder* e); }; // ------------------------------------------------------------------------ @@ -211,7 +212,7 @@ struct systemtap_session std::string tmpdir; std::string translated_source; // C source code - match_node * pattern_root; + match_node* pattern_root; void register_library_aliases(); // parse trees for the various script files @@ -223,6 +224,7 @@ struct systemtap_session std::vector globals; std::vector functions; std::vector probes; + std::vector embeds; // unparser data translator_output* op; -- cgit