gate.jape
Class PatternElement
java.lang.Object
|
+--gate.jape.PatternElement
- All Implemented Interfaces:
- Cloneable, JapeConstants, Matcher, Serializable
- Direct Known Subclasses:
- BasicPatternElement, ComplexPatternElement, ConstraintGroup
- public abstract class PatternElement
- extends Object
- implements Cloneable, Matcher, JapeConstants, Serializable
Superclass of the various types of pattern element, and of
ConstraintGroup. Inherits from Matcher, providing matches and reset.
Provides access to the annotations that are cached by subclasses, and
multilevel rollback of those caches. Stores the match history.
- See Also:
- Serialized Form
Fields inherited from interface gate.jape.JapeConstants |
APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, FIRST_STYLE, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, ONCE_STYLE, SINGLE_SPAN_BINDING |
Method Summary |
Object |
clone()
Cloning for processing of macro references. |
abstract AnnotationSet |
getMatchedAnnots()
Access to the annotations that have been matched. |
void |
reset()
Reset: clear annotation caches etc. |
abstract void |
rollback(int arity)
Multilevel rollback of annotation caches. |
abstract String |
toString(String pad)
Create a string representation of the object with padding. |
PatternElement
public PatternElement()
- Anonymous construction.
clone
public Object clone()
- Cloning for processing of macro references. Note that it doesn't
really clone the match history, just set it to a new Stack. This is
because a) JGL doesn't have real clone methods and b) we don't
actually need it anywhere but during parsing the .jape, where there
is no match history yet.
getMatchedAnnots
public abstract AnnotationSet getMatchedAnnots()
- Access to the annotations that have been matched.
rollback
public abstract void rollback(int arity)
- Multilevel rollback of annotation caches.
reset
public void reset()
- Reset: clear annotation caches etc. Most of the behaviour of
this method is the responsibility of subclasses.
- Specified by:
reset
in interface Matcher
toString
public abstract String toString(String pad)
- Create a string representation of the object with padding.