>>>>> "Bryan" == Bryan C Warnock <[EMAIL PROTECTED]> writes:

Bryan> The simplest statement is an expression.  I'm trying to couch the definition 
Bryan> of what composes an expression to exclude 'if', 'while', 'for', etc.
Bryan> Apparently right poorly, at that.

If you treat statement as

        EXPR;

(yes, semicolon INCLUDED) or

        if (EXPR) BLOCK

then you won't have any problems defining where semicolons go.

A statement is an expression followed by a semicolon, or an if, or a while,
or a naked block, or something in that class.

That clearly explains why

        EXPR if EXPR;

is a statement, not an EXPR, so we can't use it recursively.

The only oddness is that a closing brace acts as if it is semicolon-brace
if needed.  That way { EXPR; EXPR; EXPR } still parses, because
it acts like you wrote { EXPR; EXPR; EXPR; }.

This seems to be the most natural approach.  Define statement as
expression followed by semicolon.  Don't try to take the Pascal approach
of "semicolon is statement separator".  Take the *C* approach.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to