Skip to content

Latest commit

 

History

History
16 lines (16 loc) · 1.53 KB

File metadata and controls

16 lines (16 loc) · 1.53 KB

system_programming_lex_and_yacc_program

  1. Write a Lex program to count the number of lines and characters in the input file.
  2. Write a Lex program that implements the Caesar cipher: it replaces every letter with the one three letters after in in alphabetical order, wrapping around at Z. e.g. a is replaced by d, b by e, and so on z by c.
  3. Write a Lex program that finds the longest word (defined as a contiguous string of upper and lower case letters) in the input.
  4. Write a Lex program that distinguishes keywords, integers, floats, identifiers, operators, and comments in any simple programming language.
  5. Write a Lex program to count the number of identifiers in a C file.
  6. Write a Lex program to count the number of words, characters, blank spaces and lines in a C file.
  7. Write a Lex specification program that generates a C program which takes a string “abcd” and prints the following output abcd abc a
  8. A program in Lex to recognize a valid arithmetic expression.
  9. Write a YACC program to find the validity of a given expression (for operators + -* and /)A program in YACC which recognizes a valid variable which starts with letter followed by a digit. The letter should be in lowercase only.
  10. A Program in YACC to evaluate an expression (simple calculator program for addition and subtraction, multiplication, division).
  11. Program in YACC to recognize the string „abbb‟, „ab‟ „a‟ of the langauge (an b n , n>=1).
  12. Program in YACC to recognize the language (an b , n>=10). (output to say input is valid or not)