#include <eepp/ui/doc/languages/rcscript.hpp>
#include <eepp/ui/doc/syntaxdefinitionmanager.hpp>

namespace EE { namespace UI { namespace Doc { namespace Language {

SyntaxDefinition& addRcscript() {

	return SyntaxDefinitionManager::instance()
		->add(

			{ "RC Script",
			  { "%.rc$", "%.rc2$", "%.dlg$" },
			  {
				  { { "include", "#comments" },
					{ "normal" },
					{},
					"",
					SyntaxPatternMatchType::LuaPattern },
				  { { "include", "#keywords" },
					{ "normal" },
					{},
					"",
					SyntaxPatternMatchType::LuaPattern },
				  { { "include", "#numerics" },
					{ "normal" },
					{},
					"",
					SyntaxPatternMatchType::LuaPattern },
				  { { "include", "#operators" },
					{ "normal" },
					{},
					"",
					SyntaxPatternMatchType::LuaPattern },
				  { { "include", "#strings" },
					{ "normal" },
					{},
					"",
					SyntaxPatternMatchType::LuaPattern },

			  },
			  {

			  },
			  "",
			  {}

			} )
		.addRepositories( {

			{ "strings",
			  {
				  { { "\"", "\"", "\\\\.\\d*" },
					{ "string" },
					{},
					"",
					SyntaxPatternMatchType::RegEx },

			  } },
			{ "operators",
			  {
				  { { "(\\-|\\+|~)" }, "operator", "", SyntaxPatternMatchType::RegEx },
				  { { "(=|==|!=|<=|>=|<|>)" }, "operator", "", SyntaxPatternMatchType::RegEx },
				  { { "(?i)(\\bNOT|!|&|\\|)" }, "operator", "", SyntaxPatternMatchType::RegEx },
				  { { "(\\{|\\}|\\(|\\))" }, "operator", "", SyntaxPatternMatchType::RegEx },

			  } },
			{ "numerics",
			  {
				  { { "cpp_number_parser" }, "number", "", SyntaxPatternMatchType::Parser },

			  } },
			{ "keywords",
			  {
				  { { "(?i)\\b(VK_LBUTTON|VK_RBUTTON|VK_CANCEL|VK_MBUTTON|VK_XBUTTON1|VK_XBUTTON2|"
					  "VK_BACK|VK_TAB|VK_CLEAR|VK_RETURN|VK_SHIFT|VK_CONTROL|VK_MENU|VK_PAUSE|VK_"
					  "CAPITAL|VK_KANA|VK_HANGUEL|VK_HANGUL|VK_IME_ON|VK_JUNJA|VK_FINAL|VK_HANJA|"
					  "VK_KANJI|VK_IME_OFF|VK_ESCAPE|VK_CONVERT|VK_NONCONVERT|VK_ACCEPT|VK_"
					  "MODECHANGE|VK_SPACE|VK_PRIOR|VK_NEXT|VK_END|VK_HOME|VK_LEFT|VK_UP|VK_RIGHT|"
					  "VK_DOWN|VK_SELECT|VK_PRINT|VK_EXECUTE|VK_SNAPSHOT|VK_INSERT|VK_DELETE|VK_"
					  "HELP|VK_LWIN|VK_RWIN|VK_APPS|VK_SLEEP|VK_NUMPAD0|VK_NUMPAD1|VK_NUMPAD2|VK_"
					  "NUMPAD3|VK_NUMPAD4|VK_NUMPAD5|VK_NUMPAD6|VK_NUMPAD7|VK_NUMPAD8|VK_NUMPAD9|"
					  "VK_MULTIPLY|VK_ADD|VK_SEPARATOR|VK_SUBTRACT|VK_DECIMAL|VK_DIVIDE|VK_F1|VK_"
					  "F2|VK_F3|VK_F4|VK_F5|VK_F6|VK_F7|VK_F8|VK_F9|VK_F10|VK_F11|VK_F12|VK_F13|VK_"
					  "F14|VK_F15|VK_F16|VK_F17|VK_F18|VK_F19|VK_F20|VK_F21|VK_F22|VK_F23|VK_F24|"
					  "VK_NUMLOCK|VK_SCROLL|VK_LSHIFT|VK_RSHIFT|VK_LCONTROL|VK_RCONTROL|VK_LMENU|"
					  "VK_RMENU|VK_BROWSER_BACK|VK_BROWSER_FORWARD|VK_BROWSER_REFRESH|VK_BROWSER_"
					  "STOP|VK_BROWSER_SEARCH|VK_BROWSER_FAVORITES|VK_BROWSER_HOME|VK_VOLUME_MUTE|"
					  "VK_VOLUME_DOWN|VK_VOLUME_UP|VK_MEDIA_NEXT_TRACK|VK_MEDIA_PREV_TRACK|VK_"
					  "MEDIA_STOP|VK_MEDIA_PLAY_PAUSE|VK_LAUNCH_MAIL|VK_LAUNCH_MEDIA_SELECT|VK_"
					  "LAUNCH_APP1|VK_LAUNCH_APP2|VK_OEM_1|VK_OEM_PLUS|VK_OEM_COMMA|VK_OEM_MINUS|"
					  "VK_OEM_PERIOD|VK_OEM_2|VK_OEM_3|VK_OEM_4|VK_OEM_5|VK_OEM_6|VK_OEM_7|VK_OEM_"
					  "8|VK_OEM_102|VK_PROCESSKEY|VK_PACKET|VK_ATTN|VK_CRSEL|VK_EXSEL|VK_EREOF|VK_"
					  "PLAY|VK_ZOOM|VK_NONAME|VK_PA1|VK_OEM_CLEAR)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(ID\\w+_\\w+)\\b" }, "keyword", "", SyntaxPatternMatchType::RegEx },
				  { { "(?i)#\\b(define|elif|else|endif|if|ifdef|ifndef|include|undef|pragma)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(BEGIN|BLOCK|END)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(SBS_BOTTOMALIGN|SBS_HORZ|SBS_LEFTALIGN|SBS_RIGHTALIGN|SBS_SIZEBOX|"
					  "SBS_SIZEBOXBOTTOMRIGHTALIGN|SBS_SIZEBOXTOPLEFTALIGN|SBS_SIZEGRIP|SBS_VERT|"
					  "FW_DONTCARE|FW_THIN|FW_EXTRALIGHT|FW_LIGHT|FW_NORMAL|FW_MEDIUM|FW_SEMIBOLD|"
					  "FW_BOLD|FW_EXTRABOLD|FW_HEAVY|BS_3STATE|BS_AUTO3STATE|BS_AUTOCHECKBOX|BS_"
					  "AUTORADIOBUTTON|BS_BITMAP|BS_BOTTOM|BS_CENTER|BS_CHECKBOX|BS_COMMANDLINK|BS_"
					  "DEFCOMMANDLINK|BS_DEFPUSHBUTTON|BS_FLAT|BS_GROUPBOX|BS_ICON|BS_LEFT|BS_"
					  "LEFTTEXT|BS_MULTILINE|BS_NOTIFY|BS_OWNERDRAW|BS_PUSHBUTTON|BS_PUSHLIKE|BS_"
					  "RADIOBUTTON|BS_RIGHT|BS_RIGHTBUTTON|BS_SPLITBUTTON|BS_TEXT|BS_TOP|BS_"
					  "USERBUTTON|BS_VCENTER|BS_PUSHBOX|SS_BITMAP|SS_BLACKFRAME|SS_BLACKRECT|SS_"
					  "CENTERIMAGE|SS_ENDELLIPSIS|SS_ETCHEDFRAME|SS_ETCHEDHORZ|SS_ETCHEDVERT|SS_"
					  "GRAYFRAME|SS_GRAYRECT|SS_ICON|SS_LEFT|SS_LEFTNOWORDWRAP|SS_NOPREFIX|SS_"
					  "NOTIFY|SS_OWNERDRAW|SS_PATHELLIPSIS|SS_REALSIZEIMAGE|SS_RIGHT|SS_SIMPLE|SS_"
					  "SUNKEN|SS_USERITEM|SS_WHITEFRAME|SS_WORDELLIPSIS|SS_CENTER|CBS_AUTOHSCROLL|"
					  "CBS_DISABLENOSCROLL|CBS_DROPDOWN|CBS_DROPDOWNLIST|CBS_HASSTRINGS|CBS_"
					  "LOWERCASE|CBS_NOINTEGRALHEIGHT|CBS_OEMCONVERT|CBS_OWNERDRAWFIXED|CBS__"
					  "OWNERDRAWVARIABLE|CBS_SIMPLE|CBS_SORT|CBS_UPPERCASE|LBS_DISABLENOSCROLL|LBS_"
					  "EXTENDEDSEL|LBS_HASSTRINGS|LBS_MULTICOLUMN|LBS_MULTIPLESEL|LBS_NODATA|LBS_"
					  "NOINTEGRALHEIGHT|LBS_NOREDRAW|LBS_NOSEL|LBS_NOTIFY|LBS_OWNERDRAWFIXED|LBS_"
					  "OWNERDRAWVARIABLE|LBS_SORT|LBS_STANDARD|LBS_USETABSTOPS|LBS_"
					  "WANTKEYBOARDINPUT|TCS_BOTTOM|TCS_BUTTONS|TCS_FIXEDWIDTH|TCS_FLATBUTTONS|TCS_"
					  "FOCUSNEVER|TCS_FOCUSONBUTTONDOWN|TCS_FORCEICONLEFT|TCS_FORCELABELLEFT|TCS_"
					  "HOTTRACK|TCS_MULTILINE|TCS_MULTISELECT|TCS_OWNERDRAWFIXED|TCS_RAGGEDRIGHT|"
					  "TCS_RIGHT|TCS_RIGHTJUSTIFY|TCS_SCROLLOPPOSITE|TCS_SINGLELINE|TCS_TABS|TCS_"
					  "TOOLTIPS|TCS_VERTICAL|TVS_CHECKBOXES|TVS_DISABLEDRAGDROP|TVS_EDITLABELS|TVS_"
					  "FULLROWSELECT|TVS_HASBUTTONS|TVS_HASLINES|TVS_INFOTIP|TVS_LINESATROOT|TVS_"
					  "NOHSCROLL|TVS_NONEVENHEIGHT|TVS_NOSCROLL|TVS_NOTOOLTIPS|TVS_RTLREADING|TVS_"
					  "SHOWSELALWAYS|TVS_SINGLEEXPAND|TVS_TRACKSELECT|LVS_ALIGNLEFT|LVS_ALIGNTOP|"
					  "LVS_AUTOARRANGE|LVS_EDITLABELS|LVS_ICON|LVS_LIST|LVS_NOCOLUMNHEADER|LVS_"
					  "NOLABELWRAP|LVS_NOSCROLL|LVS_NOSORTHEADER|LVS_OWNERDATA|LVS_OWNERDRAWFIXED|"
					  "LVS_REPORT|LVS_SHAREIMAGELISTS|LVS_SHOWSELALWAYS|LVS_SINGLESEL|LVS_"
					  "SMALLICON|LVS_SORTASCENDING|LVS_SORTDESCENDING|PBS_MARQUEE|PBS_SMOOTH|PBS_"
					  "VERTICAL|TBSTYLE_ALTDRAG|TBSTYLE_AUTOSIZE|TBSTYLE_CUSTOMERASE|TBSTYLE_FLAT|"
					  "TBSTYLE_LIST|TBSTYLE_REGISTERDROP|TBSTYLE_TOOLTIPS|TBSTYLE_TRANSPARENT|"
					  "TBSTYLE_WRAPABLE|CCS_ADJUSTABLE|CCS_BOTTOM|CCS_LEFT|CCS_NODIVIDER|CCS_"
					  "NOMOVEX|CCS_NOMOVEY|CCS_NOPARENTALIGN|CCS_NORESIZE|CCS_RIGHT|CCS_TOP|CCS_"
					  "VERT|UDS_ALIGNLEFT|UDS_ALIGNRIGHT|UDS_ARROWKEYS|UDS_AUTOBUDDY|UDS_HORZ|UDS_"
					  "HOTTRACK|UDS_NOTHOUSANDS|UDS_SETBUDDYINT|UDS_WRAP|SBARS_SIZEGRIP|SBARS_"
					  "TOOLTIPS|SBT_TOOLTIPS|DTS_APPCANPARSE|DTS_LONGDATEFORMAT|DTS_RIGHTALIGN|DTS_"
					  "SHORTDATEFORMAT|DTS_SHOWNONE|DTS_TIMEFORMAT|DTS_UPDOWN|MCS_DAYSTATE|MCS_"
					  "MULTISELECT|MCS_NOTODAY|MCS_NOTODAYCIRCLE|MCS_WEEKNUMBERS|ES_AUTOHSCROLL|ES_"
					  "AUTOVSCROLL|ES_CENTER|ES_DISABLENOSCROLL|ES_LEFT|ES_MULTILINE|ES_NOHIDESEL|"
					  "ES_PASSWORD|ES_READONLY|ES_RIGHT|ES_SAVESEL|ES_SELECTIONBAR|ES_SUNKEN|ES_"
					  "VERTICAL|ES_WANTRETURN|ACS_AUTOPLAY|ACS_CENTER|ACS_TIMER|ACS_TRANSPARENT|"
					  "PGS_AUTOSCROLL|PGS_DRAGNDROP|PGS_HORZ|PGS_VERT|RBS_AUTOSIZE|RBS_BANDBORDERS|"
					  "RBS_DBLCLKTOGGLE|RBS_FIXEDORDER|RBS_REGISTERDROP|RBS_TOOLTIPS|RBS_VARHEIGHT|"
					  "RBS_VERTICALGRIPPER|HDS_BUTTONS|HDS_DRAGDROP|HDS_FILTERBAR|HDS_FULLDRAG|HDS_"
					  "HIDDEN|HDS_HORZ|HDS_HOTTRACK|LWS_IGNORERETURN|LWS_NOPREFIX|LWS_RIGHT|LWS_"
					  "TRANSPARENT|LWS_USECUSTOMTEXT|LWS_USEVISUALSTYLE)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(WS_BORDER|WS_CAPTION|WS_CHILD|WS_CHILDWINDOW|WS_CLIPCHILDREN|WS_"
					  "CLIPSIBLINGS|WS_DISABLED|WS_DLGFRAME|WS_GROUP|WS_HSCROLL|WS_ICONIC|WS_"
					  "MAXIMIZE|WS_MAXIMIZEBOX|WS_MINIMIZE|WS_MINIMIZEBOX|WS_OVERLAPPED|WS_"
					  "OVERLAPPEDWINDOW|WS_POPUP|WS_POPUPWINDOW|WS_SIZEBOX|WS_SYSMENU|WS_TABSTOP|"
					  "WS_THICKFRAME|WS_TILED|WS_TILEDWINDOW|WS_VISIBLE|WS_VSCROLL|DS_ABSALIGN|DS_"
					  "SYSMODAL|DS_FIXEDSYS|DS_NOFAILCREATE|DS_SETFONT|DS_MODALFRAME|DS_NOIDLEMSG|"
					  "DS_SETFOREGROUND|DS_CONTROL|DS_CENTER|DS_CENTERMOUSE|DS_CONTEXTHELP)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(WS_EX_ACCEPTFILES|WS_EX_APPWINDOW|WS_EX_CLIENTEDGE|WS_EX_COMPOSITED|"
					  "WS_EX_CONTEXTHELP|WS_EX_CONTROLPARENT|WS_EX_DLGMODALFRAME|WS_EX_LAYERED|WS_"
					  "EX_LAYOUTRTL|WS_EX_LEFT|WS_EX_LEFTSCROLLBAR|WS_EX_LTRREADING|WS_EX_MDICHILD|"
					  "WS_EX_NOACTIVATE|WS_EX_NOINHERITLAYOUT|WS_EX_NOPARENTNOTIFY|WS_EX_"
					  "NOREDIRECTIONBITMAP|WS_EX_OVERLAPPEDWINDOW|WS_EX_PALETTEWINDOW|WS_EX_RIGHT|"
					  "WS_EX_RIGHTSCROLLBAR|WS_EX_RTLREADING|WS_EX_STATICEDGE|WS_EX_TOOLWINDOW|WS_"
					  "EX_TOPMOST|WS_EX_TRANSPARENT|WS_EX_WINDOWEDGE)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(FILEVERSION|PRODUCTVERSION|FILEFLAGSMASK|FILEFLAGS|FILEOS|FILETYPE|"
					  "FILESUBTYPE|VS_FF_DEBUG|VS_FF_PATCHED|VS_FF_PRERELEASE|VS_FF_PRIVATEBUILD|"
					  "VS_FF_SPECIALBUILD|VS_FFI_FILEFLAGSMASK|VOS_UNKNOWN|VOS_DOS|VOS_NT|VOS__"
					  "WINDOWS16|VOS__WINDOWS32|VOS_DOS_WINDOWS16|VOS_DOS_WINDOWS32|VOS_NT_"
					  "WINDOWS32|VFT_UNKNOWN|VFT_APP|VFT_DLL|VFT_DRV|VFT_FONT|VFT_VXD|VFT_STATIC_"
					  "LIB|VFT2_UNKNOWN|VFT2_DRV_COMM|VFT2_DRV_PRINTER|VFT2_DRV_KEYBOARD|VFT2_DRV_"
					  "LANGUAGE|VFT2_DRV_DISPLAY|VFT2_DRV_MOUSE|VFT2_DRV_NETWORK|VFT2_DRV_SYSTEM|"
					  "VFT2_DRV_INSTALLABLE|VFT2_DRV_SOUND|VFT2_DRV_VERSIONED_PRINTER|VFT2_FONT_"
					  "RASTER|VFT2_FONT_VECTOR|VFT2_FONT_TRUETYPE)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(ANSI_CHARSET|DEFAULT_CHARSET|SYMBOL_CHARSET|SHIFTJIS_CHARSET|"
					  "HANGEUL_CHARSET|HANGUL_CHARSET|GB2312_CHARSET|CHINESEBIG5_CHARSET|OEM_"
					  "CHARSET|JOHAB_CHARSET|HEBREW_CHARSET|ARABIC_CHARSET|GREEK_CHARSET|TURKISH_"
					  "CHARSET|VIETNAMESE_CHARSET|THAI_CHARSET|EASTEUROPE_CHARSET|RUSSIAN_CHARSET|"
					  "MAC_CHARSET|BALTIC_CHARSET)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(ASCII|VERSION|CLASS|CAPTION|CHARACTERISTICS|EXSTYLE|STYLE|VALUE|"
					  "NOINVERT|ALT|SHIFT|VIRTKEY|CHECKED|GRAYED|HELP|INACTIVE|MENUBARBREAK|"
					  "MENUBREAK|MENUITEM|SEPARATOR)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(ACCELERATORS|BITMAP|CURSOR|DIALOGEX|DIALOG|FONT|HTML|ICON|LANGUAGE|"
					  "MENUEX|MENU|MESSAGETABLE|POPUP|PLUGPLAY|RCDATA|STRINGTABLE|TEXTINCLUDE|"
					  "TYPELIB|VERSIONINFO|VXD|User-Defined|RC_INVOKED|DISCARDABLE|MANIFEST|"
					  "ANICURSOR|ANIICON)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(BUTTON|EDIT|STATIC|LISTBOX|SCROLLBAR|COMBOBOX|WC_HEADER|WC_LISTVIEW|"
					  "WC_TREEVIEW|HOTKEY_CLASS|UPDOWN_CLASS|ANIMATE_CLASS|WC_COMBOBOXEX|WC_"
					  "TABCONTROL|MONTHCAL_CLASS|PROGRESS_CLASS|REBARCLASSNAME|TOOLTIPS_CLASS|"
					  "TRACKBAR_CLASS|STATUSCLASSNAME|TOOLBARCLASSNAME|DATETIMEPICK_CLASS|WC_"
					  "IPADDRESS|WC_PAGESCROLLER|WC_NATIVEFONTCTL|DRAGLISTMSGSTRING)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(?i)\\b(AUTO3STATE|AUTOCHECKBOX|AUTORADIOBUTTON|CHECKBOX|COMBOBOX|CONTROL|"
					  "CTEXT|DEFPUSHBUTTON|EDITTEXT|GROUPBOX|LISTBOX|LTEXT|PUSHBOX|PUSHBUTTON|"
					  "RADIOBUTTON|RTEXT|SCROLLBAR|STATE3|HEDIT|IEDIT)\\b" },
					"keyword",
					"",
					SyntaxPatternMatchType::RegEx },

			  } },
			{ "comments",
			  {
				  { { ";;", ";;" },
					{ "comment" },
					{ "comment" },
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "\\/\\*", "\\*\\/" },
					{ "comment" },
					{ "comment" },
					"",
					SyntaxPatternMatchType::RegEx },
				  { { "(;|//).*$" }, "comment", "", SyntaxPatternMatchType::RegEx },

			  } },
		} );
}

}}}} // namespace EE::UI::Doc::Language
