Compiler Construction Lab Manual / Counting Number Of Comments lex Program

Program Name

Write a Compiler Construction Program for Counting Number Of Comments lex Program.
Theory
Counting Number Of Comments lex Program
Program Code


Saving: vi comments.l

Compiling and Running
lex comments.l
cc lex.yy.c
./a.out file3.c
Input
//Vi file3.c
/*hello*/
/*world*/
Hello
World


Output
Hello World no of comments are 2


Home     Back