ref: 860d5e268b3c523eac57e463b2a96824b98e044d
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; }