public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* Adding a Parser: SN_LOCAL_VAR_DEF ?
@ 2001-08-09 16:33 Keogh, Craig
  2001-08-09 17:14 ` Ian Roxborough
  0 siblings, 1 reply; 5+ messages in thread
From: Keogh, Craig @ 2001-08-09 16:33 UTC (permalink / raw)
  To: 'sourcenav@sourceware.cygnus.com'

Greetings,

I am writing an Ada parser for Source Navigator. Everything is working well
except for one thing. Local Variable definitions.

If I call sn_insert_symbol with SN_GLOB_VAR_DEF (global variable), it works
perfectly:
- it is highlighted in the editor window
- when the cursor is over the variable, it appears in the drop down box
- xref'ing works

But if I use SN_LOCAL_VAR_DEF in exactly the same way, none of the above
happen.

Yes, "generate refences to local variables" in project preferences is ON.

Is this a problem with my parser or source navigator? Has anyone else
experienced this?


Craig Keogh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding a Parser: SN_LOCAL_VAR_DEF ?
  2001-08-09 16:33 Adding a Parser: SN_LOCAL_VAR_DEF ? Keogh, Craig
@ 2001-08-09 17:14 ` Ian Roxborough
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Roxborough @ 2001-08-09 17:14 UTC (permalink / raw)
  To: Keogh, Craig; +Cc: 'sourcenav@sourceware.cygnus.com'

"Keogh, Craig" wrote:
> 
> Greetings,
> 
> I am writing an Ada parser for Source Navigator. Everything is working well
> except for one thing. Local Variable definitions.
> 
> If I call sn_insert_symbol with SN_GLOB_VAR_DEF (global variable), it works
> perfectly:
> - it is highlighted in the editor window
> - when the cursor is over the variable, it appears in the drop down box
> - xref'ing works
> 
> But if I use SN_LOCAL_VAR_DEF in exactly the same way, none of the above
> happen.

The code for passing on local variable information in the c++ parser
is working now.  It's been a while since I poked around in there, but
it doesn't use SN_LOCAL_VAR_DEF, it uses SN_REF_SCOPE_LOCAL and
SN_REF_TO_LOCAL_VAR, although it has been long enough for me to
forget how.  I think SN_REF_SCOPE_LOCAL is used to add a local
variable to a function (as in the declaration), and SN_REF_TO_LOCAL_VAR
used to mark uses of the declared local variable.

I could of course be completely wrong.

> Yes, "generate refences to local variables" in project preferences is ON.
> 
> Is this a problem with my parser or source navigator? Has anyone else
> experienced this?

Hmmm, not sure.  They could well be a problem with SN_LOCAL_VAR_DEF.

Local variables should be working in C/C++ use now.  You should
see them in the Xref window.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding a Parser: SN_LOCAL_VAR_DEF ?
@ 2001-08-14  1:08 Mike_D_Davies
  0 siblings, 0 replies; 5+ messages in thread
From: Mike_D_Davies @ 2001-08-14  1:08 UTC (permalink / raw)
  To: sourcenav

>> Local C/C++ variables don't work for me despite having the
>>"generate
>> references to local variables" checkbox checked.
>>
>> I think there may be a problem still lingering in there somewhere,
>> but I got no response when I posted earlier.
>
>I hunted out your earlier post and ran your example code
>snippet.  I did an Xref of the "main" function and could
>see "y" and "retval" as local variable.  This was under
>a Linux system not Windows.
>
>Source-Navigator doesn't (seem) handle local variables like global
>variables (WRT the GUI).  It filters them out most of the time and
>I only see them in "show references" branches of an xref.

OK,  I also see them now, but as you say only in the show references branch of
an xref.  Thanks for pointing that out.

I didn't expect this to be the result of the "generate references to local
variables" switch,  is there any way of forcing local variables to be treated
the same way as globals ?  Or is there some problem relating to multiple local
variables from different function scopes havint the same name ?

>There is a chance of some weird stuff going on under Windows
>WRT to local variables.

Aparently not :-)

Thanks again,

Mike



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding a Parser: SN_LOCAL_VAR_DEF ?
  2001-08-10  1:39 Mike_D_Davies
@ 2001-08-10 10:21 ` Ian Roxborough
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Roxborough @ 2001-08-10 10:21 UTC (permalink / raw)
  To: Mike_D_Davies; +Cc: sourcenav

Mike_D_Davies@fmo.com wrote:
> 
> >  Local variables should be working in C/C++ use now.  You should
> >     see them in the Xref window.
> 
> When you say "now" what do you mean in terms of version number ?

5.0

> I am using SN under Windows from the sourcenav-010412-windows.zip file.
> Local C/C++ variables don't work for me despite having the "generate
> references to local variables" checkbox checked.
>
> I think there may be a problem still lingering in there somewhere,
> but I got no response when I posted earlier.

I hunted out your earlier post and ran your example code
snippet.  I did an Xref of the "main" function and could
see "y" and "retval" as local variable.  This was under
a Linux system not Windows.

Source-Navigator doesn't (seem) handle local variables like global
variables (WRT the GUI).  It filters them out most of the time and
I only see them in "show references" branches of an xref.

There is a chance of some weird stuff going on under Windows
WRT to local variables.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Adding a Parser: SN_LOCAL_VAR_DEF ?
@ 2001-08-10  1:39 Mike_D_Davies
  2001-08-10 10:21 ` Ian Roxborough
  0 siblings, 1 reply; 5+ messages in thread
From: Mike_D_Davies @ 2001-08-10  1:39 UTC (permalink / raw)
  To: sourcenav

>  Local variables should be working in C/C++ use now.  You should
>     see them in the Xref window.

When you say "now" what do you mean in terms of version number ?  I am using SN
under Windows from the sourcenav-010412-windows.zip file.  Local C/C++ variables
don't work for me despite having the "generate references to local variables"
checkbox checked.

I think there may be a problem still lingering in there somewhere,  but I got no
response when I posted earlier.

Mike


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-08-14  1:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-09 16:33 Adding a Parser: SN_LOCAL_VAR_DEF ? Keogh, Craig
2001-08-09 17:14 ` Ian Roxborough
2001-08-10  1:39 Mike_D_Davies
2001-08-10 10:21 ` Ian Roxborough
2001-08-14  1:08 Mike_D_Davies

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).