Write A Program To Print HTML Tags

 


Input Text File

<html>
<head>
<title>Introduction</title>
</head>
<body>
<h1>My Name is Jay</h1>
<p>I from India.</p>
</body>
</html>


Code


%{
#include<stdio.h>
%}

%%
"<"[^>]*> {printf("VALUE:%s\n",yytext);}
.|\n ;
%%
int main()
{
extern FILE *yyin;
yyin=fopen("HTMLInput.txt","r");
if(yyin==NULL){
printf("File Not Found");
}
yylex();
return 0;
}
yywrap()
{
return(1);
}


Output






Comments

Popular posts from this blog

Write A Program To Print Hello World Using Lex

Create a Student registration form using following tags form,input,textarea,button,select,optio. The registration form must consist of following information: first name,Middle name,last name, gender(use radio button),address,phone no,email id,hobbies(use checkbox),city,state,country,collage name (use dropdown menu).