summaryrefslogtreecommitdiffstats
path: root/elaborate.h
diff options
context:
space:
mode:
authorfche <fche>2005-07-26 22:40:14 +0000
committerfche <fche>2005-07-26 22:40:14 +0000
commit54dfabe9e604ec06cdb5550f58420c60d0cbdbd9 (patch)
tree2dc021fd5534f57a51235a9598cec6cec9ed2342 /elaborate.h
parentf05bc729c752cee5eb11fde9193eea12a21b0d12 (diff)
downloadsystemtap-steved-54dfabe9e604ec06cdb5550f58420c60d0cbdbd9.tar.gz
systemtap-steved-54dfabe9e604ec06cdb5550f58420c60d0cbdbd9.tar.xz
systemtap-steved-54dfabe9e604ec06cdb5550f58420c60d0cbdbd9.zip
2005-07-26 Frank Ch. Eigler <fche@redhat.com>
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.
Diffstat (limited to 'elaborate.h')
-rw-r--r--elaborate.h38
1 files changed, 20 insertions, 18 deletions
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<std::string, literal *> const & parameters,
- std::vector<probe *> & results_to_expand_further,
- std::vector<derived_probe *> & finished_results) = 0;
+ probe* base,
+ probe_point* location,
+ std::map<std::string, literal*> const & parameters,
+ std::vector<probe*> & results_to_expand_further,
+ std::vector<derived_probe*> & finished_results) = 0;
virtual ~derived_probe_builder() {}
};
@@ -169,20 +170,20 @@ match_key
class
match_node
{
- std::map<match_key, match_node *> sub;
- derived_probe_builder * end;
+ std::map<match_key, match_node*> sub;
+ derived_probe_builder* end;
public:
match_node();
- derived_probe_builder * find_builder(std::vector<probe_point::component *> const & components,
+ derived_probe_builder* find_builder(std::vector<probe_point::component*> const & components,
unsigned pos,
- std::vector< std::pair<std::string, literal *> > & parameters);
+ std::vector< std::pair<std::string, literal*> > & 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<vardecl*> globals;
std::vector<functiondecl*> functions;
std::vector<derived_probe*> probes;
+ std::vector<embeddedcode*> embeds;
// unparser data
translator_output* op;