本文整理汇总了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));
}
}
示例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
}
}
示例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);
}
}
示例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;
}
}
示例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
}
示例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;
}
}
示例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();
}
}
示例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();
}
示例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;
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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());
}
示例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());
}