Java Code Examples for com.intellij.lexer.FlexAdapter

The following examples show how to use com.intellij.lexer.FlexAdapter. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: intellij-haskforce   Source File: HaskellParserWrapper.java    License: Apache License 2.0 5 votes vote down vote up
@NotNull
@Override
public ASTNode parse(IElementType root_, PsiBuilder builder_) {
    maxRbraceDebt = -1;
    lastCountedTok = -1;
    regressed = false;
    debtPoints.clear();
    builder_.setTokenTypeRemapper(myRemapper);
    lexer =  (_HaskellParsingLexer) ((FlexAdapter) ((PsiBuilderImpl) builder_).getLexer()).getFlex();
    return super.parse(root_, builder_);
    // return super.parse(root_, new MyDebugPsiBuilderWrapper(builder_));
}
 
Example 2
Source Project: CppTools   Source File: CppFindUsagesProvider.java    License: Apache License 2.0 5 votes vote down vote up
@Nullable
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(
    new FlexAdapter(new _CppLexer(true, false, true, true, true)), // TODO: c/c++ dialects
    TokenSet.create(CppTokenTypes.IDENTIFIER),
    CppTokenTypes.COMMENTS,
    TokenSet.create(CppTokenTypes.STRING_LITERAL)
  );
}
 
Example 3
Source Project: CppTools   Source File: CppHighlighter.java    License: Apache License 2.0 5 votes vote down vote up
@NotNull
public Lexer getHighlightingLexer() {
  return new LayeredLexer( new FlexAdapter(new _CppLexer(true, false, true, true, true)) ) { // TODO: c/c++ dialects
    {
      registerSelfStoppingLayer(new StringLiteralLexer('\"', CppTokenTypes.STRING_LITERAL),
                            new IElementType[]{CppTokenTypes.STRING_LITERAL}, IElementType.EMPTY_ARRAY);

      registerSelfStoppingLayer(new StringLiteralLexer('\'', CppTokenTypes.SINGLE_QUOTE_STRING_LITERAL),
                            new IElementType[]{CppTokenTypes.SINGLE_QUOTE_STRING_LITERAL},
                            IElementType.EMPTY_ARRAY);
    }
  };
}
 
Example 4
Source Project: CppTools   Source File: MakefileFindUsagesProvider.java    License: Apache License 2.0 5 votes vote down vote up
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(
    new FlexAdapter(new _MakefileLexer(true)),
    TokenSet.create(MakefileTokenTypes.IDENTIFIER, MakefileTokenTypes.TARGET_IDENTIFIER,
      MakefileTokenTypes.VAR_DEFINITION, MakefileTokenTypes.VAR_REFERENCE),
    MakefileTokenTypes.COMMENTS,
    MakefileTokenTypes.LITERALS
  );
}
 
Example 5
Source Project: reasonml-idea-plugin   Source File: DuneParserDefinition.java    License: MIT License 4 votes vote down vote up
@NotNull
@Override
public Lexer createLexer(Project project) {
    return new FlexAdapter(new DuneLexer(DuneTypes.INSTANCE));
}
 
Example 6
Source Project: reasonml-idea-plugin   Source File: DuneSyntaxHighlighter.java    License: MIT License 4 votes vote down vote up
@NotNull
@Override
public Lexer getHighlightingLexer() {
    return new FlexAdapter(new DuneLexer(DuneTypes.INSTANCE));
}
 
Example 7
Source Project: nix-idea   Source File: NixParserDefinition.java    License: Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public Lexer createLexer(Project project) {
    NixLexer lxr = new NixLexer((Reader) null);
    return new FlexAdapter(lxr);
}
 
Example 8
Source Project: react-templates-plugin   Source File: RTLexer.java    License: MIT License 4 votes vote down vote up
public RTLexer() {
    super(new FlexAdapter(new _RTLexer((Reader) null)), TokenSet.create(JSTokenTypes.STRING_LITERAL));
}
 
Example 9
JSGraphQLEndpointTodoLexer(OccurrenceConsumer occurrenceConsumer) {
    super(new FlexAdapter(new JSGraphQLEndpointLexer()), occurrenceConsumer);
}
 
Example 10
@NotNull
@Override
public Lexer createLexer(Project project) {
    return new FlexAdapter(new JSGraphQLEndpointLexer());
}
 
Example 11
@NotNull
@Override
public Lexer getHighlightingLexer() {
	return new FlexAdapter(new JSGraphQLEndpointLexer());
}
 
Example 12
@NotNull
@Override
public Lexer createLexer(Project project) {
	return new FlexAdapter(new JSGraphQLEndpointDocLexer());
}
 
Example 13
@NotNull
@Override
public Lexer getHighlightingLexer() {
	return new FlexAdapter(new JSGraphQLEndpointDocLexer());
}
 
Example 14
@Override
protected Lexer createLexer() {
	return new FlexAdapter(new JSGraphQLEndpointLexer());
}
 
Example 15
@Override
protected Lexer createLexer() {
	return new FlexAdapter(new JSGraphQLEndpointDocLexer());
}
 
