[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non-greedy wildcard possible? (Long)
From: |
Frank Heckenbach |
Subject: |
Re: Non-greedy wildcard possible? (Long) |
Date: |
Tue, 18 May 2004 03:09:57 +0200 |
User-agent: |
semail 20040101 |
Laurence Finston wrote:
> I had a problem that reminds me of this. Sometimes, one would like to
> "get out of" a rule in `yyparse()' and "get into" another rule. I
> believe this to be impossible, except with `gotos', which is risky.
> If one does it, then one must be very careful about using the semantic
> values of the tokens of all the rules involved. I _don't_ recommend
> it.
If you mean a `goto' from one action into another, this will
certainly not work. The actions in `{ ... }' are just for the
semantic values and irrelevant for the actual parsing.
What you achieve is at best to execute a part of another semantic
action, and at worst to mess up completely, especially if the code
after the `goto' accesses any `$n' values. But the parsing will
continue with the original state (it will not even notice the
`goto'). (You could try modifying the parser's internal structures,
but before you start this, you should really try to restructure your
grammar or use a more powerful parsing algorithm, i.e. GLR.)
(This is quite different from a recursive descent parser ... where a
`goto' into another rule will also mess up -- but for different
reasons. :-)
Frank
--
Frank Heckenbach, address@hidden
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)
- Re: Non-greedy wildcard possible? (Long), (continued)
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/15
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/15
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/16
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/16
- How about this, then... (Not quite non-greedy wildcard), Magnus Lie Hetland, 2004/05/16
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/16
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/16
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/17
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/17
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/17
- Re: Non-greedy wildcard possible? (Long),
Frank Heckenbach <=
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/18
- Re: Non-greedy wildcard possible? (Long), Frank Heckenbach, 2004/05/18
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/19
- Re: Non-greedy wildcard possible? (Long), Frank Heckenbach, 2004/05/19
- Re: Non-greedy wildcard possible? (Long), Frank Heckenbach, 2004/05/17
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/18
- Re: Non-greedy wildcard possible? (Long), Frank Heckenbach, 2004/05/18
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/18
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/18
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/18