system-programming

System Programming Programs List


Program 1: WAP in Lex to count the number of lines and characters in the input file.


Program 2: Write a Lex program that implements the Caesar cipher. It replaces every letter with the one three letters after in an alphabetical order, wrapping around at Z e.g a is replaced by d ,d bye ,and so on z by c.


Program 3: Write a Lex program that finds the longest word (defined as a contiguous string of upper and lower case letters) in the input.


Program 4: Write a Lex program that distinguishes keywords, integers , floats , identifiers , operators and comments in any simple programming language.


Program 5: Write a Lex program to count the number of identifiers in a c file.


Program 6: Write a Lex program to count the number of words, characters, blank spaces and lines in c file.


Program 7: Write a Lex specification program that generate a c program which takes a string “abcd” and print the following output
Abcd
Abc
Ab
A





Program 8: Write a program in Lex to recognise a valid arithmetic expression.


Program 9: Write a YACC program to find the validity of a given expression (for operators + – * and /) .A program in YACC which recognises a valid variable which starts with a letter followed by a digit.The letter should be in lower case only.


Program 10: Write a program in YACC to evaluate an expression (simple calculator program for addition and subtraction,multiplication ,division).


Program 11: Write a program in YACC to recognise the string “abbb”, “ab”,”a” of the language (anbn ,n>=1).


Program 12: Write a program in YACC to recognise the language (anb ,n>=10). (output to say input is valid or not)