Wednesday, August 24, 2016

Flex Breaking Code into Lexme and Token Insertion in Symbol Table


Explanation:

This code requires linux OS. I recommend using Linux Mint. It also requires g++ and flex is installed. In case they are not installed just type their name on the terminal and it will show appropriate commands to install it.

The symbol table insertion can be seen with command "pst" when input is given through command line. In the file cs.sh uncomment the line ./samp and comment ./samp < in.txt > out.txt to give command through terminal and see the output there also.

File Structure:


Bash Script:


Code:


Sample Input:


Symbol Table using "pst" Command:


Sample Output:


No comments: