diff options
author | fche <fche> | 2005-06-03 21:01:35 +0000 |
---|---|---|
committer | fche <fche> | 2005-06-03 21:01:35 +0000 |
commit | 553d27a587615e4b242a89bf1a7af93b71f050f0 (patch) | |
tree | 1ca4e5d35908208e5d533bb32e22b6aa567221b8 /parse.cxx | |
parent | 63a7c90e365874972925e886ed50941f5620bdfe (diff) | |
download | systemtap-steved-553d27a587615e4b242a89bf1a7af93b71f050f0.tar.gz systemtap-steved-553d27a587615e4b242a89bf1a7af93b71f050f0.tar.xz systemtap-steved-553d27a587615e4b242a89bf1a7af93b71f050f0.zip |
2005-06-03 Frank Ch. Eigler <fche@redhat.com>
* TODO: Removed entries already represented in bugzilla.
* elaborate.cxx: Rewrite type inference for several operators.
* main.cxx (main): For -p2 runs, print types of function/probe locals.
* parse.cxx (scan): Identify more two-character operators.
(parse_comparison): Support the whole suite.
* translate.cxx (visit_unary_expression, logical_or_expr,
logical_and_expr, comparison,ternary_expression): New support.
* testsuite/parseok/semok.stp: Clever new test.
* testsuite/transok/four.stp: New test.
* testsuite/*: Some tweaked tests for syntax changes.
Diffstat (limited to 'parse.cxx')
-rw-r--r-- | parse.cxx | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -286,14 +286,17 @@ lexer::scan () // handle two-character operators if ((c == '=' && c2 == '=') || + (c == '!' && c2 == '=') || + (c == '<' && c2 == '=') || + (c == '>' && c2 == '=') || (c == '+' && c2 == '+') || (c == '-' && c2 == '-') || (c == '|' && c2 == '|') || (c == '&' && c2 == '&') || - (c == '<' && c2 == '<') || + // (c == '<' && c2 == '<') || + // (c == '>' && c2 == '>') || (c == '+' && c2 == '=') || (c == '-' && c2 == '=') || - (c == ':' && c2 == ':') || (c == '-' && c2 == '>') || false) // XXX: etc. n->content.push_back ((char) input_get ()); @@ -301,9 +304,15 @@ lexer::scan () // handle three-character operator if (c == '<' && c2 == '<') { + input_get (); // swallow c2 int c3 = input.peek (); if (c3 == '<') - n->content.push_back ((char) input_get ()); + { + input_get (); // swallow c3 + n->content = "<<<"; + } + else + n->content = "<<"; } return n; @@ -843,7 +852,7 @@ parser::parse_assignment () next (); e->right = parse_expression (); op1 = e; - // XXX: map assign/accumlate operators like +=, /= + // XXX: map assign/accumulate operators like +=, /= // to ordinary assignment + nested binary_expression } @@ -994,7 +1003,13 @@ parser::parse_comparison () const token* t = peek (); while (t && t->type == tok_operator - && (t->content == ">" || t->content == "==")) // xxx: more + && (t->content == ">" || + t->content == "<" || + t->content == "==" || + t->content == "!=" || + t->content == "<=" || + t->content == ">=" || + false )) // xxx: more { comparison* e = new comparison; e->left = op1; |