/** @author ilyas */
public class DefaultHighlighter {

  @NonNls static final String LINE_COMMENT_ID = "Line comment";
  @NonNls static final String BLOCK_COMMENT_ID = "Block comment";
  @NonNls static final String DOC_COMMENT_ID = "Groovydoc comment";
  @NonNls static final String DOC_COMMENT_TAG_ID = "Groovydoc tag";
  @NonNls static final String KEYWORD_ID = "Keyword";
  @NonNls static final String NUMBER_ID = "Number";
  @NonNls static final String GSTRING_ID = "GString";
  @NonNls static final String STRING_ID = "String";
  @NonNls static final String BRACES_ID = "Braces";
  @NonNls static final String BRACKETS_ID = "Brackets";
  @NonNls static final String PARENTHESES_ID = "Parentheses";

  @NonNls static final String OPERATION_SIGN_ID = "Operation sign";
  @NonNls static final String BAD_CHARACTER_ID = "Bad character";
  @NonNls static final String WRONG_STRING_ID = "Wrong string literal";

  @NonNls static final String ANNOTATION_ID = "Annotation";
  @NonNls static final String INSTANCE_FIELD_ID = "Instance field";
  @NonNls static final String STATIC_FIELD_ID = "Static field";
  @NonNls static final String METHOD_CALL_ID = "Method call";
  @NonNls static final String STATIC_METHOD_ACCESS_ID = "Static method access";
  @NonNls static final String CLASS_REFERENCE_ID = "Class";
  @NonNls static final String TYPE_PARAMETER_ID = "Type parameter";
  @NonNls static final String INSTANCE_PROPERTY_REFERENCE_ID = "Instance property reference ID";
  @NonNls static final String STATIC_PROPERTY_REFERENCE_ID = "Static property reference ID";
  @NonNls static final String MAP_KEY_ID = "Map key";

  @NonNls static final String UNRESOLVED_ACCESS_ID = "Unresolved reference access";
  static final String LITERAL_CONVERSION_ID = "List/map to object conversion";

  static final String VALID_STRING_ESCAPE_ID = "Valid string escape";
  static final String INVALID_STRING_ESCAPE_ID = "Invalid string escape";

  @NonNls static final String LABEL_ID = "Label";

  public static TextAttributesKey LINE_COMMENT =
      TextAttributesKey.createTextAttributesKey(
          LINE_COMMENT_ID, SyntaxHighlighterColors.LINE_COMMENT.getDefaultAttributes());

  public static TextAttributesKey ANNOTATION =
      TextAttributesKey.createTextAttributesKey(
          ANNOTATION_ID,
          HighlightInfoType.ANNOTATION_NAME.getAttributesKey().getDefaultAttributes());

  public static TextAttributesKey LOCAL_VARIABLE =
      TextAttributesKey.createTextAttributesKey(
          "Groovy var", HighlightInfoType.LOCAL_VARIABLE.getAttributesKey().getDefaultAttributes());
  public static TextAttributesKey REASSIGNED_LOCAL_VARIABLE =
      TextAttributesKey.createTextAttributesKey(
          "Groovy reassigned var",
          HighlightInfoType.REASSIGNED_LOCAL_VARIABLE.getAttributesKey().getDefaultAttributes());
  public static TextAttributesKey PARAMETER =
      TextAttributesKey.createTextAttributesKey(
          "Groovy parameter",
          HighlightInfoType.PARAMETER.getAttributesKey().getDefaultAttributes());
  public static TextAttributesKey REASSIGNED_PARAMETER =
      TextAttributesKey.createTextAttributesKey(
          "Groovy reassigned parameter",
          HighlightInfoType.REASSIGNED_PARAMETER.getAttributesKey().getDefaultAttributes());

  public static TextAttributesKey METHOD_DECLARATION =
      TextAttributesKey.createTextAttributesKey(
          "Groovy method declaration",
          HighlightInfoType.METHOD_DECLARATION.getAttributesKey().getDefaultAttributes());

