0% found this document useful (0 votes)
124 views9 pages

XML List Functions For Notepad++

The document describes the configuration of language parsers for Notepad++. It includes the parser ID, display name, comment expression, and main expression for 14 different parsers covering languages like PHP, C, C++, Java, XML, Batch, and more. Each parser defines elements for matching classes, functions, and their names.

Uploaded by

selene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views9 pages

XML List Functions For Notepad++

The document describes the configuration of language parsers for Notepad++. It includes the parser ID, display name, comment expression, and main expression for 14 different parsers covering languages like PHP, C, C++, Java, XML, Batch, and more. Each parser defines elements for matching classes, functions, and their names.

Uploaded by

selene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 9

<?xml version="1.0" encoding="UTF-8" ?

>
<!-| To learn how to make your own language parser, please check the following li
nk:
|
http://notepad-plus-plus.org/features/function-list.html
\-->
<NotepadPlus>
<functionList>
<associationMap>
<!-langID:
Don't use L_JS (19) use L_JAVASCRIPT (58) instead!
L_ADA
= 31
L_ASCII
L_SEARCHRESULT = 47
L_ASM
L_SMALLTALK
= 37
L_ASP
L_SQL
= 17
L_AU3
L_TCL
= 29
L_BASH
L_TEX
= 24
L_BATCH
L_TEXT
= 0
L_C
L_USER
= 15
L_CAML
L_VB
= 18
L_CMAKE
L_VERILOG
= 43
L_COBOL
L_VHDL
= 38
L_COFFEESCRIPT
L_XML
= 9
L_CPP
L_YAML
= 49
L_CS

= 42 | L_DIFF

= 33 | L_LISP

= 14 | L_EXTERNAL

= 60 | L_LUA

= 32 | L_FLASH

= 27 | L_MAKEFILE

= 16 | L_FORTRAN

= 25 | L_MATLAB

= 40 | L_FORTRAN_77

= 59 | L_NSIS

= 26 | L_GUI4CLI

= 51 | L_OBJC

= 12 | L_HASKELL

= 45 | L_PASCAL

= 2 | L_HTML

= 8 | L_PERL

= 41 | L_INI

= 13 | L_PHP

= 48 | L_INNO

= 46 | L_POWERSHELL

= 50 | L_JAVA

= 6 | L_PROPS

= 56 | L_JAVASCRIPT

= 58 | L_PS

= 3 | L_JS

= 19 | L_PYTHON

= 4 | L_JSON

= 57 | L_R

L_CSS

= 20 | L_JSP

= 55 | L_RC

L_D

= 52 | L_KIX

= 39 | L_RUBY

= 30 | L_SCHEME
= 23 |
= 10 |
= 44 |
= 28 |
= 5 |
= 11 |
= 21 |
= 1 |
= 53 |
= 34 |
= 35 |
= 22 |
= 54 |
= 7 |
= 36 |

0 = L_TEXT

| 16 = L_ASP

| 32 = L_ASM

1 = L_PHP

| 17 = L_SQL

| 33 = L_DIFF

2 = L_C

| 18 = L_VB

| 34 = L_PROPS

3 = L_CPP

| 19 = L_JS

| 35 = L_PS

4 = L_CS

| 20 = L_CSS

| 36 = L_RUBY

| 21 = L_PERL

| 37 = L_SMALL

| 22 = L_PYTHON

| 38 = L_VHDL

| 48 = L_CMAKE
| 49 = L_YAML
| 50 = L_COBOL
| 51 = L_GUI4CLI
| 52 = L_D
TALK

5 = L_OBJC
| 53 = L_POWERSHELL
6 = L_JAVA

| 54 = L_R
7 = L_RC

| 23 = L_LUA

| 39 = L_KIX

| 24 = L_TEX

| 40 = L_AU3

| 25 = L_FORTRAN

| 41 = L_CAML

| 26 = L_BASH

| 42 = L_ADA

| 27 = L_FLASH

| 43 = L_VERIL

| 28 = L_NSIS

| 44 = L_MATLA

| 29 = L_TCL

| 45 = L_HASKE

| 30 = L_LISP

| 46 = L_INNO

| 31 = L_SCHEME

| 47 = L_SEARC

| 55 = L_JSP
8 = L_HTML
| 56 = L_COFFEESCRIPT
9 = L_XML
| 57 = L_JSON
10 = L_MAKEFILE
| 58 = L_JAVASCRIPT
11 = L_PASCAL
OG
| 59 = L_FORTRAN_77
12 = L_BATCH
B
| 60 = L_EXTERNAL
13 = L_INI
LL
|
14 = L_ASCII
|
15 = L_USER
HRESULT |

