Commit Graph
1414 Commits
Author SHA1 Message Date
Manuel Dobusch d720414467 test: bug fixes
Fixed several platform specific bugs.
2014-10-06 14:16:57 +02:00
malte_langkabel 0f34f55844 data: windows crash fix
* fixed a crash on windows that occurred when the name of a token was stored in a container that was destroyed after a const & was returned.
2014-10-06 11:18:27 +02:00
Eberhard Graether a294519cd1 logic: clear views when search query doesn't have a result 2014-09-30 22:23:54 +02:00
Eberhard Graether 390df1db1f data: removed Singleton from Dictionary and made it a member of SearchIndex
Dictionary never had a good reason of being a Singleton in the first place so this will avoid concurrency and
structural issues in the future.
2014-09-30 22:10:42 +02:00
Eberhard Graether 95ece9ef2e utility: removed templates from utilityString functions to use std::deque by default 2014-09-11 17:37:18 +02:00
Eberhard Graether fec7abbc9b ui: integrated autocompletion and filtering into SearchView
- QtSearchView was split into QtSearchView and QtSearchBox.
- QtSearchBox contains all Qt elements and can use them purely
- QtSearchView forwards calls from the SearchController to QtSearchBox
- Searching is initiated with MessageSearch to the SearchController
- Autocompletion is initiated with MessageSearchAutocomplete to the SearchController
- The search field is able to create filter queries by only giving autocompletions for the last token in the query
- For named tokens the search field adds their token ids to the query in the form of "A,25" for faster lookup

bug id = #21
2014-09-11 14:53:03 +02:00
Eberhard Graether 760e5ffafd logic: refactored GraphAccess and GraphController to use single call that returns Graph
This change refactors the GraphController to use the GraphAccess only with a single call that returns a Graph. The Graph
contains all information for visually representing the active Token with all parent and child nodes and edges. This
reduces coupling of the data and logic tiers.
2014-09-10 01:07:26 +02:00
Eberhard Graether 9a546b4312 test: added SearchIndexTestSuite and refined SearchIndex API 2014-09-09 16:35:18 +02:00
Eberhard Graether 4fd1f330ed data: added SearchIndex for fuzzy name search and rewrote name handling in the Storage
This change stores each Token name in the separate singleton class Dictionary. The Dictionary gives each saved word an
Id and thereby avoids duplicated names. E.g if the constructor method "Graph::Graph" is stored then the word "Graph"
only appears once in memory.

The class SearchIndex is now responsible for the name hierarchy and is instantiated by the Storage. The SearchIndex
builds the name hierarchy using SearchNodes, each holding a Dictionary string reference of the name it holds. E.g if the
names "math::ceil" and "math::floor" are added to the SearchIndex then 3 nodes get created, the SearchNode "math" will
hold the two childs "ceil" and "floor".

The hierarchical graph creation functionality got split off from Graph into the new subclass StorageGraph. The
StorageGraph creates nodes with a passed SearchNode pointer of the name it represents in the SearchIndex. Thereby the
StorageGraph reuses the hierarchical information in the SearchIndex and can create nodes much quicker by avoiding node
searches and name comparisions.

The name information is now stored in the Nodes via the TokenComponentName class, which is subclassed into
TokenComponentNameReferenced and TokenComponentNameCached. The StorageClass creates nodes with the component
TokenComponentNameReferenced, which holds a pointer to the SearchNode instance holding the name. This allows for
retrieving the full name of the node, without using other Nodes int the Graph, which might not be present. If the Node
is copied then the component changes to a TokenComponentNameCached, which holds the full name as a string, so the
memory in the Storage doesn't have to be accessed anymore.

TokenComponentSignature is now only holding an Id of the signature string saved in the Dictionary, which speeds up the
signature comparison. A follow-up will change saving the whole signature as string to reusing the wordIds it is
consisting of.

