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
 1423: Parsing
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Erik Olofsson
Tomato Guru

111 Posts

Posted - Sep 22 2005 :  08:59:56 AM  Show Profile
If you could make this work I would be a happy programmer :)


#include "stdafx.h"

typedef __w64 int aint;
typedef int bint;
namespace NIds
{
	class CDefaultPointerHolder
	{
		public:
	};

#define DIdsPInlineS inline
#define DIdsPInlineM inline
#define DIdsPInlineL inline

	template <typename t_CPointer, typename t_CTyped>
		class TCDynamicPtr
	{
	public:
        t_CPointer m_PtrData;

		DIdsPInlineS TCDynamicPtr &operator = (t_CTyped *_pSetTo)
		{
			return *this;
		}

		DIdsPInlineS bint operator == (t_CTyped *_pCompareTo)
		{
			return true;
		}

		DIdsPInlineS operator t_CTyped * () const
		{			
			return 0;
		}

		DIdsPInlineS t_CTyped * operator -> () const
		{
			return 0;
		}
        
	};

	namespace NMem
	{
		class CAllocator_Heap
		{
		public:
		};
	}
#define DIdsDefaultAllocator NIds::NMem::CAllocator_Heap

	namespace NTree
	{

		template <typename t_CPointerHolder = CDefaultPointerHolder>
		class TCAVLLinkAlignedData
		{
		public:
			typedef TCDynamicPtr<t_CPointerHolder, TCAVLLinkAlignedData> CData;

		};
		
		template <typename t_CData, typename t_CKey, typename t_CLinkData, typename t_CTranslator, typename t_CCompare, typename t_CAllocator>
		class TCAVLTreeParams
		{
			public:
			
			typedef t_CData CData;
			typedef t_CKey CKey;
			typedef t_CLinkData CLinkData;
			typedef t_CTranslator CTranslator;
			typedef t_CCompare CCompare;
			typedef t_CAllocator CAllocator;
			
		};
		
		template <typename t_CParamsTree>
		class TCAVLTreeAggregate
		{
		public:
			typedef typename t_CParamsTree::CData CData;
			typedef typename t_CParamsTree::CKey CKey;
			typedef typename t_CParamsTree::CLinkType CLinkType;
			typedef typename t_CParamsTree::CLinkData CLinkData;
			typedef typename CLinkData::CData CLinkCData;
			typedef typename t_CParamsTree::CTranslator CTranslator;
			typedef typename t_CParamsTree::CCompare CCompare;
			typedef typename t_CParamsTree::CAllocator CAllocator;

			int m_TreeMember;
			
			/************************************************************************************************\			||-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?||
			|| Iterator
			||______________________________________________________________________________________________||
			\\************************************************************************************************/

#			define DIdsTreeAvlDefaultIteratorRecursionDepth (sizeof(void *)*12)
			template <aint _RecursionDepth = DIdsTreeAvlDefaultIteratorRecursionDepth>
			class TIterator
			{
			public:
				
				typedef typename t_CParamsTree::CData CData;
				typedef typename t_CParamsTree::CKey CKey;
				typedef typename t_CParamsTree::CLinkType CLinkType;
				typedef typename t_CParamsTree::CLinkData CLinkData;
				typedef typename CLinkData::CData CLinkCData;
				typedef typename t_CParamsTree::CTranslator CTranslator;
				typedef typename t_CParamsTree::CCompare CCompare;
				typedef typename t_CParamsTree::CAllocator CAllocator;

				int m_IteratorMember;
				
				DIdsPInlineS TIterator(const TCAVLTreeAggregate &_Tree)
				{
				}

				DIdsPInlineS CData *GetCurrent() const
				{
					return 0;
				}

				DIdsPInlineS operator CData *() const
				{
					return GetCurrent();
				}

				DIdsPInlineS CData * operator ->() const
				{
					return GetCurrent();
				}

				DIdsPInlineS void operator ++()
				{
				}
				
				DIdsPInlineS void operator --()
				{
				}
			};
		};

		template <typename t_CParams>
		class TCAVLTree : public TCAVLTreeAggregate<t_CParams>
		{
		public:
			TCAVLTree()
			{
			}

			~TCAVLTree()
			{
			}
		};

		template <typename t_CParamsLink>
		class TCAVLLinkAggregate
		{
		public:
			class CParams : public t_CParamsLink
			{
			public:
				typedef TCAVLLinkAggregate CLinkType;			
			};
		};

