Results 1 to 4 of 4

Thread: java tokenizer

  1. #1
    mia69 is offline Member
    Join Date
    Feb 2010
    Posts
    5
    Rep Power
    0

    Default java tokenizer

    hi guys

    so in my program i use a java tokenizer
    Java Code:
    StreamTokenizer st = new StreamTokenizer ( new BufferedInputStream (new FileInputStream (filePath))) ;
    but i have a problem while testing
    Java Code:
    if(st.toString().equals("Token['+'], line 1") )
    					 {
    					 token[j]="+";
    					 token1[j]=2;
    					
    			          j++;
    					    
    				      }
    well with this i can only test the first line wich is not enough i wanna test all the file

    i need help:confused:
    thank you

  2. #2
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    368
    Rep Power
    5

    Default

    What is this tokenizer supposed to do???

    Please post some example :)

    What is content of file?
    What are delimiters?
    What do you need in output?

  3. #3
    mia69 is offline Member
    Join Date
    Feb 2010
    Posts
    5
    Rep Power
    0

    Default

    this is the content of the file for now
    Java Code:
    (23+5)*((12*4)+3)$
    now i've done the parser of
    E-->E+T|T
    T-->T*F|F
    E-->(E)|id
    but if i write the "(23+5)*((12*4)+3)$" at the second line of the file it won't
    work because of line1 in the test:)

  4. #4
    mia69 is offline Member
    Join Date
    Feb 2010
    Posts
    5
    Rep Power
    0

Similar Threads

  1. building a tokenizer
    By Igor in forum New To Java
    Replies: 2
    Last Post: 01-20-2010, 05:45 PM
  2. Manipulating String Tokenizer
    By Bomber_Will in forum New To Java
    Replies: 2
    Last Post: 04-19-2009, 11:54 PM
  3. string tokenizer
    By twinytwo in forum New To Java
    Replies: 2
    Last Post: 03-26-2009, 02:10 PM
  4. String Tokenizer And Arraya
    By everlast88az in forum Advanced Java
    Replies: 2
    Last Post: 11-06-2008, 11:20 PM
  5. Parsing or Tokenizer??
    By hiklior in forum New To Java
    Replies: 15
    Last Post: 05-28-2008, 02:20 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
  •