GenericCommentState

A CommentState object that returns a comment from a scanner.

Implements: ICommentState

Description

The GenericCommentState class allows you to create a CommentState object that returns a comment from a scanner.

Fields

CR

Carrige return or \n character

protected final int CR = ‘\n’

LF

Line feed or \r character

protected final int LF = ‘\r’

Instance methods

nextToken

Either delegates to a comment-handling state, or returns a token with just a slash in it.

public Token nextToken(IScanner scanner, ITokenizer tokenizer) throws Exception

  • scanner: IScanner - text string to be tokenized.
  • tokenizer: ITokenizer - tokenizer class that controls the process.
  • returns: Token - next token from the top of the stream.