com.holub.text
Class BeginToken

java.lang.Object
  extended by com.holub.text.BeginToken
All Implemented Interfaces:
Token

public class BeginToken
extends Object
implements Token

The Begin token is special in that it has no width, and doesn't match anything in the input. It's used solely as a convenient initial value for the current-token field of the Scanner, but is made public in case you want to build your own scanner.

See Also:
Token
©2004 Allen I. Holub. All rights reserved.

This code may be used freely by yourself with the following restrictions:

  1. Your splash screen, about box, or equivalent, must include Allen Holub's name, copyright, and URL. For example:

    This program contains Allen Holub's SQL package.
    (c) 2005 Allen I. Holub. All Rights Reserved.
    http://www.holub.com


    If your program does not run interactively, then the foregoing notice must appear in your documentation.
  2. You may not redistribute (or mirror) the source code.
  3. You must report any bugs that you find to me. Use the form at http://www.holub.com/company/contact.html or send email.
  4. The software is supplied as is. Neither Allen Holub nor Holub Associates are responsible for any bugs (or any problems caused by bugs, including lost productivity or data) in any of this code.

Constructor Summary
BeginToken()
           
 
Method Summary
 String lexeme()
          Returns the input string that matched the token specification.
 boolean match(String input, int offset)
          Returns true if the sequence at the indicated offset from the beginning of the indicated input string matches the current token.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeginToken

public BeginToken()
Method Detail

match

public boolean match(String input,
                     int offset)
Description copied from interface: Token
Returns true if the sequence at the indicated offset from the beginning of the indicated input string matches the current token.

Specified by:
match in interface Token

lexeme

public String lexeme()
Description copied from interface: Token
Returns the input string that matched the token specification.

Specified by:
lexeme in interface Token

toString

public String toString()
Overrides:
toString in class Object