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