Tabnine Logo
Lexer.getTokenStart
Code IndexAdd Tabnine to your IDE (free)

How to use
getTokenStart
method
in
com.intellij.lexer.Lexer

Best Java code snippets using com.intellij.lexer.Lexer.getTokenStart (Showing top 7 results out of 315)

origin: KronicDeth/intellij-elixir

public int getTokenStart() {
  return lexer().getTokenStart();
}
origin: KronicDeth/intellij-elixir

private void restoreElixirPosition(@Nullable LexerPosition elixirPosition) {
  if (elixirPosition != null) {
    elixirLexer.start(getBufferSequence(), eexLexer.getTokenStart(), eexLexer.getTokenEnd());
    elixirLexer.restore(elixirPosition);
  }
}
origin: KronicDeth/intellij-elixir

public void advance() {
  if (eexLexer.getTokenType() == ELIXIR) {
    elixirLexer.advance();
    if (elixirLexer.getTokenType() == null) {
      eexLexer.advance();
    }
  } else {
    eexLexer.advance();
    if (eexLexer.getTokenType() == ELIXIR) {
      // start automatically does equivalent of `advance` since `elixirLexer` is also a look-ahead lexer
      elixirLexer.start(getBufferSequence(), eexLexer.getTokenStart(), eexLexer.getTokenEnd());
    }
  }
}
origin: BashSupport/BashSupport

@Override
public int getTokenStart() {
  int tokenStart = myDelegate.getTokenStart();
  if (!afterPrefix && tokenStart == 0) {
    return 0;
  }
  if (afterEOF) {
    return prefix.length() + suffix.length() + tokenStart;
  }
  return prefix.length() + tokenStart;
}
origin: Camelcade/Perl5-IDEA

 private void lexToken(Lexer lexer) {
  myTokenType = lexer.getTokenType();
  if (myTokenType == LEFT_BRACE_CODE_START) {
   myTokenType = LEFT_BRACE;
  }
  myTokenStart = lexer.getTokenStart();
  myState = lexer.getState();
  myTokenEnd = lexer.getTokenEnd();
  lexer.advance();
 }
}
origin: BashSupport/BashSupport

final String tokenText = lexer.getTokenText();
int tokenStart = lexer.getTokenStart();
int tokenEnd = lexer.getTokenEnd();
int realLength = tokenEnd - tokenStart;
origin: BashSupport/BashSupport

@Test
public void testEmptyDelegate() throws Exception {
  String prefix = "prefix ";
  String suffix = " suffix";
  PrefixSuffixAddingLexer lexer = new PrefixSuffixAddingLexer(new EmptyLexer(), prefix, BashTokenTypes.STRING2, suffix, BashTokenTypes.STRING2);
  assertPosition(lexer, 0, prefix.length(), 0, BashTokenTypes.STRING2, prefix);
  lexer.advance();
  assertPosition(lexer, prefix.length(), prefix.length() + suffix.length(), 0, BashTokenTypes.STRING2, suffix);
  //after the first advance the delegate must still be at initial position
  Assert.assertEquals(0, lexer.getDelegate().getTokenStart());
  lexer.advance();
  Assert.assertNull(lexer.getTokenType());
  assertPosition(lexer, prefix.length() + suffix.length(), prefix.length() + suffix.length(), 0, null, "");
}
com.intellij.lexerLexergetTokenStart

Popular methods of Lexer

  • start
  • advance
  • getBufferEnd
  • getTokenEnd
  • getTokenType
  • getBufferSequence
  • getState
  • restore
  • getCurrentPosition
  • getTokenSequence
  • getTokenText
  • getTokenText

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • BoxLayout (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now