Lastly the SearchIndex holds basic fuzzy search functionality. A passed query gets compared down the SearchNode
hierarchy as long as matches for each letter are found. Matches must contain all letters of the query. The search is
case-insensitive. If letters are found in front positions, next to each other or written in uppercase they are weighed
higher in the match ranking. The character ':' is also interpreted and found, although the '::' delimiter is not stored.

E.g. the query "m:l" used on the example above will return both "math::floor" and "math::ceil", but "floor" is ranked
higher because the 'l' appears closer to the start.
2014-09-06 01:13:07 +02:00
Eberhard Graether 5c89e49ff0 test: added GraphFilter and GraphFilterConductor tests 2014-09-01 12:15:17 +02:00
Eberhard Graether aee0b7c337 test: added QueryTree tests checking correct query syntax 2014-08-31 11:36:08 +02:00
Eberhard Graether c84972b96e logic: added query syntax and filtering system for search
This change allows the user to use a simple query syntax in the search field to filter the results using names,
operators and predefined filters.

The class QueryTree is capable of parsing a simple query language consiting of QueryNodes, subclassed as
QueryOperators, QueryCommands and QueryTokens. QueryToken identifies a Token by name. QueryCommand represents predefined
filters. QueryOperator defines the syntactic relationship.

QueryNode examples:
	"A" -> QueryToken that identifies the Token named A
	class -> QueryCommand that filters all Nodes that are classes
	. -> QueryOperator that concatenates filters

QueryExamples:
	"A".class -> All Tokens named A that are classes
	method.(private|protected) -> All methods that are private or protected
	"A".member -> All members of A
	"A":field.!const -> All fields of A that are not const (':' can be used instead of '.member')

QueryTree checks for correct operator precedence and validity of the query.
All QueryCommands can be found in data/query/QueryCommand.cpp
All QueryOperators can be found in data/query/QueryOperator.cpp

The parsed QueryTree is then passed to the class GraphFilterConductor, which is capable of applying the query on a
Graph. Each part of the query gets assigned a GraphFilter that filters the input Graph in order of node precedence. The
class SubGraph is used as intermediate container, only holding bare pointers to Nodes and Edges. The output Graph holds
all Nodes that match the query.

MessageActivateTokens is used to show all of the results in the CodeView. The GraphView currently only shows the first
Node of the results.

