User forums > Help

C++ parser errors

(1/3) > >>

Profic:
I'm evaluating C::B as replacement of Dev-cpp and found some errors:
1) First  of all class templates seemes parsed totally incorrectly
I got a lof of dublicate, bogus and out-of-place "symbols" (in selfnamed tab). I even got class named ">" and const named ",".
2) Also there can be something wrong with comment skipping in folding - C-style comments skipped properly, but C++-style ones not - it get commented } as end-of-group (noticed on commented code with } at line end).
3) Moreover if I choose "Jump to declaration" from context menu - I get to line next to expected.
4) Unnamed enum causes all defined in it constants (also last ",") appear in global scope independ of there is was really defined (see code below)

--- Code: ---namespace ... {
class ... {
enum {
// full skip, even [{] and [}] skipped
// forces m_state.m_skip = true
// used to skip up to end group things not skipped otherwise
pdFullSkip,
// current depth of table - possible values are 1 and 2; 3 and more are ignored
pdDepth,
// current destination - see Dest enum
pdDest,
// either finish reached
// forces odDest = dNone
// forces m_state.m_skip = true
// used to check item correctness
pdFinish,
};
};
}

--- End code ---

5) Every reload of tree indirectly (e.g. through saving file) leads to append of updated items to end instead of replace
I think there are more but those I found in couples of minutes and stop research.

PS. If not clear - most of above is about "Symbols" tab at left side of main window
PSS. Sorry for my English, it's not my primary language, but I tried :)
PSSS. Win/XP-SP2 C::B/1.0-b6

Profic:
Just to add
I post link to this topic in bug report about symbols tab (http://sourceforge.net/tracker/index.php?func=detail&aid=1162313&group_id=126998&atid=707416).
If needed I can provide example which causes template misparsing. But as I can see in sourses parser support of templates is very rudimentar, and so it is not quick fixable...

rickg22:
Yes, I think that the parser should be labelled "experimental". At least that won't catch users off-guard (i.e. expecting a commercial-grade class browser, and getting errors)

mandrav:
I started fixing some class-parser bugs. All submitted class-parser related bugs are now fixed.


--- Quote ---But as I can see in sourses parser support of templates is very rudimentar, and so it is not quick fixable...
--- End quote ---

Templates support is not rudimentary... it's non-existent...

EDIT: to clarify "non-existent", no special handling is done for templates. They 're seen as normal classes.

Yiannis.

Profic:
Well, I see, that they are not handled in special [read any] way, but misparsing is there :)

Member specializations do not appear in list at all, example:

--- Code: ---template<typename Typename>
class Class { void member(); /*...*/ };
//...
template<>
void Class<void>::member() { /*...*/ }

--- End code ---


Class specializations (at least one of them) appear as class named ">", example:

--- Code: ---template<typename Typename>
class Class : public Base { /*...*/ };
//...
template<>
class Class<void> : public Base { /*...*/ };

--- End code ---


Template members (defined outside of class) appear twice - once in class itself, and second sibling to it, example:

--- Code: ---template<typename Typename>
Class { void member1(); std::string<Typename> member2(); /*...*/ };
//...
template<typename Typename>
void
Class<Typename>::member1() { /*...*/ }
//...
template<typename Typename>
std::string<Typename>
Class<Typename>::member2();

--- End code ---

This example leads to:

--- Code: ---- Class
| | - member1() : void
| | - member2()
| - member1() : ::
| - member2() : ::

--- End code ---


Also, as I mentioned earlier when I select "Jump to declaration" in context menu, I jump to line next to expected

Navigation

[0] Message Index

[#] Next page

Go to full version