Category Archives: Compiler Design

Program to find out FOLLOW of NONTERMINALS of given productions


Note: Please replace NULL by the null character to avoid the warnings null character must be enclosed by single quotes ‘ ‘.  Output :

Posted in C, Compiler Design | Tagged , , , | Leave a comment

A program to find FIRST of NON TERMINALS of the given grammar


OUTPUT:

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

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 , , , , | Leave a comment