summaryrefslogtreecommitdiffstats
path: root/parse.cxx
diff options
context:
space:
mode:
authorfche <fche>2007-11-20 03:59:19 +0000
committerfche <fche>2007-11-20 03:59:19 +0000
commitd898100ab001dd4b3465f738dad76d1d646c3261 (patch)
treeeb20e3219db643c07802dbec890b704e44b87458 /parse.cxx
parent3b0c565c2b75d777c3993f0284185b5aa4c3528d (diff)
downloadsystemtap-steved-d898100ab001dd4b3465f738dad76d1d646c3261.tar.gz
systemtap-steved-d898100ab001dd4b3465f738dad76d1d646c3261.tar.xz
systemtap-steved-d898100ab001dd4b3465f738dad76d1d646c3261.zip
PR 3887: sufficient+optional probe points
2007-11-19 Frank Ch. Eigler <fche@elastic.org> PR 3887. * staptree.h (probe_point): Add "sufficient" field. * staptree.cxx: Initialize it, print it. * parse.cxx (parse_probe_point): Parse it. * elaborate.cxx (derive_probes): Implement it. * stapprobes.5.in: Document it. * NEWS: Gloat about it. * parseok/five.stp, semok/twentyseven.stp: Test "!" probe point flag. * iostat-scsi.stp: Adopt "!" probe point flag.
Diffstat (limited to 'parse.cxx')
-rw-r--r--parse.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/parse.cxx b/parse.cxx
index 173639b3..228f9a2c 100644
--- a/parse.cxx
+++ b/parse.cxx
@@ -996,7 +996,6 @@ parser::parse_probe (std::vector<probe *> & probe_ret,
next ();
continue;
}
-
else if (t && t->type == tok_operator && t->content == ",")
{
locations.push_back(pp);
@@ -1348,9 +1347,12 @@ parser::parse_probe_point ()
// We only fall through here at the end of a probe point (past
// all the dotted/parametrized components).
- if (t && t->type == tok_operator && t->content == "?")
+ if (t && t->type == tok_operator &&
+ (t->content == "?" || t->content == "!"))
{
pl->optional = true;
+ if (t->content == "!") pl->sufficient = true;
+ // NB: sufficient implies optional
next ();
t = peek ();
// fall through
@@ -1361,7 +1363,7 @@ parser::parse_probe_point ()
t->content == "=" || t->content == "+=" ))
break;
- throw parse_error ("expected '.' or ',' or '(' or '?' or '{' or '=' or '+='");
+ throw parse_error ("expected one of '. , ( ? ! { = +='");
}
return pl;