// Path: src/com/intellij/perlplugin/language/PerlLexerAdapter.java
// public class PerlLexerAdapter extends FlexAdapter {
//     public PerlLexerAdapter() {
//         super(new _PerlLexer((Reader) null));
//     }
// }
// 
// Path: src/com/intellij/perlplugin/psi/PerlTypes.java
// public interface PerlTypes {
// 
//     IElementType PROPERTY = new PerlElementType("PROPERTY");
//     IElementType CRLF = new PerlTokenType("CRLF");
//     IElementType KEY = new PerlTokenType("KEY");
//     IElementType OPERATOR = new PerlTokenType("OPERATOR");
//     IElementType BRACES = new PerlTokenType("BRACES");
//     IElementType VALUE = new PerlTokenType("VALUE");
//     IElementType WHITESPACE = new PerlTokenType("WHITESPACE");
//     IElementType SUBROUTINE = new PerlTokenType("SUBROUTINE");
//     IElementType PACKAGE = new PerlTokenType("PACKAGE");
//     IElementType POINTER = new PerlTokenType("POINTER");
//     IElementType LINE_COMMENT = new PerlTokenType("LINE_COMMENT");
//     IElementType MARKUP = new PerlTokenType("MARKUP");
//     IElementType LANG_VARIABLE = new PerlTokenType("LANG_VARIABLE");
//     IElementType LANG_FUNCTION = new PerlTokenType("LANG_FUNCTION");
//     IElementType LANG_SYNTAX = new PerlTokenType("LANG_SYNTAX");
//     IElementType LANG_FILE_HANDLES = new PerlTokenType("LANG_FILE_HANDLES");
//     IElementType ARGUMENTS = new PerlTokenType("ARGUMENTS");
//     IElementType VARIABLE = new PerlTokenType("VARIABLE");
//     IElementType HASH_KEY = new PerlTokenType("HASH_KEY");
//     IElementType PREDICATE = new PerlTokenType("PREDICATE");
// 
//     class Factory {
//         public static PsiElement createElement(ASTNode node) {
//             IElementType type = node.getElementType();
// //       if (type == PROPERTY) {
//             return new PerlPropertyImpl(node);
// //      }
// //      throw new AssertionError("Unknown element type: " + type);
//         }
//     }
// 
// }


