本文整理匯總了Java中org.eclipse.jface.text.rules.Token.UNDEFINED屬性的典型用法代碼示例。如果您正苦於以下問題:Java Token.UNDEFINED屬性的具體用法?Java Token.UNDEFINED怎麽用?Java Token.UNDEFINED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.jface.text.rules.Token
的用法示例。
在下文中一共展示了Token.UNDEFINED屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: evaluate
@Override
public IToken evaluate(ICharacterScanner scanner1, boolean resume) {
if (!(scanner1 instanceof BatchDocumentPartitionScanner)){
return Token.UNDEFINED;
}
BatchDocumentPartitionScanner scanner = (BatchDocumentPartitionScanner)scanner1;
if (scanner.getOffset()<ECHO.length()){
/* would be a problem on start on going back...*/
return Token.UNDEFINED;
}
scanner.unread(); // go to character before
int charBeforeAsInt = scanner.read(); // get character, moves to origin pos again
/* fast guard closing:*/
if (charBeforeAsInt!='o' && charBeforeAsInt!='O'){ // echo ECHO <- last character must be an o other wise guard close...
return Token.UNDEFINED;
}
ICharacterScannerCodePosSupport codePosSupport = new ICharacterScannerCodePosSupport(scanner);
if (parserSupport.isAfterEchoHandled(codePosSupport)){
return getSuccessToken();
}
codePosSupport.resetToStartPos();
return Token.UNDEFINED;
}
示例2: evaluate
@Override
public IToken evaluate(ICharacterScanner scanner, boolean resume) {
int r = scanner.read();
scanner.unread();
/* fast guard closing:*/
if (ICharacterScanner.EOF==r || r!='<'){
return Token.UNDEFINED;
}
ICharacterScannerCodePosSupport codePosSupport = new ICharacterScannerCodePosSupport(scanner);
if (hereStringSupport.isHereStringStateHandled(codePosSupport)){
return getSuccessToken();
}
codePosSupport.resetToStartPos();
return Token.UNDEFINED;
}
示例3: evaluate
@Override
public IToken evaluate(ICharacterScanner scanner, boolean resume) {
int r = scanner.read();
scanner.unread();
/* fast guard closing:*/
if (ICharacterScanner.EOF==r || r!='<'){
return Token.UNDEFINED;
}
ICharacterScannerCodePosSupport codePosSupport = new ICharacterScannerCodePosSupport(scanner);
if (hereDocSupport.isHereDocStateHandled(codePosSupport)){
return getSuccessToken();
}
codePosSupport.resetToStartPos();
return Token.UNDEFINED;
}
示例4: doEvaluate
@Override
protected IToken doEvaluate(final ICharacterScanner scanner, final boolean resume) {
if (resume) {
if (this.endSequenceDetected(scanner)) {
return this.fToken;
}
} else {
final int c = scanner.read();
if (c == this.fStartSequence[0]) {
if (this.sequenceDetected(scanner, this.fStartSequence, false)) {
if (this.endSequenceDetected(scanner)) {
return this.fToken;
}
}
}
}
scanner.unread();
return Token.UNDEFINED;
}
示例5: evaluate
public IToken evaluate( ICharacterScanner scanner){
buffer.setLength(0);
int c = read(scanner);
if (c == '&') {
int i = 0;
do {
c = read(scanner);
i++;
if (c == '<' || c == ']') {
for (int j = i - 1; j > 0; j--)
scanner.unread();
return Token.UNDEFINED;
}
} while (c != ';');
return fToken;
}
scanner.unread();
return Token.UNDEFINED;
}
示例6: evaluate
@Override
public IToken evaluate(ICharacterScanner scanner, boolean resume) {
if (fColumn == UNDEFINED) return doEvaluate(scanner, resume);
int c = scanner.read();
scanner.unread();
if (c == fStartSequence[0]) {
int col = scanner.getColumn();
if (col == 1) {
scanner.unread();
int p = scanner.read();
if (p == '\n') col = 0;
}
return (fColumn == col ? doEvaluate(scanner, resume) : Token.UNDEFINED);
}
return Token.UNDEFINED;
}
示例7: doEvaluate
/**
* Does the actual evaluation of the stream.
*
* @param scanner The scanner
* @param count The initial count of {
* @return <code>fToken</code> on success, <code>Token.UNDEFINED</code> if
* the match doesn't succeed
*/
private IToken doEvaluate(ICharacterScanner scanner, int count) {
boolean inString = false;
int c = scanner.read();
if (((char) c) == '{') {
do {
c = scanner.read();
if (((char) c) == '{' && !inString)
count++;
else if (((char) c) == '}' && !inString)
count--;
else if (((char) c) == '"' && !inString)
inString = true;
else if (((char) c) == '"' && inString)
inString = false;
else if (c == ICharacterScanner.EOF)
return Token.UNDEFINED;
} while (count > 0);
return fToken;
}
scanner.unread();
return Token.UNDEFINED;
}
示例8: evaluate
public IToken evaluate(ICharacterScanner scanner) {
int count = 0;
int charsRead = 0;
int c = scanner.read();
if (((char) c) == '"') {
do {
c = scanner.read();
charsRead++;
if (c == ICharacterScanner.EOF) {
unwind(scanner, charsRead);
return Token.UNDEFINED;
} else if (((char) c) == '{') {
count++;
} else if (((char) c) == '}') {
if (count == 0) {
unwind(scanner, charsRead);
return Token.UNDEFINED;
}
count--;
}
} while (((char) c) != '"');
return fToken;
}
scanner.unread();
return Token.UNDEFINED;
}
示例9: evaluate
@Override
public IToken evaluate(ICharacterScanner scanner) {
int col = scanner.getColumn();
if (col == 1) {
scanner.unread();
int p = scanner.read();
if (p == '\n') col = 0;
}
try {
if (col == 0) {
String text = getScanText(scanner);
if (tagStarts(text)) {
gotoEOB(scanner);
return getSuccessToken();
}
}
} catch (BadLocationException e) {
Log.error("HtmlCodeRule", e);
}
return Token.UNDEFINED;
}
示例10: evaluate
public IToken evaluate(ICharacterScanner scanner) {
buffer.setLength(0);
charsRead = 0;
int c = read(scanner);
if (c == matchString.charAt(0)) {
do {
c = read(scanner);
} while (isOK((char) c));
if (charsRead == matchString.length()) {
return fToken;
} else {
rewind(scanner);
return Token.UNDEFINED;
}
}
scanner.unread();
return Token.UNDEFINED;
}
示例11: doEvaluate
protected IToken doEvaluate(ICharacterScanner scanner, boolean resume) {
if (resume) {
if (endSequenceDetected(scanner))
return fToken;
} else {
int c= scanner.read();
if (c == fStartSequence[0]) {
scanner.unread();
scanner.unread();
int before = scanner.read();
if (before=='\\'){
return Token.UNDEFINED;
}
scanner.read();
if (sequenceDetected(scanner, fStartSequence, false)) {
if (endSequenceDetected(scanner))
return fToken;
}
}
}
scanner.unread();
return Token.UNDEFINED;
}
示例12: evaluate
@Override
public IToken evaluate(ICharacterScanner scanner, boolean resume) {
char start = (char) scanner.read();
if ('-' !=start) {
scanner.unread();
return Token.UNDEFINED;
}
/* check if the former character is a space - if not this is not an argument */
scanner.unread();
scanner.unread();
char beforeStart = (char) scanner.read();
if (' ' !=beforeStart){
/* no unread necessary, scanner is at start start*/
return Token.UNDEFINED;
}
/* go after start again*/
scanner.read();
/* okay could be a parameter*/
do {
char c = (char) scanner.read();
if (! isPartOfParameter(c)) {
scanner.unread();
break;
}
} while (true);
return getSuccessToken();
}
示例13: evaluate
@Override
public IToken evaluate(final ICharacterScanner scanner) {
final int c = scanner.read();
if (c == '[' || c == ']') {
return this.token;
}
scanner.unread();
return Token.UNDEFINED;
}
示例14: evaluate
@Override
public IToken evaluate(final ICharacterScanner scanner) {
final int c = scanner.read();
if (c == '(' || c == ')') {
return this.token;
}
scanner.unread();
return Token.UNDEFINED;
}
示例15: evaluate
@Override
public IToken evaluate(final ICharacterScanner scanner) {
final int c = scanner.read();
if (c == this.specChar) {
return this.token;
}
scanner.unread();
return Token.UNDEFINED;
}