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. --- parse.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'parse.h') diff --git a/parse.h b/parse.h index 26cac17d..701034ec 100644 --- a/parse.h +++ b/parse.h @@ -27,7 +27,8 @@ struct source_loc enum token_type { - tok_junk, tok_identifier, tok_operator, tok_string, tok_number + tok_junk, tok_identifier, tok_operator, tok_string, tok_number, + tok_embedded // XXX: add tok_keyword throughout }; @@ -95,10 +96,11 @@ private: unsigned num_errors; private: // nonterminals - void parse_probe (probe *&, probe_alias *&); + void parse_probe (std::vector&, std::vector&); + void parse_global (std::vector&); + embeddedcode* parse_embeddedcode (); probe_point* parse_probe_point (); literal* parse_literal (); - void parse_global (std::vector&); functiondecl* parse_functiondecl (); block* parse_stmt_block (); statement* parse_statement (); -- cgit