bug id = #6
2014-08-30 18:24:00 +02:00
malte_langkabel 9ea28ed64a utility: visual studio 2012 compatibility
* removed default template parameters for template functions.
2014-08-01 16:26:02 +02:00
Eberhard Graether 8950d679e1 data: Saving virtual abstraction of methods as TokenComponentAbstraction 2014-08-01 05:27:09 +02:00
Eberhard Graether 5893d0c776 test: added StorageTestSuite
This change adds the StorageTestSuite that checks whether the ParserClient callbacks cause the right things to be saved.
In order to allow for easier data retrieval the ParserClient callbacks now return the Id of the inserted Token, which
can then be used to retrieve the Token pointer.
2014-08-01 02:10:42 +02:00
Eberhard Graether b110d528dc data: Added type bitmasking to Node and Edge and check type on Edge creation 2014-07-31 15:07:18 +02:00
Eberhard Graether af9b75348c test: Changed ProjectSettingsTestSuite to SettingsTestSuite and extended it substantially 2014-07-31 02:17:17 +02:00
Eberhard Graether 890575cd90 data: Parsing type usages within function and method bodies
This change parses type usages in function and method bodies and saves them with an edge of type EDGE_TYPE_USAGE. This
also includes base class types used in initialization lists of derived class constructors.
2014-07-30 22:35:30 +02:00
Eberhard Graether dc09860680 data: Parsing functions with ParseFunction for signature comparing
This change switches function and method parsing to use the structure ParseFunction, which holds all important values of
the function. This structure is then used also in call and usage parsing to allow distinction between signatures.
2014-07-30 13:32:38 +02:00
Eberhard Graether acfc4934c2 data: Parsing field usage in initialization list 2014-07-30 13:28:35 +02:00
Eberhard Graether da4811c5ea data: Parsing Typedefs with ParseTypeUsage
With this change typedefs have two TokenLocations, one for the TypeName and one for the UnderlyingType. When the
typedef is used with a variable the typedef is referenced now and not the underlying type.
2014-07-30 13:24:25 +02:00
Eberhard Graether 96df63055a data: Saving TokenLocations of scopes separately
This change parses the TokenLocations of scopes of classes, structs, functions, methods, namespaces and enums and
saves them in Storage with type LOCATION_SCOPE. The TokenLocations of these nodes are just their name declarations now.
Scope locations are displayed in blue color in the code view.
2014-07-28 17:54:36 +02:00
Eberhard Graether 182e18840e ui: show annotation in code snippets for TokenLocations that wrap around the snippet
bug id = #12
2014-07-28 03:27:16 +02:00
Eberhard Graether 95929db6e0 ui: improved ui of maximized code file window
* Annotations updated when active token Id changes
* FileName in window title
* Maximize button not shown
* Scrolls roughly to the maximized location.
* Maximizing also on double click in code snippet
2014-07-28 01:17:01 +02:00
Eberhard Graether dea79f701b ui: added maximize button to CodeSnippets that opens the full file in a separate window 2014-07-27 16:13:59 +02:00
Eberhard Graether b0e3cda41e data: Added getName() method to Edge
format = EdgeType:fromNode->toNode
2014-07-27 02:22:45 +02:00
Eberhard Graether 473e26f072 data: Switched Graph implementation to use std::map with Id as key for Nodes and Edges 2014-07-26 23:32:16 +02:00
Eberhard Graether 16d49e58cc logic: extended CodeView to show locations of edges to the active Token and merge overlapping snippets 2014-07-26 23:07:47 +02:00
Eberhard Graether eeacb92b55 data: polished location parsing in clang to capture exact type and variable name locations. 2014-07-26 18:34:02 +02:00
Eberhard Graether 4bf459fa99 logic: Refreshing reloads the source code and resets the Token ids to start from 1 2014-07-26 15:31:55 +02:00
Eberhard Graether 68c6ede244 data: saving graph nodes with short name only
This change saves only the short names in the node, getName() no only gives the short version. The fullName is assembled
from the parent nodes on demand using the getFullName() method.
2014-07-26 14:58:06 +02:00
Eberhard Graether 641acc2bde data: Moved EdgeComponent system to Token and extended it to cover all type specific Edge and Token fields
This change moves the EdgeComponent system to Token and redefines them as TokenComponents.
* Performance tests on the side showed that using typeid() in getComponent() is faster than dynamically casting every
pointer.
* The hasComponent() method was deliberately left out in the implementation, because it used to look up the right
component and discard it again. This check for presence can also be achieved by just using getComponent().
* The method addComponent() is protected in Token, so that Node and Edge can guard which Component is set on which type
by implementing specific setters for each Component.
* The GraphTestSuite was extended to include tests for the Component implementation (and missing tests for locationIds
in Token and copying of Node and Edge were added).
2014-07-26 02:26:59 +02:00
Eberhard Graether 5d201b9880 ui: added shortcut to refresh view
Added a refresh shortcut to the new View menu, that causes stylesheets to be refreshed by dispatching a MessageRefresh.
2014-07-21 17:49:41 +02:00
Eberhard Graether 0074db86e8 src: replaced gui wording with view wording
Changed gui wording in lib and app to view wording, since MVC views do not necessarily deal with GUIs. And moved files
so structure is similar in lib and app.
2014-07-21 14:48:02 +02:00
Eberhard Graether bf563f92f3 logic: moved font and logger initialization into init() in main 2014-07-21 13:25:18 +02:00
Eberhard Graether 160e67a94d utility: added stream logging macros
For easier use with int and other basic types, new logging macros where introduced that use stringstream internally, so
heterogeneous data can be logged using the following syntax:
	LOG_INFO_STREAM(<< "hello " << 42 << '!');
