/** * {@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; }
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); }
@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(); }
public Class<? extends Lexer> bindLexer() { return InternalPkmntcgoLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalPkmntcgoLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalTypesLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalTypesLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalRegularExpressionLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalRegularExpressionLexer.class); }
/** * Create a new lexer for the given input. */ protected TokenSource createLexer(CharStream stream) { Lexer lexer = lexerProvider.get(); lexer.setCharStream(stream); return lexer; }
public Class<? extends Lexer> bindLexer() { return InternalN4JSLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalN4JSLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalN4MFLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalN4MFLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalMyDslLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalMyDslLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalBromiumLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalBromiumLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalDSLPoliciesLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalDSLPoliciesLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalLcDslLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalLcDslLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalDslLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalDslLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalRestauranteLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalRestauranteLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalOCCILexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalOCCILexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalCommentAssociationTestLanguageLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalPureXbaseLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalXbaseLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalFowlerDslTestLanguageLexer.class); }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalExUnorderedGroupsTestLanguageLexer.class); }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalXbaseWithAnnotationsLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalXtypeLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalXtypeLexer.class); }
public Class<? extends Lexer> bindLexer() { return InternalRefactoringTestLanguageLexer.class; }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalRefactoringTestLanguageLexer.class); }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalXtextTerminalsTestLanguageLexer.class); }
public void configureRuntimeLexer(Binder binder) { binder.bind(Lexer.class) .annotatedWith(Names.named(LexerBindings.RUNTIME)) .to(InternalRefactoringTestLanguage1Lexer.class); }