|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.holub.text.RegexToken
public class RegexToken
Matches a token specified by a regular expression.
(as described in the Pattern
class.
Pattern
,
Token
This code may be used freely by yourself with the following restrictions:
|
Constructor Summary | |
---|---|
RegexToken(String description)
Create a token. |
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 |
---|
public RegexToken(String description)
description
- a regular expression
(see) that describes
the set of lexemes associated with this token.
The expression is case insensitive, so the
expression "ABC" also recognizes "abc".Method Detail |
---|
public boolean match(String input, int offset)
Token
match
in interface Token
public String lexeme()
Token
lexeme
in interface Token
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |