Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Namespace Parsing Problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Avi Bueno
New Member

6 Posts

Posted - Jul 06 2007 :  05:55:45 AM  Show Profile  Reply with Quote
Hi,

VA doesn't parse identifiers inside a namespace of a class package I wrote.
I couldn't reproduce it in a small example, but I found that the same behavior happens when using Kevis Van Horn's smart_ptr class (excellent implementation, btw).

You can get the code here: http://web.archive.org/web/20000823030637/www.xmission.com/~ksvhsoft/code/smart_ptrs.html

For the following:
--

class Base {};
typedef ksvh::smart_ptr<Base>::spnwm	BaseSP;
              ~~~~~~~~~        ~~~~~
--

I get a red underline under smart_ptr and spnwm.

Help anyone?

Avi Bueno
New Member

6 Posts

Posted - Jul 06 2007 :  06:01:35 AM  Show Profile  Reply with Quote
I think this forum also has a parsing problem.. probably because there's a www inside the hyperlink I added..

Please Copy & Paste the full URL, I can't get it to show properly here..

The URL is: http:// web.archive.org/web/20000823030637/www.xmission.com/~ksvhsoft/code/smart_ptrs.html
Go to Top of Page

kevinsikes
Tomato Guru

USA
271 Posts

Posted - Jul 06 2007 :  06:08:56 AM  Show Profile  Reply with Quote
Please post VA X version, IDE, OS, etc. using the Copy Info button on the VA X options - About node.

Kevin Sikes
Infotainment Platform Design Engineer
Ford Motor Company
Go to Top of Page

Avi Bueno
New Member

6 Posts

Posted - Jul 06 2007 :  06:25:13 AM  Show Profile  Reply with Quote
OK, this info is from a trial version I have at home, but the configuration resembles the environment I have at work.

--
VA_X.dll file version 10.3.1557.0 built 2007.05.29
VAOpsWin.dll version 1.3.2.2
VATE.dll version 1.0.5.6
DevEnv.exe version 8.0.50727.42
msenv.dll version 8.0.50727.42
Font: Courier New 13(Pixels)
Comctl32.dll version 6.0.2900.2180
Windows XP 5.1 Build 2600 Service Pack 2
Single processor

Platform: Win32
Stable Includes:
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\include;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\PlatformSDK\\include;
C:\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\include;

Library Includes:
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfcm;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\crt\\src;

Other Includes:

--
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 07 2007 :  2:33:10 PM  Show Profile  Reply with Quote
I have downloaded the smart pointer code files and I am seeing the same problem. It took a little while to figure out why, but I did in the end. The problem is the comment blocks at the top of the files, e.g.

#if 0
Copyright (C) 1997 by Kevin S. Van Horn.  You may freely use and modify
this software, subject to the following restrictions:
  (1) This copyright notice must remain in the source, unchanged.
  (2) You are NOT allowed to redistribute this software in any form.
The current version of this software may be obtained at
http://www.xmission.com/~ksvhsoft/ by following the software components
link.  NOTE: This software is provided without warranty of any kind.
#endif


This is wrapped ONLY in #if 0, #endif, there is nothing here to tell us this is a comment.

VA's parser is not a compiler, instead it is designed to help you, including with code that is blocked out like this, so it parses the comment as code, and this breaks the following namesapces. A better example of why VA parses this code is this case:

#ifdef LINUX
// code here I want VA to parse and help me with
#endif

change the comment block into a real comment and the problem goes away.

zen is the art of being at one with the two'ness
Go to Top of Page

Avi Bueno
New Member

6 Posts

Posted - Jul 09 2007 :  09:56:24 AM  Show Profile  Reply with Quote
Thanks for the fix.
Alas, I was trying to demonstrate the problem that I have in my code and thought it's the same problem.. Knowing that it isn't, I found the source for the problem.

Review the following code sample:

--
#define TEST_PROJECT_HAS_A_CPP_NAMESPACE

#ifdef	TEST_PROJECT_HAS_A_CPP_NAMESPACE
#define TEST_PROJECT_NAMESPACE		TestProject
#define TEST_PROJECT_NAMESPACE_BEGIN	namespace TEST_PROJECT_NAMESPACE {
#define TEST_PROJECT_NAMESPACE_END	}
#define TEST_PROJECT_NAMESPACE_USE	using namespace TEST_PROJECT_NAMESPACE
#else
#define TEST_PROJECT_NAMESPACE
#define TEST_PROJECT_NAMESPACE_BEGIN
#define TEST_PROJECT_NAMESPACE_END
#define TEST_PROJECT_NAMESPACE_USE
#endif

TEST_PROJECT_NAMESPACE_BEGIN
class Test
{
public:
	void f()	{}
};
TEST_PROJECT_NAMESPACE_END

void main()
{
	TestProject::Test* pTest;
	~~~~~~~~~~~  ~~~~
}
--


This tecnique for enabling/disabling namespaces is used in the xerces XML library.
You can see the problem in the main() function..

Is there any workaround for this one?

Thanks.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000