spartacus
18th April 2008, 14:51
Did anybody think about using something like "ctags" with baan? Maybee one have to reduce this tool, just to work with functions. But it would be cool if you can jump trough your DALs and DLLs just with a click!!
I don't know ctags, I have just an idea how it works. And if it works, how I think, it could be a great tool for us!
I think it should be possbile to adopt it to the baan syntax, more complex could be, that we usually work on a client, whereas the files reside on the server.
mark_h
18th April 2008, 18:04
Hello spartacus! I moved the thread from code and utilities because that is for actual sharing of code. While this sounds like an excellent idea I believe it might get a better response here.
NPRao
18th April 2008, 20:28
I think the bic_info already gives that skeleton information. In the LN tools, there is a new option called IDE Explorer which gives the gbf style function tree browser, which also includes the program sections, when you click on a section and you have the source code, the default editor automatically opens and jumps to the section you clicked. You can do the same for the dll's which are referred by your program script.
Refer to the screen shot.
spartacus
21st April 2008, 15:22
But I think this is LN specific. It isn't hidden somewhere in Baan 5?
tredok
30th August 2010, 18:42
Hi,
I recently began using 'ctags' with Baan. I would like to share the process I
followed to get it working so you can also use it.
I've created a file of tags to define external functions of Dlls and Includes.
It is possible in the future to extend functions of DAL and external
variables of Dlls, but right now I don't bear in mind that option.
I attach the following files to use during the process inside 'baantags.zip' file, although not all are
required:
'ctags-5.8_withBaanParser\*' -> Recompiled 'ctags' program with Baan parser.
'ctags-5.8_baanPatch\*' -> Patch to add the Baan parser recompiling the 'ctags'
program oneself.
'listAppScripts.py' -> Python script to get the sources for 'ctags' to parse.
'copyBaanScript.js' -> Ultraedit script that creates a local backup of the
active document.
Here are the steps, but I advise you to take them with caution because I don't
take responsability for problems that may arise from them, although I will be happy to
try to resolve any doubts. Steps preceded by an asterisk aren't mandatory but
necessary if you wish to recompile 'ctags' by your own.
1.- I will assume that you will download attached zip file to 'C:\', and you
will unzip it getting this directory structure:
C:\baantags\ctags-5.8_withBaanParser
C:\baantags\ctags-5.8_baanPatch
C:\baantags\listAppScripts.py
C:\baantags\copyBaanScript.js
2.- Download Python. Link -> http://www.python.org/ftp/python/3.1.2/python-3.1.2.msi
3.- Install Python.
4.- Add the path of the Python binary to the PATH environment variable.
*5.- Download ctags. Link -> http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz
*6.- Download MinGW. Link -> http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get/mingw-get-0.1-mingw32-alpha-2-bin.zip/download
*7.- Download MSYS. Link -> http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe
*8.- Unzip MinGW. --Warning: Highly recommended on 'C:\MinGW\'!
*9.- Add 'bin' directory of previous step to the PATH environment variable.
*10.- Install several Unix utilities adapted to Windows. In my Windows shell:
winshell> mingw-get install gcc mingw32-make gdb msys-base
*11.- Install MSYS. --Warning: When seeking the path to MinGW, ensure that
'C:\MinGW' exists and write it as shown in the example!
*12.- Unzip ctags (supposed in C:\baantags\ctags-5.8\).
*13.- Patch 'ctags'. In my windows shell:
winshell> copy /-y C:\baantags\ctags-5.8_baanPatch\* C:\baantags\ctags-5.8\
winshell> rmdir /S C:\baantags\ctags-5.8_withBaanParser
winshell> move C:\baantags\ctags-5.8 C:\baantags\ctags-5.8_withBaanParser
*14.- Run 'MSYS (rxvt)'.
*15.- Recompile ctags. In my MSYS shell:
$ cd /c/baantags/ctags-5.8_withBaanParser/
$ ./configure --prefix=`pwd`/bins/ && make && make install
$ mv bins/bin/ctags.exe .
$ rm -rd bins/
$ exit
16.- Edit 'listAppScripts.py' script. Adapt it to your specific environment.
Explanation: It's written in Python. Go trought the Baan application directory and
creates the 'baanscripts.txt' file with all scripts to parse later with
'ctags'.
It will be necessary to change the following variables:
'vrcs' -> VRC structure.
'paqs' -> So many sublists as elements in 'vrcs' variable.
'appPath' -> Path to the Baan application directory (mapped in Z:\ in my case).
17.- Run 'listAppScripts.py'. In my Windows shell:
winshell> cd C:\baantags
winshell> python listAppScripts.py
18.- Run ctags over the file with the scripts to parse created in the previous
step. in my Windows shell:
winshell> cd C:\baantags
winshell> ctags-5.8_withBaanParser\ctags.exe --language-force=baan -L baanscripts.txt
*** At this point, the tags file has been created. There is one step left,
configure your favourite editor. Gvim in my case, so I will explain the process
in this one. ***
*** WARNING: ctags opens scripts directly from the file system, bypassing the
protection of Baan to change the script from those who don't have permissions.
It's risky because a mistake could lead to changes in standard scripts of from
other VRCs. I've fixed it in GVim in the next two steps, but no idea about Ultraedit.
*** For GVim users. ***
19.- Edit _vimrc file (or maybe _gvimrc).
20.- Add next sentences to it:
"Path to tags file.
set tags^=C:\baantags\tags
" Open tags scripts in read-only mode. WARNING: It will be necessary to
adapt the path.
au BufEnter Z:/erpln/application/*/[pi]* set nomodifiable
*** For Ultraedit users. ***
Add the tags file to the option 'Project/CTAGS Options/Default Tagfile'.
Ready. Ctags can be used with Baan. Enjoy it.
I will be waiting for feedback.
Regards.