		template <typename t_CParamsLink>
		class TCAVLLink : public TCAVLLinkAggregate<t_CParamsLink>
		{
		public:
			TCAVLLink()
			{
			}

		};

#define DIdsPOffsetOf(_Type, _Member) ((aint)(&((_Type *)4)->_Member)-4)

#		define DIdsTreeAVL_Trans(_Class, _Member) \				class CAVLTree_Translator##_Member \				{\				public:\					DIdsPInlineS static aint GetOffset()\					{\						return (aint)DIdsPOffsetOf(_Class, _Member);\					}\				};\
#		define DIdsTreeAVLAligned_LinkType(_cClass, _Member, _cKey, _cCompare) NIds::NTree::TCAVLLink< NIds::NTree::TCAVLTreeParams<_cClass, _cKey, NIds::NTree::TCAVLLinkAlignedData<NIds::CDefaultPointerHolder>, _cClass::CAVLTree_Translator##_Member, _cCompare, DIdsDefaultAllocator > >
#		define DIdsTreeAVLAligned_Member(_cClass, _Member, _cKey, _cCompare) DIdsTreeAVLAligned_LinkType(_cClass, _Member, _cKey, _cCompare) _Member;

#		define DIdsTreeAVLAligned_Link(_cClass, _Member, _cKey, _cCompare) \					DIdsTreeAVL_Trans(_cClass, _Member) \					DIdsTreeAVLAligned_Member(_cClass, _Member, _cKey, _cCompare)
					
					
#		define DIdsTreeAVLAlignedA_LinkType(_cClass, _Member, _cKey, _cCompare) NIds::NTree::TCAVLLinkAggregate< NIds::NTree::TCAVLTreeParams<_cClass, _cKey, NIds::NTree::TCAVLLinkAlignedData<NIds::CDefaultPointerHolder>, _cClass::CAVLTree_Translator##_Member, _cCompare, DIdsDefaultAllocator > >
					
#		define DIdsTreeAVLAligned_Tree(_cClass, _Member, _cKey, _cCompare) NIds::NTree::TCAVLTree<DIdsTreeAVLAlignedA_LinkType(_cClass, _Member, _cKey, _cCompare)::CParams>
#		define DIdsTreeAVLAlignedA_Tree(_cClass, _Member, _cKey, _cCompare) NIds::NTree::TCAVLTreeAggregate<DIdsTreeAVLAlignedA_LinkType(_cClass, _Member, _cKey, _cCompare)::CParams>

#		define DIdsTreeAVLAligned_Iterator(_cClass, _Member, _cKey, _cCompare) DIdsTreeAVLAlignedA_Tree(_cClass, _Member, _cKey, _cCompare)::TIterator<DIdsTreeAvlDefaultIteratorRecursionDepth>
	}

}


class CTest
{
public:
	int m_Member0;
	int m_Member1;

	class CCompare
	{
	public:

	};

	DIdsTreeAVLAligned_Link(CTest, m_Link, int, CCompare);

};


int _tmain(int argc, _TCHAR* argv[])
{
	DIdsTreeAVLAligned_Tree(CTest, m_Link, int, CTest::CCompare) Tree;

	DIdsTreeAVLAligned_Iterator(CTest, m_Link, int, CTest::CCompare) Iter = Tree;

	while (Iter)
	{
		Iter->m_Member0 = 0;
		Iter. // Here m_IteratorMember should be shown
		Iter-> // Here m_Link, m_Member0 and m_Member1 should be shown. Although they are shown here, it's probably for the wrong reason (Tree shows the same)
		Tree. // Mere m_TreeMember should be shows

		++Iter;
	}


	return 0;
}

Cutting Edge Project Management
http://www.hansoft.se

Wrongway
Tomato Guru

USA
129 Posts

Posted - Sep 22 2005 :  1:49:08 PM  Show Profile
Are you noticing things being underlined that shouldn't be?

In one of my C# files, it is underlining MessgeBox, MessageBoxButtons, MessageBoxIcon, and all of it's methods/properties. It is also underlining properties that I created in objects.

Wrongway

Wrongway
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18942 Posts

Posted - Sep 22 2005 :  4:01:08 PM  Show Profile
Erik, this has gone in

case=770

i had a look, and decided that it was making my head hurt is this auto generated, or do you really write code like this?


Wrongway can you post a code snippet that shows this problem for me to test? the above code is C++, so it is not directly relevant. does disabling VA make any difference? in C# the IDE will produce quite a bit of underlining of its own.

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

John_H_Bergman
Tomato Guru

USA
198 Posts

Posted - Sep 22 2005 :  4:18:33 PM  Show Profile
I've seen this sometimes too... where my definitions start out underlined, but then after editting for a while, its almost like VA catches up and stops doing that. I wasn't sure if this was related to the disk usage / cpu usage or not.

John H. Bergman
CTO
SiliconZone


[email protected]

To Send email, remove the .online.
Go to Top of Page

Erik Olofsson
Tomato Guru

111 Posts

Posted - Sep 23 2005 :  09:49:51 AM  Show Profile
Yes I write code like this, although the above is only a subset to make a reproducable example. To my defence I couldn't figure out a way to get the functionality without using macros or making every use of the template messy. :)

Cutting Edge Project Management
http://www.hansoft.se
Go to Top of Page

Erik Olofsson
Tomato Guru

111 Posts

Posted - Sep 23 2005 :  1:27:56 PM  Show Profile
Here is another case that does not work correctly. It might be related to case 734 though.


class CTest0
{
public:
	int m_ClassMember0;
};

class CSuper0
{
public:

	class CTest0
	{
	public:
		int m_ClassMember1;
	};

	void Test()
	{
		CTest0 Test;
		Test. // Should display m_ClassMember1
	}

	virtual CTest0 ReturnTest() = 0;
};

class CImp0 : public CSuper0
{
public:

	CTest0 ReturnTest()
	{
		CTest0 Ret;
		Ret. // Should display m_ClassMember1
		return Ret;
	}
};

Cutting Edge Project Management
http://www.hansoft.se
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Sep 24 2005 :  11:31:29 AM  Show Profile
Erik:
We'll give your CTest0 example its own case since it's not quite a duplicate of 734. FWIW, Your problem is not related to our new C/C++ parser -- it appears to have been around for a while.

case=773
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18942 Posts

Posted - Sep 24 2005 :  3:57:21 PM  Show Profile
John H VA waits for you to pause in your typing before it reparses recent changes, so that it does not get in the way. it is possible this is a factor in what you are seeing.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000