David L. Nicol writes:
: Dan Sugalski wrote:
: > I'm not a parser guy by any means (unfortunately) but we have
: > the distinct possibility of completely replacing all of the
: > parser rules after token X appears, whatever that token might
: > be. (Heck, we may have the possibility of replacing the entire
: > parser) There's no guarantee the non-perl-6 section will have a
: > nice end-delimiter for us to find. Granted that won't be the
: > case all the time, but it's certainly quite feasable. We might
: > not even be able to rely on perl's definition of a token. (Or
: > whitespace for that matter--Whitespace isn't just whitespace in
: > python mode)
: 
: 
: sounds a lot like an "exec" system call: there are some things
: which remain in effect (open file handles, current directory,
: environment) but there are many others which do not.  Maybe
: switching parsers is best an absolute kind of thing rather than
: a stacked kind of thing, with the later parser responsible for
: switching back.  

The truth is somewhere in the middle.  It is incumbent on the outer rule
to inform the inner rule how it thinks the inner rule ought to terminate,
and it is the choice of the inner rule whether to follow the convention
suggested by the outer rule.  A rule that starts at a left parenthesis
will suggest stopping on a right parenthesis, but if the inner rule
is parsing troff, all bets are off on properly nesting parens.

Larry

Reply via email to