%{ #include<stdio.h> int nl = 0; int nw = 0; int nc = 0; %} %% \n nl++; [a-zA-Z]+ {nw++,nc+=yyleng;} [^]nc++; %% int main(){ printf("Enter the string:\n"); yylex(); printf("No. of lines is %d,words is %d and characters is %d",nl,nw,nc); return 0; }
I am sagar who are you
Standard output is empty
ERROR: /home/3YmdOw/prog:19:0: Syntax error: Unexpected end of file ERROR: '$runtoplevel'/0: Undefined procedure: program/0 Exception: (3) program ? EOF: exit
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!