RV College of Engineering, Bengaluru
Compiler Design(18CS63)
Lab Programs (CIE and SEE)
- Program 1:
- Write a LEX program to count number of words, lines, characters and whitespaces in a given paragraph
- Write a YACC program to recognize strings of the form anbn+mcm, n,m>=0.
- Program 2:
- Write a LEX program to count number of Positive and Negative integers and Positive & Negative fractions.
- Write a YACC program to validate and evaluate a simple expression involving operators +,- , * and /.
- Program 3:
- Write a LEX program to count the number of comment lines in a C Program. Also eliminate them and copy that program into a separate file.
- Write a YACC program to recognize a nested (minimum3levels)FOR loop statement for C language
- Program 4:
- Write a LEX program to recognize and count the number of identifiers, operators and keywords in a given input file.
- Write a YACC program to recognize nested IF control statements (C language) and display the number of levels of nesting.
- Program 5: Write a C program to implement a ShiftReduce parser for a given grammar and generate the parsing table by parsing the given string.
- Program 6: YACC program that reads the C statements for an input file and converts them in quadruple three address intermediate code.
- Program 7: Write a YACC program that identifies the Function Definition of C language
- Program 8: Write a YACC program that generates Assembly language (Target) Code for valid Arithmetic Expression.