%{ #include<stdio.h> %} word [ab]+" " nr [3-9][0-9][0-9]|[1-9][0,9]{3,} el {nr}|([a-z][a-z})*[a-z} list "{"{el}(,{el})+"}" %% {list} {printf("%s\n",yylex);} (.*{word}.*){2,}\n {ECHO;} .|\n; %% int main(int argc, char**argv){ FILE *g; if(argc>0) yyin = fopen(argv[1], "r"); if(!(g=fopen("a.txt", "w"))) fprintf(stderr, "error"); else yyout=g; yylex(); }
Quote:el {nr}|([a-z][a-z})*[a-z}
[a-z}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)