  public static TextAttributesKey INSTANCE_FIELD =
      TextAttributesKey.createTextAttributesKey(
          INSTANCE_FIELD_ID,
          HighlightInfoType.INSTANCE_FIELD.getAttributesKey().getDefaultAttributes());

  public static TextAttributesKey METHOD_CALL =
      TextAttributesKey.createTextAttributesKey(
          METHOD_CALL_ID, HighlightInfoType.METHOD_CALL.getAttributesKey().getDefaultAttributes());

  public static TextAttributesKey STATIC_FIELD =
      TextAttributesKey.createTextAttributesKey(
          STATIC_FIELD_ID,
          HighlightInfoType.STATIC_FINAL_FIELD.getAttributesKey().getDefaultAttributes());

  public static TextAttributesKey STATIC_METHOD_ACCESS =
      TextAttributesKey.createTextAttributesKey(
          STATIC_METHOD_ACCESS_ID,
          HighlightInfoType.STATIC_METHOD.getAttributesKey().getDefaultAttributes());

  public static TextAttributesKey BLOCK_COMMENT =
      TextAttributesKey.createTextAttributesKey(
          BLOCK_COMMENT_ID, SyntaxHighlighterColors.JAVA_BLOCK_COMMENT.getDefaultAttributes());

  public static TextAttributesKey DOC_COMMENT_CONTENT =
      TextAttributesKey.createTextAttributesKey(
          DOC_COMMENT_ID, SyntaxHighlighterColors.DOC_COMMENT.getDefaultAttributes());

  public static TextAttributesKey DOC_COMMENT_TAG =
      TextAttributesKey.createTextAttributesKey(
          DOC_COMMENT_TAG_ID, SyntaxHighlighterColors.DOC_COMMENT_TAG.getDefaultAttributes());

  public static TextAttributesKey CLASS_REFERENCE =
      TextAttributesKey.createTextAttributesKey(
          CLASS_REFERENCE_ID, HighlighterColors.TEXT.getDefaultAttributes().clone());

  public static TextAttributesKey TYPE_PARAMETER =
      TextAttributesKey.createTextAttributesKey(
          TYPE_PARAMETER_ID,
          CodeInsightColors.TYPE_PARAMETER_NAME_ATTRIBUTES.getDefaultAttributes().clone());

  public static final TextAttributes INSTANCE_PROPERTY_REFERENCE_ATTRIBUTES =
      INSTANCE_FIELD.getDefaultAttributes().clone();
  public static final TextAttributes STATIC_PROPERTY_REFERENCE_ATTRIBUTES =
      STATIC_FIELD.getDefaultAttributes().clone();

  static {
    INSTANCE_PROPERTY_REFERENCE_ATTRIBUTES.setFontType(Font.PLAIN);
    STATIC_PROPERTY_REFERENCE_ATTRIBUTES.setFontType(Font.ITALIC);
  }

  public static TextAttributesKey INSTANCE_PROPERTY_REFERENCE =
      TextAttributesKey.createTextAttributesKey(
          INSTANCE_PROPERTY_REFERENCE_ID, INSTANCE_PROPERTY_REFERENCE_ATTRIBUTES);

  public static TextAttributesKey STATIC_PROPERTY_REFERENCE =
      TextAttributesKey.createTextAttributesKey(
          STATIC_PROPERTY_REFERENCE_ID, STATIC_PROPERTY_REFERENCE_ATTRIBUTES);

  public static final TextAttributes KEYWORD_ATTRIBUTES =
      SyntaxHighlighterColors.KEYWORD.getDefaultAttributes().clone();

  static {
    KEYWORD_ATTRIBUTES.setForegroundColor(new Color(0, 0, 67));
    KEYWORD_ATTRIBUTES.setFontType(Font.BOLD);
  }

  public static TextAttributesKey KEYWORD =
      TextAttributesKey.createTextAttributesKey(
          "GROOVY_" + KEYWORD_ID.toUpperCase(), KEYWORD_ATTRIBUTES);

