Author Topic: adding Tcl's tclOO class names to tags in...don't laugh...visual slickedit 6.0  (Read 5648 times)

bobl

  • Community Member
  • Posts: 14
  • Hero Points: 0
Hi
To my eternal shame...I'm still using vs6.0<smile>.
Re tags, whilst namespaces show up fine, tclOO class names do not (although you can detect classes by + symbols for constructors). How hard would it be to parse the code and add tags for class names
i.e. anything following the string "::oo::class create"
e.g.
"::oo::class create TAG_NAME<<eol or space>>"
Any advice much appreciated??
« Last Edit: November 06, 2013, 07:56:23 PM by bobl »

bobl

  • Community Member
  • Posts: 14
  • Hero Points: 0
Getting there...slowly.
I see that tags are in .vtg files.
I created a new one as a sibling to tcl.vtg
i.e. c:\vslick\tagfiles\myTclOO_tags.vtg...
as another child file under '"Tcl" Tag Files'.
I rebuilt the tag file and it seems to have all expected tags.

Re adding tclOO classes...this looks very helpful....
halfway down the page....
Step 6: Write tagging support for Logo
http://blog.slickedit.com/2008/05/tutorial-adding-language-support-to-slickedit/

Presumably it's slick-c and I'm guessing the compiled c is what I'm seeing in the .vtg file...It seems to me I need to edit the procs shown for my class and compile them to a .vtg file...Is that it...I must confess I am a bit confused.
Again any pointers would be most welcome.
Thank you in anticipation.

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
hmmm...  Wasn't that installed off of punched cards?   ;D

The vtg file is the indexes of all the found tags (basically a database file)  The slick-c code you're writing is the code that will scan the files and make the tags based upon how you parse the file.  You'll then create a vtg file of that type and slickedit should know to use your code to build the file.

bobl

  • Community Member
  • Posts: 14
  • Hero Points: 0
Reading up more these seem promising too...
push_tag
  make_tags
     See "tags.e" for information on adding support for other languages.
         Dynamic Tagging 
               Tags for the Current File
        This feature does NOT require a tag file.
         Symbols Tab
                The Symbols tab of the Output toolbar
                 (docked on the bottom by default)
                 displays the tags for the word under the cursor.
   
     The -t option recursively search directories. 
     The -r is used to replace or add tags for the files that follow.
     The  -d option deletes tags for the files specified.
      gui_make_tags
gui_make_tags
find_tag

searching for "tags.e" in help as advised brought up nada!

Thank you for responding...and yes I see what you're saying.
I'm quite happy to have a play and seem to be looking in the right place re-generating tag files but...
what do you do to that c source and...
where do you put the result
for slickedit to use it
i.e. do you compile it to an include file,
put it in the main project directory and then
say #include incfile in your main source file?
I doubt it but have no idea what you do do.
Again thank you in anticipation.
« Last Edit: November 07, 2013, 07:48:20 PM by bobl »

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
If you're referring to the:
Code: [Select]
#define LOGO_MODE_NAME "Logo"
#define LOGO_EXTENSION1 "logo"
#define LOGO_EXTENSION2 "lgo"

// This function is called when the module is loaded.
// It configures the "logo" and "lgo" file extensions.
void defload()
stuff -
That code is slickedit-c which is what slickedit is built on, it's also used to make macros as well - So you'll make a "Logo.e" file out of that code which will load the "logo.vlx" file - Put that Logo.e file in the slickedit macro directory (or maybe your slickedit workspace directory... but some permanent location) and you can then build this file by starting slickedit, going to the menu and selecting Macro | Load Module then pick out the "logo.e" file.  This will "install" the language support.

The other parsing sections work the same way - They can be in the logo.e macro file or in another *.e file.  Then do the Load Module command for SE to use it.

bobl

  • Community Member
  • Posts: 14
  • Hero Points: 0
Thank you very much for your help. It's really appreciated.

Dennis

  • Senior Community Member
  • Posts: 3999
  • Hero Points: 522
Here's where you'll find the TCL tagging code in 6.0:

1) Go to the SlickEdit command line and type:
        fp tcl_proc_search
2) You probably just need to change the regular expression it uses to scan for classes.
3) Go to Macro > Load Module… to reload the modified macro.

In version 18.0.1, we have improved tagging for Tcl, so you really should download a trial and check it out.

bobl

  • Community Member
  • Posts: 14
  • Hero Points: 0
Dennis
Thanks very much for your advice.
It looks like it's right on the button!

>"In version 18.0.1, we have improved tagging for Tcl".
That's very good to hear! Thank you for your work and recommendation. 
« Last Edit: November 08, 2013, 03:21:00 PM by bobl »

bobl

  • Community Member
  • Posts: 14
  • Hero Points: 0
Dennis...you are "the business"!
All I had to do to get TclOO recognised with your guidance was...
a) as you directed...get the right proc in tcl.e by typing "fp tcl_proc_search" into slickedit's command line under the project window.
b) Replace "class" with "class create" in the macro definition for TCL_TAGTYPE.
c) Replace "[ \t]@(itcl\:\:|)" with "[ \t]@(\:\:oo\:\:|)"
in the search regex line.
itcl class tags were already in back in 2000!
« Last Edit: November 08, 2013, 06:59:33 PM by bobl »