summaryrefslogtreecommitdiffstats
path: root/staptree.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 /staptree.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 'staptree.h')
-rw-r--r--staptree.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/staptree.h b/staptree.h
index 62bd8dfe..cfc09eb3 100644
--- a/staptree.h
+++ b/staptree.h
@@ -236,12 +236,12 @@ struct vardecl_builtin: public vardecl
};
-struct block;
+struct statement;
struct functiondecl: public symboldecl
{
std::vector<vardecl*> formal_args;
std::vector<vardecl*> locals;
- block* body;
+ statement* body;
functiondecl ();
void print (std::ostream& o);
void printsig (std::ostream& o);
@@ -263,6 +263,14 @@ struct statement
std::ostream& operator << (std::ostream& o, statement& k);
+struct embeddedcode: public statement
+{
+ std::string code;
+ void print (std::ostream& o);
+ void visit (visitor* u);
+};
+
+
struct block: public statement
{
std::vector<statement*> statements;
@@ -358,6 +366,7 @@ struct next_statement: public statement
struct probe;
struct probe_alias;
+struct embeddedcode;
struct stapfile
{
std::string name;
@@ -365,10 +374,13 @@ struct stapfile
std::vector<probe_alias*> aliases;
std::vector<functiondecl*> functions;
std::vector<vardecl*> globals;
+ std::vector<embeddedcode*> embeds;
void print (std::ostream& o);
};
+
+
struct probe_point
{
struct component // XXX: sort of a restricted functioncall
@@ -398,13 +410,11 @@ struct probe
virtual ~probe() {}
};
-struct probe_alias
- : public probe
+struct probe_alias: public probe
{
probe_alias(std::vector<probe_point*> const & aliases);
std::vector<probe_point*> alias_names;
virtual void printsig (std::ostream &o);
- virtual ~probe_alias() {}
};
@@ -414,6 +424,7 @@ struct visitor
{
virtual ~visitor () {}
virtual void visit_block (block *s) = 0;
+ virtual void visit_embeddedcode (embeddedcode *s) = 0;
virtual void visit_null_statement (null_statement *s) = 0;
virtual void visit_expr_statement (expr_statement *s) = 0;
virtual void visit_if_statement (if_statement* s) = 0;
@@ -449,6 +460,7 @@ struct visitor
struct traversing_visitor: public visitor
{
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);
@@ -489,6 +501,7 @@ struct throwing_visitor: public visitor
virtual void throwone (const token* t);
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);
@@ -531,6 +544,7 @@ struct deep_copy_visitor: public visitor
static block *deep_copy (block *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);