You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1388 lines
59 KiB

7 years ago
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!-- ==========================================================================\
  3. |
  4. | To learn how to make your own language parser, please check the following
  5. | link:
  6. | http://notepad-plus-plus.org/features/function-list.html
  7. |
  8. \=========================================================================== -->
  9. <NotepadPlus>
  10. <functionList>
  11. <associationMap>
  12. <!--
  13. langID:
  14. Don't use L_JS (19) use L_JAVASCRIPT (58) instead!
  15. Don't use L_USER and L_EXTERNAL, use extension or UDL name association instead!
  16. L_ADA = 42 | L_DIFF = 33 | L_LISP = 30 | L_SCHEME = 31
  17. L_ASCII = 14 | L_EXTERNAL = 60 | L_LUA = 23 | L_SEARCHRESULT = 47
  18. L_ASM = 32 | L_FLASH = 27 | L_MAKEFILE = 10 | L_SMALLTALK = 37
  19. L_ASP = 16 | L_FORTRAN = 25 | L_MATLAB = 44 | L_SQL = 17
  20. L_AU3 = 40 | L_FORTRAN_77 = 59 | L_NSIS = 28 | L_TCL = 29
  21. L_BASH = 26 | L_GUI4CLI = 51 | L_OBJC = 5 | L_TEX = 24
  22. L_BATCH = 12 | L_HASKELL = 45 | L_PASCAL = 11 | L_TEXT = 0
  23. L_C = 2 | L_HTML = 8 | L_PERL = 21 | L_USER = 15
  24. L_CAML = 41 | L_INI = 13 | L_PHP = 1 | L_VB = 18
  25. L_CMAKE = 48 | L_INNO = 46 | L_POWERSHELL = 53 | L_VERILOG = 43
  26. L_COBOL = 50 | L_JAVA = 6 | L_PROPS = 34 | L_VHDL = 38
  27. L_COFFEESCRIPT = 56 | L_JAVASCRIPT = 58 | L_PS = 35 | L_XML = 9
  28. L_CPP = 3 | L_JS = 19 | L_PYTHON = 22 | L_YAML = 49
  29. L_CS = 4 | L_JSON = 57 | L_R = 54 |
  30. L_CSS = 20 | L_JSP = 55 | L_RC = 7 |
  31. L_D = 52 | L_KIX = 39 | L_RUBY = 36 |
  32. 0 = L_TEXT | 16 = L_ASP | 32 = L_ASM | 48 = L_CMAKE
  33. 1 = L_PHP | 17 = L_SQL | 33 = L_DIFF | 49 = L_YAML
  34. 2 = L_C | 18 = L_VB | 34 = L_PROPS | 50 = L_COBOL
  35. 3 = L_CPP | 19 = L_JS | 35 = L_PS | 51 = L_GUI4CLI
  36. 4 = L_CS | 20 = L_CSS | 36 = L_RUBY | 52 = L_D
  37. 5 = L_OBJC | 21 = L_PERL | 37 = L_SMALLTALK | 53 = L_POWERSHELL
  38. 6 = L_JAVA | 22 = L_PYTHON | 38 = L_VHDL | 54 = L_R
  39. 7 = L_RC | 23 = L_LUA | 39 = L_KIX | 55 = L_JSP
  40. 8 = L_HTML | 24 = L_TEX | 40 = L_AU3 | 56 = L_COFFEESCRIPT
  41. 9 = L_XML | 25 = L_FORTRAN | 41 = L_CAML | 57 = L_JSON
  42. 10 = L_MAKEFILE | 26 = L_BASH | 42 = L_ADA | 58 = L_JAVASCRIPT
  43. 11 = L_PASCAL | 27 = L_FLASH | 43 = L_VERILOG | 59 = L_FORTRAN_77
  44. 12 = L_BATCH | 28 = L_NSIS | 44 = L_MATLAB | 60 = L_EXTERNAL
  45. 13 = L_INI | 29 = L_TCL | 45 = L_HASKELL |
  46. 14 = L_ASCII | 30 = L_LISP | 46 = L_INNO |
  47. 15 = L_USER | 31 = L_SCHEME | 47 = L_SEARCHRESULT |
  48. if langID cannot be found above, you can set the file extensions ...
  49. <association id="my_parser_id" ext=".my_parser_ext1" />
  50. <association id="my_parser_id" ext=".my_parser_ext2" />
  51. and for User Defined Languages (UDL's) use ...
  52. <association id="my_parser_id" userDefinedLangName="My UDL Name" />
  53. Note(s):
  54. Not required, just a guide.
  55. Suffix Indicates
  56. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  57. _class parser has a class part only
  58. _function parser has a function part only
  59. _syntax parser has both a class and function part
  60. -->
  61. <!-- ======================================================================== -->
  62. <!-- ___ parserID -->
  63. <!-- V -->
  64. <association id= "php_syntax" langID= "1" />
  65. <association id= "c_function" langID= "2" />
  66. <association id= "cplusplus_syntax" langID= "3" />
  67. <association id= "csharp_class" langID= "4" />
  68. <association id= "java_syntax" langID= "6" />
  69. <association id= "xml_node" langID= "9" />
  70. <association id= "batch_label" langID="12" />
  71. <association id= "ini_section" langID="13" />
  72. <association id= "perl_function" langID="21" />
  73. <association id= "python_syntax" langID="22" />
  74. <association id= "bash_function" langID="26" />
  75. <association id= "nsis_syntax" langID="28" />
  76. <association id= "assembly_subroutine" langID="32" />
  77. <association id= "ruby_syntax" langID="36" />
  78. <association id= "autoit3_function" langID="40" />
  79. <association id= "innosetup_syntax" langID="46" />
  80. <association id= "powershell_function" langID="53" />
  81. <association id= "javascript_function" langID="58" />
  82. <!-- ======================================================================== -->
  83. <association id= "baanc_section" langID="60" />
  84. <!-- ======================================================================== -->
  85. <association id= "krl_function" userDefinedLangName="KRL" />
  86. <association id= "krl_function" ext=".src" />
  87. <association id= "krl_function" ext=".sub" />
  88. <!-- ======================================================================== -->
  89. <association id= "sinumerik_function" userDefinedLangName="Sinumerik" />
  90. <association id= "sinumerik_function" ext=".arc" />
  91. <!-- ======================================================================== -->
  92. <association id= "universe_basic" userDefinedLangName="UniVerse BASIC" />
  93. <association id= "universe_basic" ext=".bas" />
  94. <!-- ======================================================================== -->
  95. </associationMap>
  96. <parsers>
  97. <!-- ========================================================= [ PHP ] -->
  98. <!-- PHP - Personal Home Page / PHP Hypertext Preprocessor -->
  99. <parser
  100. id ="php_syntax"
  101. displayName="PHP"
  102. commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
  103. >
  104. <classRange
  105. mainExpr ="^\s*(class|abstract\s+class|final\s+class|interface|trait)[\t\x20]+[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*(\s*|\s*(extends|implements|(extends\s+(\\|[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*)+\s+implements))\s+(\,\s*|(\\|[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*))+\s*)?\{"
  106. openSymbole ="\{"
  107. closeSymbole="\}"
  108. >
  109. <className>
  110. <nameExpr expr="(class|abstract\s+class|final\s+class|interface|trait)\s+\w+" />
  111. <nameExpr expr="\s+\w+\Z" />
  112. <nameExpr expr="\w+\Z" />
  113. </className>
  114. <function
  115. 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*\([^\{]*\{"
  116. >
  117. <functionName>
  118. <funcNameExpr expr="(?!(if|while|for|switch))\w+\s*\([^\{]*" />
  119. <!-- comment out the following node to display the method with parameters -->
  120. <funcNameExpr expr="(?!(if|while|for|switch))\w+" />
  121. </functionName>
  122. </function>
  123. </classRange>
  124. <function
  125. mainExpr="^\s*function\s+\w+\s*\("
  126. >
  127. <functionName>
  128. <nameExpr expr="(?!(if|while|for))\w+\s*\(" />
  129. <nameExpr expr="(?!(if|while|for))\w+" />
  130. </functionName>
  131. <className>
  132. <nameExpr expr="\w+(?=\s*::)" />
  133. </className>
  134. </function>
  135. </parser>
  136. <!-- =========================================================== [ C ] -->
  137. <parser
  138. displayName="C"
  139. id ="c_function"
  140. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  141. (?s:\x2F\x2A.*?\x2A\x2F) # Multi Line Comment
  142. | (?m-s:\x2F{2}.*$) # Single Line Comment
  143. | (?s:\x22(?:[^\x22\x5C]|\x5C.)*\x22) # String Literal - Double Quoted
  144. | (?s:\x27(?:[^\x27\x5C]|\x5C.)*\x27) # String Literal - Single Quoted
  145. "
  146. >
  147. <function
  148. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  149. (?: # Declaration specifiers
  150. \b
  151. (?:
  152. (?-i:auto|register|static|extern|typedef) # Storage class specifier
  153. | (?: # Type specifier
  154. (?-i:void|char|short|int|long|float|double|(?:un)?signed)
  155. | (?-i:struct|union|enum)
  156. \s+
  157. (?&amp;VALID_ID) # Struct, Union or Enum Specifier (simplified)
  158. | (?&amp;VALID_ID) # Type-definition name
  159. )
  160. | (?'TYPE_QUALIFIER'(?-i:const|volatile))
  161. )
  162. \b
  163. \s*
  164. )*
  165. (?'DECLARATOR'
  166. (?'POINTER'
  167. \*
  168. \s*
  169. (?:
  170. \b(?&amp;TYPE_QUALIFIER)\b
  171. \s*
  172. )*
  173. (?:(?&amp;POINTER))? # Boost::Regex 1.58-1.59 do not correctly handle quantifiers on subroutine calls
  174. )?
  175. (?: # 'DIRECT_DECLARATOR'
  176. \s*
  177. (?'VALID_ID' # valid identifier, use as subroutine
  178. \b(?!(?-i:
  179. auto
  180. | break
  181. | c(?:ase|har|on(?:st|ntinue))
  182. | d(?:efault|o(?:uble)?)
  183. | e(?:lse|num|xtern)
  184. | f(?:loat|or)
  185. | goto
  186. | i(?:f|n(?:t|line))
  187. | long
  188. | while
  189. | re(?:gister|strict|turn)
  190. | s(?:hort|i(?:gned|zeof)|t(?:atic|ruct)|witch)
  191. | typedef
  192. | un(?:ion|signed)
  193. | vo(?:id|latile)
  194. | _(?:
  195. A(?:lignas|lignof|tomic)
  196. | Bool
  197. | Complex
  198. | Generic
  199. | Imaginary
  200. | Noreturn
  201. | Static_assert
  202. | Thread_local
  203. )
  204. )\b) # keywords, not to be used as identifier
  205. [A-Za-z_\x7F-\xFF][\w\x7F-\xFF]* # valid character combination for identifiers
  206. )
  207. | \s*\(
  208. (?&amp;DECLARATOR)
  209. \)
  210. | \s*(?&amp;VALID_ID)
  211. \s*\[
  212. [^[\];{]*?
  213. \]
  214. | \s*(?&amp;VALID_ID)
  215. \s*\(
  216. [^();{]*?
  217. \)
  218. )
  219. \s*
  220. )
  221. (?=\{) # start of function body
  222. "
  223. >
  224. <functionName>
  225. <nameExpr expr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  226. [A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*
  227. \s*\( # start of parameters
  228. (?s:.*?) # whatever, until...
  229. \) # end of parameters
  230. " />
  231. <!-- comment out the following node to display the method with its parameters -->
  232. <!-- <nameExpr expr="[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*" /> -->
  233. </functionName>
  234. </function>
  235. </parser>
  236. <!-- ========================================================= [ C++ ] -->
  237. <parser
  238. displayName="C++"
  239. id ="cplusplus_syntax"
  240. commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
  241. >
  242. <classRange
  243. mainExpr ="^[\t\x20]*(class|struct)[\t\x20]+\w+\s*(final)?\s*(:\s*(public|protected|private)\s+\w+\s*)?\{"
  244. openSymbole ="\{"
  245. closeSymbole="\}"
  246. >
  247. <className>
  248. <nameExpr expr="(class|struct)[\t\x20]+\w+" />
  249. <nameExpr expr="[\t\x20]+\w+" />
  250. <nameExpr expr="\w+" />
  251. </className>
  252. <function
  253. mainExpr="^[\t\x20]*((static|const|virtual)\s+)?(\w+(\s+\w+)?(\s+|(\*|\*\*|&amp;)\s+|\s+(\*|\*\*|&amp;)|\s+(\*|\*\*|&amp;)\s+))?(\w+\s*::)?(?!(if|while|for|switch))[\w~]+\s*\([^\)\(]*\)(\s*const\s*)?(\s*(final|override|final\s*override|override\s*final)\s*)?[\n\s]*\{"
  254. >
  255. <functionName>
  256. <funcNameExpr expr="(?!(if|while|for|switch))[\w~]+\s*\(" />
  257. <funcNameExpr expr="(?!(if|while|for|switch))[\w~]+" />
  258. </functionName>
  259. </function>
  260. </classRange>
  261. <function
  262. mainExpr="^[\t\x20]*((static|const|virtual)\s+)?\w+(\s+\w+)?(\s+|(\*|\*\*|&amp;)\s+|\s+(\*|\*\*|&amp;)|\s+(\*|\*\*|&amp;)\s+)(\w+\s*::)?(?!(if|while|for))\w+\s*\([^\)\(]*\)(\s*const\s*)?[\n\s]*\{"
  263. >
  264. <functionName>
  265. <nameExpr expr="(?!(if|while|for))\w+\s*\(" />
  266. <nameExpr expr="(?!(if|while|for))\w+" />
  267. </functionName>
  268. <className>
  269. <nameExpr expr="\w+(?=\s*::)" />
  270. </className>
  271. </function>
  272. </parser>
  273. <!-- ========================================================== [ C# ] -->
  274. <!--
  275. | Based on:
  276. | http://sourceforge.net/p/notepad-plus/patches/613/
  277. \-->
  278. <parser
  279. displayName="C#"
  280. id ="csharp_class"
  281. commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
  282. >
  283. <classRange
  284. mainExpr ="^[\t\x20]*((public|protected|private|internal)\s+)?(\w+\s*)?(class|struct|interface)[\t\x20]+[^\{]+\{"
  285. openSymbole ="\{"
  286. closeSymbole="\}"
  287. >
  288. <className>
  289. <nameExpr expr="(class|struct|interface)[\t\x20]+\w+" />
  290. <nameExpr expr="[\t\x20]+\w+" />
  291. <nameExpr expr="\w+" />
  292. </className>
  293. <function
  294. mainExpr="^[^\S\r\n]*(?&lt;modifier1&gt;(?:public|protected|internal|private)\s*)?(?&lt;modifier2&gt;(?:new|static|virtual|sealed|override|abstract|extern)\s*)?(partial\s*)?(?&lt;type&gt;(?!(return|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;ctorParams&gt;[\w\s,&lt;&gt;\[\]\:=\.]*)\))?[\w\s&lt;&gt;\:,\(\)\[\]]*(?:\{|;)"
  295. >
  296. <functionName>
  297. <funcNameExpr expr="(\w+(&lt;[\w,\s&lt;&gt;]+&gt;)?\s?)\(" />
  298. <funcNameExpr expr="(\w+(&lt;[\w,\s&lt;&gt;]+&gt;)?\s?)" />
  299. </functionName>
  300. </function>
  301. </classRange>
  302. </parser>
  303. <!-- ======================================================== [ Java ] -->
  304. <!--
  305. | Based on:
  306. | https://notepad-plus-plus.org/community/topic/12691/function-list-with-java-problems
  307. \-->
  308. <parser
  309. displayName="Java"
  310. id ="java_syntax"
  311. >
  312. <classRange
  313. mainExpr ="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  314. (?m)^[\t\x20]* # leading whitespace
  315. (?:
  316. (?-i:
  317. abstract
  318. | final
  319. | native
  320. | p(?:rivate|rotected|ublic)
  321. | s(?:tatic|trictfp|ynchronized)
  322. | transient
  323. | volatile
  324. | @[A-Za-z_]\w* # qualified identifier
  325. (?: # consecutive names...
  326. \. # ...are dot separated
  327. [A-Za-z_]\w*
  328. )*
  329. )
  330. \s+
  331. )*
  332. (?-i:class|enum|@?interface)
  333. \s+
  334. (?'DECLARATOR'
  335. (?'VALID_ID' # valid identifier, use as subroutine
  336. \b(?!(?-i:
  337. a(?:bstract|ssert)
  338. | b(?:oolean|reak|yte)
  339. | c(?:ase|atch|har|lass|on(?:st|tinue))
  340. | d(?:efault|o(?:uble)?)
  341. | e(?:lse|num|xtends)
  342. | f(?:inal(?:ly)?|loat|or)
  343. | goto
  344. | i(?:f|mp(?:lements|ort)|nstanceof|nt(?:erface)?)
  345. | long
  346. | n(?:ative|ew)
  347. | p(?:ackage|rivate|rotected|ublic)
  348. | return
  349. | s(?:hort|tatic|trictfp|uper|witch|ynchronized)
  350. | th(?:is|rows?)|tr(?:ansient|y)
  351. | vo(?:id|latile)
  352. | while
  353. )\b) # keywords, not to be used as identifier
  354. [A-Za-z_]\w* # valid character combination for identifiers
  355. )
  356. (?:
  357. \s*\x3C # start-of-template indicator...
  358. (?'GENERIC' # ...match first generic, use as subroutine
  359. \s*
  360. (?:
  361. (?&amp;DECLARATOR) # use named generic
  362. | \? # or unknown
  363. )
  364. (?: # optional type extension
  365. \s+(?-i:extends|super)
  366. \s+(?&amp;DECLARATOR)
  367. (?: # multiple bounds...
  368. \s+\x26 # ...are ampersand separated
  369. \s+(?&amp;DECLARATOR)
  370. )*
  371. )?
  372. (?: # match consecutive generics objects...
  373. \s*, # ...are comma separated
  374. (?&amp;GENERIC)
  375. )?
  376. )
  377. \s*\x3E # end-of-template indicator
  378. )?
  379. (?: # package and|or nested classes...
  380. \. # ...are dot separated
  381. (?&amp;DECLARATOR)
  382. )?
  383. )
  384. (?: # optional object extension
  385. \s+(?-i:extends)
  386. \s+(?&amp;DECLARATOR)
  387. (?: # consecutive objects...
  388. \s*, # ...are comma separated
  389. \s*(?&amp;DECLARATOR)
  390. )*
  391. )?
  392. (?: # optional object implementation
  393. \s+(?-i:implements)
  394. \s+(?&amp;DECLARATOR)
  395. (?: # consecutive objects...
  396. \s*, # ...are comma separated
  397. \s*(?&amp;DECLARATOR)
  398. )*
  399. )?
  400. \s*\{ # whatever, up till start-of-body indicator
  401. "
  402. openSymbole ="\{"
  403. closeSymbole="\}"
  404. >
  405. <className>
  406. <nameExpr expr="(?-i:class|enum|@?interface)\s+\K\w+(?:\s*\x3C.*?\x3E)?" />
  407. </className>
  408. <function
  409. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  410. ^[\t\x20]* # leading whitespace
  411. (?:
  412. (?-i:
  413. abstract
  414. | final
  415. | native
  416. | p(?:rivate|rotected|ublic)
  417. | s(?:tatic|trictfp|ynchronized)
  418. | transient
  419. | volatile
  420. | @[A-Za-z_]\w* # qualified identifier
  421. (?: # consecutive names...
  422. \. # ...are dot separated
  423. [A-Za-z_]\w*
  424. )*
  425. )
  426. \s+
  427. )*
  428. (?:
  429. \s*\x3C # start-of-template indicator
  430. (?&amp;GENERIC)
  431. \s*\x3E # end-of-template indicator
  432. )?
  433. \s*
  434. (?'DECLARATOR'
  435. [A-Za-z_]\w* # (parent) type name
  436. (?: # consecutive sibling type names...
  437. \. # ...are dot separated
  438. [A-Za-z_]\w*
  439. )*
  440. (?:
  441. \s*\x3C # start-of-template indicator
  442. (?'GENERIC' # match first generic, use as subroutine
  443. \s*
  444. (?:
  445. (?&amp;DECLARATOR) # use named generic
  446. | \? # or unknown
  447. )
  448. (?: # optional type extension
  449. \s+(?-i:extends|super)
  450. \s+(?&amp;DECLARATOR)
  451. (?: # multiple bounds...
  452. \s+\x26 # ...are ampersand separated
  453. \s+(?&amp;DECLARATOR)
  454. )*
  455. )?
  456. (?: # consecutive generics objects...
  457. \s*, # ...are comma separated
  458. (?&amp;GENERIC)
  459. )?
  460. )
  461. \s*\x3E # end-of-template indicator
  462. )?
  463. (?: # package and|or nested classes...
  464. \. # ...are dot separated
  465. (?&amp;DECLARATOR)
  466. )?
  467. (?: # optional compound type...
  468. \s*\[ # ...start-of-compound indicator
  469. \s*\] # ...end-of-compound indicator
  470. )*
  471. )
  472. \s+
  473. (?'VALID_ID' # valid identifier, use as subroutine
  474. \b(?!(?-i:
  475. a(?:bstract|ssert)
  476. | b(?:oolean|reak|yte)
  477. | c(?:ase|atch|har|lass|on(?:st|tinue))
  478. | d(?:efault|o(?:uble)?)
  479. | e(?:lse|num|xtends)
  480. | f(?:inal(?:ly)?|loat|or)
  481. | goto
  482. | i(?:f|mp(?:lements|ort)|nstanceof|nt(?:erface)?)
  483. | long
  484. | n(?:ative|ew)
  485. | p(?:ackage|rivate|rotected|ublic)
  486. | return
  487. | s(?:hort|tatic|trictfp|uper|witch|ynchronized)
  488. | th(?:is|rows?)|tr(?:ansient|y)
  489. | vo(?:id|latile)
  490. | while
  491. )\b) # keywords, not to be used as identifier
  492. [A-Za-z_]\w* # valid character combination for identifiers
  493. )
  494. \s*\( # start-of-parameters indicator
  495. (?'PARAMETER' # match first parameter, use as subroutine
  496. \s*(?-i:final\s+)?
  497. (?&amp;DECLARATOR)
  498. \s+(?&amp;VALID_ID) # parameter name
  499. (?: # consecutive parameters...
  500. \s*, # ...are comma separated
  501. (?&amp;PARAMETER)
  502. )?
  503. )?
  504. \) # end-of-parameters indicator
  505. (?: # optional exceptions
  506. \s*(?-i:throws)
  507. \s+(?&amp;VALID_ID) # first exception name
  508. (?: # consecutive exception names...
  509. \s*, # ...are comma separated
  510. \s*(?&amp;VALID_ID)
  511. )*
  512. )?
  513. [^{;]*\{ # start-of-function-body indicator
  514. "
  515. >
  516. <functionName>
  517. <funcNameExpr expr="\w+(?=\s*\()" />
  518. </functionName>
  519. </function>
  520. </classRange>
  521. </parser>
  522. <!-- ========================================================= [ XML ] -->
  523. <!-- XML - eXtensible Markup Language -->
  524. <parser
  525. displayName="XML Node"
  526. id ="xml_node"
  527. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  528. (?:\x3C!--(?:[^\-]|-(?!-\x3E))*--\x3E) # Multi Line Comment
  529. "
  530. >
  531. <function
  532. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  533. \x3C # begin of node
  534. (?:
  535. (?-i:\?XML) # only name of root node is allowed to start with a question mark
  536. | \w+(?::\w+)? # a node name can contain a colon e.g. `xs:schema`
  537. )
  538. (?: # match attributes
  539. \s+ # at least one whitespace before attribute-name
  540. \w+(?::\w+)? # an attribute name can contain a colon e.g. `xmlns:xs`
  541. \h*=\h* # name-value separator can be surrounded by blanks
  542. (?: # quoted attribute value, embedded escaped quotes allowed...
  543. \x22(?:[^\x22\x5C]|\x5C.)*?\x22 # ...double quoted...
  544. | \x27(?:[^\x27\x5C]|\x5C.)*?\x27 # ...single quoted
  545. )
  546. )+ # only match nodes with at least one attribute
  547. "
  548. >
  549. <functionName>
  550. <nameExpr expr="[^\x3C]*" />
  551. </functionName>
  552. </function>
  553. </parser>
  554. <!-- ================================ [ Batch / Command Shell Script ] -->
  555. <parser
  556. displayName="Batch / Command Shell Script"
  557. id ="batch_label"
  558. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  559. (?m-s:(?i:REM)(?:\h.+)?$) # Single Line Comment 1
  560. | (?m-s::{2}.*$) # Single Line Comment 2
  561. "
  562. >
  563. <function
  564. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  565. (?m-s) # enforce strict line by line search
  566. ^ # label starts at the beginning of a line,...
  567. \h* # ...can be preceded by blank characters and
  568. : # ...starts with a colon
  569. \K # keep the text matched so far, out of the overall match
  570. \w # a label name has to start with a word character,...
  571. [\w.\-]+ # ...the remainder of the name can contain dots and minus signs and
  572. \b # ...ends at a word boundary i.e. discard any trailing characters
  573. "
  574. />
  575. </parser>
  576. <!-- ========================================= [ Initialisation File ] -->
  577. <!-- File format used for: .INF / .INI / .REG / .editorconfig -->
  578. <parser
  579. displayName="INI Section"
  580. id ="ini_section"
  581. commentExpr="(?x)
  582. (?m-s:[;\#].*$) # Single Line Comment
  583. "
  584. >
  585. <function
  586. mainExpr="^\h*[\[&quot;][\w*.;\x20()\-]+[&quot;\]]"
  587. >
  588. <functionName>
  589. <nameExpr expr="[^[\]&quot;]*" />
  590. </functionName>
  591. </function>
  592. </parser>
  593. <!-- ======================================================== [ PERL ] -->
  594. <!-- PERL - Practical Extraction and Reporting Language -->
  595. <parser
  596. displayName="PERL"
  597. id ="perl_function"
  598. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  599. (?m-s:\x23.*$) # Single Line Comment
  600. "
  601. >
  602. <function
  603. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  604. sub
  605. \s+
  606. [A-Za-z_]\w*
  607. \s*
  608. \(
  609. [^()]*
  610. \)
  611. \s*\{ # start of class body
  612. "
  613. >
  614. <functionName>
  615. <nameExpr expr="(?:sub\s+)?\K[A-Za-z_]\w*" />
  616. </functionName>
  617. <className>
  618. <nameExpr expr="[A-Za-z_]\w*(?=\s*:{2})" />
  619. </className>
  620. </function>
  621. </parser>
  622. <!-- ====================================================== [ Python ] -->
  623. <parser
  624. displayName="Python"
  625. id ="python_syntax"
  626. commentExpr="(?s:'''.*?''')|(?m-s:#.*?$)"
  627. >
  628. <classRange
  629. mainExpr ="(?&lt;=^class\x20).*?(?=\n\S|\Z)"
  630. >
  631. <className>
  632. <nameExpr expr="\w+(?=[\(|:])" />
  633. </className>
  634. <function
  635. mainExpr="(?&lt;=def\x20).+?(?=:)"
  636. >
  637. <functionName>
  638. <funcNameExpr expr=".*" />
  639. </functionName>
  640. </function>
  641. </classRange>
  642. <function
  643. mainExpr="(?&lt;=def\x20).+?(?=:)"
  644. >
  645. <functionName>
  646. <nameExpr expr=".*" />
  647. </functionName>
  648. </function>
  649. </parser>
  650. <!-- ======================================================== [ Bash ] -->
  651. <!-- BASH - Bourne-Again Shell -->
  652. <parser
  653. displayName="Bash"
  654. id ="bash_function"
  655. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  656. (?-s:(?:^\x23[^!]|^\h*\x23|\h+\x23).*$) # Single Line Comment
  657. | (?s:\x22(?:[^\x22\x5C]|\x5C.)*\x22) # String Literal - Double Quoted
  658. | (?s:\x27[^\x27]*\x27) # String Literal - Single Quoted
  659. | (?s: # Here Document (Type 1) and Here String
  660. \x3C{2,3}\h*(?'HD1ID'[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*\b)[^\r\n]*\R
  661. (?s:.*?)
  662. \R\k'HD1ID' # close with exactly the same identifier, in the first column
  663. )
  664. | (?s: # Here Document (Type 2)
  665. \x3C{2}-\h*(?'HD2ID'[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*\b)[^\r\n]*\R
  666. (?s:.*?)
  667. \R\h*\k'HD2ID' # close with exactly the same identifier
  668. )
  669. "
  670. >
  671. <function
  672. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  673. (?m)^\h* # optional leading whitespace
  674. (?:
  675. (?-i:function\s+)
  676. (?'VALID_ID' # valid identifier, use as subroutine
  677. \b(?!(?-i:
  678. do(?:ne)?
  679. | el(?:if|se)|esac
  680. | f(?:i|or|unction)
  681. | i[fn]
  682. | select
  683. | t(?:hen|ime)
  684. | until
  685. | while
  686. )\b) # keywords, not to be used as identifier
  687. [A-Za-z_\x7F-\xFF][\w\x7F-\xFF]* # valid character combination for identifiers
  688. )
  689. (?:\s*\([^)]*?\))? # parentheses and parameters optional
  690. |
  691. (?&amp;VALID_ID)
  692. \s*\([^)]*?\) # parentheses required, parameters optional
  693. )
  694. [^{;]*?\{ # no semi-colon until start of body
  695. "
  696. >
  697. <functionName>
  698. <nameExpr expr="\b(?!function\b)\w+(?:\s*\([^)]*\))?" />
  699. <!-- comment out the following node to display the function with its parameters -->
  700. <nameExpr expr="\w+(?=\b)" />
  701. </functionName>
  702. </function>
  703. </parser>
  704. <!-- ======================================================== [ NSIS ] -->
  705. <!-- NSIS - Nullsoft Scriptable Install System -->
  706. <parser
  707. displayName="NSIS"
  708. id ="nsis_syntax"
  709. >
  710. <classRange
  711. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  712. \b(?-i:SectionGroup)\b # open indicator
  713. (?s:.*?)
  714. \b(?-i:SectionGroupEnd)\b # close indicator
  715. "
  716. >
  717. <className>
  718. <nameExpr expr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  719. (?m-s)
  720. SectionGroup\h+(?-i:/e\h+)? # start indicator and its optional switch
  721. \K # keep the text matched so far, out of the overall match
  722. .+$ # whatever, till end-of-line
  723. "
  724. />
  725. <nameExpr expr="[^\r\n\x22]*" />
  726. </className>
  727. <function
  728. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  729. (?m)
  730. ^(?'INDENT'\h*) # optional leading whitespace at start-of-line
  731. (?:
  732. (?-i:!macro)
  733. \h+ # required whitespace separator
  734. \K # keep the text matched so far, out of the overall match
  735. [^\r\n]*$ # whatever, until end-of-line
  736. |
  737. (?'TAG'(?-i:Function|PageEx|Section))
  738. \h+ # required whitespace separator
  739. (?-i:/o\h+)? # optional switch
  740. \K # keep the text matched so far, out of the overall match
  741. (?s:
  742. .*? # whatever,
  743. (?= # up till...
  744. ^\k'INDENT' # ...equal indent at start-of-line for...
  745. \k'TAG'End\b # ...matching close indicator
  746. )
  747. )
  748. |
  749. \x24\x7B # start-of-open-element indicator
  750. (?'ID'[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*)
  751. \x7D # end-of-open-element indicator
  752. \h+ # required whitespace separator
  753. (?-i:/o\h+)? # optional switch
  754. \K # keep the text matched so far, out of the overall match
  755. (?s:
  756. .*? # whatever,
  757. (?= # up till...
  758. ^\k'INDENT' # ...equal indent at start-of-line for...
  759. \x24\x7B\k'ID'End\x7D # ...matching close indicator
  760. )
  761. )
  762. )
  763. "
  764. >
  765. <functionName>
  766. <funcNameExpr expr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  767. (?m)
  768. [^\r\n]+? # whatever,
  769. (?= # up till...
  770. \h* # ...optional whitespace and...
  771. (?:
  772. \x2F\x2A # ...start of multi line comment or...
  773. | [\x23;] # ...start of single line comment or...
  774. | $ # ...end-of-line
  775. )
  776. )
  777. "
  778. />
  779. </functionName>
  780. </function>
  781. </classRange>
  782. <function
  783. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  784. (?m)
  785. ^(?'INDENT'\h*) # optional leading whitespace at start-of-line
  786. (?:
  787. (?-i:!macro)
  788. \h+ # required whitespace separator
  789. \K # keep the text matched so far, out of the overall match
  790. [^\r\n]*$ # whatever, until end-of-line
  791. |
  792. (?'TAG'(?-i:Function|PageEx|Section))
  793. \h+ # required whitespace separator
  794. (?-i:/o\h+)? # optional switch
  795. \K # keep the text matched so far, out of the overall match
  796. (?s:
  797. .*? # whatever,
  798. (?= # up till...
  799. ^\k'INDENT' # ...equal indent at start-of-line for...
  800. \k'TAG'End\b # ...matching close indicator
  801. )
  802. )
  803. |
  804. \x24\x7B # start-of-open-element indicator
  805. (?'ID'[A-Za-z_\x7F-\xFF][\w\x7F-\xFF]*)
  806. \x7D # end-of-open-element indicator
  807. \h+ # required whitespace separator
  808. (?-i:/o\h+)? # optional switch
  809. \K # keep the text matched so far, out of the overall match
  810. (?s:
  811. .*? # whatever,
  812. (?= # up till...
  813. ^\k'INDENT' # ...equal indent at start-of-line for...
  814. \x24\x7B\k'ID'End\x7D # ...matching close indicator
  815. )
  816. )
  817. )
  818. "
  819. >
  820. <functionName>
  821. <nameExpr expr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  822. (?m)
  823. [^\r\n]+? # whatever,
  824. (?= # up till...
  825. \h* # ...optional whitespace and...
  826. (?:
  827. \x2F\x2A # ...start of multi line comment or...
  828. | [\x23;] # ...start of single line comment or...
  829. | $ # ...end-of-line
  830. )
  831. )
  832. "
  833. />
  834. </functionName>
  835. </function>
  836. </parser>
  837. <!-- ==================================================== [ Assembly ] -->
  838. <parser
  839. displayName="Assembly"
  840. id ="assembly_subroutine"
  841. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  842. (?m-s:;.*$) # Single Line Comment
  843. "
  844. >
  845. <function
  846. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  847. (?m)^\h* # optional leading whitespace
  848. \K # keep the text matched so far, out of the overall match
  849. [A-Za-z_$][\w$]* # valid character combination for labels
  850. (?=:) # up till the colon
  851. "
  852. />
  853. </parser>
  854. <!-- ======================================================== [ Ruby ] -->
  855. <parser
  856. displayName="Ruby"
  857. id ="ruby_syntax"
  858. >
  859. <!-- within a class-->
  860. <classRange
  861. mainExpr ="(?&lt;=^class\x20).*?(?=\n\S|\Z)"
  862. >
  863. <className>
  864. <nameExpr expr="\w+" />
  865. </className>
  866. <function
  867. mainExpr="^\s*def\s+\w+"
  868. >
  869. <functionName>
  870. <funcNameExpr expr="(?&lt;=def\s)\w+" />
  871. </functionName>
  872. </function>
  873. </classRange>
  874. <!-- without class-->
  875. <function
  876. mainExpr="^\s*def\s+\w+"
  877. >
  878. <functionName>
  879. <nameExpr expr="(?&lt;=def\s)\w+" />
  880. </functionName>
  881. </function>
  882. </parser>
  883. <!-- ===================================================== [ AutoIt3 ] -->
  884. <!--
  885. | Based on:
  886. | https://sourceforge.net/p/notepad-plus/discussion/331753/thread/5d9bb881/#e86e
  887. \-->
  888. <parser
  889. displayName="AutoIt3"
  890. id ="autoit3_function"
  891. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  892. (?is:\x23cs.*?\x23ce) # Multi Line Comment
  893. | (?m-s:^\h*;.*?$) # Single Line Comment
  894. "
  895. >
  896. <function
  897. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  898. (?m)^\h* # optional leading whitespace
  899. (?i:FUNC\s+) # start-of-function indicator
  900. \K # keep the text matched so far, out of the overall match
  901. [A-Za-z_]\w* # valid character combination for identifiers
  902. \s*\([^()]*?\) # parentheses required, parameters optional
  903. "
  904. >
  905. <!-- comment out the following node to display the function with its parameters -->
  906. <functionName>
  907. <nameExpr expr="[A-Za-z_]\w*" />
  908. </functionName>
  909. </function>
  910. </parser>
  911. <!-- ================================================== [ Inno Setup ] -->
  912. <parser
  913. displayName="Inno Setup"
  914. id ="innosetup_syntax"
  915. >
  916. <classRange
  917. mainExpr ="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  918. (?ms)
  919. (?'SECTION_HEADER'
  920. ^ # header starts at beginning of a line
  921. \[ # start of section header
  922. (?-i:Code) # `Code` section name
  923. ] # end of section header
  924. )
  925. .*? # whatever, up till...
  926. (?= # ...next valid section header or...
  927. ^ # +-- header starts at beginning of a line
  928. \[ # +-- start-of-header indicator
  929. (?-i:
  930. Components|(?:Custom)?Messages
  931. | Dirs
  932. | Files
  933. | I(?:cons|nstallDelete)
  934. | Languages
  935. | R(?:egistry|un)
  936. | Setup
  937. | T(?:asks|ypes)
  938. | Uninstall(?:Delete|Run)
  939. ) # +-- valid section name
  940. ] # \-- end-of-header indicator
  941. | \Z # ...end-of-file
  942. )
  943. "
  944. >
  945. <className>
  946. <nameExpr expr="^\[\K[^\h\]]+(?=])" />
  947. </className>
  948. <function
  949. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  950. (?m-s)^\h* # optional leading whitespace
  951. (?i:FUNCTION\h+)
  952. (?'VALID_ID'
  953. [A-Za-z_]\w*
  954. )
  955. \s*\( # start-of-parameter-list indicator
  956. [^()]* # parameter list
  957. \s*\) # end-of-parameter-list indicator
  958. \s*: # type indicator
  959. \s*[A-Za-z_]\w* # type identifier
  960. \s*; # end-of-statement indicator
  961. "
  962. >
  963. <functionName>
  964. <funcNameExpr expr="(?i:FUNCTION\h+)\K[A-Za-z_]\w*\s*\([^()]*\)" />
  965. <!-- comment out the following node to display the method with its parameters -->
  966. <funcNameExpr expr="[A-Za-z_]\w*" />
  967. </functionName>
  968. </function>
  969. </classRange>
  970. <function
  971. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  972. (?ms)
  973. (?'SECTION_HEADER'
  974. ^ # header starts at beginning of a line
  975. \[ # start-of-header indicator
  976. (?-i:
  977. Components|(?:Custom)?Messages
  978. | Dirs
  979. | Files
  980. | I(?:cons|nstallDelete)
  981. | Languages
  982. | R(?:egistry|un)
  983. | Setup
  984. | T(?:asks|ypes)
  985. | Uninstall(?:Delete|Run)
  986. ) # valid section name
  987. ] # end-of-header indicator
  988. )
  989. .*? # whatever, up till...
  990. (?=
  991. (?&amp;SECTION_HEADER) # ...next valid section header,...
  992. | ^\[(?-i:Code)] # ...`Code` section header or...
  993. | \Z # ...end-of-file
  994. )
  995. "
  996. >
  997. <functionName>
  998. <nameExpr expr="^\[\K[^\]]+(?=])" />
  999. </functionName>
  1000. </function>
  1001. </parser>
  1002. <!-- ================================================== [ PowerShell ] -->
  1003. <parser
  1004. displayName="PowerShell"
  1005. id ="powershell_function"
  1006. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  1007. (?s:\x3C\x23(?:[^\x23]|\x23[^\x3E])*\x23\x3E) # Multi Line Comment
  1008. | (?m-s:\x23.*$) # Single Line Comment
  1009. "
  1010. >
  1011. <function
  1012. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  1013. \b
  1014. (?:function|filter)
  1015. \s+
  1016. (?:
  1017. [A-Za-z_]\w*
  1018. :
  1019. )?
  1020. [A-Za-z_][\w\-]*
  1021. \s*
  1022. [({]
  1023. "
  1024. >
  1025. <functionName>
  1026. <nameExpr expr="[A-Za-z_][\w\-]*(?=\s*[({])" />
  1027. </functionName>
  1028. <className>
  1029. <nameExpr expr="[A-Za-z_]\w*(?=:)" />
  1030. </className>
  1031. </function>
  1032. </parser>
  1033. <!-- ================================================ [ J(ava)Script ] -->
  1034. <parser
  1035. displayName="JavaScript"
  1036. id ="javascript_function"
  1037. commentExpr="(?s:/\*.*?\*/)|(?m-s://.*?$)"
  1038. >
  1039. <function
  1040. mainExpr="((^|\s+|[;\}\.])([A-Za-z_$][\w$]*\.)*[A-Za-z_$][\w$]*\s*[=:]|^|[\s;\}]+)\s*function(\s+[A-Za-z_$][\w$]*)?\s*\([^\)\(]*\)[\n\s]*\{"
  1041. >
  1042. <functionName>
  1043. <nameExpr expr="[A-Za-z_$][\w$]*\s*[=:]|[A-Za-z_$][\w$]*\s*\(" />
  1044. <nameExpr expr="[A-Za-z_$][\w$]*" />
  1045. </functionName>
  1046. <className>
  1047. <nameExpr expr="([A-Za-z_$][\w$]*\.)*[A-Za-z_$][\w$]*\." />
  1048. <nameExpr expr="([A-Za-z_$][\w$]*\.)*[A-Za-z_$][\w$]*" />
  1049. </className>
  1050. </function>
  1051. </parser>
  1052. <!-- ========================================================= [ KRL ] -->
  1053. <!-- KRL - KUKA Robot Language -->
  1054. <!--
  1055. | https://notepad-plus-plus.org/community/topic/12264/function-list-for-new-language
  1056. \-->
  1057. <parser
  1058. displayName="KRL"
  1059. id ="krl_function"
  1060. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  1061. (?m-s:;.*$) # Single Line Comment
  1062. "
  1063. >
  1064. <function
  1065. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  1066. (?i:
  1067. (?:GLOBAL\h+)?
  1068. DEF # start-of-procedure indicator, possible extended to...
  1069. (?:
  1070. FCT # ...start-of-function indicator
  1071. \h+
  1072. (?:BOOL|CHAR|INT|REAL|(?&amp;VALID_ID)) # returning a primitive type or a user-defined-type...
  1073. (?: # ...optionally as an array
  1074. \h*\[
  1075. \h*(?:\d+|\x27(?:H[0-9A-Fa-f]+|B[01]+)\x27)?
  1076. \h*\]
  1077. )?
  1078. )?
  1079. )
  1080. \h+
  1081. \K # keep the text matched so far, out of the overall match
  1082. (?'VALID_ID' # valid identifier, use as subroutine
  1083. \b(?!(?i:
  1084. AN(?:D|IN|OUT)
  1085. | B(?:OOL|RAKE|_(?:AND|EXOR|NOT|OR))
  1086. | C(?:ASE|AST_(?:FROM|TO)|HAR|IRC(?:_REL)?|ON(?:ST|TINUE)|_(?:DIS|ORI|PTP|VEL))
  1087. | D(?:ECL|EF(?:AULT|DAT|FCT)|ELAY|O)
  1088. | E(?:LSE|ND(?:DAT|FCT|FOR|IF|LOOP|SWITCH|WHILE)?|NUM|X(?:IT|OR|T(?:FCT)?))
  1089. | F(?:ALSE|OR)
  1090. | G(?:LOBAL|OTO)
  1091. | HALT
  1092. | I(?:[FS]|MPORT|NT(?:ERRUPT)?)
  1093. | L(?:IN(?:_REL)?|OOP)
  1094. | M(?:AXI|INI)MUM
  1095. | NOT
  1096. | OR
  1097. | P(?:RIO|TP(?:_REL)?|UBLIC)
  1098. | RE(?:AL|PEAT|SUME|TURN)
  1099. | S(?:EC|IGNAL|TRUC|WITCH)
  1100. | T(?:HEN|O|RIGGER|RUE)
  1101. | UNTIL
  1102. | W(?:AIT|HEN|HILE)
  1103. )\b) # keywords, not to be used as identifier
  1104. [$A-Za-z_\x7F-\xFF][$\w\x7F-\xFF]{0,23} # valid character combination for identifiers
  1105. )
  1106. \h*\([^)]*\)
  1107. "
  1108. >
  1109. <!-- comment out the following node to display the method with its parameters -->
  1110. <functionName>
  1111. <nameExpr expr="[$A-Za-z_\x7F-\xFF][$\w\x7F-\xFF]{0,23}" />
  1112. </functionName>
  1113. </function>
  1114. </parser>
  1115. <!-- =================================================== [ Sinumerik ] -->
  1116. <!-- Sinumerik - Siemens Numeric Control -->
  1117. <!--
  1118. | https://notepad-plus-plus.org/community/topic/12520/function-list-for-simatic
  1119. | 20161113: Added `(?!\$PATH)` to get around restriction/bug of
  1120. | two characters required before comment.
  1121. \-->
  1122. <parser
  1123. displayName="Sinumerik"
  1124. id ="sinumerik_function"
  1125. commentExpr="(?m-s:;(?!\$PATH).*?$)"
  1126. >
  1127. <function
  1128. mainExpr="(?m)^%_N_\K[A-Za-z_]\w*"
  1129. />
  1130. </parser>
  1131. <!-- ============================================== [ UniVerse BASIC ] -->
  1132. <!--
  1133. | Based on:
  1134. | https://notepad-plus-plus.org/community/topic/12742/functionlist-different-results-with-different-line-endings
  1135. \-->
  1136. <parser
  1137. displayName="UniVerse BASIC"
  1138. id ="universe_basic"
  1139. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  1140. (?m-s:
  1141. (?:^|;) # at start-of-line or after end-of-statement
  1142. \h* # optional leading whitespace
  1143. (?-i:REM\b|\x24\x2A|[\x21\x2A]) # Single Line Comment 1..4
  1144. .*$ # whatever, until end-of-line
  1145. )
  1146. | (?:\x22[^\x22\r\n]*\x22) # String Literal - Double Quoted
  1147. | (?:\x27[^\x27\r\n]*\x27) # String Literal - Single Quoted
  1148. | (?:\x5C[^\x5C\r\n]*\x5C) # String Literal - Backslash Quoted
  1149. "
  1150. >
  1151. <function
  1152. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  1153. (?m-i)^ # case-sensitive, NO leading whitespace
  1154. (?:
  1155. \d+\b(?=:?) # completely numeric label, colon optional + discarded
  1156. | [A-Za-z_][\w.$%]*(?=:) # alphanumeric label, colon required + discarded
  1157. )
  1158. "
  1159. />
  1160. </parser>
  1161. <!-- ======================================================= [ BaanC ] -->
  1162. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1163. | Based on:
  1164. | https://notepad-plus-plus.org/community/topic/14494/functionlist-classrange-question
  1165. |
  1166. | Note(s):
  1167. | 1. Boost::Regex 1.58-1.59 do not correctly handle quantifiers on subroutine calls
  1168. | therefore the additional non-capturing group i.e. "(?:(?&amp;COMMENT))?" instead
  1169. | of simply "(?&amp;COMMENT)?"
  1170. \-->
  1171. <parser
  1172. displayName="BaanC Sections"
  1173. id ="baanc_section"
  1174. >
  1175. <classRange
  1176. mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
  1177. (?im) # case-insensitive, ^ and $ match at line breaks
  1178. (?(DEFINE) # definition of sub-routines
  1179. (?'SECTION'
  1180. ^\h* # optional leading whitespace at start-of-line
  1181. (?: # known section names
  1182. (?:after|before)\.(?:report\.\d+|\w+(?:\.\w+)*\.\d+)
  1183. | (?:field|zoom\.from)\.(?:all|other|\w+(?:\.\w+)*)
  1184. | (?:footer|group|header)\.\d+
  1185. | choice\.\w+(?:\.\w+)*
  1186. | detail\.\d+
  1187. | form\.(?:all|other|\d+)
  1188. | functions
  1189. | main\.table\.io
  1190. ): # end-of-section-header indicator
  1191. )
  1192. (?'SECTION_EMPTY'
  1193. ^\h* # optional leading whitespace at start-of-line
  1194. (?: # known `empty` section names
  1195. after\.(?:form\.read|program|receive\.data|update\.db\.commit)
  1196. | before\.(?:(?:display|new)\.object|program)
  1197. | declaration
  1198. | on\.(?:display\.total\.line|error)
  1199. ): # end-of-section-header indicator
  1200. )
  1201. )
  1202. (?&amp;SECTION) # section header
  1203. (?s:.*?) # whatever,
  1204. (?= # ...up till
  1205. \s*
  1206. (?:
  1207. (?&amp;SECTION) # ...next section header,
  1208. | (?&amp;SECTION_EMPTY) # ...next `empty` section header
  1209. | \Z # ...or end-of-text
  1210. )
  1211. )
  1212. "
  1213. >
  1214. <className>
  1215. <nameExpr expr="^\h*\K\w+(?:\.\w+)*:" />
  1216. </className>
  1217. <function
  1218. mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
  1219. (?im) # case-insensitive, ^ and $ match at line breaks
  1220. (?(DEFINE) # definition of sub-routines
  1221. (?'COMMENT'
  1222. \s*\x7C[^\r\n]* # trailing comment
  1223. (?: # optional subsequent comment
  1224. (?:\r?\n|\n?\r) # - mandatory line-break
  1225. \s*\x7C[^\r\n]* # - `trailing` comment
  1226. )*
  1227. )
  1228. )
  1229. ^\h* # optional leading whitespace at start-of-line
  1230. (?:
  1231. \K # discard text matched so far
  1232. (?: # known sub-section names
  1233. after\.(?:choice|d(?:elete|isplay)|f(?:ield|orm)|group|input|layout|re(?:ad|write)|skip\.(?:delete|(?:re)?write)|write|zoom)
  1234. | before\.(?:ch(?:ecks|oice)|d(?:elete|isplay)|f(?:ield|orm)|group|input|layout|print|re(?:ad|write)|write|zoom)
  1235. | check\.input
  1236. | domain\.error
  1237. | init\.(?:f(?:ield|orm)|group)
  1238. | on\.(?:choice|e(?:ntry|xit)|input)
  1239. | read\.view
  1240. | ref\.(?:display|input)
  1241. | selection\.filter
  1242. | when\.field\.changes
  1243. ): # end-of-sub-section-header indicator
  1244. |
  1245. function # keyword, start-of-function-header indicator
  1246. (?:(?&amp;COMMENT))? # optional `embedded` comment
  1247. (?: # optional storage-class specifier
  1248. \s+extern
  1249. (?:(?&amp;COMMENT))? # ...with optional `embedded` comment
  1250. )?
  1251. (?: # optional function type specifier
  1252. \s+(?:
  1253. boolean
  1254. | double
  1255. | long
  1256. | string
  1257. | void
  1258. | domain
  1259. (?:(?&amp;COMMENT))? # ...with optional `embedded` comment
  1260. \s+\w+(?:\.\w+)*
  1261. )
  1262. (?:(?&amp;COMMENT))? # ...with optional `embedded` comment
  1263. )?
  1264. \s+
  1265. \K # discard text matched so far
  1266. \w+(?:\.\w+)* # function identifier
  1267. (?:(?&amp;COMMENT)(?:\r?\n|\n?\r))? # optional `embedded` comment
  1268. \s*\( # start-of-parameter-list indicator
  1269. )
  1270. "
  1271. >
  1272. <functionName>
  1273. <funcNameExpr expr="\w+(?:\.\w+)*(?:\h*:)?" />
  1274. </functionName>
  1275. </function>
  1276. </classRange>
  1277. <function
  1278. mainExpr="(?x) # free-spacing (see `RegEx - Pattern Modifiers`)
  1279. (?im) # case-insensitive, ^ and $ match at line breaks
  1280. (?(DEFINE) # definition of sub-routines
  1281. (?'COMMENT'
  1282. \s*\x7C[^\r\n]* # trailing comment
  1283. (?: # optional subsequent comment
  1284. (?:\r?\n|\n?\r) # - mandatory line-break
  1285. \s*\x7C[^\r\n]* # - `trailing` comment
  1286. )*
  1287. )
  1288. )
  1289. ^\h* # optional leading whitespace at start-of-line
  1290. (?:
  1291. \K # discard text matched so far
  1292. (?: # known `empty` section names
  1293. after\.(?:form\.read|program|receive\.data|update\.db\.commit)
  1294. | before\.(?:display\.object|new\.object|program)
  1295. | declaration
  1296. | on\.(?:display\.total\.line|error)
  1297. ): # end-of-section-header indicator
  1298. |
  1299. function # keyword, start-of-function-header indicator
  1300. (?:(?&amp;COMMENT))? # optional `embedded` comment
  1301. (?: # optional storage-class specifier
  1302. \s+extern
  1303. (?:(?&amp;COMMENT))? # ...with optional `embedded` comment
  1304. )?
  1305. (?: # optional function type specifier
  1306. \s+(?:
  1307. boolean
  1308. | double
  1309. | long
  1310. | string
  1311. | void
  1312. | domain
  1313. (?:(?&amp;COMMENT))? # ...with optional `embedded` comment
  1314. \s+\w+(?:\.\w+)*
  1315. )
  1316. (?:(?&amp;COMMENT))? # ...with optional `embedded` comment
  1317. )?
  1318. \s+
  1319. \K # discard text matched so far
  1320. \w+(?:\.\w+)* # function identifier
  1321. (?:(?&amp;COMMENT)(?:\r?\n|\n?\r))? # optional `embedded` comment
  1322. \s*\( # start-of-parameter-list indicator
  1323. )
  1324. "
  1325. >
  1326. <functionName>
  1327. <nameExpr expr="\w+(?:\.\w+)*(?:\h*:)?" />
  1328. </functionName>
  1329. </function>
  1330. </parser>
  1331. <!-- ================================================================= -->
  1332. </parsers>
  1333. </functionList>
  1334. </NotepadPlus>