Lab: Tokenizer
Objective
In this lab you will familiarize yourself with the task of tokenizing a
simple input by implementing the core methods in the Tokenizer utility
class.
Setup
To get started, import the project for this lab, Tokenizer, from the
Tokenizer.zip file available at this link. If you
don't remember how to do this, see the Setup
instructions
in an earlier lab.
Method
- First carefully look through the file
Tokenizer.javain thesrcfolder and make sure you understand all the given members and themainmethod in particular. Complete the body of the static methodsnextWordOrSeparatorandtokensby pasting the code you wrote for the homework into the skeleton provided. - Run the main program to test your implementation of
nextWordOrSeparatorandtokens. You can use theSampleProgram.blandSampleInput.txtfiles in thedatafolder in your project as test inputs. The main program generates two output files (both in thedatafolder):expected-output.txtthat contains the correct output for the given input andactual-output.txtthat is the output generated by your implementation. Use Eclipse's file compare feature you learned about in the previous labs to compare the two outputs. Fix your code as needed.