On 2018-03-15, at 11:02:17, Charles Mills wrote:

>  Your points are good but FWIW ; is a command separator and at a "higher 
> level" than quoted string parsing.
> Find "foo;bar" is for better or worse exactly the same as
> Find "foobar"
>  
I believe not.  Find "foo;bar" is the same as
    Find "foo
    bar"

... both of which are reported as syntax errors.

Very bad design.  A "higher level" executive has no business performing
a bottom-up parse of commands it passes to a lower level processor.  At
least it should support an escape convention, such as:
    Find "foo\;bar"
... with the "\" protecting the ";".  The command passed to the lower level
would then simply be:
    Find "foo;bar"

But that couldn't be done with a simple TRT.  Oh, my gosh!  Think of the
performance implications of doing it right!

Feedback from a parser to its lexical analyzer is generally deemed
harmful (but consider PL/I!)  OTOH, the lexical analyzer should not
impose limitations on the parser's syntax.

>     printf( "foo;bar\n" );  /* in C  */
>  
C's lexical analyzer knows enough to recognize that the second ";", but
not the first, is a token separator.

-- gil

Reply via email to