Lex and Yacc Program Index
Lex and Yacc Program Index
Lex Assignments:
1. Program to count the number of vowels and consonants in a given string. 2. Program to count the number of characters, words, spaces and lines in a given input
line.
3. 3. Program to count the number of :
a. Positive and negative integers b. b. Positive and negative fraction 4. Program to count the number of comments lines in a given c program. Also eliminate them and copy that program into separate file. 5. Program to count the number of 'scanf' and 'printf' statements in a c program. Replace them with 'readf' and 'writef' statements respectively. 6. Program to recognize a valid arithmetic expression and identify the identifiers and operators present and print them separately. 7. Program to recognize and count the number of identifiers in a given input file.
Yacc Assignments:
1. Program to test the validity of a simple expression involving operators +,-,* and /. 2. Program to recognize nested IF control statements and display the number of levels of nesting. 3. Program to recognize a valid arithmetic expression that uses operators +,-.* and/. 4. Program to recognize a valid variable, which starts with a letter, followed by any number of letters or digit. 5. Program to evaluate an arithmetic expression involving operators +,-,*and /. 6. Program to recognize strings aaab, ab, abbb and a using the grammar (anbn, where n>=0). 7. Program to recognize the grammar (anb where n>=10).
Instruction: 1. A combination of one LEX and one YACC problem will be asked based on lots. 2. Both will have equal weight age.