diff options
author | fche <fche> | 2005-05-05 20:31:53 +0000 |
---|---|---|
committer | fche <fche> | 2005-05-05 20:31:53 +0000 |
commit | 829198553c89ca7f2da93559c61c04ee89079ea1 (patch) | |
tree | 2f23d20d3d6d1c4078cbb50fc8f35d323e922cde /semtest.cxx | |
parent | e3f6c9cdd804120df4ec0b0fa33c033371958f17 (diff) | |
download | systemtap-steved-829198553c89ca7f2da93559c61c04ee89079ea1.tar.gz systemtap-steved-829198553c89ca7f2da93559c61c04ee89079ea1.tar.xz systemtap-steved-829198553c89ca7f2da93559c61c04ee89079ea1.zip |
* preliminaries for code generation logic
2005-05-05 Frank Ch. Eigler <fche@redhat.com>
* parse.cxx (parse): Add helper methods.
(lexer::scan, parse_assignment): Parse "<<<" operator. Fix assignment
associativity.
(parse_symbol): Permit function with empty arg list.
(parse_global, parse_statement, parse_functiondecl): Expect
unconsumed leading keyword.
(parse_global): Don't use ";" termination.
* parse.h: Corresponding changes.
* staptree.cxx (binary_expression::resolve_types): Fix <<<
type inference.
(translator_output): Improve pretty-printing.
(*): Add general visitors to statement/expression types.
* staptree.h: Corresponding changes. Tweak symresolution_info fields.
Add semantic_error class.
* semtest.cxx: Adapt to this.
* testsuite/parseok/two.stp, semok/*.stp: Adapt to syntax changes.
Diffstat (limited to 'semtest.cxx')
-rw-r--r-- | semtest.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/semtest.cxx b/semtest.cxx index a37e3323..09cd7576 100644 --- a/semtest.cxx +++ b/semtest.cxx @@ -21,7 +21,7 @@ semantic_pass_1 (vector<stapfile*>& files) for (unsigned j=0; j<f->functions.size(); j++) { functiondecl* fn = f->functions[j]; - symresolution_info ri (fn->locals, f->globals, files, f, fn); + symresolution_info ri (fn->locals, f->globals, f->functions, fn); fn->body->resolve_symbols (ri); if (ri.num_unresolved) @@ -32,7 +32,7 @@ semantic_pass_1 (vector<stapfile*>& files) for (unsigned j=0; j<f->probes.size(); j++) { probe* pn = f->probes[j]; - symresolution_info ri (pn->locals, f->globals, files, f); + symresolution_info ri (pn->locals, f->globals, f->functions); pn->body->resolve_symbols (ri); if (ri.num_unresolved) @@ -113,8 +113,7 @@ main (int argc, char *argv []) vector<stapfile*> files; if (argc == 1) { - parser p (cin); - stapfile* f = p.parse (); + stapfile* f = parser::parse (cin); if (f) files.push_back (f); else @@ -122,8 +121,7 @@ main (int argc, char *argv []) } else for (int i = 1; i < argc; i ++) { - parser p (argv[i]); - stapfile* f = p.parse (); + stapfile* f = parser::parse (argv[i]); if (f) files.push_back (f); else @@ -131,7 +129,8 @@ main (int argc, char *argv []) } rc += semantic_pass_1 (files); - rc += semantic_pass_2 (files); + if (rc == 0) + rc += semantic_pass_2 (files); for (unsigned i=0; i<files.size(); i++) { |