Parsing problem for Java datatypes in a Text

I need a logic/algorithm based on Java which can return me the type of the input parameter. The input parameter is a text. But the function has to analyse the text and find out whether the input (can be)/is of type int, String, float or enum or an array of primitive data types.

Eg:

The input parameter is: (("ABC","DEF"), (1,2,3), 5.5, (5.2, 6.2,8.8), (RED, BLUE)). Here the function should return me the result as:

DataType-1 is array of String (as the String are always represented in quotes).
DataType-2 is an array of integers
DataType-3 is of type float
DataType-4 is an array of float
DataType-5 is an array of enum, say Color. (Enum always represented without quotes)

Validation should be taken care for non-matching "(" or")". Also for mixed type datatype not allowed.

Due to time constraint this question is being asked. I am looking for some available parsers or expert solution which is failure-proof. Thanks in Advance.
ranjeevrajanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
You could make something with regular expressions
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mayank SAssociate Director - Product EngineeringCommented:
There are some open-source parser generators in Java:

http://java-source.net/open-source/parser-generators 
0
Mayank SAssociate Director - Product EngineeringCommented:
BTW that input parameter is not really correct Java. I don't know what it is supposed to be.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.