import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.perlplugin.language.PerlLexerAdapter;
import com.intellij.perlplugin.psi.PerlTypes;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
import java.awt.*;
import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey;
    public Lexer getHighlightingLexer() {
        return new PerlLexerAdapter();
    }

    @NotNull
    @Override
    public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {

        if (tokenType.equals(PerlTypes.LANG_VARIABLE)) {
            return LANG_VARIABLE_KEYS;
        } else if (tokenType.equals(PerlTypes.LANG_FUNCTION)) {
            return LANG_FUNCTION_KEYS;
        } else if (tokenType.equals(PerlTypes.LANG_SYNTAX)) {
            return LANG_SYNTAX_KEYS;
        } else if (tokenType.equals(PerlTypes.LANG_FILE_HANDLES)) {
            return LANG_FILE_HANDLES_KEYS;
        } else if (tokenType.equals(PerlTypes.SUBROUTINE)) {
            return SUBROUTINE_KEYS;
        } else if (tokenType.equals(PerlTypes.ARGUMENTS)) {
            return ARGUMENTS_KEYS;
        } else if (tokenType.equals(PerlTypes.VARIABLE)) {
            return VARIABLES_KEYS;
        } else if (tokenType.equals(PerlTypes.BRACES)) {
            return BRACES_KEYS;
        } else if (tokenType.equals(PerlTypes.OPERATOR)) {
            return OPERATOR_KEYS;
        } else if (tokenType.equals(PerlTypes.KEY)) {
            return KEY_KEYS;
        } else if (tokenType.equals(PerlTypes.HASH_KEY)) {
            return LANG_VARIABLE_KEYS;
// Path: src/com/intellij/perlplugin/language/PerlLexerAdapter.java
// public class PerlLexerAdapter extends FlexAdapter {
//     public PerlLexerAdapter() {
//         super(new _PerlLexer((Reader) null));
//     }
// }
// 
// Path: src/com/intellij/perlplugin/psi/PerlTypes.java
// public interface PerlTypes {
// 
//     IElementType PROPERTY = new PerlElementType("PROPERTY");
//     IElementType CRLF = new PerlTokenType("CRLF");
//     IElementType KEY = new PerlTokenType("KEY");
//     IElementType OPERATOR = new PerlTokenType("OPERATOR");
//     IElementType BRACES = new PerlTokenType("BRACES");
//     IElementType VALUE = new PerlTokenType("VALUE");
//     IElementType WHITESPACE = new PerlTokenType("WHITESPACE");
//     IElementType SUBROUTINE = new PerlTokenType("SUBROUTINE");
//     IElementType PACKAGE = new PerlTokenType("PACKAGE");
//     IElementType POINTER = new PerlTokenType("POINTER");
//     IElementType LINE_COMMENT = new PerlTokenType("LINE_COMMENT");
//     IElementType MARKUP = new PerlTokenType("MARKUP");
//     IElementType LANG_VARIABLE = new PerlTokenType("LANG_VARIABLE");
//     IElementType LANG_FUNCTION = new PerlTokenType("LANG_FUNCTION");
//     IElementType LANG_SYNTAX = new PerlTokenType("LANG_SYNTAX");
//     IElementType LANG_FILE_HANDLES = new PerlTokenType("LANG_FILE_HANDLES");
//     IElementType ARGUMENTS = new PerlTokenType("ARGUMENTS");
//     IElementType VARIABLE = new PerlTokenType("VARIABLE");
//     IElementType HASH_KEY = new PerlTokenType("HASH_KEY");
//     IElementType PREDICATE = new PerlTokenType("PREDICATE");
// 
//     class Factory {
//         public static PsiElement createElement(ASTNode node) {
//             IElementType type = node.getElementType();
// //       if (type == PROPERTY) {
//             return new PerlPropertyImpl(node);
// //      }
// //      throw new AssertionError("Unknown element type: " + type);
//         }
//     }
// 
// }


// Path: src/com/intellij/perlplugin/extensions/syntax/highlighting/PerlSyntaxHighlighter.java
import com.intellij.lexer.Lexer;
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.perlplugin.language.PerlLexerAdapter;
import com.intellij.perlplugin.psi.PerlTypes;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
import java.awt.*;
import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey;

    public Lexer getHighlightingLexer() {
        return new PerlLexerAdapter();
    }

    @NotNull
    @Override
    public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {

        if (tokenType.equals(PerlTypes.LANG_VARIABLE)) {
            return LANG_VARIABLE_KEYS;
        } else if (tokenType.equals(PerlTypes.LANG_FUNCTION)) {
            return LANG_FUNCTION_KEYS;
        } else if (tokenType.equals(PerlTypes.LANG_SYNTAX)) {
            return LANG_SYNTAX_KEYS;
        } else if (tokenType.equals(PerlTypes.LANG_FILE_HANDLES)) {
            return LANG_FILE_HANDLES_KEYS;
        } else if (tokenType.equals(PerlTypes.SUBROUTINE)) {
            return SUBROUTINE_KEYS;
        } else if (tokenType.equals(PerlTypes.ARGUMENTS)) {
            return ARGUMENTS_KEYS;
        } else if (tokenType.equals(PerlTypes.VARIABLE)) {
            return VARIABLES_KEYS;
        } else if (tokenType.equals(PerlTypes.BRACES)) {
            return BRACES_KEYS;
        } else if (tokenType.equals(PerlTypes.OPERATOR)) {
            return OPERATOR_KEYS;
        } else if (tokenType.equals(PerlTypes.KEY)) {
            return KEY_KEYS;
        } else if (tokenType.equals(PerlTypes.HASH_KEY)) {
            return LANG_VARIABLE_KEYS;
        } else if (tokenType.equals(PerlTypes.PACKAGE)) {