2013-01-06 01:50:12 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
2013-10-12 09:10:03 +00:00
|
|
|
<!--
|
|
|
|
For learning making your language parser, please check the following link:
|
|
|
|
http://notepad-plus-plus.org/features/function-list.html
|
|
|
|
-->
|
2013-01-06 01:50:12 +00:00
|
|
|
<NotepadPlus>
|
|
|
|
<functionList>
|
|
|
|
<associationMap>
|
2013-03-20 22:50:48 +00:00
|
|
|
<!-- langID:
|
|
|
|
L_TEXT: 0 L_PHP: 1 L_C: 2 L_CPP: 3 L_CS: 4 L_OBJC: 5
|
|
|
|
L_JAVA: 6 L_RC: 7 L_HTML: 8 L_XML: 9 L_MAKEFILE: 10 L_PASCAL: 11
|
|
|
|
L_BATCH:12 L_INI: 13 L_ASCII: 14 L_USER: 15 L_ASP: 16 L_SQL: 17
|
|
|
|
L_VB: 18 L_JS: 19 L_CSS: 20 L_PERL: 21 L_PYTHON: 22 L_LUA: 23
|
|
|
|
L_TEX: 24 L_FORTRAN: 25 L_BASH: 26 L_FLASH: 27 L_NSIS: 28 L_TCL: 29
|
|
|
|
L_LISP: 30 L_SCHEME: 31 L_ASM: 32 L_DIFF: 33 L_PROPS: 34 L_PS: 35
|
|
|
|
L_RUBY: 36 L_SMALLTALK:37 L_VHDL: 38 L_KIX: 39 L_AU3: 40 L_CAML: 41
|
|
|
|
L_ADA: 42 L_VERILOG: 43 L_MATLAB: 44 L_HASKELL: 45 L_INNO: 46 L_SEARCHRESULT: 47
|
|
|
|
L_CMAKE: 48 L_YAML: 49 L_COBOL 50 L_GUI4CLI: 51 L_D: 52 L_POWERSHELL: 53
|
|
|
|
L_R: 54 L_JSP: 55
|
|
|
|
-->
|
2013-09-08 22:02:26 +00:00
|
|
|
<association langID="1" id="php_function"/>
|
|
|
|
<association langID="2" id="c_function"/>
|
|
|
|
<association langID="3" id="c_cpp_function"/>
|
2014-10-28 22:09:55 +00:00
|
|
|
<association langID="4" id="cs_function"/>
|
2013-11-03 22:22:57 +00:00
|
|
|
<association langID="6" id="java"/>
|
2013-09-08 22:02:26 +00:00
|
|
|
<association langID="9" id="xml_node"/>
|
|
|
|
<association langID="12" id="batch_label"/>
|
|
|
|
<association langID="13" id="ini_section"/>
|
|
|
|
<association langID="19" id="js_function"/>
|
|
|
|
<association langID="21" id="perl_function"/>
|
2014-08-15 23:05:45 +00:00
|
|
|
<association langID="22" id="python_function"/>
|
2014-05-01 12:59:04 +00:00
|
|
|
<association langID="26" id="bash_function"/>
|
2013-09-08 22:02:26 +00:00
|
|
|
<association langID="28" id="nsis_syntax"/>
|
2016-04-12 11:45:45 +00:00
|
|
|
<association langID="36" id="ruby_function"/>
|
2013-03-20 22:50:48 +00:00
|
|
|
<!--
|
|
|
|
if langID cannot be found above, you can still set the file extensions
|
2013-09-08 22:02:26 +00:00
|
|
|
<association ext=".my_passer_ext1" id="my_passer_id"/>
|
|
|
|
<association ext=".my_passer_ext2" id="my_passer_id"/>
|
|
|
|
|
|
|
|
for User Defined Languages:
|
|
|
|
<association userDefinedLangName="my user defined language" id="my_udl_passer_id"/>
|
|
|
|
<association userDefinedLangName="Autocad" id="my_autocad_passer_id"/>
|
2013-03-20 22:50:48 +00:00
|
|
|
-->
|
|
|
|
|
2013-01-06 01:50:12 +00:00
|
|
|
</associationMap>
|
|
|
|
<parsers>
|
2013-09-08 22:02:26 +00:00
|
|
|
|
|
|
|
<parser id="xml_node" displayName="XML Node" commentExpr="<!--([^-]|-(?!->))*-->">
|
|
|
|
<!-- Only match nodes with at least one attribute -->
|
|
|
|
<function
|
|
|
|
mainExpr="<[\w\?]+[\t ]+\w+[\t ]*=[\t ]*"[^"]+""
|
|
|
|
displayMode="$functionName">
|
|
|
|
<functionName>
|
|
|
|
<nameExpr expr="[^<]*"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
|
|
|
<parser id="batch_label" displayName="BAT Label" commentExpr="((::.*?$)|(REM.*?$))">
|
|
|
|
<function
|
|
|
|
mainExpr="^[\t ]*:\w+"
|
|
|
|
displayMode="$functionName">
|
|
|
|
<functionName>
|
|
|
|
<nameExpr expr="[^\t :]*"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
|
|
|
<parser id="ini_section" displayName="INI Section" commentExpr="((#.*?$)|(;.*?$))">
|
|
|
|
<function
|
|
|
|
mainExpr="^[\t ]*[\["][\w_.; \(\)-]+[\]"]"
|
|
|
|
displayMode="$functionName">
|
|
|
|
<functionName>
|
|
|
|
<nameExpr expr="[^\[\]"]*"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
2013-11-03 22:22:57 +00:00
|
|
|
<parser id="java" displayName="Java" commentExpr="((/\*.*?\*)/|(//.**$))">
|
2014-08-05 06:42:48 +00:00
|
|
|
<classRange mainExpr="^[\t ]*((public|protected|private|static|final|abstract|synchronized|@(\w)+)\s+)*(class|enum|interface|@interface)\s+\w+(<\s*\w+(,\s*\w+)*\s*>)?(\s+extends\s+\w+)?(\s+implements\s+\w+(,\s*\w+)*)?\s*\{" openSymbole="\{" closeSymbole="\}">
|
2013-01-06 01:50:12 +00:00
|
|
|
<className>
|
2014-08-05 06:42:48 +00:00
|
|
|
<nameExpr expr="(class|enum|interface|@interface)\s+\w+(<\s*\w+(,\s*\w+)*\s*>)?"></nameExpr>
|
|
|
|
<nameExpr expr="\s+\w+(<\s*\w+(,\s*\w+)*\s*>)?"></nameExpr>
|
|
|
|
<nameExpr expr="\w+(<\s*\w+(,\s*\w+)*\s*>)?"></nameExpr>
|
2013-01-06 01:50:12 +00:00
|
|
|
</className>
|
2014-08-05 06:42:48 +00:00
|
|
|
<function mainExpr="^[\t ]*((public|protected|private|static|final|abstract|synchronized|@(\w)+)\s+)*(\w*(\[\s*])*\s+)?(?!(if|while|for|switch|catch|synchronized)\b)\w+(\[\s*])*(<\s*\w+(,\s*\w+)*\s*>)?\s*\([^\)\(]*\)(\s+throws\s+\w+)?\s*\{">
|
2013-01-06 01:50:12 +00:00
|
|
|
<functionName>
|
2014-08-05 06:42:48 +00:00
|
|
|
<funcNameExpr expr="(?!(if|while|for|switch|catch|synchronized)\b)\w+(\[\s*])*(<\s*\w+(,\s*\w+)*\s*>)?\s*\("></funcNameExpr>
|
|
|
|
<funcNameExpr expr="(?!(if|while|for|switch|catch|synchronized)\b)\w+(\[\s*])*(<\s*\w+(,\s*\w+)*\s*>)?"></funcNameExpr>
|
2013-01-06 01:50:12 +00:00
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</classRange>
|
|
|
|
</parser>
|
2013-09-08 22:02:26 +00:00
|
|
|
|
2013-06-12 23:36:34 +00:00
|
|
|
<parser id="c_function" displayName="C source" commentExpr="((/\*.*?\*)/|(//.*?$))">
|
2013-01-06 01:50:12 +00:00
|
|
|
<function
|
2015-07-30 21:24:05 +00:00
|
|
|
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?[\w:]+([\s]+[\w]+)?([\s]+|(\*|\*\*)[\s]+|[\s]+(\*|\*\*)|[\s]+(\*|\*\*)[\s]+)([\w_]+[\s]*::)?(?!(if|while|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{"
|
2013-08-08 16:08:29 +00:00
|
|
|
displayMode="$functionName">
|
2013-02-22 23:17:28 +00:00
|
|
|
<functionName>
|
2013-06-12 23:36:34 +00:00
|
|
|
<nameExpr expr="(?!(if|while|for))[\w_~]+[\s]*\("/>
|
|
|
|
<nameExpr expr="(?!(if|while|for))[\w_~]+"/>
|
2013-02-22 23:17:28 +00:00
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
|
|
|
|
2013-07-07 18:27:03 +00:00
|
|
|
<parser id="js_function" displayName="Javascript" commentExpr="((/\*.*?\*)/|(//.*?$))">
|
2013-03-20 22:50:48 +00:00
|
|
|
<function
|
2013-12-07 01:41:25 +00:00
|
|
|
mainExpr="((^|[\s]+|[;\}\.])([_A-Za-z][\w_]*\.)*[_A-Za-z][\w_]*[\s]*[=:]|^|[\s;\}]+)[\s]*function([\s]+[_A-Za-z]?[\w_]*\([^\)\(]*\)|\([^\)\(]*\))[\n\s]*\{"
|
2013-03-20 22:50:48 +00:00
|
|
|
displayMode="$className->$functionName">
|
|
|
|
<functionName>
|
2013-12-07 01:41:25 +00:00
|
|
|
<nameExpr expr="[_A-Za-z][\w_]*[\s]*[=:]|[_A-Za-z]?[\w_]*[\s]*\("/>
|
2013-07-07 18:27:03 +00:00
|
|
|
<nameExpr expr="[_A-Za-z]?[\w_]*"/>
|
2013-03-20 22:50:48 +00:00
|
|
|
</functionName>
|
|
|
|
<className>
|
2013-07-07 18:27:03 +00:00
|
|
|
<nameExpr expr="([_A-Za-z][\w_]*\.)*[_A-Za-z][\w_]*\."/>
|
|
|
|
<nameExpr expr="([_A-Za-z][\w_]*\.)*[_A-Za-z][\w_]*"/>
|
2013-03-20 22:50:48 +00:00
|
|
|
</className>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
|
|
|
|
2013-06-12 23:36:34 +00:00
|
|
|
<parser id="c_cpp_function" displayName="C++ Class" commentExpr="((/\*.*?\*)/|(//.*?$))">
|
2013-03-20 22:50:48 +00:00
|
|
|
<classRange
|
2015-08-23 12:29:16 +00:00
|
|
|
mainExpr="^[\t ]*(class|struct)[\t ]+[\w]+[\s]*(final)?[\s]*(:[\s]*(public|protected|private)[\s]+[\w]+[\s]*)?\{"
|
2013-03-20 22:50:48 +00:00
|
|
|
openSymbole = "\{"
|
|
|
|
closeSymbole = "\}"
|
|
|
|
displayMode="node">
|
|
|
|
<className>
|
|
|
|
<nameExpr expr="(class|struct)[\t ]+[\w]+"/>
|
|
|
|
<nameExpr expr="[\t ]+[\w]+"/>
|
|
|
|
<nameExpr expr="[\w]+"/>
|
|
|
|
</className>
|
|
|
|
<function
|
2015-08-23 12:29:16 +00:00
|
|
|
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?([\w]+([\s]+[\w]+)?([\s]+|(\*|\*\*|&)[\s]+|[\s]+(\*|\*\*|&)|[\s]+(\*|\*\*|&)[\s]+))?([\w_]+[\s]*::)?(?!(if|while|for|switch))[\w_~]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?([\s]*(final|override|final[\s]*override|override[\s]*final)[\s]*)?[\n\s]*\{">
|
2013-03-20 22:50:48 +00:00
|
|
|
<functionName>
|
2013-05-30 21:22:45 +00:00
|
|
|
<funcNameExpr expr="(?!(if|while|for|switch))[\w_~]+[\s]*\("/>
|
|
|
|
<funcNameExpr expr="(?!(if|while|for|switch))[\w_~]+"/>
|
2013-03-20 22:50:48 +00:00
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</classRange>
|
|
|
|
<function
|
2015-07-30 21:24:05 +00:00
|
|
|
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?[\w]+([\s]+[\w]+)?([\s]+|(\*|\*\*|&)[\s]+|[\s]+(\*|\*\*|&)|[\s]+(\*|\*\*|&)[\s]+)([\w_]+[\s]*::)?(?!(if|while|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*\{"
|
2013-03-20 22:50:48 +00:00
|
|
|
displayMode="$className->$functionName">
|
|
|
|
<functionName>
|
2013-06-12 23:36:34 +00:00
|
|
|
<nameExpr expr="(?!(if|while|for))[\w_]+[\s]*\("/>
|
|
|
|
<nameExpr expr="(?!(if|while|for))[\w_]+"/>
|
2013-03-20 22:50:48 +00:00
|
|
|
</functionName>
|
|
|
|
<className>
|
|
|
|
<nameExpr expr="[\w_]+(?=[\s]*::)"/>
|
|
|
|
</className>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
2013-09-08 22:02:26 +00:00
|
|
|
<parser id="nsis_syntax" displayName="NSIS Syntax" commentExpr="((/\*.*?\*)/|(#.*?$)|(;.*?$))">
|
|
|
|
<function
|
|
|
|
mainExpr="^[\t ]*(!macro|Function|Section|SectionGroup)[\t ]+[^\r\n]*$"
|
|
|
|
displayMode="$functionName">
|
|
|
|
<functionName>
|
|
|
|
<nameExpr expr="(?(?=[\t ]*!macro)[\t ]*!macro[\t ]+[^\s]+|[^\r\n]*)"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
|
|
|
<parser id="perl_function" displayName="Perl">
|
2014-08-15 23:05:45 +00:00
|
|
|
<function mainExpr="^[\s]*(?<!#)[\s]*sub[\s]+[\w]+[\s]*\(?[^\)\(]*?\)?[\n\s]*\{" displayMode="$className->$functionName">
|
2013-09-08 22:02:26 +00:00
|
|
|
<functionName>
|
|
|
|
<nameExpr expr="(sub[\s]+)?\K[\w]+"/>
|
|
|
|
</functionName>
|
|
|
|
<className>
|
|
|
|
<nameExpr expr="[\w]+(?=[\s]*::)"/>
|
|
|
|
</className>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
2016-04-12 11:45:45 +00:00
|
|
|
<parser id="php_function" displayName="PHP" commentExpr="((/\*.*?\*)/|(//.*?$))">
|
|
|
|
<classRange
|
|
|
|
mainExpr="^[\s]*(class|abstract[\s]+class|final[\s]+class)[\t ]+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*([\s]*|[\s]*(extends|implements|(extends[\s]+(\\|[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)+[\s]+implements))[\s]+(\,[\s]*|(\\|[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))+[\s]*)?\{"
|
|
|
|
openSymbole = "\{"
|
|
|
|
closeSymbole = "\}"
|
|
|
|
displayMode="node">
|
|
|
|
<className>
|
|
|
|
<nameExpr expr="(class|abstract[\s]+class|final[\s]+class)[\s]+[\w]+"/>
|
|
|
|
<nameExpr expr="[\s]+[\w]+\Z"/>
|
|
|
|
<nameExpr expr="[\w]+\Z"/>
|
|
|
|
</className>
|
|
|
|
<function
|
|
|
|
mainExpr="^[\s]*((static|public|protected|private|final)*(\s+(static|public|protected|private|final))+[\s]+)?(function[\s]+)+([\w]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+))?([\w_]+[\s]*::)?(?!(if|while|for|switch))[\w_~]+[\s]*\([^\{]*\{">
|
|
|
|
<functionName>
|
|
|
|
<funcNameExpr expr="(?!(if|while|for|switch))[\w_]+[\s]*\([^\{]*"/>
|
|
|
|
<!-- comment below node if want display method with parmas -->
|
|
|
|
<funcNameExpr expr="(?!(if|while|for|switch))[\w_]+"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</classRange>
|
|
|
|
<function
|
|
|
|
mainExpr="^[\s]*function[\s]+\w+\("
|
|
|
|
displayMode="$className->$functionName">
|
|
|
|
<functionName>
|
|
|
|
<nameExpr expr="(?!(if|while|for))[\w_]+[\s]*\("/>
|
|
|
|
<nameExpr expr="(?!(if|while|for))[\w_]+"/>
|
|
|
|
</functionName>
|
|
|
|
<className>
|
|
|
|
<nameExpr expr="[\w_]+(?=[\s]*::)"/>
|
|
|
|
</className>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
2014-05-01 12:59:04 +00:00
|
|
|
<parser id="bash_function" displayName="Shell" commentExpr="(#.*?$)">
|
|
|
|
<function
|
|
|
|
mainExpr="^[\t ]*(function[\t\r\n ]*)?([a-zA-Z0-9_])+[\t\r\n ]*(\([^\)]*\))?[\t\r\n ]*(\{)[^(\})\r\n\t ]*"
|
|
|
|
displayMode="$functionName">
|
|
|
|
<functionName>
|
|
|
|
<nameExpr expr="[^{]*"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</parser>
|
2016-04-12 11:45:45 +00:00
|
|
|
|
2014-08-15 23:05:45 +00:00
|
|
|
<parser id="python_function" displayName="Python class" commentExpr="(#.*?$|'''.*?('''|\Z))">
|
|
|
|
<classRange mainExpr="(?<=^class ).*?(?=\n\S|\Z)">
|
|
|
|
<className>
|
|
|
|
<nameExpr expr="\w+(?=[\(|:])"/>
|
|
|
|
</className>
|
|
|
|
<function mainExpr="(?<=def ).+?(?=:)">
|
|
|
|
<functionName>
|
|
|
|
<funcNameExpr expr=".*"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</classRange>
|
|
|
|
<function mainExpr="(?<=def ).+?(?=:)">
|
|
|
|
<functionName>
|
|
|
|
<funcNameExpr expr=".*"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</parser>
|
2013-09-08 22:02:26 +00:00
|
|
|
|
2016-04-12 11:45:45 +00:00
|
|
|
<parser id="ruby_function" displayName="Ruby">
|
|
|
|
<!-- within a class-->
|
|
|
|
<classRange
|
|
|
|
mainExpr="(?<=^class ).*?(?=\n\S|\Z)"
|
|
|
|
displayMode="node" >
|
|
|
|
<className>
|
|
|
|
<nameExpr expr="\w+"/>
|
|
|
|
</className>
|
|
|
|
<function mainExpr="^\s*def\s+\w+" displayMode="$className->$functionName" >
|
|
|
|
<functionName>
|
|
|
|
<funcNameExpr expr="(?<=def\s)\w+"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</classRange>
|
|
|
|
|
|
|
|
<!-- without class-->
|
|
|
|
<function mainExpr="^\s*def\s+\w+" displayMode="$functionName" >
|
|
|
|
<functionName>
|
|
|
|
<nameExpr expr="(?<=def\s)\w+"/>
|
|
|
|
</functionName>
|
|
|
|
</function>
|
|
|
|
</parser>
|
|
|
|
|
2014-10-28 22:09:55 +00:00
|
|
|
<parser id="cs_function" displayName="C# Class" commentExpr="((/\*.*?\*)/|(//.*?$))">
|
|
|
|
<classRange
|
|
|
|
mainExpr="^[\t ]*((public|protected|private|internal)[\s]+)?([\w]+[\s]*)?(class|struct|interface)[\t ]+[^\{]+\{"
|
|
|
|
openSymbole = "\{"
|
|
|
|
closeSymbole = "\}"
|
|
|
|
displayMode="node">
|
|
|
|
<className>
|
|
|
|
<nameExpr expr="(class|struct|interface)[\t ]+[\w]+"/>
|
|
|
|
<nameExpr expr="[\t ]+[\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>
|
|
|
|
<function mainExpr="">
|
|
|
|
</function>
|
|
|
|
</parser>
|
2013-01-06 01:50:12 +00:00
|
|
|
</parsers>
|
|
|
|
</functionList>
|
|
|
|
</NotepadPlus>
|