krl.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. | https://npp-user-manual.org/docs/function-list/
  7. |
  8. \=========================================================================== -->
  9. <NotepadPlus>
  10. <functionList>
  11. <!-- ========================================================= [ KRL ] -->
  12. <!-- KRL - KUKA Robot Language -->
  13. <!--
  14. | https://notepad-plus-plus.org/community/topic/12264/function-list-for-new-language
  15. \-->
  16. <parser
  17. displayName="KRL"
  18. id ="krl_function"
  19. commentExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  20. (?m-s:;.*$) # Single Line Comment
  21. "
  22. >
  23. <function
  24. mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`)
  25. (?i:
  26. (?:GLOBAL\h+)?
  27. DEF # start-of-procedure indicator, possible extended to...
  28. (?:
  29. FCT # ...start-of-function indicator
  30. \h+
  31. (?:BOOL|CHAR|INT|REAL|(?&amp;VALID_ID)) # returning a primitive type or a user-defined-type...
  32. (?: # ...optionally as an array
  33. \h*\[
  34. \h*(?:\d+|\x27(?:H[0-9A-Fa-f]+|B[01]+)\x27)?
  35. \h*\]
  36. )?
  37. )?
  38. )
  39. \h+
  40. \K # keep the text matched so far, out of the overall match
  41. (?'VALID_ID' # valid identifier, use as subroutine
  42. \b(?!(?i:
  43. AN(?:D|IN|OUT)
  44. | B(?:OOL|RAKE|_(?:AND|EXOR|NOT|OR))
  45. | C(?:ASE|AST_(?:FROM|TO)|HAR|IRC(?:_REL)?|ON(?:ST|TINUE)|_(?:DIS|ORI|PTP|VEL))
  46. | D(?:ECL|EF(?:AULT|DAT|FCT)|ELAY|O)
  47. | E(?:LSE|ND(?:DAT|FCT|FOR|IF|LOOP|SWITCH|WHILE)?|NUM|X(?:IT|OR|T(?:FCT)?))
  48. | F(?:ALSE|OR)
  49. | G(?:LOBAL|OTO)
  50. | HALT
  51. | I(?:[FS]|MPORT|NT(?:ERRUPT)?)
  52. | L(?:IN(?:_REL)?|OOP)
  53. | M(?:AXI|INI)MUM
  54. | NOT
  55. | OR
  56. | P(?:RIO|TP(?:_REL)?|UBLIC)
  57. | RE(?:AL|PEAT|SUME|TURN)
  58. | S(?:EC|IGNAL|TRUC|WITCH)
  59. | T(?:HEN|O|RIGGER|RUE)
  60. | UNTIL
  61. | W(?:AIT|HEN|HILE)
  62. )\b) # keywords, not to be used as identifier
  63. [$A-Za-z_\x7F-\xFF][$\w\x7F-\xFF]{0,23} # valid character combination for identifiers
  64. )
  65. \h*\([^)]*\)
  66. "
  67. >
  68. <!-- comment out the following node to display the method with its parameters -->
  69. <functionName>
  70. <nameExpr expr="[$A-Za-z_\x7F-\xFF][$\w\x7F-\xFF]{0,23}" />
  71. </functionName>
  72. </function>
  73. </parser>
  74. </functionList>
  75. </NotepadPlus>