43 lines
1.8 KiB
XML
43 lines
1.8 KiB
XML
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
<!-- ==========================================================================\
|
||
|
|
|
||
|
| To learn how to make your own language parser, please check the following
|
||
|
| link:
|
||
|
| https://npp-user-manual.org/docs/function-list/
|
||
|
|
|
||
|
\=========================================================================== -->
|
||
|
<NotepadPlus>
|
||
|
<functionList>
|
||
|
<!-- ========================================================== [ C# ] -->
|
||
|
|
||
|
<!--
|
||
|
| Based on:
|
||
|
| http://sourceforge.net/p/notepad-plus/patches/613/
|
||
|
\-->
|
||
|
<parser
|
||
|
displayName="C#"
|
||
|
id ="csharp_class"
|
||
|
commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
|
||
|
>
|
||
|
<classRange
|
||
|
mainExpr ="^[\t\x20]*((public|protected|private|internal)\s+)?(\w+\s*)?(class|struct|interface)[\t\x20]+[^\{]+\{"
|
||
|
openSymbole ="\{"
|
||
|
closeSymbole="\}"
|
||
|
>
|
||
|
<className>
|
||
|
<nameExpr expr="(class|struct|interface)[\t\x20]+\w+" />
|
||
|
<nameExpr expr="[\t\x20]+\w+" />
|
||
|
<nameExpr expr="\w+" />
|
||
|
</className>
|
||
|
<function
|
||
|
mainExpr="^[^\S\r\n]*(?<modifier1>(?:public|protected|internal|private)\s*)?(?<modifier2>(?:new|static|virtual|sealed|override|abstract|extern)\s*)?(partial\s*)?(?<type>(?!(return|if|else))\w+(?<genericType><[\w,\s<>]+>)?\s+)(?<name>\w+(?<genericNameType><[\w,\s<>]+>)?\s?)\((?<params>[\w\s,<>\[\]\:=\.]*)\)(?<ctorChain>\s*\:\s*(?:base|this)\s*\((?<ctorParams>[\w\s,<>\[\]\:=\.]*)\))?[\w\s<>\:,\(\)\[\]]*(?:\{|;)"
|
||
|
>
|
||
|
<functionName>
|
||
|
<funcNameExpr expr="(\w+(<[\w,\s<>]+>)?\s?)\(" />
|
||
|
<funcNameExpr expr="(\w+(<[\w,\s<>]+>)?\s?)" />
|
||
|
</functionName>
|
||
|
</function>
|
||
|
</classRange>
|
||
|
</parser>
|
||
|
</functionList>
|
||
|
</NotepadPlus>
|