2014-07-21 02:11:07 +02:00
Eberhard Graether 0d46de871a src: fixed clang warnings, fixed undefined symbols logs, fixed code convention violations 2014-07-21 01:26:35 +02:00
malte_langkabel ad5056354d data: parse variable usage
* Implemented functions for parsing usages of fields and global variables in ASTBodyVisitor and ASTVisitor.
* Storage adds TokenLocatons and Edges for usages.
* Added tests for parsing usage of fields and global variables.

fortune cookie message = Fame, riches and love are yours for the taking.
2014-07-17 15:09:53 +02:00
Eberhard Graether 4578c109ec ui: added find shortcut to set focus in search view
The shortcut is added to the new Find menubar item and dispatches a MessageFind, which is handled by the
SearchController. QtSearchView assures via the ViewLayout that the view is visible when setting focus on the search box.
2014-07-17 14:38:18 +02:00
Manuel Dobusch 7157f0d127 ui: graph edges clickable
The graph views edges are now clickable. On click the edge and its connected nodes will be displayed.

fortune cookie message = Be prepared to accept an exciting opportunity in the future.
2014-07-17 12:19:28 +02:00
Manuel Dobusch 2c9c83d003 ui: typed edges
Edges in the graph view are now colored according to their type.
2014-07-16 15:38:54 +02:00
malte_langkabel 886171cb2a ui: save and load view layout
* QtMainWindow now saves and loads its layout parameters.
2014-07-16 13:48:40 +02:00
Eberhard Graether 810ed7c064 build: fixed errors in clang
* removed const m_dimensions in VectorBase and replaced it with N
* changed signature of DummyNode::operator=
* fixed warning for DummyNode wrongly declared as class
2014-07-16 11:54:16 +02:00
Manuel Dobusch ec42ef708d ui: graph view layouting and member rendering
Added simple layouting functions (implementations for simple grid and circle layout).
Also the graph displays class members and connections (edges) to or from them "correctly" now.

fortune cookie message = Your exotic ideas will lead you to many exciting new adventures.
2014-07-15 16:40:52 +02:00
malte_langkabel 61cb4afd91 ui: style search view
Added stylesheet for search view.
Added utility function that loads all font files inside a folder.
Added icons and font files.
2014-07-15 12:30:40 +02:00
Eberhard Graether bbe5874a89 data: saving typedef to Storage
This change save typedef expressions to the Storage using a node of type Node::NODE_TYPEDEF and an edge of type
Edge::EDGE_TYPEDEF_OF that leads to the original type, with the qualifiers saved as DataType on the edge.
2014-07-14 16:47:40 +02:00
Eberhard Graether b7cbef3772 data: saving locations of return and parameter types
This change introduces the structure ParseTypeUsage for passing information about type usage from the parser to it's
client. It is used for passing data type and location information about return types and parameter types, which now
get saved to the corresponding edges in the Storage.
2014-07-14 16:21:10 +02:00
malte_langkabel ce54bd50ed data: Tests for DataType
* Added Array and Reference Modifier for DataType.
* Created basic tests for DataType.
* Fixed bug where qualifiers of modifiers were not copied correctly.
* Fixed bug where DataType modifiers were applied in the wrong (reverse) order.
2014-07-14 11:29:44 +02:00
Eberhard Graether 9284397d46 data: refactored Storage
* put TypeEdge creation into private method
* removed commented code
* removed signature test code
* fixed line breaks
2014-07-10 16:52:35 +02:00
Eberhard Graether e2ec5ffee2 data: compare signatures when storing overloaded functions and methods
Function and method nodes are now distincted by their signature when added to the graph. A different node for each
overloaded declaration is created with the signature as member field.

fortune cookie message = Deine harte Arbeit wird schnell belohnt werden.
2014-07-10 16:08:59 +02:00