Skip to content

EmmanuelJojy/Compiler-Lab

Repository files navigation

Compiler-Lab

KTU S7 Compiler Laboratory Source Codes CSL 411

  • For LEX and YACC code create a new directory for each question and name the source files lex.l and yaac.y for simplicity. The commands given below are tailored for the default names.
  • && simply combines the commands to a single line.
# To simulate LEX  programs use 
$ flex lex.l && gcc lex.yy.c -ll && ./a.out

# To simulate YACC programs use 
$ yacc -d yacc.y && flex lex.l && gcc y.tab.c lex.yy.c -ll && ./a.out

# To simulate C programs use
$ gcc pgm.c && ./a.out

Record Index

No. Date Source Title Link
01 28/09/2022 C Lexical analyzer for C Language 🔗
02 06/10/2022 LEX Lexical analyzer for C Language 🔗
03 21/10/2022 LEX Count lines, words & characters 🔗
04 21/10/2022 LEX Replace substring 🔗
05 21/10/2022 LEX Count vowels and consonants 🔗
06 26/10/2022 YACC Arithmetic expression validator 🔗
07 28/10/2022 YACC Basic identifier validator 🔗
08 28/10/2022 YACC Arithmetic expression evaluator 🔗
09 18/11/2022 C ∈ - Closure of all states 🔗
10 18/11/2022 C ∈ - NFA to NFA 🔗
11 C NFA to DFA
12 25/11/2022 C First and Follow of Grammar 🔗
13 09/12/2022 C Recursive Descent Parser 🔗
14 09/12/2022 C Shift Reduce Parser 🔗
15 17/12/2022 C Intermediate Code Generation 🔗
16 17/12/2022 C Constant Propagation 🔗
17 17/12/2022 C Assembly Code Generation 🔗

Addon Experiments

No. Date Source Title Link
01 06/10/2022 LEX Count Vowels 🔗
02 06/10/2022 LEX Real Numbers 🔗
03 28/10/2022 YACC Zero One 🔗
04 28/10/2022 YACC AnBn 🔗
05 28/10/2022 YACC Infix to Postfix 🔗
06 28/10/2022 YACC Palindrome 🔗

Exam Experiments

No. Date Source Title Link
01 19/10/2022 LEX Calculator 🔗
02 19/10/2022 LEX Line Space Tabs 🔗
03 19/10/2022 LEX C Comments 🔗
04 19/10/2022 LEX Multi - Space 🔗
05 19/10/2022 LEX Positive Negative 🔗
06 19/10/2022 LEX Longest Length 🔗
07 19/10/2022 LEX Odd Even 🔗
08 19/10/2022 LEX Prime 🔗
09 19/10/2022 LEX Leap Year 🔗
10 19/10/2022 LEX Armstrong 🔗
11 21/12/2022 C Dead Code Elimination 🔗
12 21/12/2022 C Sub-expression Elimination 🔗

References

No. Title Link
01 LEX 🔗
02 YACC 🔗
03 GNU BISON 🔗
04 Record Left Print 📄

About

KTU S7 Compiler Laboratory Source Codes CSL 411

Topics

Resources

License

Stars

Watchers

Forks