if langID cannot be found above, you can set the file ex


tensions ...
<association id="my_parser_id" ext=".my_parser_ext1" />
<association id="my_parser_id" ext=".my_parser_ext2" />
and for User Defined Languages (UDL's) use ...
<association id="my_parser_id" userDefinedLangName="My U
DL Name" />
-->
<association
<association
<association
<association
<association
<association
<association
<association
<association
<association
<association
<association
<association
<association

langID= "1"
langID= "2"
langID= "3"
langID= "4"
langID= "6"
langID= "9"
langID="12"
langID="13"
langID="21"
langID="22"
langID="26"
langID="28"
langID="36"
langID="58"

id="php_function" />
id="c_function" />
id="cpp_function" />
id="cs_function" />
id="java" />
id="xml_node" />
id="batch_label" />
id="ini_section" />
id="perl_function" />
id="python_function" />
id="bash_function" />
id="nsis_syntax" />
id="ruby_function" />
id="javascript_function" />

</associationMap>
<parsers>
<parser
id
="php_function"
displayName="PHP"
commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
>
<classRange
mainExpr
="^\s*(class|abstract\s+clas
s|final\s+class)[\t\x20]+[A-Za-z_\x7f-\xff][\w\x7f-\xff]*(\s*|\s*(extends|implem
ents|(extends\s+(\\|[A-Za-z_\x7f-\xff][\w\x7f-\xff]*)+\s+implements))\s+(\,\s*|(
\\|[A-Za-z_\x7f-\xff][\w\x7f-\xff]*))+\s*)?\{"
openSymbole ="\{"

closeSymbole="\}"
>
<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|pr
otected|private|final)*(\s+(static|public|protected|private|final))+\s+)?(functi
on\s+)+(\w+(\s+\w+)?(\s+|\*\s+|\s+\*|\s+\*\s+))?(\w+\s*::)?(?!(if|while|for|swit
ch))[\w~]+\s*\([^\{]*\{"
>
<functionName>
<funcNameExpr expr="(?!(
if|while|for|switch))\w+\s*\([^\{]*" />
<!-- comment out the fol
lowing node to display the method with parameters -->
<funcNameExpr expr="(?!(
if|while|for|switch))\w+" />
</functionName>
</function>
</classRange>
<function
mainExpr="^\s*function\s+\w+\("
>
<functionName>
<nameExpr expr="(?!(if|while|for
))\w+\s*\(" />
<nameExpr expr="(?!(if|while|for
))\w+" />
</functionName>
<className>
<nameExpr expr="\w+(?=\s*::)" />
</className>
</function>
</parser>
<parser
id
="c_function"
displayName="C source"
commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
>
<function
mainExpr="^[\t\x20]*((static|const|virtu
al)\s+)?[\w:]+(\s+\w+)?(\s+|(\*|\*\*)\s+|\s+(\*|\*\*)|\s+(\*|\*\*)\s+)(\w+\s*::)
?(?!(if|while|for))\w+\s*\([^\)\(]*\)(\s*const\s*)?[\n\s]*\{"
>
<functionName>
<nameExpr expr="(?!(if|while|for
))[\w~]+\s*\(" />
<nameExpr expr="(?!(if|while|for
))[\w~]+" />
</functionName>
</function>
</parser>
<parser
id

="cpp_function"