Example 16
Source Project: Buck-IntelliJ-Plugin   Source File: BuckParserDefinition.java    License: Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public Lexer createLexer(Project project) {
  return new FlexAdapter(new _BuckLexer((Reader) null));
}
 
Example 17
Source Project: BashSupport   Source File: BashLexer.java    License: Apache License 2.0 4 votes vote down vote up
public BashLexer(BashVersion bashVersion) {
    super(new FlexAdapter(
            new _BashLexer(bashVersion, null)),
            MergeTuple.create(TokenSet.create(STRING_DATA), STRING_CONTENT),
            MergeTuple.create(TokenSet.create(HEREDOC_LINE), HEREDOC_CONTENT));
}
 
Example 18
Source Project: react-templates-plugin   Source File: RTLexer.java    License: MIT License 4 votes vote down vote up
public RTLexer() {
    super(new FlexAdapter(new _RTLexer((Reader) null)), TokenSet.create(JSTokenTypes.STRING_LITERAL));
}
 
Example 19
Source Project: intellij-latte   Source File: LatteMacroLexerAdapter.java    License: MIT License 4 votes vote down vote up
public LatteMacroLexerAdapter() {
	super(
		new FlexAdapter(new LatteMacroLexer((java.io.Reader) null)),
		TokenSet.create(LatteTypes.T_MACRO_CONTENT)
	);
}
 
Example 20
Source Project: intellij-latte   Source File: LatteMacroContentLexerAdapter.java    License: MIT License 4 votes vote down vote up
public LatteMacroContentLexerAdapter() {
	super(
			new FlexAdapter(new LatteMacroContentLexer(null)),
			TokenSet.create(LatteTypes.T_PHP_CONTENT, LatteTypes.T_MACRO_ARGS)
	);
}
 
Example 21
Source Project: intellij-latte   Source File: LattePhpLexerAdapter.java    License: MIT License 4 votes vote down vote up
public LattePhpLexerAdapter() {
	super(
		new FlexAdapter(new LattePhpLexer((java.io.Reader) null)),
		TokenSet.create(T_TEXT, T_HTML_CLOSE_TAG_OPEN, T_HTML_OPEN_TAG_OPEN, T_HTML_OPEN_TAG_CLOSE, T_HTML_TAG_CLOSE)
	);
}
 
Example 22
Source Project: intellij-latte   Source File: LatteTopLexerAdapter.java    License: MIT License 4 votes vote down vote up
public LatteTopLexerAdapter() {
	super(
		new FlexAdapter(new LatteTopLexer((java.io.Reader) null)),
			LatteHtmlUtil.HTML_TOKENS
	);
}
 
Example 23
Source Project: intellij-haxe   Source File: HXMLSyntaxHighlighter.java    License: Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public Lexer getHighlightingLexer() {
  return new FlexAdapter(new HXMLLexer((Reader)null));
}
 
Example 24
Source Project: intellij-haxe   Source File: HXMLParserDefinition.java    License: Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public Lexer createLexer(Project project) {
  return new FlexAdapter(new HXMLLexer((Reader) null));
}
 
Example 25
Source Project: intellij-xquery   Source File: XQueryLexer.java    License: Apache License 2.0 4 votes vote down vote up
public XQueryLexer() {
    super(new MergingLexerAdapter(new FlexAdapter(new _XQueryLexer()), orSet(COMMENTS, WHITE_SPACES, CHARACTER_CONTENTS)));
}
 
Example 26
Source Project: buck   Source File: BuckParserDefinition.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Lexer createLexer(Project project) {
  return new FlexAdapter(new _BuckLexer((Reader) null));
}
 
Example 27
Source Project: consulo   Source File: LexerEditorHighlighter.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
  return getClass().getName() + "(" + (myLexer.getClass() == FlexAdapter.class ? myLexer.toString() : myLexer.getClass().getName()) + "): '" + myLexer.getBufferSequence() + "'";
}
 
Example 28
Source Project: consulo   Source File: LexerEditorHighlighter.java    License: Apache License 2.0 4 votes vote down vote up
private InvalidStateException(LexerEditorHighlighter highlighter, String message, Throwable cause) {
  super(highlighter.getClass().getName() + "(" +
        (highlighter.myLexer.getClass() == FlexAdapter.class ? highlighter.myLexer.toString() : highlighter.myLexer.getClass().getName()) +
        "): " + message, cause);
  myAttachments = new Attachment[]{AttachmentFactory.get().create("content.txt", highlighter.myLexer.getBufferSequence().toString())};
}
 
Example 29
Source Project: Intellij-Dust   Source File: DustParserDefinition.java    License: MIT License 4 votes vote down vote up
@NotNull
@Override
public Lexer createLexer(Project project) {
  return new FlexAdapter(new DustLexer((Reader) null));
}
 
Example 30
Source Project: Intellij-Dust   Source File: DustSyntaxHighlighter.java    License: MIT License 4 votes vote down vote up
@NotNull
@Override
public Lexer getHighlightingLexer() {
  return new FlexAdapter(new DustLexer((Reader) null));
}