You are here: PSPad forum > English discussion forum > Re: Write a custom Code Explorer parser?

Re: Write a custom Code Explorer parser?

Goto Page: 1 2 Next

#1 Write a custom Code Explorer parser?

Posted by: jeki | Date: 2018-06-25 07:09 | IP: IP Logged

I use PSPad for for a specific scripting language of a product in use in our company.

So i used as Code Explorer "ftVBS". Function in our Language will so mapped. Know I want to expand the possibilities of the Code Explorer to get better overview over our scripts
at a glance.

It is possible to write own Code Explorer?

-> I found responses in the forum that indicate that isn't possible to wirte own Code Explorer...but, wouldn't it be a powerfull capability of PSPad, if it is possible to expand the Code Explorer?

Options: Reply | Quote | Up ^


#2 Re: Write a custom Code Explorer parser?

Posted by: pspad | Date: 2018-06-25 07:25 | IP: IP Logged

No, there is no possibility to write own code explorer yet.
If you will send me source samples and description wjat do you want to see in code explorer window, I will add new code explorer for you

Options: Reply | Quote | Up ^


#3 Re: Write a custom Code Explorer parser?

Posted by: Gabriel_ACE | Date: 2018-06-28 18:04 | IP: IP Logged

jeki:
I use PSPad for for a specific scripting language of a product in use in our company.

So i used as Code Explorer "ftVBS". Function in our Language will so mapped. Know I want to expand the possibilities of the Code Explorer to get better overview over our scripts
at a glance.

It is possible to write own Code Explorer?

-> I found responses in the forum that indicate that isn't possible to wirte own Code Explorer...but, wouldn't it be a powerfull capability of PSPad, if it is possible to expand the Code Explorer?

I always wanted that in PSPAD!! T_______T

Options: Reply | Quote | Up ^


#4 Re: Write a custom Code Explorer parser?

Posted by: jeki | Date: 2018-07-03 15:13 | IP: IP Logged

This will be great winking smiley

I would need for our selfmade/-used language named "KiBasic":

Code Explorer:
======================================
[-] Includes
.|-- .\reports\Lib_include.bas
.|-- .\reports\Can_include.bas
[-] Functions
.|-- myFristFunction():integer
.|-- mySecondeFunction(string p_abc):integer
[-] Labels
.|-- (-): start script
.|-- (A): do something
.|-- (-): endscript
[-] Modules
.|-- abctools.dll
.|-- report.dll
[-] Variables
.|-- string strTmp, strTmpA
.|-- integer intTmp
.|-- flaot floTmp
.|-- integer ddReport = getcurrentreportdict()
.|-- integer ddReportB= getcurrentreportdict()
======================================

By following Code:
======================================
rem MODULES & INCLUDES
rem -----------------------
include ".\reports\Lib_include.bas"
module "abctools.dll"
module "report.dll"
include ".\reports\Can_include.bas"
rem -----------------------

rem VARIABLES
rem -----------------------
string strTmp, strTmpA
integer intTmp
flaot floTmp
rem -----------------------

rem FUNCTIONS
rem -----------------------
function myFristFunction():integer
myFristFunction=1
endfunc

function mySecondFunction(string p_abc):integer
mySecondFunction=1
endfunc
rem -----------------------

rem MAIN
rem -----------------------

rem # (-): start script
integer i
i = myFristFunction()

rem # (A): do something
i = mySecondFunction("hi")

integer ddReport = getcurrentreportdict()
integer ddReportB= getcurrentreportdict()

rem # (-): endscript
rem stop the script
break
rem -----------------------
======================================

Following Regex for each line:
======================================
[+] Includes -> "^\s*include\s*\"(.*)\"$"
[+] Functions-> "^\s*function\s*(.*)$"
[+] Labels-> "^\s*rem\s\#\s(.*)"
[+] Modules-> "^\s*module\s*\"(.*)\"$"
[+] Variables-> ^\s*((string|integer|float)\s+([_a-zA-Z]*)(\s*(=\s*.*|,\s*[_a-zA-Z]*)*))\s*$
======================================

Hopefully my RegEx are right sad smiley

Thank you.

Options: Reply | Quote | Up ^


#5 Re: Write a custom Code Explorer parser?

Posted by: pspad | Date: 2018-08-02 11:27 | IP: IP Logged

Sorry for delay.
First version of KiBasic code explorer (file type ftKiBas) will be part of the next build. Some preview (before module fixing):

image

Options: Reply | Quote | Up ^


#6 Re: Write a custom Code Explorer parser?

Posted by: pspad | Date: 2018-08-02 12:10 | IP: IP Logged

New build was published. You can check new code parser

Options: Reply | Quote | Up ^


#7 Re: Write a custom Code Explorer parser?

Posted by: jeki | Date: 2018-11-13 18:10 | IP: IP Logged

Eiii...I missed your message! I was looking for a answer, but I was not sure if really someone will implement my wish -))! Wow...It looks good.

So I tried to install the latest version 5.0 and copy & paste the latest build 5.0.1 (287) in the installation folder. But I do not find the highlighter?! I searched for "ftKiBas" and also "KiBasic", ...gone through all highlighters... ...?

Where I can find the highlighter?

Thanks for your help.

Options: Reply | Quote | Up ^


#8 Re: Write a custom Code Explorer parser?

Posted by: pspad | Date: 2018-11-13 18:24 | IP: IP Logged

Hello

ftKiBas is code explorer type for user highlighter.
Wasnt KiBasic highlighter defined by you? I didn't know your language definition.
Open menu settings / user highlighter and create KiBasic highlighter definition. Assign ftKiBasic as file explorer type.

Options: Reply | Quote | Up ^


#9 Re: Write a custom Code Explorer parser?

Posted by: jeki | Date: 2018-11-20 15:21 | IP: IP Logged

Da...! You are my superhero, godfather, best of ever... ... ... smiling smiley

It's time to...! Thank you very much!

(Yes, I had an own hilighter...but didn't find where I had to select the code-explorer...)

Options: Reply | Quote | Up ^


#10 Re: Write a custom Code Explorer parser?

Posted by: bomans007 | Date: 2018-12-11 08:51 | IP: IP Logged

Hi

We are using Pspad already for a longer time in my company, and this for the same reason as described above, namely for coding in a company specific programming languages.
Since the syntax of this langues is looking more or less to VBscript, we benefited the included code explorer features of Pspad without any problem!

Since we are huge fans of the product we wanted to introduce Pspad(and it's benefits smiling smiley ) in the reporting team as well(to overcome the many shortcomings of the default IDE)
The only inconvenience that we see (so far) with the Pspad flexibility so far is that the code explorer is not customizable and that's why I got here to this post.

Would it be possible to extend the code explorer of PsPad for the Sas language.
It should only list 'functions' which are marked with the 'Macro' keyword. e.g.
%macro MacroFunctionName;
...
Code
...
%mend MacroFunctionName;

Thanks anyway!

Options: Reply | Quote | Up ^


Goto Page: 1 2 Next





Editor PSPad - freeware editor, © 2001 - 2018 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR