From bb2e3076ea20631d4606050550bc9664204f2c62 Mon Sep 17 00:00:00 2001 From: fche Date: Wed, 8 Jun 2005 22:02:09 +0000 Subject: 2005-06-08 Frank Ch. Eigler systemtap/916 Implement all basic scalar operators, including modify-assignment. * parse.cxx (lexer): Allow multi-character lookahead in order to scan 1/2/3-character operators. (parse_boolean_or/and/xor/shift): New routines. * translate.cxx (visit_assignment, visit_binary_expression, visit_*_crement): Generally rewrote. (visit_*): Added more parentheses in output. (emit_module_init): Initialize globals. * staptree.h, elaborate.cxx, elaborate.h: Remove exponentiation. * main.cxx (main): Add an end-of-line to output file. * testsuite/*: Several new tests. --- parse.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'parse.h') diff --git a/parse.h b/parse.h index 29ae41c8..b7054b0d 100644 --- a/parse.h +++ b/parse.h @@ -57,8 +57,10 @@ public: private: int input_get (); + int input_peek (unsigned n=0); std::istream& input; std::string input_name; + std::vector lookahead; unsigned cursor_line; unsigned cursor_column; }; @@ -115,13 +117,16 @@ private: // nonterminals expression* parse_ternary (); expression* parse_logical_or (); expression* parse_logical_and (); + expression* parse_boolean_or (); + expression* parse_boolean_xor (); + expression* parse_boolean_and (); expression* parse_array_in (); expression* parse_comparison (); + expression* parse_shift (); expression* parse_concatenation (); expression* parse_additive (); expression* parse_multiplicative (); expression* parse_unary (); - expression* parse_exponentiation (); expression* parse_crement (); expression* parse_value (); expression* parse_symbol (); -- cgit