Re: GOTO operator
| From: | Alan Knowles | Date: | Thu, 19 Aug 2004 07:49:49 +0000 |
| Subject: | Re: GOTO operator | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-12256@lists.php.net to get a copy of this message | ||
if you look at the bison/flex, they both use switch/case - the parsers I use, both generate code like this, however they ended up using variable functions, as even the overhead of the function calls is faster than the large switch/case called repeatidly.. (this is ideally what dynamic goto's could replace)
re2c uses goto's with static addresses. - I doubt though it would be easy to modify the parser generators I have to do this..
No idea how lemon works?..
The other alternative would be to do some apc optimization on switch/case with integers...
Regards
Alan
Hartmut Holzgraefe wrote:
Alan Knowles wrote:How that? C doesn't have dynamic goto targets either but still its used for parsing lot ...- compile time hooking (no dynamic goto targets)That kind of makes them useless for writing parsers, which was one of the justifications of them.