Java 类org.eclipse.xtext.parser.antlr.Lexer 实例源码

项目:n4js    文件:LazyTokenStream.java   
/**
 * {@inheritDoc}
 */
@Override
public String toString(int start, int stop) {
    if (start < 0 || stop < 0) {
        return null;
    }
    CommonToken startToken = (CommonToken) tokens.get(start);
    CommonToken stopToken = (CommonToken) tokens.get(stop);
    CharStream charStream = ((Lexer) tokenSource).getCharStream();
    String result = charStream.toString().substring(startToken.getStartIndex(), stopToken.getStopIndex());
    return result;
}
项目:xtext-extras    文件:TokenSequencePreservingPartialParsingHelper.java   
protected boolean isSameTokenSequence(String originalText, String newText, int expectedLength) {
    Lexer originalLexer = lexerProvider.get();
    Lexer newLexer = lexerProvider.get();
    originalLexer.setCharStream(new ANTLRStringStream(originalText));
    newLexer.setCharStream(new ANTLRStringStream(newText));
    return isSameTokenSequence(originalLexer, newLexer, expectedLength);
}
项目:xtext-extras    文件:XtextAntlrGeneratorFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    BindFactory binder = new BindFactory();
        binder.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper", "org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper");
        if(getNaming().hasIde()){
            binder.addConfiguredBinding("HighlightingLexer",
                    "binder.bind(" + Lexer.class.getName() + ".class)"+
                    ".annotatedWith(com.google.inject.name.Names.named(" +
                    "org.eclipse.xtext.ide.LexerIdeBindings.HIGHLIGHTING" +
                    ")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
                   .addConfiguredBinding("HighlightingTokenDefProvider",
                    "binder.bind(" + ITokenDefProvider.class.getName() + ".class)"+
                    ".annotatedWith(com.google.inject.name.Names.named(" +
                    "org.eclipse.xtext.ide.LexerIdeBindings.HIGHLIGHTING" +
                    ")).to(" + AntlrTokenDefProvider.class.getName() +".class)");
        } else {
            binder.addConfiguredBinding("HighlightingLexer",
                    "binder.bind(" + Lexer.class.getName() + ".class)"+
                    ".annotatedWith(com.google.inject.name.Names.named(" +
                    "org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
                    ")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
                   .addConfiguredBinding("HighlightingTokenDefProvider",
                    "binder.bind(" + ITokenDefProvider.class.getName() + ".class)"+
                    ".annotatedWith(com.google.inject.name.Names.named(" +
                    "org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
                    ")).to(" + AntlrTokenDefProvider.class.getName() +".class)");
        }
        return binder.getBindings();
}
项目:pokemon-tcgo-deck-generator    文件:AbstractPkmntcgoRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalPkmntcgoLexer.class;
}
项目:pokemon-tcgo-deck-generator    文件:AbstractPkmntcgoRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalPkmntcgoLexer.class);
}
项目:n4js    文件:AbstractTypesRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalTypesLexer.class;
}
项目:n4js    文件:AbstractTypesRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalTypesLexer.class);
}
项目:n4js    文件:AbstractRegularExpressionRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalRegularExpressionLexer.class;
}
项目:n4js    文件:AbstractRegularExpressionRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalRegularExpressionLexer.class);
}
项目:n4js    文件:HighlightingParser.java   
/**
 * Create a new lexer for the given input.
 */
protected TokenSource createLexer(CharStream stream) {
    Lexer lexer = lexerProvider.get();
    lexer.setCharStream(stream);
    return lexer;
}
项目:n4js    文件:AbstractN4JSRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalN4JSLexer.class;
}
项目:n4js    文件:AbstractN4JSRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalN4JSLexer.class);
}
项目:n4js    文件:AbstractN4MFRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalN4MFLexer.class;
}
项目:n4js    文件:AbstractN4MFRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalN4MFLexer.class);
}
项目:Xtext_Xtend_HTML_Generator    文件:AbstractMyDslRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalMyDslLexer.class;
}
项目:Xtext_Xtend_HTML_Generator    文件:AbstractMyDslRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalMyDslLexer.class);
}
项目:bromium    文件:AbstractBromiumRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalBromiumLexer.class;
}
项目:bromium    文件:AbstractBromiumRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalBromiumLexer.class);
}
项目:gw4e.project    文件:AbstractDSLPoliciesRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalDSLPoliciesLexer.class;
}
项目:gw4e.project    文件:AbstractDSLPoliciesRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalDSLPoliciesLexer.class);
}
项目:lcdsl    文件:AbstractLcDslRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalLcDslLexer.class;
}
项目:lcdsl    文件:AbstractLcDslRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalLcDslLexer.class);
}
项目:gemoc-studio    文件:AbstractDslRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalDslLexer.class;
}
项目:gemoc-studio    文件:AbstractDslRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalDslLexer.class);
}
项目:org.xtext.dsl.restaurante    文件:AbstractRestauranteRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalRestauranteLexer.class;
}
项目:org.xtext.dsl.restaurante    文件:AbstractRestauranteRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalRestauranteLexer.class);
}
项目:OCCI-Studio    文件:AbstractOCCIRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalOCCILexer.class;
}
项目:OCCI-Studio    文件:AbstractOCCIRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalOCCILexer.class);
}
项目:xtext-core    文件:AbstractCommentAssociationTestLanguageRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalCommentAssociationTestLanguageLexer.class;
}
项目:xtext-extras    文件:AbstractPureXbaseRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalPureXbaseLexer.class);
}
项目:xtext-extras    文件:AbstractXbaseRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalXbaseLexer.class;
}
项目:xtext-core    文件:AbstractFowlerDslTestLanguageRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalFowlerDslTestLanguageLexer.class);
}
项目:xtext-core    文件:AbstractExUnorderedGroupsTestLanguageRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalExUnorderedGroupsTestLanguageLexer.class);
}
项目:xtext-extras    文件:AbstractXbaseWithAnnotationsRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalXbaseWithAnnotationsLexer.class);
}
项目:xtext-extras    文件:AbstractXtypeRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalXtypeLexer.class;
}
项目:xtext-extras    文件:AbstractXtypeRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalXtypeLexer.class);
}
项目:xtext-extras    文件:AbstractRefactoringTestLanguageRuntimeModule.java   
public Class<? extends Lexer> bindLexer() {
    return InternalRefactoringTestLanguageLexer.class;
}
项目:xtext-extras    文件:AbstractRefactoringTestLanguageRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalRefactoringTestLanguageLexer.class);
}
项目:xtext-core    文件:AbstractXtextTerminalsTestLanguageRuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalXtextTerminalsTestLanguageLexer.class);
}
项目:xtext-extras    文件:AbstractRefactoringTestLanguage1RuntimeModule.java   
public void configureRuntimeLexer(Binder binder) {
    binder.bind(Lexer.class)
        .annotatedWith(Names.named(LexerBindings.RUNTIME))
        .to(InternalRefactoringTestLanguage1Lexer.class);
}