Question: In this activity, you will use Flex to build a program that counts the occurrences of the following types of strings in input: Uppercase Letters
In this activity, you will use Flex to build a program that counts the occurrences of the following types of strings in input:
Uppercase Letters eg. A, B
Lowercase Letters eg. c, d
Integer eg. 123, 4
Operators eg. +, -, *, /
Total number of lines
Example
Input:
123a4b56c78DEF+
21Ghi34JK-/22
Output:
Number of lines: 2
Number of Capital letters: 6
Number of Lowercase letters: 5
Number of integers: 7
Number of operators: 3
Noted: To officially terminate your input, press ctrl + d then you will see the output prompted.
For your submission, you should submit your .lex, and a.out file (or your final executable file)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
