当前位置: 首页>>代码示例>>Java>>正文


Java LexerPosition类代码示例

本文整理汇总了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();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:TemplateBlackAndWhiteLexer.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:XPathLexer.java

示例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);
  }
}
 
开发者ID:raydac,项目名称:netbeans-mmd-plugin,代码行数:8,代码来源:MMLexer.java

示例4: restore

import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Override
public void restore(@NotNull LexerPosition lexerPosition) {
    currentOffset = lexerPosition.getOffset();
    lexemeIndex = lexerPosition.getState();
    lexerToken = null;
    advance();
}
 
开发者ID:vsch,项目名称:idea-multimarkdown,代码行数:8,代码来源:MultiMarkdownLexer.java

示例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();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:TemplateBlackAndWhiteLexer.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:40,代码来源:HaxeLexer.java

示例7: getCurrentPosition

import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@NotNull
@Override
public LexerPosition getCurrentPosition() {
    throw new RuntimeException("Not supported");
}
 
开发者ID:vermut,项目名称:intellij-snakeyaml,代码行数:6,代码来源:YamlLexer.java

示例8: restore

import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Override
public void restore(@NotNull LexerPosition position) {
    throw new RuntimeException("Not supported");
}
 
开发者ID:vermut,项目名称:intellij-snakeyaml,代码行数:5,代码来源:YamlLexer.java

示例9: Position

import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
public Position(LexerPosition templatePosition, LexerPosition jspPosition) {
  myTemplatePosition = templatePosition;
  myBasePosition = jspPosition;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:TemplateBlackAndWhiteLexer.java

示例10: getTemplatePosition

import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
public LexerPosition getTemplatePosition() {
  return myTemplatePosition;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:TemplateBlackAndWhiteLexer.java

示例11: getBasePosition

import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
public LexerPosition getBasePosition() {
  return myBasePosition;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:TemplateBlackAndWhiteLexer.java

示例12: getCurrentPosition

import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@NotNull
@Override
public LexerPosition getCurrentPosition() {
  return new Position(myTemplateLexer.getCurrentPosition(), myBaseLexer.getCurrentPosition());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:TemplateBlackAndWhiteLexer.java

示例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);
}
 
开发者ID:raydac,项目名称:netbeans-mmd-plugin,代码行数:4,代码来源:MMLexer.java

示例14: getCurrentPosition

import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Nonnull
@Override
public LexerPosition getCurrentPosition() {
  this.pos.load(this.delegate.getCurrentPosition());
  return this.pos;
}
 
开发者ID:raydac,项目名称:netbeans-mmd-plugin,代码行数:7,代码来源:MMLexer.java

示例15: restore

import com.intellij.lexer.LexerPosition; //导入依赖的package包/类
@Override
public void restore(@Nonnull LexerPosition position) {
  this.pos.save(this.delegate.getCurrentPosition());
}
 
开发者ID:raydac,项目名称:netbeans-mmd-plugin,代码行数:5,代码来源:MMLexer.java


注:本文中的com.intellij.lexer.LexerPosition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。