gpt4 book ai didi

org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.yyreset()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 08:47:31 24 4
gpt4 key购买 nike

本文整理了Java中org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker.yyreset()方法的一些代码示例,展示了YamlTokenMaker.yyreset()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlTokenMaker.yyreset()方法的具体详情如下:
包路径:org.fife.ui.rsyntaxtextarea.modes.YamlTokenMaker
类名称:YamlTokenMaker
方法名:yyreset

YamlTokenMaker.yyreset介绍

[英]Resets the scanner to read from a new input stream. Does not close the old reader. All internal variables are reset, the old input stream cannot be reused (internal buffer is discarded and lost). Lexical state is set to YY_INITIAL.
[中]将扫描仪重置为从新的输入流中读取。不会关闭旧的阅读器。所有内部变量都被重置,旧的输入流无法重用(内部缓冲区被丢弃并丢失)。词法状态设置为YY_INITIAL。

代码示例

代码示例来源:origin: bobbylight/RSyntaxTextArea

/**
 * Returns the first token in the linked list of tokens generated
 * from <code>text</code>.  This method must be implemented by
 * subclasses so they can correctly implement syntax highlighting.
 *
 * @param text The text from which to get tokens.
 * @param initialTokenType The token type we should start with.
 * @param startOffset The offset into the document at which
 *        <code>text</code> starts.
 * @return The first <code>Token</code> in a linked list representing
 *         the syntax highlighted text.
 */
@Override
public Token getTokenList(Segment text, int initialTokenType, int startOffset) {
  resetTokenList();
  this.offsetShift = -text.offset + startOffset;
  // Start off in the proper state.
  int state = YYINITIAL;
  s = text;
  try {
    yyreset(zzReader);
    yybegin(state);
    return yylex();
  } catch (IOException ioe) {
    ioe.printStackTrace();
    return new TokenImpl();
  }
}

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

/**
 * Returns the first token in the linked list of tokens generated
 * from <code>text</code>.  This method must be implemented by
 * subclasses so they can correctly implement syntax highlighting.
 *
 * @param text The text from which to get tokens.
 * @param initialTokenType The token type we should start with.
 * @param startOffset The offset into the document at which
 *        <code>text</code> starts.
 * @return The first <code>Token</code> in a linked list representing
 *         the syntax highlighted text.
 */
@Override
public Token getTokenList(Segment text, int initialTokenType, int startOffset) {
  resetTokenList();
  this.offsetShift = -text.offset + startOffset;
  // Start off in the proper state.
  int state = YYINITIAL;
  s = text;
  try {
    yyreset(zzReader);
    yybegin(state);
    return yylex();
  } catch (IOException ioe) {
    ioe.printStackTrace();
    return new TokenImpl();
  }
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com