// Highlighter rules based on Ace Editor <https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/java_highlight_rules.js>
// made by David Parreño Barbuzano <david.parreno101@alu.ulpgc.es>
{
    "name": "java-tokenizer",
    "extension": ".java",
    "check_rules": false,
    "inherit_rules": "text_tokenizer_rules",
    "override_tokens": {
        "constant.language.boolean": "constant.language"
    },
    "states": {
        "start": [
            {
                "token": "comment.line",
                "regex": "\\/\\/$",
                "next": "start"
            },
            {
                "token": "comment",
                "regex": "\\/\\/",
                "next": "singleLineComment"
            },
            {
                "token": "comment.block",
                "regex": "\\/\\*(\\*?)",
                "next": "multipleLineComment"
            },
            {
                "token": "string",
                "regex": "[\"](?:(?:\\\\.)|(?:[^\"\\\\]))*?[\"]"
            },
            {
                "token": "string",
                "regex": "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
            },
            {
                "token": "constant.numeric",
                "regex": "0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\\b"
            },
            {
                "token": "constant.numeric",
                "regex": "[+-]?[0-9][0-9_]*(?:(?:\\.[0-9_]*)?(?:[eE][+-]?[0-9_]+)?)?[LlSsDdFfYy]?\\b"
            },
            {
                "token": "variable.language",
                "regex": "this"
            },
            {
                "token": "keyword",
                "regex": "(?:abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while|var)\\b"
            },
            {
                "token": "constant.language",
                "regex": "(?:null|Infinity|NaN|undefined)\\b"
            },
            {
                "token": "support.function",
                "regex": "\\b(?:AbstractMethodError|AssertionError|ClassCircularityError|ClassFormatError|Deprecated|EnumConstantNotPresentException|ExceptionInInitializerError|IllegalAccessError|IllegalThreadStateException|InstantiationError|InternalError|NegativeArraySizeException|NoSuchFieldError|Override|Process|ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|SuppressWarnings|TypeNotPresentException|UnknownError|UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|InstantiationException|IndexOutOfBoundsException|ArrayIndexOutOfBoundsException|CloneNotSupportedException|NoSuchFieldException|IllegalArgumentException|NumberFormatException|SecurityException|Void|InheritableThreadLocal|IllegalStateException|InterruptedException|NoSuchMethodException|IllegalAccessException|UnsupportedOperationException|Enum|StrictMath|Package|Compiler|Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|Character|Boolean|StackTraceElement|Appendable|StringBuffer|Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|StackOverflowError|OutOfMemoryError|VirtualMachineError|ArrayStoreException|ClassCastException|LinkageError|NoClassDefFoundError|ClassNotFoundException|RuntimeException|Exception|ThreadDeath|Error|Throwable|System|ClassLoader|Cloneable|Class|CharSequence|Comparable|String|Object)\\b"
            },
            {
                "token": "constant.language.boolean",
                "regex": "(?:true|false)\\b"
            },
            {
                "token": "keyword.operator",
                "regex": "\\b(?:in|instanceof|new|delete|typeof|void)"
            },
            {
                "token": "identifier",
                "regex": "[a-zA-Z_$][a-zA-Z0-9_$]*"
            },
            {
                "token": "keyword.operator",
                "regex": "!|\\$|%|&|\\||\\^|\\*|\\/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\*=|\\/=|%=|\\+=|\\-=|&=|\\|=|\\^="
            },
            {
                "token": "keyword.operator",
                "regex": "\\?|:|,|;|\\."
            },
            {
                "token": "paren.lparen",
                "regex": "[[({]"
            },
            {
                "token": "paren.rparen",
                "regex": "[\\])}]"
            },
            {
                "token": "text",
                "regex": "\\s+"
            }
        ],
        "singleLineComment": [
            {
                "token": "comment.line",
                "regex": "$",
                "next": "start"
            },
            {
                "default_token": "comment.line"
            }
        ],
        "multipleLineComment": [
            {
                "token": "comment.block",
                "regex": "\\*\\/",
                "next": "start"
            },
            {
                "default_token": "comment.block"
            }
        ]
    }
}