This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Language Reference, updated
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- Cc: "Mike Mason" <mmlnx at us dot ibm dot com>, "Robb Romans" <robb at linux dot vnet dot ibm dot com>, "SystemTap" <systemtap at sources dot redhat dot com>
- Date: 12 Dec 2006 15:45:06 -0500
- Subject: Re: Language Reference, updated
- References: <C56DB814FAA30B418C75310AC4BB279D010DC8B6@scsmsx413.amr.corp.intel.com>
josh wrote:
> The semicolon is necessary because it's optional. :-/ [...]
>
> Said with less tongue-in-cheek: There are certain grammatical
> ambiguities that are due to the fact that the language has no statement
> separator.
Yes. (Or, alternately, because it has both prefix and postfix operators.)
> [...] The spacing indicates what I want to happen, but the actual
> parsing will produce this:
> probe foo {
> (a) = ((b)++)
> c
> }
> Surprise! [...]
We could have a "DWIM" post-parse pass, which would emit warnings if
suspicious line spans occur in expression statements.
> You might conclude that it's best to always include a semicolon as a
> statement separator, but even that can backfire. [if () foo; else bar; ]
> This will give you "parse error: expected statement" [...]
I'm ambivalent about how problematic this is. Awk and tcl, for
example are newline sensitive (";" is a separator for multiple
statements on a single line). We all know how python feels. IIRC
dtrace takes the C route.
- FChE