Results 1 to 2 of 2
  1. #1
    ShortIt is offline Member
    Join Date
    Jan 2011
    Posts
    7
    Rep Power
    0

    Exclamation 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.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,524
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by ShortIt View Post
    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.
    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,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. String Tokenizer help
    By GreenTea in forum New To Java
    Replies: 4
    Last Post: 10-30-2010, 02:44 AM
  2. String Tokenizer
    By sumaih in forum Java Gaming
    Replies: 2
    Last Post: 08-21-2010, 03:23 PM
  3. String Tokenizer
    By viperlasson in forum New To Java
    Replies: 1
    Last Post: 03-09-2010, 01:14 PM
  4. String Tokenizer
    By redasu in forum Advanced Java
    Replies: 4
    Last Post: 02-19-2010, 03:30 AM
  5. string tokenizer
    By twinytwo in forum New To Java
    Replies: 2
    Last Post: 03-26-2009, 02:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •