Examples of ClojureFlexLexer


Examples of org.jetbrains.plugins.clojure.lexer.ClojureFlexLexer

* @author ilyas
*/
public class ClojureIndexPatternBuilder implements IndexPatternBuilder {
  public Lexer getIndexingLexer(PsiFile file) {
    if (file instanceof ClojureFile) {
      return new ClojureFlexLexer();
    }
    return null;
  }
View Full Code Here

Examples of org.jetbrains.plugins.clojure.lexer.ClojureFlexLexer

*/
public class ClojureFindUsagesProvider implements FindUsagesProvider{

  @Nullable
  public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(new ClojureFlexLexer(),
            ClojureTokenTypes.IDENTIFIERS, ClojureTokenTypes.COMMENTS, ClojureTokenTypes.STRINGS);
  }
View Full Code Here

Examples of org.jetbrains.plugins.clojure.lexer.ClojureFlexLexer

  public ElementPattern<? extends PsiElement> getPattern() {
    return new ClojureSymbolPattern();
  }

  public boolean isInputValid(String newName, PsiElement element, ProcessingContext context) {
    final ClojureFlexLexer lexer = new ClojureFlexLexer();
    lexer.start(newName, 0, newName.length(), 0);
    if (lexer.getTokenType() != ClojureTokenTypes.symATOM) return false;
    lexer.advance();
    return lexer.getTokenType() == null;
  }
View Full Code Here

Examples of org.jetbrains.plugins.clojure.lexer.ClojureFlexLexer

public class ClojureNamesUtil {

  public static boolean isIdentifier(String text) {
    ApplicationManager.getApplication().assertReadAccessAllowed();
    if (text == null) return false;
    Lexer lexer = new ClojureFlexLexer();
    lexer.start(text, 0, text.length(), 0);
    if (lexer.getTokenType() != ClojureTokenTypes.symATOM) return false;
    lexer.advance();
    return lexer.getTokenType() == null;
  }
View Full Code Here

Examples of org.jetbrains.plugins.clojure.lexer.ClojureFlexLexer

* @author ilyas
*/
public class ClojureNameValidator extends LanguageExtensionPoint<NamesValidator> implements NamesValidator {

  public boolean isKeyword(String name, Project project) {
    final ClojureFlexLexer lexer = new ClojureFlexLexer();
    lexer.start(name, 0, name.length(), 0);
    if (!ClojureTokenTypes.KEYWORDS.contains(lexer.getTokenType())) return false;
    lexer.advance();
    return lexer.getTokenType() == null;
  }
View Full Code Here

Examples of org.jetbrains.plugins.clojure.lexer.ClojureFlexLexer

    lexer.advance();
    return lexer.getTokenType() == null;
  }

  public boolean isIdentifier(String name, Project project) {
    final ClojureFlexLexer lexer = new ClojureFlexLexer();
    lexer.start(name, 0, name.length(), 0);
    if (!ClojureTokenTypes.IDENTIFIERS.contains(lexer.getTokenType())) return false;
    lexer.advance();
    return lexer.getTokenType() == null;
  }
View Full Code Here

Examples of org.jetbrains.plugins.clojure.lexer.ClojureFlexLexer

*/
public class ClojureParserDefinition implements ParserDefinition {

  @NotNull
  public Lexer createLexer(Project project) {
    return new ClojureFlexLexer();
  }
View Full Code Here

Examples of org.jetbrains.plugins.clojure.lexer.ClojureFlexLexer

  public static final IElementType FIRST_LIST_ELEMENT = new ClojureElementType("first list element");
 
  @NotNull
  public Lexer getHighlightingLexer() {
    return new LookAheadLexer(new ClojureFlexLexer()) {
      @Override
      protected void lookAhead(Lexer baseLexer) {
        if (baseLexer.getTokenType() == ClojureElementTypes.LEFT_PAREN) {
          advanceAs(baseLexer, ClojureElementTypes.LEFT_PAREN);
          while (ClojureTokenTypes.symS.contains(baseLexer.getTokenType())) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.