displayName="C++ Class"
commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
>
<classRange
mainExpr
="^[\t\x20]*(class|struct)[\
t\x20]+\w+\s*(final)?\s*(:\s*(public|protected|private)\s+\w+\s*)?\{"
openSymbole ="\{"
closeSymbole="\}"
>
<className>
<nameExpr expr="(class|struct)[\
t\x20]+\w+" />
<nameExpr expr="[\t\x20]+\w+" />
<nameExpr expr="\w+" />
</className>
<function
mainExpr="^[\t\x20]*((static|con
st|virtual)\s+)?(\w+(\s+\w+)?(\s+|(\*|\*\*|&amp;)\s+|\s+(\*|\*\*|&amp;)|\s+(\*|\
*\*|&amp;)\s+))?(\w+\s*::)?(?!(if|while|for|switch))[\w~]+\s*\([^\)\(]*\)(\s*con
st\s*)?(\s*(final|override|final\s*override|override\s*final)\s*)?[\n\s]*\{"
>
<functionName>
<funcNameExpr expr="(?!(
if|while|for|switch))[\w~]+\s*\(" />
<funcNameExpr expr="(?!(
if|while|for|switch))[\w~]+" />
</functionName>
</function>
</classRange>
<function
mainExpr="^[\t\x20]*((static|const|virtu
al)\s+)?\w+(\s+\w+)?(\s+|(\*|\*\*|&amp;)\s+|\s+(\*|\*\*|&amp;)|\s+(\*|\*\*|&amp;
)\s+)(\w+\s*::)?(?!(if|while|for))\w+\s*\([^\)\(]*\)(\s*const\s*)?[\n\s]*\{"
>
<functionName>
<nameExpr expr="(?!(if|while|for
))\w+\s*\(" />
<nameExpr expr="(?!(if|while|for
))\w+" />
</functionName>
<className>
<nameExpr expr="\w+(?=\s*::)" />
</className>
</function>
</parser>
<parser
id
="cs_function"
displayName="C# Class"
commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
>
<classRange
mainExpr
="^[\t\x20]*((public|protect
ed|private|internal)\s+)?(\w+\s*)?(class|struct|interface)[\t\x20]+[^\{]+\{"
openSymbole ="\{"
closeSymbole="\}"
>
<className>
<nameExpr expr="(class|struct|in
terface)[\t\x20]+\w+" />

<nameExpr expr="[\t\x20]+\w+" />


<nameExpr expr="\w+" />
</className>
<function
mainExpr="^[^\S\r\n]*(?&lt;modif
ier1&gt;(?:public|protected|internal|private)\s*)?(?&lt;modifier2&gt;(?:new|stat
ic|virtual|sealed|override|abstract|extern)\s*)?(partial\s*)?(?&lt;type&gt;(?!(r
eturn|if|else))\w+(?&lt;genericType&gt;&lt;[\w,\s&lt;&gt;]+&gt;)?\s+)(?&lt;name&
gt;\w+(?&lt;genericNameType&gt;&lt;[\w,\s&lt;&gt;]+&gt;)?\s?)\((?&lt;params&gt;[
\w\s,&lt;&gt;\[\]\:=\.]*)\)(?&lt;ctorChain&gt;\s*\:\s*(?:base|this)\s*\((?&lt;ct
orParams&gt;[\w\s,&lt;&gt;\[\]\:=\.]*)\))?[\w\s&lt;&gt;\:,\(\)\[\]]*(?:\{|;)"
>
<functionName>
<funcNameExpr expr="(\w+
(&lt;[\w,\s&lt;&gt;]+&gt;)?\s?)\(" />
<funcNameExpr expr="(\w+
(&lt;[\w,\s&lt;&gt;]+&gt;)?\s?)" />
</functionName>
</function>
</classRange>
</parser>
<parser
id
="java"
displayName="Java"
commentExpr="(?s:/\*.*?\*/)|(?m-s://.*$)"
>
<classRange
mainExpr
="^[\t\x20]*((public|protect
ed|private|static|final|abstract|synchronized|@(\w)+)\s+)*(class|enum|interface|
@interface)\s+\w+(&lt;\s*\w+(,\s*\w+)*\s*&gt;)?(\s+extends\s+\w+)?(\s+implements
\s+\w+(,\s*\w+)*)?\s*\{"
openSymbole ="\{"
closeSymbole="\}"
>
<className>
<nameExpr expr="(class|enum|inte
rface|@interface)\s+\w+(&lt;\s*\w+(,\s*\w+)*\s*&gt;)?" />
<nameExpr expr="\s+\w+(&lt;\s*\w
+(,\s*\w+)*\s*&gt;)?" />
<nameExpr expr="\w+(&lt;\s*\w+(,
\s*\w+)*\s*&gt;)?" />
</className>
<function
mainExpr="^[\t\x20]*((public|pro
tected|private|static|final|abstract|synchronized|@(\w)+)\s+)*(\w*(\[\s*])*\s+)?
(?!(if|while|for|switch|catch|synchronized)\b)\w+(\[\s*])*(&lt;\s*\w+(,\s*\w+)*\
s*&gt;)?\s*\([^\)\(]*\)(\s+throws\s+\w+)?\s*\{"
>
<functionName>
<funcNameExpr expr="(?!(
if|while|for|switch|catch|synchronized)\b)\w+(\[\s*])*(&lt;\s*\w+(,\s*\w+)*\s*&g
t;)?\s*\(" />
<funcNameExpr expr="(?!(
if|while|for|switch|catch|synchronized)\b)\w+(\[\s*])*(&lt;\s*\w+(,\s*\w+)*\s*&g
t;)?" />
</functionName>
</function>
</classRange>
</parser>

