Re: (PHP) Resolving Lost Scanned Includes

Eric Ludlam <[email protected]> Sun, 09 Aug 2015 20:58:51 -0400
Newsgroups gmane.emacs.semantic
Message-ID <[email protected]>
On 08/09/2015 06:25 PM, Andrea Turso wrote:
> Dear Eric,
>
> I have used the the Wisent grammar in semantic/wisent/java-tags.wy to
> create a small parser for PHP [1]
>
> My objective is to extract the list of included classes from a buffer
> and make their name clickable (to jump to definition).
>
> When testing the java-tags parser all import statements are converted
> into Semantic Includes, and it's possible to click on the class name to
> visit its file.
>
> My PHP grammar is also using the INCLUDE-TAG macro, but all includes end
> up being lost, so I wonder if there is anything non-obvious that must be
> done.
>
> I suppose Semantic/SemanticDB/TypeCache (which one?) needs a function to
> map the type name to a file — and for that I might rely on the code from
> another user of this mailing list [2].
>
> In the past I remember getting as far as finding the
> semanticdb-find-translate-path-includes-default function, but failed to
> understand how to get include tags to be resolved.
>
> I would appreciate if you could tell me what functions do I need to
> override, or write, to achieve similar results to that of the java-tags
> grammar?

Hi Andrea, The PHP stuff sounds great.  It is has been unfortunate that 
the version in cedet/contrib hasn't been usable.

The magic you need is `semantic-tag-include-filename', which appears to 
be in lisp/cedet/semantic/java.el.

This converts the string in the tag into a file name.  Without it, the 
includes infrastructure just trys to use it directly.

I hope this helps.
Eric

------------------------------------------------------------------------------