Author Topic: Notepad+++  (Read 9330 times)

0 Members and 1 Guest are viewing this topic.

ChrisCarlson

  • Guest
Notepad+++
« on: March 26, 2015, 09:42:09 AM »
Does anyone have a function parser (functionList.xml) for notepad+++?

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: Notepad+++
« Reply #1 on: March 26, 2015, 09:45:12 AM »
Here is one.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

ChrisCarlson

  • Guest
Re: Notepad+++
« Reply #2 on: March 26, 2015, 10:00:39 AM »
Looks to be the "stock" functionList.xml file?

My regex skills are severely lacking but I think it would be something along these lines?

Code: [Select]

<association ext = ".lsp" id="autolisp_function"/>

<parser id="autolisp_function" displayname="AutoLisp">
<function
mainExpr="mainExpr="/([(defun])\w+$/ig"
displayMode="$functionName">
        <functionName>
<nameExpr expr="/[_]\w+/igm"/>
</functionName>
</function>
</parser>


But that's not it :confused:
« Last Edit: March 26, 2015, 10:22:39 AM by ChrisCarlson »

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: Notepad+++
« Reply #3 on: March 26, 2015, 10:56:36 AM »
Looks to be the "stock" functionList.xml file?

..

You didn't want that one?
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

ChrisCarlson

  • Guest
Re: Notepad+++
« Reply #4 on: March 26, 2015, 12:13:44 PM »
No, that file comes default with the installation. The end user has the ability to add in custom function traps. Which in turn, add the function to the function list for easy finding or referencing.

huiz

  • Swamp Rat
  • Posts: 917
  • Certified Prof C3D
Re: Notepad+++
« Reply #5 on: March 26, 2015, 01:14:23 PM »
In your AppData path you can find the personal file which you can edit. Mine is exact the same as the original so I never added or changed something :-)

The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

ymg

  • Guest
Re: Notepad+++
« Reply #6 on: March 27, 2015, 03:06:56 PM »
Chris,

Not too good at regex but this one
seems to work for me.

Code: [Select]
<parser id="lisp_function" displayName="Lisp">
<function
mainExpr="[ \t]*\([ \t]*defun[ \t][a-zA-Z0-9_+\-*/<>=:.!?@%&|]+"
displayMode="$className->$functionName">
</function>
</parser>

Also added the following line in association

Code: [Select]
<association langID="30" id="lisp_function"/>
Probably would need to add a regex to catch the comments.

ymg
« Last Edit: March 27, 2015, 03:24:43 PM by ymg »

ymg

  • Guest
Re: Notepad+++
« Reply #7 on: March 27, 2015, 03:40:21 PM »
Chris,

Here, may be a bit better with the argument to the function.

Code: [Select]
<parser id="lisp_function" displayName="Lisp">
     <function
  mainExpr="[ \t]*\([ \t]*defun[ \t]+[a-zA-Z0-9_+\-*/<>=:.!?@%&|]+[ \t]+\([a-zA-Z0-9_+\-*/<>=:.!?@%&| \t]*\)"
displayMode="$className->$functionName">
     </function>
</parser>

ChrisCarlson

  • Guest
Re: Notepad+++
« Reply #8 on: March 27, 2015, 03:49:10 PM »
Very nice! Thanks!

ymg

  • Guest
Re: Notepad+++
« Reply #9 on: March 28, 2015, 04:24:18 AM »
Chris,

This regex
Code: [Select]
(?s);\|.*?\|; will find multiple lines comments,

while this one
Code: [Select]
;.*$ will find single-line comment.

However, I could not make it work in the parser for Function list.
Maybe you have better luck than me.

ymg

ymg

  • Guest
Re: Notepad+++
« Reply #10 on: March 28, 2015, 03:21:05 PM »
Chris,

Here the parser with a much simpler regex.

Code: [Select]
                        <parser id="lisp_function" displayName="Lisp">
<function
     mainExpr="\(defun.*?\)"
     displayMode="$functionName">
</function>
</parser>

Still haven't found the trick to exclude comments though.

And a few regex that could be handy in Autolisp:

