Re: semantic-analyze-current-context for fortran functions and subroutine

Eric Ludlam <[email protected]> Mon, 09 Feb 2015 21:21:43 -0500
Newsgroups gmane.emacs.cedet
Message-ID <[email protected]>
On 02/05/2015 05:13 PM, Martin Stein wrote:
> Just to try it out I added a new class
> semantic-analyze-context-subroutine with methods for type-constraint and
> show and overloaded semantic-analyze-current-context (well mostly I
> copied the default routine and added a cond branch for the subroutine).
> Works fine, except for having an almost complete copy of this analyze beast.

Huh, I think we can find a better way to integrate in new kinds of 
contexts that overloading all of semantic-analyze-current-context.  Not 
sure what at the moment though.

> I should mention that even so it is sometimes rather difficult and
> tedious to navigate through the semantic code base, it is a great
> framework for adding support for a new language.

Indeed.  The more features we add, the harder it is to understand. 
Unwinding all the different datatypes while also trying to make it 
language agnostic with all the right hooks is surprisingly complex.

> BTW-1: There is a semantic-analyze-context-return class, but not in use.
> And in fact completion with type matching for return in C does not seem
> to work, it just offers everything, it seems.

That probably means we have no tests.  Though I see a comment that says 
TODO right next to the return option that is deeply suspicious.  :)

> BTW-2: I also saw that eventually I will need to overload some more
> functions relying on regexp matching or forward-sexp (e.g.
> semantic-ctxt-current-symbol), otherwise those nasty fortran
> continuation lines are not dealt with properly (giving a wrong context...).

Indeed.  Hopefully not too many though.  The default versions of things 
like `semantic-up-context'  and the like tries to rely on functions like 
`up-list' so if fortran supports those you'll be ok.

For the current-symbol, we could update elements related to looking at 
the type relation separator and see if we can enable a language to 
extend it to include looking at continuation symbols.

I haven't looked in there in a while, but hopefully we can just tweak it 
a little bit to get you the hook you need.

Eric

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/