本文整理汇总了Java中com.intellij.lexer.LexerPosition类的典型用法代码示例。如果您正苦于以下问题:Java LexerPosition类的具体用法?Java LexerPosition怎么用?Java LexerPosition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LexerPosition类属于com.intellij.lexer包,在下文中一共展示了LexerPosition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restore
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Override
public void restore(@NotNull LexerPosition position) {
final Position p = (Position)position;
myBaseLexer.restore(p.getBasePosition());
final LexerPosition templatePos = p.getTemplatePosition();
if (templatePos != null && templatePos.getOffset() < myTemplateLexer.getBufferEnd()) {
myTemplateLexer.restore(templatePos);
}
else {
setupTemplateToken();
}
}
示例2: lookingAt
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
private static boolean lookingAt(Lexer lexer, TokenSet tokenSet) {
final LexerPosition position = lexer.getCurrentPosition();
try {
lexer.advance();
skipWhitespaceAnComments(lexer);
return tokenSet.contains(lexer.getTokenType());
} finally {
lexer.restore(position);
}
}
示例3: load
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
public void load(@Nonnull final com.igormaznitsa.mindmap.model.parser.MindMapLexer.LexerPosition position) {
if (this.pos == null) {
this.pos = position.makeCopy();
} else {
this.pos.set(position);
}
}
示例4: restore
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Override
public void restore(@NotNull LexerPosition lexerPosition) {
currentOffset = lexerPosition.getOffset();
lexemeIndex = lexerPosition.getState();
lexerToken = null;
advance();
}
示例5: restore
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Override
public void restore(LexerPosition position) {
final Position p = (Position)position;
myBaseLexer.restore(p.getBasePosition());
final LexerPosition templatePos = p.getTemplatePosition();
if (templatePos != null && templatePos.getOffset() < myTemplateLexer.getBufferEnd()) {
myTemplateLexer.restore(templatePos);
}
else {
setupTemplateToken();
}
}
示例6: lookAhead
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Override
protected void lookAhead(Lexer baseLexer) {
if (baseLexer.getTokenType() == PPERROR) {
final LexerPosition position = baseLexer.getCurrentPosition();
baseLexer.advance();
while (HaxeTokenTypeSets.WHITESPACES.contains(baseLexer.getTokenType()) ||
HaxeTokenTypeSets.COMMENTS.contains(baseLexer.getTokenType())) {
baseLexer.advance();
}
if (HaxeTokenTypeSets.STRINGS.contains(baseLexer.getTokenType())) {
while (HaxeTokenTypeSets.STRINGS.contains(baseLexer.getTokenType())) {
baseLexer.advance();
}
}
else {
baseLexer.restore(position);
}
advanceAs(baseLexer, PPERROR);
}
else if (baseLexer.getTokenType() == PPIF || baseLexer.getTokenType() == PPELSEIF) {
advanceAs(baseLexer, PPIF);
while (!lookAheadExpressionIsTrue(baseLexer)) {
IElementType elementType = eatUntil(baseLexer, PPEND, PPELSE, PPELSEIF);
if (elementType == PPELSEIF) {
advanceAs(baseLexer, PPBODY);
continue;
}
advanceAs(baseLexer, PPBODY);
break;
}
}
else if (baseLexer.getTokenType() == PPELSE) {
eatUntil(baseLexer, PPEND);
advanceAs(baseLexer, PPELSE);
}
else {
super.lookAhead(baseLexer);
}
}
示例7: getCurrentPosition
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@NotNull
@Override
public LexerPosition getCurrentPosition() {
throw new RuntimeException("Not supported");
}
示例8: restore
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Override
public void restore(@NotNull LexerPosition position) {
throw new RuntimeException("Not supported");
}
示例9: Position
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
public Position(LexerPosition templatePosition, LexerPosition jspPosition) {
myTemplatePosition = templatePosition;
myBasePosition = jspPosition;
}
示例10: getTemplatePosition
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
public LexerPosition getTemplatePosition() {
return myTemplatePosition;
}
示例11: getBasePosition
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
public LexerPosition getBasePosition() {
return myBasePosition;
}
示例12: getCurrentPosition
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@NotNull
@Override
public LexerPosition getCurrentPosition() {
return new Position(myTemplateLexer.getCurrentPosition(), myBaseLexer.getCurrentPosition());
}
示例13: save
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
public void save(@Nonnull final com.igormaznitsa.mindmap.model.parser.MindMapLexer.LexerPosition position) {
position.set(this.pos);
}
示例14: getCurrentPosition
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Nonnull
@Override
public LexerPosition getCurrentPosition() {
this.pos.load(this.delegate.getCurrentPosition());
return this.pos;
}
示例15: restore
import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Override
public void restore(@Nonnull LexerPosition position) {
this.pos.save(this.delegate.getCurrentPosition());
}