Compiler Construction Lab Manual / Bottom down parsers SLR Follow

Program Name

Write a Compiler Construction Program for Bottom down parsers SLR Follow.
Theory
Program Code


Saving: vi follow.c

Compiling and Running
Cc follow.c
./a.out
Input and Output
enter the no.of production 3
enter the production
E=T+E
T=F*T
F=i

enter element whose follow is to be found F
FOLLOW(F)={*}
do you want to continue -1,exit -0
1
enter element whose follow is to be found T
FOLLOW(T)={+}
do you want to continue -1,exit -0
1
enter element whose follow is to be found E
FOLLOW(E)={#}
do you want to continue -1,exit -0
0


Home     Back