Skip to content

Lex Programs

  1. Lex program that copies a file, replacing each nonempty sequence of white space by a single blank.

  2. Lex program that copies a C program, replacing each instance of the keyword float with double.

  3. Lex program which will modify the words in the following way:

    1. If the first letter is a consonant, move it to the end of the word and then add ay.
    2. If the first letter is a vowel, just add ay to the end of the word.
  4. Lex program to identify identifiers from a given input source file.

  5. Lex program to count the number of vowels and consonants from an input file and write the results to a file.

  6. Lex program to count the number of lines in a given input source file.

  7. Lex program to count the number of comment lines in a c program. Also eliminate that comment line. (input read from file).

  8. Lex program to identify correctly an inputted 8 bit binary number.

  9. Lex program to find out all the tokens from input C program.(input read from file)

  10. Lex program to count the number of tokens and find out all the tokens from input C program. (input read from file)

  11. Lex program to identify all the numbers in an input text and then perform the sum of the numbers.

  12. Lex program to count the number of the word “the” in an input text.

  13. Lex program to count the number of stopwords and remove all of them.

  14. Lex program to design a simple calculator.

  15. Lex program to count the number of palindromes present in a input text and write them to a separate text file.

  16. Lex program to check valid arithmetic expressions.

  17. Lex program to find the length of an input text.

  18. Lex program to reverse all the words in an input text.

  19. Lex program to find the smallest word in an input text.

  20. Lex program to convert lowercase characters to uppercase.

  21. Lex program to sort all the words in an input text as per their length.

Released under the MIT License.