  public static TextAttributesKey NUMBER =
      TextAttributesKey.createTextAttributesKey(
          NUMBER_ID, SyntaxHighlighterColors.NUMBER.getDefaultAttributes());

  public static TextAttributesKey GSTRING =
      TextAttributesKey.createTextAttributesKey(
          GSTRING_ID, SyntaxHighlighterColors.STRING.getDefaultAttributes());

  public static TextAttributesKey STRING =
      TextAttributesKey.createTextAttributesKey(
          STRING_ID, SyntaxHighlighterColors.STRING.getDefaultAttributes());

  public static TextAttributesKey BRACES =
      TextAttributesKey.createTextAttributesKey(
          BRACES_ID, SyntaxHighlighterColors.BRACES.getDefaultAttributes());

  public static TextAttributesKey BRACKETS =
      TextAttributesKey.createTextAttributesKey(
          BRACKETS_ID, SyntaxHighlighterColors.BRACKETS.getDefaultAttributes());

  public static TextAttributesKey PARENTHESES =
      TextAttributesKey.createTextAttributesKey(
          PARENTHESES_ID, SyntaxHighlighterColors.PARENTHS.getDefaultAttributes());

  public static TextAttributesKey OPERATION_SIGN =
      TextAttributesKey.createTextAttributesKey(
          OPERATION_SIGN_ID, SyntaxHighlighterColors.OPERATION_SIGN.getDefaultAttributes());

  public static TextAttributesKey BAD_CHARACTER =
      TextAttributesKey.createTextAttributesKey(
          BAD_CHARACTER_ID, CodeInsightColors.UNMATCHED_BRACE_ATTRIBUTES.getDefaultAttributes());

  public static TextAttributesKey WRONG_STRING =
      TextAttributesKey.createTextAttributesKey(
          WRONG_STRING_ID, SyntaxHighlighterColors.STRING.getDefaultAttributes());

  public static final TextAttributes UNRESOLVED_ACCESS_ATTRIBUTES =
      HighlighterColors.TEXT.getDefaultAttributes().clone();

  static {
    UNRESOLVED_ACCESS_ATTRIBUTES.setForegroundColor(Color.BLACK);
    UNRESOLVED_ACCESS_ATTRIBUTES.setEffectColor(Color.GRAY);
    UNRESOLVED_ACCESS_ATTRIBUTES.setEffectType(EffectType.LINE_UNDERSCORE);
  }

  public static final TextAttributes LITERAL_CONVERSION_ATTRIBUTES =
      HighlighterColors.TEXT.getDefaultAttributes().clone();

  static {
    LITERAL_CONVERSION_ATTRIBUTES.setForegroundColor(PlatformColors.BLUE);
    LITERAL_CONVERSION_ATTRIBUTES.setFontType(Font.BOLD);
  }

  public static final TextAttributes MAP_KEY_ATTRIBUTES =
      HighlighterColors.TEXT.getDefaultAttributes().clone();

  public static final Color MAP_KEY_COLOR = new Color(0, 128, 0);

  static {
    MAP_KEY_ATTRIBUTES.setForegroundColor(MAP_KEY_COLOR);
  }

  public static TextAttributesKey UNRESOLVED_ACCESS =
      TextAttributesKey.createTextAttributesKey(UNRESOLVED_ACCESS_ID, UNRESOLVED_ACCESS_ATTRIBUTES);
  public static TextAttributesKey LITERAL_CONVERSION =
      TextAttributesKey.createTextAttributesKey(
          LITERAL_CONVERSION_ID, LITERAL_CONVERSION_ATTRIBUTES);

  public static TextAttributesKey MAP_KEY =
      TextAttributesKey.createTextAttributesKey(MAP_KEY_ID, MAP_KEY_ATTRIBUTES);

