Community
Participate
Working Groups
Problem: Error in log if you create a C++ Class specifying Base Class in C++ Class wizard (From Navigator View and C++ Projects View) Repro with Standard and managed make C++ project. Tested with: Eclipse Platform Version: 3.0.0 Build id: 200406030854 Eclipse C/C++ Development Tools Version: 2.0.0 Build id: 200406030301 Steps: just create a Standard or managed make C++ project and add a class C1 using the C++ class Wizard. Now add another class C++ Class C2 (From Navigator View and C++ Projects View) specifying Base Class as C1 in C++ Class wizard . Actual: class created correctly but you get exceptions in log Error log. org.eclipse.cdt.core.parser.ParseError at java.lang.Throwable.<init>(Throwable.java) at org.eclipse.cdt.core.parser.ParseError.<init>(ParseError.java:48) at org.eclipse.cdt.internal.core.parser.ExpressionParser.LA (ExpressionParser.java) at org.eclipse.cdt.internal.core.parser.ExpressionParser.LT (ExpressionParser.java) at org.eclipse.cdt.internal.core.parser.Parser.classSpecifier (Parser.java:2725) at org.eclipse.cdt.internal.core.parser.Parser.declSpecifierSeq (Parser.java:1742) at org.eclipse.cdt.internal.core.parser.Parser.simpleDeclaration (Parser.java:1018) at org.eclipse.cdt.internal.core.parser.Parser.simpleDeclarationStrategyUnion (Parser.java:833) at org.eclipse.cdt.internal.core.parser.Parser.declaration (Parser.java:811) at org.eclipse.cdt.internal.core.parser.Parser.translationUnit (Parser.java:181) at org.eclipse.cdt.internal.core.parser.Parser.parse(Parser.java:134) at org.eclipse.cdt.internal.core.browser.cache.TypeParser.parseContents (TypeParser.java:424) at org.eclipse.cdt.internal.core.browser.cache.TypeParser.parseSource (TypeParser.java:319) at org.eclipse.cdt.internal.core.browser.cache.TypeParser.findType (TypeParser.java:231) at org.eclipse.cdt.internal.core.browser.cache.TypeLocatorJob.runWithDelegatedProgr ess(TypeLocatorJob.java:50) at org.eclipse.cdt.internal.core.browser.cache.BasicJob.run (BasicJob.java:72) at org.eclipse.core.internal.jobs.Worker.run(Worker.java)
Chris, this looks to me to be a timeout. Why does the type-cache provide a timeout? Do you not need the information to continue?
I believe it's because I use the timeout to do an early exit from the parse as soon as I've found the info I need (ie looking up a specific type declaration). The log entry is probably spurious and unnecessary. You can remove this line: TypeParser.java : 505 > CCorePlugin.log(e);
This is sort-of fixed since I no longer write unnecessary parser errors to the log. John, is there a way to cleanly terminate the parser?
Not yet. What you are doing is fine, just be sure to catch the ParseError as you expect it. Ideally what I would like to do is allow for users to throw a TerminateParseException from within an ISourceElementRequestor rather than using the timeout facility, it is rather heavyweight.
PR was not targeted to any particular release. Changing target milestone to 2.1
I just tried the scenario with CDT 2.0 GA 200406301134 (with Eclipse 3.0 GA 200406251208) and the error is not reproducible anymore. This defect can be closed - OK now :)
This bug is fixed but the underlying problem should still be addressed - namely, how to cancel the parser "nicely". See bug #69872.
Fixed.