
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Assigned : Wednesday, February 04, 2009 Due Date : Wednesday, February 18, 2009 at 11:59 PM
1. Write a perl program which takes a line of input from the user and gives you all the
identifiers, integers, floating points, and operators also known as tokens. The tokens in given input must be separated by a space. Definition of the various tokens is given below:
Please make sure you put a space after every token in the input. The following example will illustrate how your program is supposed to work when executed:
$ Enter any string: sum12 = 99 + 23.
Result: Identifier: sum Integer: 99 Operators: =, + Floating point : 23.
$ Enter any string: _hello123 = 99 + 23.5 – 5687 * 0. / 5673
Result: Identifier: _hello Integer: 99, 5687, 5673 Operators: =, +, -, *, / Floating point : 23.5, 0.
Your program must be able to compile and execute under perl version 5.8.8 on
CISE machines. Please also note that your program must use regular expression to
analyze the tokens.