This patch fixes the way the symbol table handles const & volatile.
It also fixes the following bugs:
47628 - signed char is parsed as char
47636 - char * and char[] are treated as different types
45697 - Parser/Symbol Table: Mismatched declarations & definition
Restructured Parser implementation to allow for better support of Selection Search.
Restructured Parser implementation to allow for separation between parsing expressions (Scanner) and complete C/C++ source.
org.eclipse.cdt.core.tests
Updated tests to accommodate for new Parser class hierarchy and factories.
This patch represents a couple of months work (off and on since the
summer) on Parser Symbol Table support for templates.
This is symbol table support only, not parser support (that still needs to
be done).
What does work:
- declarations, definitions & instantiations for class templates, function
templates, & template templates
- declarations, definitions & instantiations of class template partial
specializations
- template ordering & argument deduction (allows implicit template
function instatiation)
What doesn't (yet) work:
- Explicit specializations
- assorted smaller specific cases & bugs & things I havn't thought of yet
Refactored Parser.java to allow inline small functions and tightened the signatures for statement().
Refactored Scanner.java to allow for data to be encapsulated to allow for IScannerExtension to act upon it.
Partially fixed Bug 47628 - signed char is parsed as char (affects the outline view)
org.eclipse.cdt.core.tests
Added testBug47682() to QuickParseASTTests.java.
Core:
- fix class cast exception in the symbol table while traversing the
inheritance of a class.
- filter the results of the prefix lookup for content assist so that those
symbol without attached AST nodes aren removed so that the iterator does
not later return a null.
Tests:
- added CompletionParseTests.testBug51260
Added support for inline method x-references.
Fixed Bug 44340 - Inline functions fail to resolve references
Fixed Bug 51243 - Content Assist in an empty document causes a NPE
org.eclipse.cdt.core.tests
Moved testErrorHandling_1() from failed tests to CompleteParseASTTest.
Moved testBug44340() from failed tests to CompleteParseASTTest.
Partial fix for Bug 47752 - Outline does not recognize functions with full body try/catch blocks
org.eclipse.cdt.core.tests
Added QuickParseASTTest::testBug47752.
Refactored parser to allow for cleaner content assist implementation.
Removed IASTCompletionNode.CompletionKind.STATEMENT_START as it is redundant.
Fixed bug 50640 - Wrong completion kind when expecting an exception
Fixed bug 50471 - Wrong completion kind after the "using" keyword
Fixed bug 50621 - Wrong completion kind in a class declaration
org.eclipse.cdt.core.tests
Renamed ContextualParseTest to CompletionParseTest.
Updated COMPLETION_PARSE clients to use SINGLE_NAME_REFERENCE rather than STATEMENT_START.
org.eclipse.cdt.ui
Updated COMPLETION_PARSE clients to use SINGLE_NAME_REFERENCE rather than STATEMENT_START.
org.eclipse.cdt.ui.tests
Updated COMPLETION_PARSE clients to use SINGLE_NAME_REFERENCE rather than STATEMENT_START.
Renamed and updated CompletionTest_StatementStart_NoPrefix to CompletionTest_SingleName_Method_NoPrefix.
Renamed and updated CompletionTest_StatementStart_Prefix to CompletionTest_SingleName_Method_Prefix.
Renamed and updated CompletionFailedTest_ExceptionReference_NoPrefix_Bug50640 to CompletionTest_ExceptionReference_NoPrefix and moved to passed tests folder.
Renamed and updated CompletionFailedTest_ExceptionReference_Prefix_Bug50640 to CompletionTest_ExceptionReference_Prefix and moved to passed tests folder.
Renamed and updated CompletionFailedTest_NamespaceRef_NoPrefix_Bug50471 to CompletionTest_TypeRef_NoPrefix and moved to passed tests folder.
Renamed and updated CompletionFailedTest_NamespaceRef_Prefix_Bug50471 to CompletionTest_TypeRef_Prefix and moved to passed tests folder.
Renamed and updated CompletionFailedTest_ClassReference_Prefix_Bug50621 to CompletionTest_ClassReference_Prefix and moved to passed tests folder.
Renamed and updated CompletionFailedTest_ClassReference_NoPrefix_Bug50621 to CompletionTest_ClassReference_NoPrefix and moved to passed tests folder.
This patch provides handling of the C types _Complex, _Imaginary, _Bool &
long long int in the parser symbol table. (bug45573)
Core:
modified ParserSymbolTable.promotion() & conversion()
added TypeInfo.isLongLong
modified TypeInfo.canHold()
Core.tests:
Added ParserSymbolTableTest.testLongLong()
Added ParserSymbolTableTest.testComplex()
Added ParserSymbolTableTest.test_Bool()
Parser updates: Added IToken.getLineNumber() to facilitate adding line numbers to AST. Added line number support into IASTOffsetableElement. Updated all implementations to use this. Updated Parser and IASTFactory to populate IASTOffsetableElement with the values retrieved from IToken. Removed IScanner.getLineNumberForOffset().
Model updates: Updated CModelBuilder to access line number information from IASTOffsetableElement.
org.eclipse.cdt.core.tests
Updated ParserSymbolTableTest to accommodate new constructors for COMPLETE_PARSE ASTNodes (line # info). Updated CModelElementsTest to enable testing for line numbers. Removed CModelElementsFailedTests.testBug36379() as it is redundant due to CModelElementTests.testCModelElements() is complete. Removed CModelElementsFailedTests from AutomatedIntegrationSuite as it is empty.
- assert project create/deletion failure with detailed messages
- use common (were possible) project create/deletion methods in CProjectHelper.
- fixed problem with dep test when generating code the file was never closed causing project deletion to fail on win32
This patch implements an iterator on all the contents of IContainerSymbol.
This is a first step to an iterator on the IAST nodes.
Core:
Created IExtensibleSymbol, which is a new base class for the symbol interfaces
Created IUsingDirectiveSymbol and UsingDirectiveSymbol
Modified ASTUsingDirective to use IUsingDirectiveSymbol
Modified CompleteParseASTFactory.createUsingDirective
Added IContainerSymbol.getContentsIterator()
Implemented getContentsIterator in ContainerSymbol
Core.tests:
Modified CompleteParseASTTest.testUsingClauses
Added ParserSymbolTableTest.testIterator_1 & testIterator_2
For normal lookups in the symbol table, a HashMap is faster than the tree
map, but for prefix lookups the TreeMap is faster. So we are now using
the HashMap for normal parses, and we use the TreeMap in the parse mode
used by content assist.
Note that with these changes the results returned by the IASTNode.lookup
function used by content assist are now in predictable order: they are
first sorted in the order of the scopes visited during the lookup and then
they are sorted alphabetically
Core:
Modified symbol table constructor to take a ParseMode as a parameter.
Modified symbol table to use a TreeMap instead of HashMap when ParseMode is COMPLETION_PARSE.
Modified ASTNode.lookup to throw ASTNotImplementedException if called when ParseMode is not CONTEXTUAL_PARSE.
Core.tests:
Moved testBug48307_FriendFunction_1 & testBug48307_FriendFunction_2 to ContextualParseTest.
Updated ContextualParseTest now that the order of prefix lookup results is predictable.
UI:
Updated CompletionEngine to catch ASTNotImplementedException from IASTNode.lookup.
====================
Renamed IASTNode.LookupResult IASTNode.ILookupResult.
Introduced new ParseError exception for contextual parse() methods.
Renamed ParserFactoryException ParserFactoryError.
Replaced ParserNotImplementedException with a variant of ParseError.
Updated IScanner & IParser to not reference OffsetLimitReachedException explicitly.
Renamed ParserMode.CONTEXTUAL_PARSE to COMPLETION_PARSE.
Cleaned up IMacroDescriptor and made Scanner definitions table consistent.
Added IScanner.getDefinitions() to return the entire Map of definitions to a client.
Removed most of the warnings from parser source directory.
Removed the unused SyntaxErrorException.
Provided partial fix for Bug 44370 IASTMacro requires more information for clients.
org.eclipse.cdt.core.tests
==========================
Updated references to LookupResult as it was renamed to ILookupResult.
Removed some warnings from parser tests.
Updated Scanner & QuickParseTests to accommodate new errors and signatures.
Added QuickParseASTTests.testBug44370().
org.eclipse.cdt.ui
==================
Updated references to LookupResult as it was renamed to ILookupResult.
Updated references of ParserFactoryException to ParserFactoryError.
Updated references of ParserNotImplementedException to ParseError.
Updated references of CONTEXTUAL_PARSE to COMPLETION_PARSE.
Fixed bug 48909 - Wrong completion node after a . or an ->
Fixed bug 49702 - Wrong completion kind sent in const/dest and code blocks
Added new CompletionKind - STATEMENT_START to indicate the beginning of a statement line.
TESTS
Updated ContextualParseTest to accommodate bugfixes 48909 & 49702.
UI
Updated CompletionEngine to handle IASTCompletionKind.CompletionKind.STATEMENT_START
Core:
Added IDerivableContainerSymbol.lookupFunctionForFriendship.
Modified IASTFactory.createMethod to take an ITokenDuple for the
method name.
Added LookupType.FORFRIENDSHIP and use it in LookupElement.
Modified CompleteParseASTFactory.createMethod to handle friend
functions.
Tests:
Added CompleteParseASTTest::testBug48307_FriendFunction_1
Added CompleteParseASTTest::testBug48307_FriendFunction_2
CORE
Support the content assist lookup kind LookupKind.THIS, where the lookup
looks in the class of the this pointer.
Fix a bug where the forward declared functions/methods appeared twice in
the content assist results .
TESTS
Added ContextualParseTest::testCompletionLookup_LookupKindTHIS
Renamed IToken::tELIPSE to IToken::tELLIPSIS
Partially fixed Bug 43110 : Parser support needed for functions with ellipses
TESTS
Added CompleteParseASTTest::testBug43110() and QuickParseASTTests::testBug43110().
Added preliminary keyword support into IASTCompletionNode::getKeywords().
Refactored parser to put keyword string literals in one utility class.
TESTS
Updated testBaseCase_SimpleDeclaration() for keyword assertions.
Added OffsetLimitReachedException and restructured Parser exceptions.
Continued support for code assist/selection search parser.
Ensured all source in parser/ have copyright notices.
TESTS
Expanded ContextualParseTest::testBaseCase().
Updated tests to deal with new signatures/exceptions.
UI
Updated CompletionEngine to deal with new signatures/exceptions in parser.