  public static final TextAttributesKey VALID_STRING_ESCAPE =
      TextAttributesKey.createTextAttributesKey(
          VALID_STRING_ESCAPE_ID,
          SyntaxHighlighterColors.VALID_STRING_ESCAPE.getDefaultAttributes());
  public static final TextAttributesKey INVALID_STRING_ESCAPE =
      TextAttributesKey.createTextAttributesKey(
          INVALID_STRING_ESCAPE_ID,
          SyntaxHighlighterColors.INVALID_STRING_ESCAPE.getDefaultAttributes());

  public static final TextAttributes LABEL_ATTRIBUTES =
      HighlighterColors.TEXT.getDefaultAttributes().clone();

  public static final TextAttributesKey LABEL =
      TextAttributesKey.createTextAttributesKey(LABEL_ID, LABEL_ATTRIBUTES);

  private DefaultHighlighter() {}
}
public class NeonSyntaxHighlighter extends SyntaxHighlighterBase {

  public static final String UNKNOWN_ID = "Bad character";
  public static final TextAttributesKey UNKNOWN =
      TextAttributesKey.createTextAttributesKey(
          UNKNOWN_ID, HighlighterColors.BAD_CHARACTER.getDefaultAttributes().clone());

  public static final String COMMENT_ID = "Comment";
  public static final TextAttributesKey COMMENT =
      TextAttributesKey.createTextAttributesKey(
          COMMENT_ID, SyntaxHighlighterColors.LINE_COMMENT.getDefaultAttributes().clone());

  public static final String IDENTIFIER_ID = "Identifier";
  public static final TextAttributesKey IDENTIFIER =
      TextAttributesKey.createTextAttributesKey(
          IDENTIFIER_ID, SyntaxHighlighterColors.KEYWORD.getDefaultAttributes().clone());

  public static final String INTERPUNCTION_ID = "Interpunction";
  public static final TextAttributesKey INTERPUNCTION =
      TextAttributesKey.createTextAttributesKey(
          INTERPUNCTION_ID, SyntaxHighlighterColors.DOT.getDefaultAttributes().clone());

  public static final String NUMBER_ID = "Number";
  public static final TextAttributesKey NUMBER =
      TextAttributesKey.createTextAttributesKey(
          NUMBER_ID, SyntaxHighlighterColors.NUMBER.getDefaultAttributes().clone());

  public static final String KEYWORD_ID = "Keyword";
  public static final TextAttributesKey KEYWORD =
      TextAttributesKey.createTextAttributesKey(
          KEYWORD_ID, SyntaxHighlighterColors.KEYWORD.getDefaultAttributes().clone());

  // Groups of IElementType's
  public static final TokenSet sBAD = TokenSet.create(NEON_UNKNOWN);
  public static final TokenSet sCOMMENTS = TokenSet.create(NEON_COMMENT);
  public static final TokenSet sIDENTIFIERS =
      TokenSet.create(NEON_KEY); // , NEON_IDENTIFIER, NEON_LITERAL);
  public static final TokenSet sINTERPUNCTION =
      TokenSet.create(
          NEON_BLOCK_INHERITENCE,
          NEON_LPAREN,
          NEON_RPAREN,
          NEON_LBRACE_CURLY,
          NEON_RBRACE_CURLY,
          NEON_LBRACE_SQUARE,
          NEON_RBRACE_SQUARE,
          NEON_ITEM_DELIMITER,
          NEON_ASSIGNMENT);
  public static final TokenSet sNUMBERS = TokenSet.create(NEON_NUMBER);

  // Static container
  private static final Map<IElementType, TextAttributesKey> ATTRIBUTES =
      new HashMap<IElementType, TextAttributesKey>();

  // Fill in the map
  static {
    fillMap(ATTRIBUTES, sBAD, UNKNOWN);
    fillMap(ATTRIBUTES, sCOMMENTS, COMMENT);
    fillMap(ATTRIBUTES, sIDENTIFIERS, IDENTIFIER);
    fillMap(ATTRIBUTES, sINTERPUNCTION, INTERPUNCTION);
    fillMap(ATTRIBUTES, sNUMBERS, NUMBER);
  }

