Results 1 to 2 of 2
Thread: Need help with string tokenizer
- 02-18-2011, 06:34 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 7
- Rep Power
- 0
Need help with string tokenizer
Hello Everyone,
I have an Assignment due and I am stuck with one concept that I am not able to push through JAVA, hopefully some knowledgeable brave soul can dig me out of this one.
DESCRIPTION OF THE PROGRAM.
1) take characters from a file
i.e. (ABD+*-AD) or (BGT+*ECXS) or (MNBHUR*/)
This is dealing with RPN( Reverse Polish Notation) just to clarify so nobody thinks that I am putting garbage up here.
So this has to mainly deal with managing individual characters.
2) And the output should be in some order according to the algorithm that will be implemented, ( I am not providing that because that is not concerning with the issue that I am dealing with).
3) Professor said to use STRING TOKENIZER, as I am using that class I can not get control over each character, the only way a TOkenizer separates a string is by using and specifying delimiters. In my case there are no delimiters. Its all just one long or short consecutive characters.
How can I walk through each character in a string (as shown above) using a tokenizer without any delimiters. PLEASE HELP
4) Last thing, IS there a CHAR TOKENIZER?, I didn’t find one in JAVA API.
- 02-18-2011, 07:04 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,392
- Blog Entries
- 7
- Rep Power
- 17
Those reverse polish expressions aren't correct, e.g. ABD+*- lacks one operand on the stack (if A, B and D are separate operands) As I can see now you don't need a tokenizer at all: each and every single character means something: a letter is an operand while all the other characters are operators.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
String Tokenizer help
By GreenTea in forum New To JavaReplies: 4Last Post: 10-30-2010, 02:44 AM -
String Tokenizer
By sumaih in forum Java GamingReplies: 2Last Post: 08-21-2010, 03:23 PM -
String Tokenizer
By viperlasson in forum New To JavaReplies: 1Last Post: 03-09-2010, 01:14 PM -
String Tokenizer
By redasu in forum Advanced JavaReplies: 4Last Post: 02-19-2010, 03:30 AM -
string tokenizer
By twinytwo in forum New To JavaReplies: 2Last Post: 03-26-2009, 02:10 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks