O'Reilly logo

Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython by Richard Hightower

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The StreamTokenizer Class

StreamTokenizer breaks up an input stream into tokens and can be used to parse a simple file (excuse me, “input stream”). Read the Java API documentation on StreamTokenizer, and then compare what you read to the following methods

  • __init__(Reader)

  • __init__(InputStream)

  • nextToken()— returns the next token in the stream

  • lineno()— returns the current line number

  • lowerCaseMode(flag)— returns all words to lowercase if passed a true value

  • parseNumbers()— sets the parsing of floating-point numbers

  • pushBack()— pushes the token back onto the stream, returning it to the next nextToken() method call

  • quoteChar(char)— specifies the character string delimiter; the whole string is returned as a token in sval

  • resetSyntax()— sets all characters ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required