These token objects are then passed to the parser and is accessible to the actions in a JavaCC grammar usually by grabbing the return value of a token. The methods getToken and getNextToken described below also give access to objects of this type. If this is the last token from the input stream, or if the token manager has not read tokens beyond this one, this field is set to null. The description in the above paragraph holds only if this token is also a regular token. Otherwise, see below for a description of the contents of this field.
Regular tokens are the normal tokens that are fed to the parser.
For more information on the different kinds of tokens please see the minitutorial on the token manager . If there are no such special tokens, this field is set to null. If there is no such token, this field is null. If you wish to perform special actions when a token is constructed or create subclasses of class Token and instantiate them instead, you can redefine this method appropriately. If there are no more tokens available in the input stream, the exception ParseError is thrown.