public class TokenPattern.PatternResult
The results of a test of a sequence of Tokens against a TokenPattern.
The PatternResult is obtained from one of the getResult methods of
TokenPattern which define the start token (that is the token from which to
begin the test), the optional end token (that is the token beyond which the
test should not extend) and an indicator of whether the pattern must match
from the start token, or is allowed to scan through the tokens until a match
A PatternResult is an immutable object, from which the details of the pattern
match can be queried, such as named matches tokens.
public final java.lang.String getNamedMatch(java.lang.String name,
Returns the results of a named search clause.
name - The search clause name.
format - how the match should be returned
if format == false, the results are the exact string from the original
source from the start of the match to end. This will preserve the case of the
original source, include whitespace and comments.
if format == true, the results will have comments removed, alphanumerics
(other than string literals) will be forced to uppercase, and white space will
just be around alphanumerics and following right parenthesis.
the result of a named TokenClause within the search
if that clause matched. If named clause did not produce a match, or the
name cannot be found, null is returned.
public final T getNamedMatchStartToken(java.lang.String name)
public final T getNamedMatchEndToken(java.lang.String name)