#18 do not generate goto next state

closed-fixed
None
3
2006-01-17
2006-01-17
No

This is arguably redandand as optimizers will remove
these gotos anyway, but the generated code becomes much
more readable (and maybe it'll help optimizer as well :-).

The attached patch removes gotos that were generated
from the current state to the next one, like in the
following example:

yy37:
++YYCURSOR;
if((yych = *YYCURSOR) == '=') goto yy96;
goto yy38;

yy38:
{ RET('*'); }

Patched re2c generates instead:

yy37:
++YYCURSOR;
if((yych = *YYCURSOR) == '=') goto yy96;

{ RET('*'); }

Discussion

  • Marcus Börger
    Marcus Börger
    2006-01-17

    • priority: 5 --> 3
    • assigned_to: nobody --> helly
    • status: open --> open-accepted
     
  • Marcus Börger
    Marcus Börger
    2006-01-17

    • status: open-accepted --> closed-fixed
     
  • Marcus Börger
    Marcus Börger
    2006-01-17

    Logged In: YES
    user_id=271023

    All tests were verified manually (using a #line diff
    filtering WinMerge plugin - written with re2c).