<div>
<pre>How put "a ab abc \t abcd\n abcde"<br>and get<br>'a'<br>'ab'<br>'abc'<br>'abcd'<br>'abcde'<br><br>When i use main := (space* wyraz )* i get only chars not words<br><br>/* @LANG: c */
#include <stdio.h>
#include <string.h>
%%{
machine foo;
action beginning { pocz = p; }
action ending { printf("'%.*s'\n",(int)(p - pocz), pocz); }
wyraz = [a-z]+ >beginning %ending;
main := ( space* wyraz ) ;
write data noerror nofinal;
}%%
int main(int argc, char **argv)
{
int cs = 0;
char *pocz;
if (argc > 1)
{
char *p = argv[1];
char *pe = p + strlen(p);
char *eof = pe;
%%write init;
%%write exec;
}
return 0;
}</pre>
</div>