  @NotNull
  @Override
  public Lexer getHighlightingLexer() {
    return new NeonLexer();
  }

  @NotNull
  @Override
  public TextAttributesKey[] getTokenHighlights(IElementType type) {
    return pack(ATTRIBUTES.get(type));
  }
}
/** Created by IntelliJ IDEA. User: jon Date: Apr 3, 2010 Time: 1:55:00 AM */
public class MoonHighlightingData {
  @NonNls static final String KEYWORD_ID = "MOON_KEYWORD";
  @NonNls static final String COMMENT_ID = "MOON_COMMENT";
  @NonNls static final String LONGCOMMENT_ID = "MOON_LONGCOMMENT";
  @NonNls static final String NUMBER_ID = "MOON_NUMBER";
  @NonNls static final String STRING_ID = "MOON_STRING";
  @NonNls static final String LONGSTRING_ID = "MOON_LONGSTRING";
  @NonNls static final String LONGSTRING_BRACES_ID = "MOON_LONGSTRING_BRACES";
  @NonNls static final String LONGCOMMENT_BRACES_ID = "MOON_LONGCOMMENT_BRACES";
  @NonNls static final String BRACES_ID = "MOON_BRACES";
  @NonNls static final String PARENTHS_ID = "MOON_PARENTHS";
  @NonNls static final String BRACKETS_ID = "MOON_BRACKETS";
  @NonNls static final String BAD_CHARACTER_ID = "MOON_BAD_CHARACTER";
  @NonNls static final String IDENTIFIER_ID = "MOON_IDENTIFIER";
  @NonNls static final String VAR_ID = "MOON_VAR";
  @NonNls static final String COMMA_ID = "MOON_COMMA";
  @NonNls static final String SEMICOLON_ID = "MOON_SEMICOLON";
  @NonNls static final String SELF_ID = "MOON_SELF";
  @NonNls static final String DEFINED_CONSTANTS_ID = "MOON_DEFINED_CONSTANTS";
  @NonNls static final String LOCAL_VAR_ID = "MOON_LOCAL_VAR";
  @NonNls static final String GLOBAL_VAR_ID = "MOON_GLOBAL_VAR";
  @NonNls static final String FIELD_ID = "MOON_FIELD";
  @NonNls static final String TAIL_CALL_ID = "MOON_TAIL_CALL";
  @NonNls static final String PARAMETER_ID = "MOON_PARAMETER";
  @NonNls static final String UPVAL_ID = "MOON_UPVAL";

  @NonNls static final String LUADOC_ID = "MOON_LUADOC";
  @NonNls static final String LUADOC_TAG_ID = "MOON_LUADOC_TAG";
  @NonNls static final String LUADOC_VALUE_ID = "MOON_LUADOC_VALUE";

  @NonNls static final String OPERATION_SIGN_ID = "MOON_OPERATION_SIGN";

  private static final TextAttributes LUADOC_ATTR =
      SyntaxHighlighterColors.DOC_COMMENT.getDefaultAttributes().clone();
  public static final TextAttributesKey LUADOC =
      TextAttributesKey.createTextAttributesKey(LUADOC_ID, LUADOC_ATTR);

  private static TextAttributes LUADOC_TAG_ATTR =
      SyntaxHighlighterColors.DOC_COMMENT_TAG.getDefaultAttributes().clone();
  public static TextAttributesKey LUADOC_TAG =
      TextAttributesKey.createTextAttributesKey(LUADOC_TAG_ID, LUADOC_TAG_ATTR);

  private static TextAttributes LUADOC_VALUE_ATTR =
      SyntaxHighlighterColors.DOC_COMMENT.getDefaultAttributes().clone();
  public static TextAttributesKey LUADOC_VALUE =
      TextAttributesKey.createTextAttributesKey(LUADOC_VALUE_ID, LUADOC_VALUE_ATTR);

