public class NestedEndTokenRule
extends MultiLineRule
Modifier and Type | Field and Description |
---|---|
protected java.util.List<char[]> |
fEndSequences
The pattern's end sequence
|
Constructor and Description |
---|
NestedEndTokenRule(java.lang.String startSequence,
java.lang.String[] openingTokens,
java.lang.String[] endSequences,
char[] stoppers,
IToken token,
int openingTokenCounterStart)
Constructor
|
NestedEndTokenRule(java.lang.String startSequence,
java.lang.String[] openingTokens,
java.lang.String[] endSequences,
IToken token)
Constructor not using the stopping character array.
|
NestedEndTokenRule(java.lang.String startSequence,
java.lang.String[] openingTokens,
java.lang.String[] endSequences,
IToken token,
int openingTokenCounterStart)
Constructor not using the stopping character array.
|
Modifier and Type | Method and Description |
---|---|
protected IToken |
doEvaluate(ICharacterScanner scanner,
boolean resume) |
protected boolean |
endSequenceDetected(ICharacterScanner scanner)
Returns whether the end sequence was detected.
|
protected boolean |
startSequenceDetected(ICharacterScanner scanner,
boolean eofAllowed)
checks if we have found a start sequence.
In opposit to the superclass implementation, this one makes sure that the start sequence is not part of a longer string. |
protected java.util.List<char[]> fEndSequences
public NestedEndTokenRule(java.lang.String startSequence, java.lang.String[] openingTokens, java.lang.String[] endSequences, char[] stoppers, IToken token, int openingTokenCounterStart)
startSequence
- The token start sequenceopeningTokens
- A String array defining the start tokens for the nesting token match.endSequences
- The token end sequencesstoppers
- char array of stopping characters (only if there no 'open' braces)token
- The token to be processed.openingTokenCounterStart
- 0 or 1, depending on wheather there is an initial
opening token like '{'
or not (e.g. for #macro, #while...
statements)public NestedEndTokenRule(java.lang.String startSequence, java.lang.String[] openingTokens, java.lang.String[] endSequences, IToken token)
startSequence
- The token start sequenceopeningTokens
- A String array defining the start tokens for the nesting token match.endSequences
- The token end sequencestoken
- The token to be processed.public NestedEndTokenRule(java.lang.String startSequence, java.lang.String[] openingTokens, java.lang.String[] endSequences, IToken token, int openingTokenCounterStart)
startSequence
- The token start sequenceopeningTokens
- A String array defining the start tokens for the nesting token match.endSequences
- The token end sequencestoken
- The token to be processed.openingTokenCounterStart
- 0 or 1, depending on wheather there is an initial
opening token like '{'
or not (e.g. for #macro, #while...
statements)protected IToken doEvaluate(ICharacterScanner scanner, boolean resume)
org.eclipse.jface.text.rules.PatternRule#doEvaluate(org.eclipse.jface.text.rules.ICharacterScanner, boolean)
protected boolean startSequenceDetected(ICharacterScanner scanner, boolean eofAllowed)
scanner
- The scanner being processedeofAllowed
- true
if EOF
terminates the
token, false
otherwise.true
if a start sequence is dedected,
false
otherwise.protected boolean endSequenceDetected(ICharacterScanner scanner)
true
if the
rule breaks on the end of the line, or if the EOF character is read.scanner
- the character scanner to be usedtrue
if the end sequence has been detected