本文整理汇总了Java中org.netbeans.spi.lexer.LexerRestartInfo.input方法的典型用法代码示例。如果您正苦于以下问题:Java LexerRestartInfo.input方法的具体用法?Java LexerRestartInfo.input怎么用?Java LexerRestartInfo.input使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.spi.lexer.LexerRestartInfo
的用法示例。
在下文中一共展示了LexerRestartInfo.input方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: FTLLexer
import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public FTLLexer(LexerRestartInfo<FTLTokenId> info) {
this.info = info;
final LexerInput input = info.input();
InputStream istream = new InputStream() {
@Override
public int read() throws IOException {
int result = input.read();
//debug("read " + result);
//if (result == LexerInput.EOF) {
// throw new IOException("LexerInput EOF");
//}
return result;
}
};
SimpleCharStream stream = new SimpleCharStream(istream);
fmParserTokenManager = new FMParserWSTokenManager(stream);
}
示例3: JPQLLexer
import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
JPQLLexer(LexerRestartInfo<JPQLTokenId> info) {
this.info = info;
this.input = info.input();
this.tokenFactory = info.tokenFactory();
//JavaCharStream stream = new JavaCharStream(info.input());
//javaParserTokenManager = new JavaParserTokenManager(stream);
}
示例4: 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
}
示例5: 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);
}
}
示例6: TestLexer
import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
TestLexer(LexerRestartInfo<TestTokenId> info) {
this.input = info.input();
this.tokenFactory = info.tokenFactory();
assert (info.state() == null); // never set to non-null value in state()
Integer ver = (Integer)info.getAttributeValue("version");
this.version = (ver != null) ? ver.intValue() : 2;
}
示例7: 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();
}
}
示例8: 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);
}
}
示例9: 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);
}
}
示例10: 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());
}
示例11: 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());
}
示例12: xdataEditorLexer
import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public xdataEditorLexer(LexerRestartInfo<ANTLRTokenId> info) {
this.info = info;
ANTLRCharStream charStream = new ANTLRCharStream(info.input(), "editor");
lexer = new xdataLexer(charStream);
// xdataLexer.lexerState state = (xdataLexer.lexerState) info.state();
//
// lexer.setLexerState((xdataLexer.lexerState) info.state());
}
示例13: DeclarativeHintLexer
import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public DeclarativeHintLexer(LexerRestartInfo<DeclarativeHintTokenId> info) {
input = info.input();
fact = info.tokenFactory();
}
示例14: TestLexer
import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public TestLexer(LexerRestartInfo<TestTokenId> info) {
this.input = info.input();
this.factory = info.tokenFactory();
}
示例15: TestHTMLTagLexer
import org.netbeans.spi.lexer.LexerRestartInfo; //导入方法依赖的package包/类
public TestHTMLTagLexer(LexerRestartInfo<TestHTMLTagTokenId> info) {
this.input = info.input();
this.tokenFactory = info.tokenFactory();
assert (info.state() == null); // passed argument always null
}