From 972662787b66d69b199c5e52488c55491e9880f3 Mon Sep 17 00:00:00 2001 From: guanglei Date: Mon, 8 May 2006 04:23:14 +0000 Subject: epilogue mode probe aliases support --- parse.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'parse.cxx') diff --git a/parse.cxx b/parse.cxx index 30c59b45..96d9a5d4 100644 --- a/parse.cxx +++ b/parse.cxx @@ -782,6 +782,8 @@ parser::parse_probe (std::vector & probe_ret, bool equals_ok = true; + int epilogue_alias = 0; + while (1) { probe_point * pp = parse_probe_point (); @@ -794,6 +796,15 @@ parser::parse_probe (std::vector & probe_ret, next (); continue; } + else if (equals_ok && t + && t->type == tok_operator && t->content == "+=") + { + aliases.push_back(pp); + epilogue_alias = 1; + next (); + continue; + } + else if (t && t->type == tok_operator && t->content == ",") { locations.push_back(pp); @@ -821,6 +832,10 @@ parser::parse_probe (std::vector & probe_ret, else { probe_alias* p = new probe_alias (aliases); + if(epilogue_alias) + p->epilogue_style = true; + else + p->epilogue_style = false; p->tok = t0; p->locations = locations; p->body = parse_stmt_block (); @@ -1068,7 +1083,8 @@ parser::parse_probe_point () t = peek (); if (t && t->type == tok_operator - && (t->content == "{" || t->content == "," || t->content == "=")) + && (t->content == "{" || t->content == "," || t->content == "=" + || t->content == "+=" )) break; if (t && t->type == tok_operator && t->content == "(") @@ -1093,7 +1109,7 @@ parser::parse_probe_point () if (t && t->type == tok_operator && t->content == ".") next (); else - throw parse_error ("expected '.' or ',' or '(' or '{' or '='"); + throw parse_error ("expected '.' or ',' or '(' or '{' or '=' or '+='"); } return pl; -- cgit