Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  Mani.l
Language: C/C++
Code:
%{
#include<stdio.h>
%}
digit[0-9]
letter[a-zA-Z]
%%
int|main|include|stdio|void|printf|case|char|return|for|void|do|if|static|while|float {printf("%s￾keywordn",yytext);}
{letter}({letter}|{digit})*{ printf("%s id,yytext); }
{digit}+ {printf("%s-not an identifiern",yytext);}
%%
int yywrap( )
{
return 1;
}
void main(int argc,char**argv)
{
if(argc>1)
yyin=fopen(argv[1],"r");
else
yyin=stdin;
yylex();
printf("n");
}
          
Comments: