Author Topic: Unrealscript tagging. One class per file, correctly determine class name  (Read 5602 times)

photex

  • Community Member
  • Posts: 61
  • Hero Points: 1
Hi folks, I'm adding Unrealscript support and currently I create the language and set it's inheritence to 'c'. For the uc_proc_search I'm just calling c_proc_search and all-in-all it finds things pretty well so it's a good starting point. Currently though the only trouble is that each *.uc file defines a single class and the syntax for the class declaration is rather unusual.
An example:

Code: [Select]
class FOO
    abstract
    native
    noexport;

// members and methods defined below
var x;
var(SomeCategory) y;
...

//EOF

Code: [Select]
class BAR extends FOO
    native
    abstract
    hidecategories(Advanced)
    placeable;

// members and methods defined below

//EOF

In each of these examples the classname isn't correctly identified (obviously) and everything in the file is considered to be global.
My question is what would the most practical way to support this be? Is there a way that in my uc_proc_search I could determine the class name and then just influence the default c_proc_search? I'd like to write as little as possible tagging code since so much of the language can already be handled by what slickedit provides out of the box.
Are there other languages supported by slickedit that are defined in a similar fashion? Perhaps I could explore those macros as a starting point.


Thanks a million!

photex

  • Community Member
  • Posts: 61
  • Hero Points: 1
Re: Unrealscript tagging. One class per file, correctly determine class name
« Reply #1 on: November 25, 2009, 07:58:04 pm »
hrm, upon closer inspection it seems that the best way to do this would be to borrow from more than C. Switching to various language modes and seeing the results leads me to think that I could be pulling from the resources of javascript at least additionally. Using C to tag structures and enumerations, javascript for functions but variables don't get tagged correctly. C skips a lot of variables that I wasn't noticing at first and javascript gets the name wrong since it's 'var type name'.

photex

  • Community Member
  • Posts: 61
  • Hero Points: 1
Re: Unrealscript tagging. One class per file, correctly determine class name
« Reply #2 on: November 30, 2009, 05:02:47 pm »
Hi everyone. So I've been making good progress but I have now a question on how to correctly place the methods and member variables in the tree.
Currently I'm using tag_tree_compose, setting the name and type, and the class name the current item belongs too. By this time I've already added the class tag but none of the subsequent items are added to the class, they sit in the tree at the same level. Do I need to discover members in the list locals method instead?

Cheers,
Chip