Providing JSP, Servlet, JAVA, JavaScript, HTML, CSS, C#, C++, Python Tutorials
%{
int c=0;
%}
str [-|+][0-9]*
%%
{str} c++;
%%
void main()
{
int b;
printf("Enter a the number \n");
yylex();
printf("number of signed numbers are %d \n",c);
}
lex cns.l
cc lex.yy.c -lfl
./a.out
then press CTRL+d
Posted in: Lex tutorial


0 Comments:
Post a Comment