  private static final TextAttributes UPVAL_ATTR =
      HighlighterColors.TEXT.getDefaultAttributes().clone();
  public static final TextAttributesKey UPVAL =
      TextAttributesKey.createTextAttributesKey(UPVAL_ID, UPVAL_ATTR);

  private static final TextAttributes LOCAL_VAR_ATTR =
      HighlighterColors.TEXT.getDefaultAttributes().clone();
  public static final TextAttributesKey LOCAL_VAR =
      TextAttributesKey.createTextAttributesKey(LOCAL_VAR_ID, LOCAL_VAR_ATTR);

  private static final TextAttributes PARAMETER_ATTR =
      HighlighterColors.TEXT.getDefaultAttributes().clone();
  public static final TextAttributesKey PARAMETER =
      TextAttributesKey.createTextAttributesKey(PARAMETER_ID, PARAMETER_ATTR);

  private static final TextAttributes GLOBAL_VAR_ATTR =
      HighlighterColors.TEXT.getDefaultAttributes().clone();
  public static final TextAttributesKey GLOBAL_VAR =
      TextAttributesKey.createTextAttributesKey(GLOBAL_VAR_ID, GLOBAL_VAR_ATTR);

  public static final TextAttributesKey FIELD =
      TextAttributesKey.createTextAttributesKey(
          FIELD_ID, HighlighterColors.TEXT.getDefaultAttributes().clone());

  static final TextAttributes TAIL_CALL_ATTR =
      HighlighterColors.TEXT.getDefaultAttributes().clone();

  public static final TextAttributesKey TAIL_CALL =
      TextAttributesKey.createTextAttributesKey(TAIL_CALL_ID, TAIL_CALL_ATTR);

  public static final TextAttributesKey KEYWORD =
      TextAttributesKey.createTextAttributesKey(
          KEYWORD_ID, SyntaxHighlighterColors.KEYWORD.getDefaultAttributes().clone());

  public static final TextAttributesKey COMMENT =
      TextAttributesKey.createTextAttributesKey(
          COMMENT_ID, SyntaxHighlighterColors.LINE_COMMENT.getDefaultAttributes().clone());
  public static final TextAttributesKey LONGCOMMENT =
      TextAttributesKey.createTextAttributesKey(
          LONGCOMMENT_ID,
          SyntaxHighlighterColors.JAVA_BLOCK_COMMENT.getDefaultAttributes().clone());

  static final TextAttributes LONGCOMMENT_BRACES_ATTR =
      SyntaxHighlighterColors.JAVA_BLOCK_COMMENT.getDefaultAttributes().clone();

  public static final TextAttributesKey LONGCOMMENT_BRACES =
      TextAttributesKey.createTextAttributesKey(LONGCOMMENT_BRACES_ID, LONGCOMMENT_BRACES_ATTR);

  public static final TextAttributesKey NUMBER =
      TextAttributesKey.createTextAttributesKey(
          NUMBER_ID, SyntaxHighlighterColors.NUMBER.getDefaultAttributes().clone());
  public static final TextAttributesKey STRING =
      TextAttributesKey.createTextAttributesKey(
          STRING_ID, SyntaxHighlighterColors.STRING.getDefaultAttributes().clone());

