<SyntaxDefinition name="C++" extensions=".cpp;.h;.hpp;.c" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
    <Color name="Comment" foreground="#84c36b" />
    <Color name="Keyword" foreground="#82AAFF" fontWeight="bold" />
    <Color name="Type" foreground="#4cc9b0" />
    <Color name="String" foreground="#ECC48D" />
    <Color name="Preprocessor" foreground="#82AAFF" fontWeight="bold" />
    <Color name="Number" foreground="#F78C6C" />
    <Color name="Function" foreground="#C3E88D" />
    <Color name="AccessModifier" foreground="#f20f5c" fontWeight="bold" />
    <Color name="UEMacro" foreground="#82AAFF" fontWeight="bold" />
    <Color name="LabelColor" foreground="#808080" />
    <Color name="JumpKeywords" foreground="#dda0dd" />
    <Color name="CompoundKeywords" foreground="#FF569CD6" fontWeight="bold" />
    <Color name="Pointer" foreground="#ff8888" fontWeight="bold"/>
    <Color name="StaticClass" foreground="#c2a8ff" />
    <Color name="Brace" foreground="#89DDFF" />
    <Color name="This" foreground="#FF569CD6" fontWeight="bold" />
    <Color name="BooleanConstants" foreground="#569cd6" fontWeight="bold" />

    <RuleSet ignoreCase="false">
        <Span color="String" begin="&quot;" end="&quot;" />
        <!-- UE Macros -->
        <Keywords color="UEMacro">
            <Word>UCLASS</Word>
            <Word>USTRUCT</Word>
            <Word>UPROPERTY</Word>
            <Word>UFUNCTION</Word>
            <Word>GENERATED_BODY</Word>
            <Word>GENERATED_USTRUCT_BODY</Word>
            <Word>GENERATED_UCLASS_BODY</Word>
        </Keywords>

        <Keywords color="JumpKeywords">
            <Word>goto</Word>
            <Word>return</Word>
            <Word>throw</Word>
        </Keywords>

        <!-- C++ Keywords -->
        <Keywords color="Keyword">
            <Word>void</Word>
            <Word>int</Word>
            <Word>Int8</Word>
            <Word>Int16</Word>
            <Word>Int32</Word>
            <Word>Int64</Word>
            <Word>uint</Word>
            <Word>UInt16</Word>
            <Word>UInt32</Word>
            <Word>UInt64</Word>
            <Word>float</Word>
            <Word>double</Word>
            <Word>bool</Word>
            <Word>return</Word>
            <Word>if</Word>
            <Word>else</Word>
            <Word>for</Word>
            <Word>while</Word>
            <Word>do</Word>
            <Word>switch</Word>
            <Word>case</Word>
            <Word>break</Word>
            <Word>continue</Word>
            <Word>namespace</Word>
            <Word>using</Word>
            <Word>typedef</Word>
            <Word>sizeof</Word>
            <Word>new</Word>
            <Word>delete</Word>
            <Word>class</Word>
            <Word>struct</Word>
            <Word>enum</Word>
            <Word>template</Word>
            <Word>typename</Word>
            <Word>const</Word>
            <Word>static</Word>
            <Word>mutable</Word>
            <Word>volatile</Word>
            <Word>override</Word>
            <Word>virtual</Word>
            <Word>explicit</Word>
            <Word>friend</Word>
            <Word>inline</Word>
            <Word>constexpr</Word>
            <Word>default</Word>
        </Keywords>

        <Keywords color="Pointer">
            <Word>nullptr</Word>
        </Keywords>

        <Keywords color="BooleanConstants">
            <Word>true</Word>
            <Word>True</Word>
            <Word>false</Word>
            <Word>False</Word>
            <Word>NULL</Word>
        </Keywords>

        <Keywords color="AccessModifier">
            <Word>public</Word>
            <Word>protected</Word>
            <Word>private</Word>
        </Keywords>

        <Keywords color="This">
            <Word>this</Word>
        </Keywords>

        <!-- Reference symbols -->
        <Rule color="Pointer">(?&lt;=[A-Za-z0-9_&gt;&amp;\]])&amp;(?=\s*[A-Za-z_&lt;])</Rule>

        <Rule color="LabelColor">\bLabel_\d+:</Rule>

        <!-- Numbers (hex too) -->
        <Rule color="Number">\b(0x[0-9a-fA-F]+|[0-9]+(\.[0-9]+)?)\b</Rule>

        <Rule color="StaticClass">\bU[A-Z][A-Za-z0-9_]*\b(?=::)</Rule>
        <Rule color="Function">[A-Za-z_][A-Za-z0-9_]*\s*(?=\()</Rule>

        <Rule color="Brace">[\[\]\{\}]</Rule>

        <Rule color="Comment">(\/\/.*|\/\*[\s\S]*?\*\/)</Rule>

        <!-- Template Functions -->
        <Rule color="Function">\b[A-Za-z_][A-Za-z0-9_]*\b(?=&lt;)</Rule>

        <!-- Types -->
        <Rule color="Type">\b[A-Z][A-Za-z0-9_]*(?:&lt;[^&gt;]+&gt;)?[*&amp;]?(?=\s+[*&amp;]?[A-Za-z_][A-Za-z0-9_]*\s*(=|;|\)|,))</Rule>

        <!-- Types inside <> -->
        <Rule color="Type">(?&lt;=&lt;)\s*[A-Z][A-Za-z0-9_]*(?:&lt;[^&gt;]+&gt;)?[*&amp;]?\s*(?=[&gt;,])</Rule>

        <!-- Match class name after the 'class' keyword -->
        <Rule color="Type">\b(?&lt;=class\s)[A-Za-z_][A-Za-z0-9_]*</Rule>

        <!-- Match name after 'public' keyword -->
        <Rule color="Type">\b(?&lt;=public\s)[A-Za-z_][A-Za-z0-9_]*</Rule>

        <!-- Types in function parameters -->
        <Rule color="Type">\b(?:T|F|U|E)[A-Z][A-Za-z0-9_]*(?:&lt;[^&gt;]+&gt;)?[*&amp;]?(?=\s+[*&amp;]?[A-Za-z_][A-Za-z0-9_]*\s*(?:=|,|\)))</Rule>
        <Rule color="Type">\b(?&lt;=[,(]\s*const\s)(?:T|F|U)[A-Z][A-Za-z0-9_]*[*&amp;]?(?=\s)</Rule>

        <!-- First parameter type in function -->
        <Rule color="Type">\b(?&lt;=\()\s*[TUF][A-Z][A-Za-z0-9_]*(?=\s*&lt;)</Rule>
        <Rule color="Type">\b(?&lt;=\()\s*[TUF][A-Z][A-Za-z0-9_]*[*&amp;]?(?=\s)</Rule>
        <Rule color="Type">\b(?&lt;=\(\s*const\s)[TUF][A-Z][A-Za-z0-9_]*[*&amp;]?(?=\s)</Rule>

    </RuleSet>
</SyntaxDefinition>
