public class WordPatternRule extends SingleLineRule
IWordDetector
Modifier and Type | Field and Description |
---|---|
protected IWordDetector |
fDetector
The word detector used by this rule
|
fBreaksOnEOF, fBreaksOnEOL, fColumn, fEndSequence, fEscapeCharacter, fEscapeContinuesLine, fStartSequence, fToken, UNDEFINED
Constructor and Description |
---|
WordPatternRule(IWordDetector detector,
String startSequence,
String endSequence,
IToken token)
Creates a rule for the given starting and ending word
pattern which, if detected, will return the specified token.
|
WordPatternRule(IWordDetector detector,
String startSequence,
String endSequence,
IToken token,
char escapeCharacter)
/**
Creates a rule for the given starting and ending word
pattern which, if detected, will return the specified token.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
endSequenceDetected(ICharacterScanner scanner)
Returns whether the end sequence was detected.
|
protected void |
unreadBuffer(ICharacterScanner scanner)
Returns the characters in the buffer to the scanner.
|
doEvaluate, doEvaluate, evaluate, evaluate, getSuccessToken, sequenceDetected, setColumnConstraint
protected IWordDetector fDetector
public WordPatternRule(IWordDetector detector, String startSequence, String endSequence, IToken token)
detector
- the word detector to be usedstartSequence
- the start sequence of the word patternendSequence
- the end sequence of the word patterntoken
- the token to be returned on successpublic WordPatternRule(IWordDetector detector, String startSequence, String endSequence, IToken token, char escapeCharacter)
detector
- the word detector to be usedstartSequence
- the start sequence of the word patternendSequence
- the end sequence of the word patterntoken
- the token to be returned on successescapeCharacter
- the escape characterprotected boolean endSequenceDetected(ICharacterScanner scanner)
endSequenceDetected
in class PatternRule
scanner
- the scanner to be usedtrue
if the word ends on the given end sequenceprotected void unreadBuffer(ICharacterScanner scanner)
scanner
- the scanner to be used
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.