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


Java LexerRestartInfo.state方法代码示例

本文整理汇总了Java中org.netbeans.spi.lexer.LexerRestartInfo.state方法的典型用法代码示例。如果您正苦于以下问题:Java LexerRestartInfo.state方法的具体用法?Java LexerRestartInfo.state怎么用?Java LexerRestartInfo.state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.spi.lexer.LexerRestartInfo的用法示例。


在下文中一共展示了LexerRestartInfo.state方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
SLexer (
    Language                    language, 
    Map<Integer,STokenId>       tokenIDToType,
    LexerRestartInfo<STokenId>  info
) {
    this.language = language;
    this.tokenFactory = info.tokenFactory ();
    this.tokenIDToType = tokenIDToType;
    this.state = info.state ();
    parser = language.getParser ();
    String outerMimeType = info.languagePath ().language (0).mimeType ();
    try {
        Language outerLanguage = LanguagesManager.getDefault ().
            getLanguage (outerMimeType);
        this.input = createInputBridge (info.input (), outerLanguage);
    } catch (ParseException ex) {
        this.input = createInputBridge (info.input (), Language.create (outerMimeType));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:SLexer.java

示例2: HtmlLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public HtmlLexer(LexerRestartInfo<HTMLTokenId> info) {
    this.input = info.input();
    this.tokenFactory = info.tokenFactory();
    if (info.state() == null) {
        this.lexerSubState = INIT;
        this.lexerState = INIT;
        this.lexerEmbeddingState = INIT;
        this.customELIndex = INIT;
        this.quoteType = false;
    } else {
        CompoundState cs = (CompoundState) info.state();
        lexerState = cs.lexerState;
        lexerSubState = cs.lexerSubState;
        lexerEmbeddingState = cs.lexerEmbeddingState;
        attribute = cs.attribute;
        tag = cs.tag;
        customELIndex = cs.customELIndex;
        quoteType = cs.quoteType;
    }

    InputAttributes inputAttributes = info.inputAttributes();
    if (inputAttributes != null) {
        cssClassTagAttrMap = (Map<String, Collection<String>>)inputAttributes.getValue(
                LanguagePath.get(HTMLTokenId.language()), CSS_CLASS_MAP_PROPERTY_KEY); //NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:HtmlLexer.java

示例3: ProtobufEditorLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
/**
 * @requires info != null
 * @effects Makes this be a new Protobuf editor lexer with 'info'.
 */
ProtobufEditorLexer(LexerRestartInfo<ProtobufTokenId> info) {
    Assert.notNull(info);

    this.info = info;

    this.lexer =
            new ProtobufLexer(
                    new AntlrCharStream(info.input(), SOURCE_NAME));
    this.lexer.setChannel(ProtobufLexer.HIDDEN);

    AntlrLexerState state = (AntlrLexerState) info.state();

    if (state != null) {
        state.apply(lexer);
    }
}
 
开发者ID:mwillema,项目名称:protobuf-netbeans-plugin,代码行数:21,代码来源:ProtobufEditorLexer.java

示例4: DockerfileLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
DockerfileLexer(@NonNull final LexerRestartInfo<DockerfileTokenId> info) {
    this.input = info.input();
    this.tokenFactory = info.tokenFactory();
    Object restoredState = info.state();
    if (restoredState instanceof Integer) {
        state = (Integer) restoredState;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:DockerfileLexer.java

示例5: JavaLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public JavaLexer(LexerRestartInfo<JavaTokenId> info) {
    this.input = info.input();
    this.tokenFactory = info.tokenFactory();
    this.state = (Integer) info.state();
    if (state == null) {
        Supplier<String> fileName = (Supplier<String>)info.getAttributeValue("fileName"); //NOI18N
        if (fileName != null && "module-info.java".equals(fileName.get())) { //NOI18N
            state = 1; // parsing module info
        }
    }
    
    Integer ver = (Integer)info.getAttributeValue("version"); //NOI18N
    this.version = (ver != null) ? ver.intValue() : 9; // TODO: Java 1.8 used by default        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:JavaLexer.java

示例6: JShellLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public JShellLexer(LexerRestartInfo<JShellToken> info) {
    this.input = info.input();
    this.tokenFactory = info.tokenFactory();
    Object s = info.state();
    if (s != null) {
        LexState ls = (LexState)s;
        this.state = ls.s;
        this.prevState = ls.prev;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:JShellLexer.java

示例7: YamlLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
/**
 * A Lexer for ruby strings
 *
 * @param substituting If true, handle substitution rules for double quoted
 * strings, otherwise single quoted strings.
 */
public YamlLexer(LexerRestartInfo<YamlTokenId> info) {
    this.input = info.input();
    this.tokenFactory = info.tokenFactory();
    if (info.state() == null) {
        this.state = ISI_WHITESPACE;
    } else {
        state = ((Integer) info.state()).intValue();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:YamlLexer.java

示例8: DTDLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public DTDLexer(LexerRestartInfo<DTDTokenId> info) {
    this.input = info.input();
    if (info.state() == null) {
        state = ISI_INIT;
        substate = 0;
    } else {
        int s = (Integer)info.state();
        this.state = s & 0x0f;
        this.substate = (s >> 4) & 0x0f;
        this.intrSubstate = (s >> 16) & 0xff;
    }
    this.tokenFactory = info.tokenFactory();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:DTDLexer.java

示例9: XhtmlElLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public XhtmlElLexer(LexerRestartInfo<XhtmlElTokenId> info) {
    this.input = info.input();
    this.inputAttributes = info.inputAttributes();
    this.tokenFactory = info.tokenFactory();
    if (info.state() == null) {
        lexerState = INIT;
        lexerCurlyNestedLevel = 0;
    } else {
        CompoundState cs = (CompoundState) info.state();
        lexerState = cs.lexerState;
        lexerCurlyNestedLevel = cs.lexerCurlyNestedLevel;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:XhtmlElLexer.java

示例10: StateLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
StateLexer(LexerRestartInfo<StateTokenId> info) {
    this.input = info.input();
    this.tokenFactory = info.tokenFactory();
    this.state = info.state();
    this.info = info;

    this.useIntStates = Boolean.TRUE.equals(info.getAttributeValue("states"));
    Object expectedRestartState = info.getAttributeValue("restartState");
    if (expectedRestartState != null && !expectedRestartState.equals(state)) {
        throw new IllegalStateException("Expected restart state " + expectedRestartState + ", but real is " + state);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:StateLexer.java

示例11: CfgPropsScanner

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public CfgPropsScanner(LexerRestartInfo info) {
    this.input = info.input();
    if (info.state() != null) {
        //reset state
        setState((LexerState) info.state());
    } else {
        zzState = zzLexicalState = YYINITIAL;
        stack.clear();
    }

}
 
开发者ID:AlexFalappa,项目名称:nb-springboot,代码行数:12,代码来源:CfgPropsScanner.java

示例12: ECLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
private ECLexer(LexerRestartInfo<ECTokenId> info) {
    this.info = info;
    AntlrCharStream charStream = new AntlrCharStream(info.input(), "EditorConfig"); // NOI18N
    lexer = new EditorConfigLexer(charStream);
    lexer.removeErrorListeners();
    // TODO add listener
    LexerState lexerMode = (LexerState) info.state();
    if (lexerMode != null) {
        lexer._mode = lexerMode.Mode;
        lexer._modeStack.addAll(lexerMode.Stack);
    }
}
 
开发者ID:junichi11,项目名称:netbeans-editorconfig-editor,代码行数:13,代码来源:ECLexer.java

示例13: ECLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
private ECLexer(LexerRestartInfo<ECTokenId> info) {
  this.info = info;
  AntlrCharStream charStream = new AntlrCharStream(info.input(), "EditorConfig"); // NOI18N
  lexer = new EditorConfigLexer(charStream);
  lexer.removeErrorListeners();
  // TODO add listener
  LexerState lexerMode = (LexerState) info.state();
  if (lexerMode != null) {
    lexer._mode = lexerMode.Mode;
    lexer._modeStack.addAll(lexerMode.Stack);
  }
}
 
开发者ID:welovecoding,项目名称:editorconfig-netbeans,代码行数:13,代码来源:ECLexer.java

示例14: clsEditorLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public clsEditorLexer(LexerRestartInfo<ANTLRTokenId> info) {
    this.info = info;
    ANTLRCharStream charStream = new ANTLRCharStream(info.input(), "editor");
    lexer = new clsLexer(charStream);
    clsLexer.lexerState state = (clsLexer.lexerState) info.state();

    lexer.setLexerState((clsLexer.lexerState) info.state());
}
 
开发者ID:daimor,项目名称:NBStudio,代码行数:9,代码来源:clsEditorLexer.java

示例15: macEditorLexer

import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public macEditorLexer(LexerRestartInfo<ANTLRTokenId> info) {
    this.info = info;
    ANTLRCharStream charStream = new ANTLRCharStream(info.input(), "editor");
    lexer = new macLexer(charStream);
    macLexer.lexerState state = (macLexer.lexerState) info.state();
    
    lexer.setLexerState((macLexer.lexerState) info.state());
}
 
开发者ID:daimor,项目名称:NBStudio,代码行数:9,代码来源:macEditorLexer.java


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