Search This Blog

Saturday, March 16, 2019

sample lex

/*lex program to count number of words*/
%{
#include<stdio.h>
#include<string.h>
int i = 0;
%}

/* Rules Section*/
%%
([a-zA-Z0-9])* {i++;} /* Rule for counting
number of words*/

"\n" {printf("%d\n", i); i = 0;}
%%

int yywrap(void){}

int main()
{
// The function that starts the analysis
yylex();

return 0;
}

No comments:

OBJECT ORIENTED PROGRAMMING THROUGH JAVA google classroom link

Classroom link: https://classroom.google.com/c/ODc0OTQxMjY1MjA5?cjc=rq67ikqo class code:  rq67ikqo exam link: https://wayground.com/join?gc=...