Skip to content

gargibisht/Lex_Programs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lex Questions:

  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 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 ab a

  8. A program in Lex to recognize a valid arithmetic expression.

About

This repository contains solved Lex programs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages