From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Roxborough To: "Keogh, Craig" Cc: "'sourcenav@sourceware.cygnus.com'" Subject: Re: Adding a Parser: SN_LOCAL_VAR_DEF ? Date: Thu, 09 Aug 2001 17:14:00 -0000 Message-id: <3B7329F6.89419A61@redhat.com> References: <34168E9E775CD411A4430000F80768621B4433@unclassfs03.rlmsystems.com.au> X-SW-Source: 2001-q3/msg00106.html "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.