Method for modeling source code having code segments that lack source location
Abstract
A system and method for modeling code segments that do not have a location is disclosed. Source code may be indexed and modeled in a data graph with nodes representing code elements and edges representing relationships between nodes. However, some code elements may be hidden or implicit and therefore may lack location information. In these cases, code figments are created and represented as nodes in the graph. Figment nodes may be specially designated so that the figment nodes may be easily distinguished from real source code nodes. The graph is then updated to include location information for the code figments in the nodes that interact with the hidden or implicit code. The data graph may then be provided to a user or as a service to be used by coding tools.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method for modeling source code comprising:
receiving source code including code segments that do not have a source location; indexing the received source code; creating a data model from the indexed source code that includes a plurality of nodes representing code elements and a plurality of edges for relationships between elements; determining the source location to be associated with each node; responsive to recognizing one of the code segments as a hidden or implicit code segment, creating a figment representation for the code segment, where the figment representation's content models code behavior based on edge relationship data included in the data model; and
assigning the created figment as the source location associated with the code segment's node.
2 . The method of claim 1 wherein a figment node is specially annotated to distinguish the node from other nodes in the data model.
3 . The method of claim 1 further comprising providing the data model to a user.
4 . The method of claim 3 wherein the data model is provided to a user via an API.
5 . The method of claim 3 wherein the data model is provided to a user via a user interface.
6 . The method of claim 3 wherein the data model is provided to a user via command line code.
7 . The method of claim 1 further comprising an edge between the node for the source code which uses the hidden or implicit code segment and a node representing the created figment.
8 . A method for using a data model that represents a code segment that does not have a source location, comprising:
requesting a data model for code which includes a code segment that does not have a source location; receiving the requested data model including a figment representation of the code segment that does not have a source location, where the figment representation's content models code behavior based on edge relationship data included in the data model; and optionally displaying the figment representation of the code segment to an end user.
9 . The method of claim 8 wherein the received data model contains metadata about the figment representation.
10 . The method of claim 9 wherein the metadata is used to show or hide the figment representation from the end user.
11 . The method of claim 9 wherein the metadata is used to display information that a code segment is a figment.
12 . The method of claim 9 wherein the metadata is used to display information that a code segment contains a figment.
13 . The method of claim 8 wherein a data model is requested using an application programming interface.
14 . A system for modeling source code comprising:
one or more processing devices and one or more storage devices storing instructions that, when executed by the one or more processing devices, cause the one or more processing devices to: receive source code including code segments that do not have a source location; index the received source code; create a data model from the indexed source code that includes a plurality of nodes representing code elements and a plurality of edges for relationships between elements; determine the source location to be associated with each node; responsive to recognizing one of the code segments as a hidden or implicit code segment, create a figment representation for the code segment, where the figment representation's content models code behavior based on edge relationship data included in the data model; and assign the created figment as the source location associated with the code segment's node.
15 . The system of claim 14 wherein a figment node is specially annotated to distinguish the node from other nodes in the data model.
16 . The system of claim 14 further comprising providing the data model to a user.
17 . The system of claim 16 wherein the data model is provided to a user via an API.
18 . The system of claim 16 wherein the data model is provided to a user via a user interface.
19 . The system of claim 16 wherein the data model is provided to a user via command line code.
20 . The system of claim 16 further comprising an edge between the node for the source code which uses the hidden or implicit code segment and a node representing the created figment.Join the waitlist — get patent alerts
Track US2015324194A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.