Structured search in source code
First Claim
1. A computer-implemented search system, the search system comprising:
- a processor; and
a memory in communication with the processor, the memory comprising computer-executable instructions that, when executed by the processor, cause the processor torepresent, utilizing a conversion component, a grammar of a program code as an abstract syntax tree; and
search, utilizing a search component, the abstract syntax tree based on a code-related query to obtain code results, the code-related query comprising an expression in a form of a grammatical unit, the processing of which by the search component initiates the search of the abstract syntax tree for program code statements contained within the program code.
2 Assignments
0 Petitions
Accused Products
Abstract
Architecture allows a programmer to answer questions about the source code the programmer is authoring, questions that cannot be answered by other means. A searching mechanism is provided over a much more structured presentation of the source code. The architecture utilizes components that provide an intimate knowledge about the structure of the text, namely, the source code of some particular programming language. The search mechanism employs an abstract syntax tree representation of the code over which the search is conducted. The program source code (as edited by the programmer) is transformed into the abstract syntax tree to embody the structure of the program. If the syntax tree is provided in XML, for example, an XML search mechanism such as Xpath can be utilized to perform the actual searching. This tree is then queried, allowing richer searching criteria to be expressed (by virtue of the structured format of the tree).
-
Citations
15 Claims
-
1. A computer-implemented search system, the search system comprising:
-
a processor; and a memory in communication with the processor, the memory comprising computer-executable instructions that, when executed by the processor, cause the processor to represent, utilizing a conversion component, a grammar of a program code as an abstract syntax tree; and search, utilizing a search component, the abstract syntax tree based on a code-related query to obtain code results, the code-related query comprising an expression in a form of a grammatical unit, the processing of which by the search component initiates the search of the abstract syntax tree for program code statements contained within the program code. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer-implemented search system, the search system comprising:
-
a processor; and a memory in communication with the processor, the memory comprising computer-executable instructions that, when executed by the processor, cause the processor to represent, utilizing a conversion component, a syntax of a program code as an abstract syntax tree; and search, utilizing a search component, the abstract syntax tree based on a code-based query to obtain code results, the code-based query comprising a natural language expression in a form of a grammatical unit, the processing of which by the search component initiates the search of the abstract syntax tree for program code statements contained within the program code as represented. - View Dependent Claims (7, 8)
-
-
9. A computer-implemented method of searching code, the method comprising:
-
representing, utilizing a computer, a grammar of a program code as an abstract syntax tree; searching, utilizing the computer, the abstract syntax tree based on a code-related query to obtain code results; returning, utilizing the computer, the code results, the code results being associated with a portion of the abstract syntax tree; mapping, utilizing the computer, the portion of the abstract syntax tree to a corresponding portion of the program code; presenting, on a display in communication with the computer, a first view comprising the portion of the abstract syntax tree that includes the portion of the program code in which the code results are found; presenting, on the display, a second view comprising the portion of the program code; and facilitating toggle between the first view and the second view. - View Dependent Claims (10, 11, 12, 13, 14, 15)
-
Specification