Tag Archives: context free grammar

Program to recognize strings ‘aaab’, ‘abbb’, ‘ab’, ‘a’ , aabb using the grammer (an bn ,n>=0).


Lex part : Yacc Part : Sample Input/Output : $ lex prog5b.l $ yacc -d prog5b.y $ cc -c lex.yy.c y.tab.c $ cc -o a.out lex.yy.o y.tab.o -lfl $ ./a.out Enter the string: aaaabb Invalid string $ ./a.out Enter the … Continue reading

Posted in C, Compiler Design | Tagged , , , , | 2 Comments