Single Line Comments in Autolisp:       ;.*$                               
Multiple Lines Comments Autolisp:       (?s);\|.*?\|;                 
Comments Single or Multilines:            (((?s);\|.*?\|;)|(;.*$)) 
Function Name with Parameters:         \(defun.*?\)                   
Function Name without (defun  :         (?<=defun).*?\)           
Within Double or Single Quotes:          (["'])(\\?.)*?\1               
Within Balanced Parentheses:              \((?>[^()]|(?R))*\)       



Most of the above was pulled or derived  from http://www.regular-expressions.info

ymg
« Last Edit: March 31, 2015, 10:56:46 AM by ymg »

77077

  • Guest
Re: Notepad+++
« Reply #11 on: May 27, 2015, 08:46:39 PM »
New version no function list plug-in  ,I still use old version

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Notepad+++
« Reply #12 on: May 28, 2015, 11:51:33 PM »
New version no function list plug-in  ,I still use old version
In the latest version V6.7.8.2 the function list works just fine.

77077

  • Guest
Re: Notepad+++
« Reply #13 on: May 29, 2015, 03:21:18 AM »
New version no function list plug-in  ,I still use old version
In the latest version V6.7.8.2 the function list works just fine.

I just download v6.7.8.2  , but function list  is  null

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Notepad+++
« Reply #14 on: May 29, 2015, 07:52:26 AM »
@ 77077: Can you post your functionList.xml?

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Notepad+++
« Reply #15 on: May 29, 2015, 07:59:58 AM »
@ ymg:
About your regular expressions:
1.
What does (?s) do?
2.
To catch single line comments use ;.*?$ instead of ;.*$

77077

  • Guest
Re: Notepad+++
« Reply #16 on: May 29, 2015, 08:01:47 AM »
@ 77077: Can you post your functionList.xml?


roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Notepad+++
« Reply #17 on: May 29, 2015, 08:05:07 AM »
But that's the default file. You have to edit the file. That is what this topic is about...

77077

  • Guest
Re: Notepad+++
« Reply #18 on: May 29, 2015, 08:11:50 AM »
But that's the default file. You have to edit the file. That is what this topic is about...

Hi roy ,Where has the edited file ?

77077

  • Guest
Re: Notepad+++
« Reply #19 on: May 29, 2015, 08:24:40 AM »
Hi roy
Here is simple routine
Can add something like this ?

 (defun c:Test (/ st ss)
Select the TAG you want to change its value:[TAG1(1)/TAG2(2)/TAG3(3)/TAG4(4)/TAG5(5)] <TAG1>:



« Last Edit: May 29, 2015, 10:07:35 AM by 77077 »

ymg

  • Guest
Re: Notepad+++
« Reply #20 on: May 29, 2015, 09:05:49 AM »
Roy,

The (?s) was to allow multilines in Notepad++ without having to
check the box.

But I am far from being very fluent with regex, like the song
I still have 10 miles to go on a 9 miles road.

ymg
« Last Edit: May 29, 2015, 09:10:48 AM by ymg »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Notepad+++
« Reply #21 on: May 29, 2015, 09:09:10 AM »
But that's the default file. You have to edit the file. That is what this topic is about...
Hi roy ,Where has the edited file ?

This is the parser I have used:
Code: [Select]
<parser id="lisp_function" displayName="lsp" commentExpr="((;\|.*?\|;)|(;.*?$))">
  <function
    mainExpr="(?&lt;=[\s\(]defun\s)\s*[^\s\(]*"
    displayMode="$functionName">
  </function>
</parser>

I have attached my file.

ChrisCarlson

  • Guest
Re: Notepad+++
« Reply #22 on: May 29, 2015, 09:14:36 AM »
That works pretty smoothly Roy, thanks!

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Notepad+++
« Reply #23 on: May 29, 2015, 09:23:33 AM »
Hi roy
Here is simple routine...
You should start a new topic for this problem. But IMO your request is strange. Tags are not restricted to the "TAG?" format. Except for quick tests I would never use "TAG1", "TAG2" etc.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Notepad+++
« Reply #24 on: May 29, 2015, 09:25:37 AM »
That works pretty smoothly Roy, thanks!
Thanks. Note that if you want the list to also contain the arguments then you should study ymg's suggestions.

77077

  • Guest
Re: Notepad+++
« Reply #25 on: May 29, 2015, 11:37:18 AM »
roy , thanks a lot.  function list is nice .

77077

  • Guest
Re: Notepad+++
« Reply #26 on: May 29, 2015, 10:29:30 PM »
roy ,I have a new question .
set language ----> L--->LISP  , ok, function list is ok
set language ----> user define language---> function list not ok .


roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Notepad+++
« Reply #27 on: May 31, 2015, 11:22:35 AM »
roy ,I have a new question .
set language ----> L--->LISP  , ok, function list is ok
set language ----> user define language---> function list not ok .
The info you need is in the file...

77077

  • Guest
Re: Notepad+++
« Reply #28 on: May 31, 2015, 12:04:20 PM »
roy ,I have a new question .
set language ----> L--->LISP  , ok, function list is ok
set language ----> user define language---> function list not ok .
The info you need is in the file...

Yes , I open functionlist .xml , but ,I can't understand , can you tell me where I need modify ?

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Notepad+++
« Reply #29 on: June 01, 2015, 03:59:47 AM »
Info in the file:
Code: [Select]
for User Defined Languages:
<association userDefinedLangName="my user defined language" id="my_udl_passer_id"/>
<association userDefinedLangName="Autocad" id="my_autocad_passer_id"/>

So after:
Code: [Select]
<association langID="30" id="lisp_function"/>Insert:
Code: [Select]
<association userDefinedLangName="LSP" id="lisp_function"/>Change "LSP" to match your name.

77077

  • Guest
Re: Notepad+++
« Reply #30 on: June 01, 2015, 04:49:52 AM »
Info in the file:
Code: [Select]
for User Defined Languages:
<association userDefinedLangName="my user defined language" id="my_udl_passer_id"/>
<association userDefinedLangName="Autocad" id="my_autocad_passer_id"/>

So after:
Code: [Select]
<association langID="30" id="lisp_function"/>Insert:
Code: [Select]
<association userDefinedLangName="LSP" id="lisp_function"/>Change "LSP" to match your name.

Thank you ,roy, now is successful !

Q1241274614

  • Guest
Re: Notepad+++
« Reply #31 on: July 07, 2015, 06:57:00 AM »
(startapp "notepad.exe" FILENAME)

Jota123457

  • Mosquito
  • Posts: 1
Re: Notepad+++
« Reply #32 on: May 13, 2017, 08:21:31 AM »
You are great!
I'm still using Notepadd++  ( :knuppel2:) with autolisp and finaly the functionlist is working.
1000 Thanks! :yay!: