Examples of ErlangLexer


Examples of org.intellij.erlang.parser.ErlangLexer

  @Override
  public WordsScanner getWordsScanner() {
    return new WordsScanner() {
      @Override
      public void processWords(CharSequence fileText, Processor<WordOccurrence> processor) {
        ErlangLexer lexer = new ErlangLexer();
        lexer.start(fileText);
        IElementType tokenType;
        while ((tokenType = lexer.getTokenType()) != null) {
          //TODO process occurrences in string literals and comments
          if (tokenType == ErlangTypes.ERL_ATOM_NAME || tokenType == ErlangTypes.ERL_VAR) {
            int tokenStart = lexer.getTokenStart();
            for (TextRange wordRange : StringUtil.getWordIndicesIn(lexer.getTokenText())) {
              int start = tokenStart + wordRange.getStartOffset();
              int end = tokenStart + wordRange.getEndOffset();
              processor.process(new WordOccurrence(fileText, start, end, WordOccurrence.Kind.CODE));
            }
          }
          lexer.advance();
        }
      }
    };
  }
View Full Code Here

Examples of org.intellij.erlang.parser.ErlangLexer

  public static final TokenSet LITERALS = TokenSet.create(ErlangTypes.ERL_STRING);

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

Examples of org.intellij.erlang.parser.ErlangLexer

  public static final TextAttributesKey MODULE_REF    = createTextAttributesKey("ERL_MODULE_REF", DefaultLanguageHighlighterColors.CLASS_NAME);

  @NotNull
  @Override
  public Lexer getHighlightingLexer() {
    return new ErlangLexer();
  }
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.