ref: e41229f96b0f353af98e8f05134a1564e4a9ff16
dir: /examples/local.peg/
%{ #define YY_CTX_LOCAL 1 #define YY_CTX_MEMBERS \ int count; %} Char = ('\n' | '\r\n' | '\r') { yy->count++ } | . %% #include <stdio.h> #include <string.h> int main() { yycontext yy; memset(&yy, 0, sizeof(yy)); while (yyparse(&yy)) ; printf("%d newlines\n", yy.count); yyrelease(&yy); return 0; }