Have get_variables in the cxxpaser a bug ?

General questions regarding the usage of CodeLite
mmkider
CodeLite Curious
Posts: 3
Joined: Mon Nov 17, 2008 9:16 am
Contact:

Have get_variables in the cxxpaser a bug ?

Post by mmkider »

I test testVarParser(buf);
But some function name will be parsing to var name.
Think you for your reply


input

Code: Select all

template <class T, class B> struct TagEntry 
{
	class TagEntry::SimpleClass {
	}
	virtual foo();
}

int a();
int b();
int c(int);
int c(int,int);
int dd;
extern int ddd;
output

Code: Select all

read: 181
===== Testing Variable parser ======
{m_name=b, m_defaultValue=, m_lineno=9, m_starAmp=, m_type=int, m_isConst=false, m_typeScope=, m_tem
plateDecl=, m_isPtr=false, m_isTemplate=false }
Pattern: /^;  int b $/
{m_name=c, m_defaultValue=, m_lineno=10, m_starAmp=, m_type=int, m_isConst=false, m_typeScope=, m_te
mplateDecl=, m_isPtr=false, m_isTemplate=false }
Pattern: /^;  int c $/
{m_name=c, m_defaultValue=, m_lineno=11, m_starAmp=, m_type=int, m_isConst=false, m_typeScope=, m_te
mplateDecl=, m_isPtr=false, m_isTemplate=false }
Pattern: /^;  int c $/
{m_name=dd, m_defaultValue=, m_lineno=12, m_starAmp=, m_type=int, m_isConst=false, m_typeScope=, m_t
emplateDecl=, m_isPtr=false, m_isTemplate=false }
Pattern: /^;  int dd $/
{m_name=ddd, m_defaultValue=, m_lineno=13, m_starAmp=, m_type=int, m_isConst=false, m_typeScope=, m_
templateDecl=, m_isPtr=false, m_isTemplate=false }
Pattern: /^  int ddd $/


User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Have get_variables in the cxxpaser a bug ?

Post by eranif »

This project CxxParser is private. It does not do what you think :)

i.e. It is not meant to scan the entire file for variables. only small portions of it. for example:
(e.g. function signature)

You have to see the picture as a whole:
First ctags parses the entire workspace, then if needed, the variable parser is invoked to parse function signature or their return value (ctags does not do that for you), for example have a look at function

Code: Select all

wxString TagsManager::NormalizeFunctionSig(const wxString &sig, size_t flags, std::vector<std::pair<int, int> > *paramLen)
in ctags_manager.cpp file

There is also the scope parser which gives you the scope name at given position

None of the these parsers can function as a stand alone parser (and they were never meant to work like that) without the lookup table and the logic provided by libCodeLite.a (the library not the IDE :D))

Eran
Make sure you have read the HOW TO POST thread
mmkider
CodeLite Curious
Posts: 3
Joined: Mon Nov 17, 2008 9:16 am
Contact:

Re: Have get_variables in the cxxpaser a bug ?

Post by mmkider »

eranif wrote:This project CxxParser is private. It does not do what you think :)

i.e. It is not meant to scan the entire file for variables. only small portions of it. for example:
(e.g. function signature)

You have to see the picture as a whole:
First ctags parses the entire workspace, then if needed, the variable parser is invoked to parse function signature or their return value (ctags does not do that for you), for example have a look at function

Code: Select all

wxString TagsManager::NormalizeFunctionSig(const wxString &sig, size_t flags, std::vector<std::pair<int, int> > *paramLen)
in ctags_manager.cpp file

There is also the scope parser which gives you the scope name at given position

None of the these parsers can function as a stand alone parser (and they were never meant to work like that) without the lookup table and the logic provided by libCodeLite.a (the library not the IDE :D))

Eran
finally I understand a little bit, thank you.
:o
Post Reply