I got frustrated with flex and went looking for a better tool. I found re2c and was glad to see it offered everything flex does and appears to address all the short comings of flex's design. I worked through the examples in order to try to quickly onboard with the re2c syntax and concepts. When I got to the push model example I found it did not compile, complaining about missing declarations for YYPEEK, YYSKIP, etc.
Debugging it was certainly a good exercise and it helped me understand better what state re2c needs to keep track of, but the problem was simply that the wrong arguments are used when invoking re2c. After defining the missing macros, I was surprised to see that YYGETSTATE wasn't being used in the generated output. This is because the example invocation uses --input custom, hence the "missing" macros, instead of --storable-state, hence the lack of YYGETSTATE invocations.
Additionally, there's a typo in the link to the --storage-state documentation. It links to this URL instead of this url, with the typo being s/featires/features/.
I got frustrated with flex and went looking for a better tool. I found re2c and was glad to see it offered everything flex does and appears to address all the short comings of flex's design. I worked through the examples in order to try to quickly onboard with the re2c syntax and concepts. When I got to the push model example I found it did not compile, complaining about missing declarations for
YYPEEK,YYSKIP, etc.Debugging it was certainly a good exercise and it helped me understand better what state re2c needs to keep track of, but the problem was simply that the wrong arguments are used when invoking re2c. After defining the missing macros, I was surprised to see that
YYGETSTATEwasn't being used in the generated output. This is because the example invocation uses--input custom, hence the "missing" macros, instead of--storable-state, hence the lack ofYYGETSTATEinvocations.Additionally, there's a typo in the link to the
--storage-statedocumentation. It links to this URL instead of this url, with the typo beings/featires/features/.