ProgQuery is a system to extract useful syntactic and semantic information from source code programs and store it in a graph database for posterior querying.
A new graph representation storing the relationships between the data (variables and objects) and the expressions or statements in which theses variables and objects are modified or used. To build this new representation, the following edge types were added :
USED_BY edge type, relating variable definitions (attributes, locals and parameters) to their uses in the different expressions of the program.
MODIFIED_BY edge type, relating variable definitions (attributes, locals and parameters) to the assignment nodes in which their stored value changes.
STATE_MODIFIED_BY edge type, relating variable definitions (attributes, locals and parameters) to the assignment nodes (or method invocations) in which the state of their stored reference is changed. When a variable definition is modified (that is, assigned to another expression), this new expression will be the start of the STATE_MODIFIED_BY relations that comes after the last modification (instead of the variable declaration). This relationship type is also used to relate THIS_REFERENCE nodes and parameter declarations to method declarations in which the state of this or any of the declared parameters is changed.
STATE_MAY_BE_MODIFIED edge type, relating variable definitions (or reference expressions in the right side of assignments) to method invocation or method declaration nodes in which, it can be possible that the state of these references changes, but this is not guaranteed (following the control flow graph).
Also, a new node type is added to complement this representation. It is called THIS_REFERENCE and it is associated to each of the class declarations. It is used to bind the explicit uses of "this" and also the STATE_MODIFIED_BY relations from any assignment or invocation that changes the state of the this (implicit or explicit) reference.
A new graph representation storing the relationships between the data (variables and objects) and the expressions or statements in which theses variables and objects are modified or used. To build this new representation, the following edge types were added :
Also, a new node type is added to complement this representation. It is called THIS_REFERENCE and it is associated to each of the class declarations. It is used to bind the explicit uses of "this" and also the STATE_MODIFIED_BY relations from any assignment or invocation that changes the state of the this (implicit or explicit) reference.