From 24cb178fd82936f55d254ebd0cd79802da21134a Mon Sep 17 00:00:00 2001 From: fche Date: Thu, 28 Jul 2005 18:07:02 +0000 Subject: 2005-07-28 Frank Ch. Eigler translator/1120 * main.cxx (main): Preset -R and -I options from environment variables (if set). Pass guru mode flags to parser. * parse.cxx (privileged): New parser operation flag. Update callers. (parse_embeddedcode): Throw an error if !privileged. (parse_functiondecl): Change signature. Prevent duplicates. (parse_globals): Ditto. * parse.h: Corresponding changes. * tapset/*.stp: Beginnings of real tapset library, to replace previous builtins. * tapsets.cxx: Greatly reduce verbose mode output. * Makefile.am: Install & dist it. * runtest.sh: Refer to it. * Makefile.in, aclocal.m4: Regenerated. * testsuite/*/*.stp: Set guru mode via /bin/sh if needed. * testusite/*/*ko.stp: Homogenize shell scripts. --- parse.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'parse.h') diff --git a/parse.h b/parse.h index 701034ec..7e5b90a4 100644 --- a/parse.h +++ b/parse.h @@ -70,19 +70,20 @@ private: class parser { public: - parser (std::istream& i); - parser (const std::string& n); + parser (std::istream& i, bool p); + parser (const std::string& n, bool p); ~parser (); stapfile* parse (); - static stapfile* parse (std::istream& i); - static stapfile* parse (const std::string& n); + static stapfile* parse (std::istream& i, bool privileged); + static stapfile* parse (const std::string& n, bool privileged); private: std::string input_name; std::istream* free_input; lexer input; + bool privileged; // scanning state const token* last (); @@ -98,10 +99,10 @@ private: private: // nonterminals void parse_probe (std::vector&, std::vector&); void parse_global (std::vector&); + void parse_functiondecl (std::vector&); embeddedcode* parse_embeddedcode (); probe_point* parse_probe_point (); literal* parse_literal (); - functiondecl* parse_functiondecl (); block* parse_stmt_block (); statement* parse_statement (); if_statement* parse_if_statement (); -- cgit