/CDSS-lab-stuff

This is our repository that holds all the lab programs from the sixth-semester Compiler Design and System Software course.

Primary LanguageC

CDSS-lab-stuff

Program 1:

1a. Lex Program to count the number of characters, words, spaces and lines in a given input file.

1b. Lex Program to recognize and count the number of identifiers in a file.

Program 2:

2a. Lex Program to count the numbers of comment lines in a given C program. Also eliminate them and copy the resulting program into separate file.

2b. Lex Program to recognize whether a given sentence is simple or compound.

Program 3:

3a. Lex Program to count no of :

    i.+ve and –ve integers

    ii. +ve and –ve fractions

3b. Lex Program to count the no of ‘scanf’ and ‘printf’ statements in a C program. Replace them with ‘readf’ and ‘writef’ statements respectively.

Program 4:

Yacc Program to evaluate arithmetic expression involving operators +,-,*, / .

Program 5:

Program to recognize a valid variable which starts with a letter, followed by any number of letters or digits.

Program 6:

Program to recognize the strings using the grammar (a^n b^ n; n>=0).

Program 7:

C program to implement a Pass 1 assembler.

Program 8:

C Program to implement Absolute Loader.

Program 9:

C program to find the FIRST in context free grammar.

Program 10:

C Program to implement Shift Reduce Parser for the given grammar.

Program 11:

C Program to implement code optimization techniques.