Package org.intellij.lang.jflex

Source Code of org.intellij.lang.jflex.JFlexLanguage

package org.intellij.lang.jflex;

import com.intellij.lang.Language;
import com.intellij.openapi.fileTypes.SingleLazyInstanceSyntaxHighlighterFactory;
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
import org.intellij.lang.jflex.fileTypes.JFlexSyntaxHighlighter;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

/**
* JFlex language.
*
* @author Alexey Efimov
*/
public class JFlexLanguage extends Language {
    @NonNls
    public static final String ID = "JFlex";

    public static final JFlexLanguage LANGUAGE = new JFlexLanguage();

    public JFlexLanguage() {
        super(ID);

        //somehow lang.syntaxHighlighterFactory extension won't work for me
        SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(this, new SingleLazyInstanceSyntaxHighlighterFactory() {
            @NotNull
            protected SyntaxHighlighter createHighlighter() {
                return new JFlexSyntaxHighlighter();
            }
        });
    }

}
TOP

Related Classes of org.intellij.lang.jflex.JFlexLanguage

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.