  private static final TextAttributes LONGSTRING_ATTR =
      SyntaxHighlighterColors.STRING.getDefaultAttributes().clone();
  private static final TextAttributes LONGSTRING_BRACES_ATTR =
      SyntaxHighlighterColors.STRING.getDefaultAttributes().clone();
  public static final TextAttributesKey LONGSTRING =
      TextAttributesKey.createTextAttributesKey(LONGSTRING_ID, LONGSTRING_ATTR);
  public static final TextAttributesKey LONGSTRING_BRACES =
      TextAttributesKey.createTextAttributesKey(LONGSTRING_BRACES_ID, LONGSTRING_BRACES_ATTR);
  public static final TextAttributesKey BRACKETS =
      TextAttributesKey.createTextAttributesKey(
          BRACKETS_ID, SyntaxHighlighterColors.BRACKETS.getDefaultAttributes().clone());
  public static final TextAttributesKey BRACES =
      TextAttributesKey.createTextAttributesKey(
          BRACES_ID, SyntaxHighlighterColors.BRACES.getDefaultAttributes().clone());
  public static final TextAttributesKey PARENTHS =
      TextAttributesKey.createTextAttributesKey(
          PARENTHS_ID, SyntaxHighlighterColors.PARENTHS.getDefaultAttributes().clone());
  public static final TextAttributesKey BAD_CHARACTER =
      TextAttributesKey.createTextAttributesKey(
          BAD_CHARACTER_ID, HighlighterColors.BAD_CHARACTER.getDefaultAttributes().clone());

  public static final TextAttributesKey COMMA =
      TextAttributesKey.createTextAttributesKey(
          COMMA_ID, SyntaxHighlighterColors.COMMA.getDefaultAttributes().clone());

  private static final TextAttributes DEFINED_CONSTANTS_ATTR =
      SyntaxHighlighterColors.KEYWORD.getDefaultAttributes().clone();

  public static final TextAttributesKey DEFINED_CONSTANTS =
      TextAttributesKey.createTextAttributesKey(DEFINED_CONSTANTS_ID, DEFINED_CONSTANTS_ATTR);

  public static final TextAttributesKey OPERATION_SIGN =
      TextAttributesKey.createTextAttributesKey(
          OPERATION_SIGN_ID, SyntaxHighlighterColors.OPERATION_SIGN.getDefaultAttributes().clone());

  static {
    DEFINED_CONSTANTS_ATTR.setForegroundColor(Color.MAGENTA);
    UPVAL_ATTR.setFontType(SimpleTextAttributes.STYLE_ITALIC);
    LONGSTRING_ATTR.setBackgroundColor(new Color(0xD0, 0xD0, 0xD0));
    GLOBAL_VAR_ATTR.setForegroundColor(new Color(128, 0, 0));
    LOCAL_VAR_ATTR.setForegroundColor(new Color(0, 153, 153));
    PARAMETER_ATTR.setForegroundColor(new Color(153, 102, 255));
    LUADOC_ATTR.setForegroundColor(new Color(64, 95, 189));
    LUADOC_TAG_ATTR.setForegroundColor(new Color(64, 95, 189));
    LUADOC_VALUE_ATTR.setForegroundColor(new Color(64, 95, 189));
  }
}
/** Syntax highlighter defines token colors. */
public class PropsSyntaxHighlighter extends SyntaxHighlighterBase {

  private static final Map<IElementType, TextAttributesKey> keys1;
  private static final Map<IElementType, TextAttributesKey> keys2;

  @NotNull
  public Lexer getHighlightingLexer() {
    return new PropsLexer();
  }

