Re: Replacement for which-func advise
Eric M. Ludlam <eric <at> siege-engine.com>
2010-04-08 11:33:24 GMT
On 04/06/2010 08:36 PM, Jan Moringen wrote:
>> This solution is similar to what we'd get if we added a new
>> > semantic-ctxt function that would, in Java's case, just be the
>> > find-tags-by-class code. We would then need to find all the necessary
>> > locations to apply it.
> Wouldn't the function in question be (the already existing function)
> semantic-analyze-scope-nested-tags? This is what I currently do for
> Java:
>
> +(define-mode-local-override semantic-analyze-scope-nested-tags
> + java-mode (position scopetypes)
> + "Maybe add package declaration to list of parents."
I think you have just shown that I can't remember my own API anymore. ;)
Perhaps I didn't understand your question, which was:
> > in Common Lisp. These do not show up in the parents slots of the scope
> > object. In my opinion, it would be useful to have them there. Or should
> > the scope be understood to strictly describe the lexical structure of
> > the code?
So where you instead asking, should code that uses a 'package' statement
followed by a function/method definition that is now in 'package' be
modified to show that it is indeed a part of package?
In that case, the rule so far as been that the tag structure map as
directly as possible to what is syntactically in the buffer as opposed
to what is logically in the buffer. The premise being that if you come
to a tag list for some language there is a deterministic mapping. That,
in turn, means you can use srecode to regenerate the essence of a tag
list as code from a tag list.
That said, I don't feel so strongly as to not allow variation. It's
just easier not to when it comes to developing a parser.
Your solution in the scope is a fine thing to do where the :parent is
added to the tag, especially since you are cloning the tag first,
leaving the buffer tag list alone.
You also asked:
> What do :parent attributes do? I thought, the nesting of tags is
> described by having children in the :members attribute of their parents.
In C++, this is like:
void namespace1::class2::method1() {};
so it is the name of some namespace/class where that method belongs. In
EIEIO, it is any method definition.
That parent tag is looked up to see if that thing belongs to some other
type, and they will be gathered together in the typecache as if they had
been parsed that way, making a more easily searched structure.
Thanks
Eric
Eric
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev