2. Parsing C Programs
Create a perl script called [url removed, login to view] that counts tokenus in a C program. The name of the program (file) shall be specified via the command line. Thus, the program should be invoked from the command line via:
perl [url removed, login to view] mainProg.c
For each line of the C program [url removed, login to view] should output:
1. The number of words (variable and reserved) on the line.
2. The number of numeric literals without decimal points on the line.
3. The number of numeric literals with decimal points on the line.
4. The number of braces, brackets and parentheses on the line.
Finally, the script should output the total number of each of the four classes, above, that were in the entire program.
Here is what the end of output might look like:
Words: 8 Ints: 1 Floats: 2 Braces: 4
Words: 3 Ints: 0 Floats: 0 Braces: 2
Words: 435 Ints: 23 Floats: 8 Braces: 64
program must ignore those elements that appear in comments or double quotes. Note that comments can be of either the // or /* ... */ form. The latter form may extend over multiple lines.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
Windows Xp and Internet Explorer 5.0 +