sudo apt-get install flex
sudo apt-get install byacc
sudo apt-get install bison
lex <lex filepath> && gcc -lfl lex.yy.c && ./a.out < input.txt | sed '/^$/d'
We use sed
to remove empty lines.
flex <lex filepath>
bison -dy <yacc filepath>
gcc -lfl lex.yy.cc y.tab.c
./a.out < input.txt | sed '/^$/d'
OR (in short)
flex <lex filepath> && bison -dy <yacc filepath> && gcc -lfl lex.yy.cc y.tab.cc && ./a.out < input.txt | sed '/^$/d'
We use sed
to remove empty lines.
Feel free to raise issues and send PRs for new programms