Ah, irgendein Beispiel also...
I leave it as an exercise for the reader to rewrite this without using goto statements.
Vielleicht findest Du, wo ich das her habe. Ansonsten kannst Du noch nach Anderhalb-Schleifen suchen.
Ob und in welcher Form PHP ein goto bekommt oder nicht, bestimmen eh andere. Ich bezweifele, dass hier jemand Einfluss darauf hat. Und auf die typische goto "Diskussion" habe ich keinen Bock. Deshalb ist von meiner Seite hier Ende.
Code:
int parse() { Token tok; reading: tok = gettoken(); if (tok == END) return ACCEPT; shifting: if (shift(tok)) goto reading; reducing: if (reduce(tok)) goto shifting; return ERROR; }
Ob und in welcher Form PHP ein goto bekommt oder nicht, bestimmen eh andere. Ich bezweifele, dass hier jemand Einfluss darauf hat. Und auf die typische goto "Diskussion" habe ich keinen Bock. Deshalb ist von meiner Seite hier Ende.
Kommentar