  public static final TextAttributesKey PROP_KEY =
      TextAttributesKey.createTextAttributesKey(
          "PROPS.KEY", SyntaxHighlighterColors.KEYWORD.getDefaultAttributes());
  public static final TextAttributesKey PROP_VALUE =
      TextAttributesKey.createTextAttributesKey(
          "PROPS.VALUE", SyntaxHighlighterColors.STRING.getDefaultAttributes());
  public static final TextAttributesKey PROP_COMMENT =
      TextAttributesKey.createTextAttributesKey(
          "PROPS.LINE_COMMENT", SyntaxHighlighterColors.LINE_COMMENT.getDefaultAttributes());
  public static final TextAttributesKey PROP_KEY_VALUE_SEPARATOR =
      TextAttributesKey.createTextAttributesKey(
          "PROPS.KEY_VALUE_SEPARATOR",
          SyntaxHighlighterColors.OPERATION_SIGN.getDefaultAttributes());
  public static final TextAttributesKey PROP_VALID_STRING_ESCAPE =
      TextAttributesKey.createTextAttributesKey(
          "PROPS.VALID_STRING_ESCAPE",
          SyntaxHighlighterColors.VALID_STRING_ESCAPE.getDefaultAttributes());
  public static final TextAttributesKey PROP_INVALID_STRING_ESCAPE =
      TextAttributesKey.createTextAttributesKey(
          "PROPS.INVALID_STRING_ESCAPE",
          SyntaxHighlighterColors.INVALID_STRING_ESCAPE.getDefaultAttributes());
  public static final TextAttributesKey PROP_SECTION =
      TextAttributesKey.createTextAttributesKey(
          "PROPS.SECTION", new TextAttributes(new Color(0x660066), null, null, null, Font.BOLD));
  public static final TextAttributesKey PROP_MACRO =
      TextAttributesKey.createTextAttributesKey(
          "PROPS.MACRO", new TextAttributes(new Color(0x0055BB), null, null, null, Font.BOLD));
  public static final TextAttributesKey PROP_PROFILE =
      TextAttributesKey.createTextAttributesKey(
          "PROPS.PROFILE", new TextAttributes(new Color(0x0000FF), null, null, null, Font.BOLD));

  static {
    keys1 = new HashMap<IElementType, TextAttributesKey>();
    keys2 = new HashMap<IElementType, TextAttributesKey>();

    keys1.put(PropsTokenTypes.TOKEN_VALUE, PROP_VALUE);
    keys1.put(PropsTokenTypes.TOKEN_EOL_COMMENT, PROP_COMMENT);
    keys1.put(PropsTokenTypes.TOKEN_KEY, PROP_KEY);
    keys1.put(PropsTokenTypes.TOKEN_KEY_VALUE_SEPARATOR, PROP_KEY_VALUE_SEPARATOR);
    keys1.put(PropsTokenTypes.TOKEN_SECTION, PROP_SECTION);
    keys1.put(PropsTokenTypes.TOKEN_MACRO, PROP_MACRO);
    keys1.put(PropsTokenTypes.TOKEN_PROFILE, PROP_PROFILE);

    keys1.put(StringEscapesTokenTypes.VALID_STRING_ESCAPE_TOKEN, PROP_VALID_STRING_ESCAPE);

    // in fact all back-slashed escapes are allowed
    keys1.put(StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN, PROP_INVALID_STRING_ESCAPE);
    keys1.put(StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN, PROP_INVALID_STRING_ESCAPE);
  }

  @NotNull
  public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
    return pack(keys1.get(tokenType), keys2.get(tokenType));
  }

  public static final Map<TextAttributesKey, Pair<String, HighlightSeverity>> DISPLAY_NAMES =
      new HashMap<TextAttributesKey, Pair<String, HighlightSeverity>>(7);

  static {
    DISPLAY_NAMES.put(PROP_KEY, new Pair<String, HighlightSeverity>("Property key", null));
    DISPLAY_NAMES.put(PROP_VALUE, new Pair<String, HighlightSeverity>("Property value", null));
    DISPLAY_NAMES.put(
        PROP_KEY_VALUE_SEPARATOR, new Pair<String, HighlightSeverity>("Key value separator", null));
    DISPLAY_NAMES.put(PROP_COMMENT, new Pair<String, HighlightSeverity>("Comment", null));
    DISPLAY_NAMES.put(
        PROP_VALID_STRING_ESCAPE, new Pair<String, HighlightSeverity>("String escape", null));
    DISPLAY_NAMES.put(
        PROP_INVALID_STRING_ESCAPE,
        new Pair<String, HighlightSeverity>("String escape (invalid)", HighlightSeverity.WARNING));
    DISPLAY_NAMES.put(PROP_SECTION, new Pair<String, HighlightSeverity>("Section", null));
    DISPLAY_NAMES.put(PROP_MACRO, new Pair<String, HighlightSeverity>("Macro", null));
    DISPLAY_NAMES.put(PROP_PROFILE, new Pair<String, HighlightSeverity>("Profile", null));
  }
}