<parser
id
="xml_node"
displayName="XML Node"
commentExpr="&lt;!--([^-]|-(?!-&gt;))*--&gt;"
>
<!-- Only match nodes with at least one attribut
e -->
<function
mainExpr="&lt;[\w\?]+[\t\x20]+\w+[\t\x20
]*=[\t\x20]*&quot;[^&quot;]+&quot;"
>
<functionName>
<nameExpr expr="[^&lt;]*" />
</functionName>
</function>
</parser>
<parser
id
="batch_label"
displayName="BAT Label"
commentExpr="(?m-s)(::.*?$)|(REM.*?$)"
>
<function
mainExpr="^[\t\x20]*:\w+"
>
<functionName>
<nameExpr expr="[^\t\x20:]*" />
</functionName>
</function>
</parser>
<parser
id
="ini_section"
displayName="INI Section"
commentExpr="(?m-s:[#;].*?$)"
>
<function
mainExpr="^[\t\x20]*[\[&quot;][\w.;\x20\
(\)-]+[\]&quot;]"
>
<functionName>
<nameExpr expr="[^\[\]&quot;]*"
/>
</functionName>
</function>
</parser>
<parser
id
="perl_function"
displayName="Perl"
>
<function
mainExpr="^\s*(?&lt;!#)\s*sub\s+\w+\s*\(
?[^\)\(]*?\)?[\n\s]*\{"
>
<functionName>
<nameExpr expr="(sub\s+)?\K\w+"
/>
</functionName>

<className>
<nameExpr expr="\w+(?=\s*::)" />
</className>
</function>
</parser>
<parser
id
="python_function"
displayName="Python class"
commentExpr="(?s:'''.*?''')|(?m-s:#.*?$)"
>
<classRange
mainExpr

="(?&lt;=^class\x20).*?(?=\n

\S|\Z)"
>
<className>
<nameExpr expr="\w+(?=[\(|:])" /
>
</className>
<function
mainExpr="(?&lt;=def\x20).+?(?=:
)"
>
<functionName>
<funcNameExpr expr=".*"
/>
</functionName>
</function>
</classRange>
<function
mainExpr="(?&lt;=def\x20).+?(?=:)"
>
<functionName>
<nameExpr expr=".*" />
</functionName>
</function>
</parser>
<parser
id
="bash_function"
displayName="Shell"
commentExpr="(?m-s:#.*?$)"
>
<function
mainExpr="^[\t\x20]*(function[\t\r\n\x20
]*)?(\w)+[\t\r\n\x20]*(\([^\)]*\))?[\t\r\n\x20]*(\{)[^(\})\r\n\t\x20]*"
>
<functionName>
<nameExpr expr="[^{]*" />
</functionName>
</function>
</parser>
<parser
id
="nsis_syntax"
displayName="NSIS Syntax"
commentExpr="(?s:/\*.*?\*/)|(?m-s:[#;].*?$)"
>
<function
mainExpr="^[\t\x20]*(!macro|Function|Sec

tion|SectionGroup)[\t\x20]+[^\r\n]*$"
>
<functionName>
<nameExpr expr="(?(?=[\t\x20]*!m
acro)[\t\x20]*!macro[\t\x20]+[^\s]+|[^\r\n]*)" />
</functionName>
</function>
</parser>
<parser
id
="ruby_function"
displayName="Ruby"
>
<!-- within a class-->
<classRange
mainExpr
="(?&lt;=^class\x20).*?(?=\n
\S|\Z)"
>
<className>
<nameExpr expr="\w+" />
</className>
<function
mainExpr="^\s*def\s+\w+"
>
<functionName>
<funcNameExpr expr="(?&l
t;=def\s)\w+" />
</functionName>
</function>
</classRange>
<!-- without class-->
<function
mainExpr="^\s*def\s+\w+"
>
<functionName>
<nameExpr expr="(?&lt;=def\s)\w+
" />
</functionName>
</function>
</parser>
<parser
id
="javascript_function"
displayName="Javascript"
commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
>
<function
mainExpr="((^|\s+|[;\}\.])([A-Za-z_]\w*\
.)*[A-Za-z_]\w*\s*[=:]|^|[\s;\}]+)\s*function(\s+[A-Za-z_]?\w*\([^\)\(]*\)|\([^\
)\(]*\))[\n\s]*\{"
>
<functionName>
<nameExpr expr="[A-Za-z_]\w*\s*[
=:]|[A-Za-z_]?\w*\s*\(" />
<nameExpr expr="[A-Za-z_]?\w*" /
>
</functionName>
<className>
<nameExpr expr="([A-Za-z_]\w*\.)
*[A-Za-z_]\w*\." />

<nameExpr expr="([A-Za-z_]\w*\.)
*[A-Za-z_]\w*" />
</className>
</function>
</parser>
</parsers>
</functionList>
</NotepadPlus>

You might also like