pmp
Interface MatcherIface

All Known Implementing Classes:
EmptyMatcher, FailingMatcher, JavaMatcher

public interface MatcherIface

Interface for regexp matcher class.

Title: PMP: Macroprocessor

Description: Java macroprocessor

Copyright: Copyright (c) 2005

Company:

Version:
1.0
Author:
Luděk Hlaváček

Nested Class Summary
static class MatcherIface.State
          State of matcher.
 
Method Summary
 void feed(int c)
          Appends character to matched string snd updates stato of this matcher.
 int getMatchingLength()
          Returns length of input subsequence that matches pattern.
 java.lang.String getPattern()
          Returns pattern associated with this matcher.
 MatcherIface.State getState()
          Returns state of matcher.
 Token getToken()
          Returns token that would be produced by this class.
 MatcherIface.State matches(java.lang.StringBuilder text)
          Resets this matcher with given string.
 void reset()
          Resets matcher.
 

Method Detail

feed

void feed(int c)
Appends character to matched string snd updates stato of this matcher.

Parameters:
c - chracter to be appended

matches

MatcherIface.State matches(java.lang.StringBuilder text)
Resets this matcher with given string.

Returns:
new state of matcher

reset

void reset()
Resets matcher.


getToken

Token getToken()
Returns token that would be produced by this class.

Returns:
token object

getMatchingLength

int getMatchingLength()
Returns length of input subsequence that matches pattern. Valid only for states MatcherIface.State.PARTIAL and MatcherIface.State.OVERFEED.

Returns:
number of characters matching the pattern

getState

MatcherIface.State getState()
Returns state of matcher.

Returns:
result of matching procedure

getPattern

java.lang.String getPattern()
Returns pattern associated with this matcher.

Returns:
regular expression