Method of providing interactive usage descriptions based on source code analysis
First Claim
1. In a program development environment executing on a computing device, a method of analyzing source code to provide an interactive usage hint during a user function call, the method comprising:
- processing in the program development environment a function contained in source code for a program written in a typeless language in which variable types are not required to be explicitly declared, the processing creating a parse tree data structure from the function written in the typeless language;
identifying in the programming development environment incoming and outgoing arguments in the parse tree data structure;
receiving in the programming development environment, subsequent to the creating of the parse tree data structure from the function written in the typeless language, a user function call of the function used to create the parse tree data structure, the user function call being at least partially completed;
analyzing in the programming development environment the function call to identify incoming and outgoing arguments,associating in the programming development environment the identified incoming and outgoing arguments in the function call with the incoming and outgoing arguments identified in the created parse tree data structure, the associating identifying a current location in the parse tree data structure;
evaluating nodes surrounding the current location in the parse tree data structure to determine at least one of a forward precondition, precondition and post-condition; and
displaying at least one usage hint interactively to the user based on the evaluating.
1 Assignment
0 Petitions
Accused Products
Abstract
A method of dynamically analyzing source code to generate usage hints for a user performing program editing is disclosed. The functions in a collection of source code being edited by a user are processed so as to generate a parse tree data structure for each function called. The incoming and outgoing arguments in the parse tree are identified. Subsequently, a user editing code calls the function and either completely or incompletely enters the arguments as part of the function called. Input arguments are identified and associated with the corresponding argument in the parse tree for the function. Relevant preconditions and post-conditions of the surrounding nodes corresponding to the current location are analyzed. Usage hints are provided for the completion of the function call. Arguments for a completed function call argument entered by the user are validated. Error messages are delivered in the event of an invalid call.
45 Citations
27 Claims
-
1. In a program development environment executing on a computing device, a method of analyzing source code to provide an interactive usage hint during a user function call, the method comprising:
-
processing in the program development environment a function contained in source code for a program written in a typeless language in which variable types are not required to be explicitly declared, the processing creating a parse tree data structure from the function written in the typeless language; identifying in the programming development environment incoming and outgoing arguments in the parse tree data structure; receiving in the programming development environment, subsequent to the creating of the parse tree data structure from the function written in the typeless language, a user function call of the function used to create the parse tree data structure, the user function call being at least partially completed; analyzing in the programming development environment the function call to identify incoming and outgoing arguments, associating in the programming development environment the identified incoming and outgoing arguments in the function call with the incoming and outgoing arguments identified in the created parse tree data structure, the associating identifying a current location in the parse tree data structure; evaluating nodes surrounding the current location in the parse tree data structure to determine at least one of a forward precondition, precondition and post-condition; and displaying at least one usage hint interactively to the user based on the evaluating. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. In an electronic device having a programming environment with a language processor, a method comprising:
-
providing in the program development environment a collection of source code including at least one function, the source code written in a typeless language in which variable types are not required to be explicitly declared; using in the program development environment the language processor to process a function in the source code written in the typeless language to create a parse tree data structure; identifying in the program development environment arguments in the parse tree data structure; receiving in the program development environment, subsequent to the creating of the parse tree data structure from the function written in the typeless language, a user function call of the function used to create the parse tree data structure, the user function call being at least partially completed; identifying in the program development environment arguments in the function call; associating in the program development environment the identified arguments in the function call with the arguments identified in the created parse tree data structure, the associating identifying a current location in the parse tree data structure; evaluating nodes surrounding the current location in the parse tree data structure to determine at least one of a forward precondition, precondition and post-condition; and displaying at least one usage hint interactively to a user based on the evaluating. - View Dependent Claims (12)
-
-
13. A non-transitory medium storing computer-executable instructions for analyzing source code to provide an interactive usage hint during a user function call, the instructions when executed causing a computing device to:
-
process in a program development environment a function contained in source code for a program written in a typeless language in which variable types are not required to be explicitly declared, the processing creating a parse tree data structure from the function written in the typeless language; identify in the program development environment incoming and outgoing arguments in the parse tree data structure; receive in the program development environment, subsequent to the creating of the parse tree data structure from the function written in the typeless language, a user function call of the function used to create the parse tree data structure, the user function call being at least partially completed; analyze in the program development environment the function call to identify incoming and outgoing arguments, associate in the program development environment the identified incoming and outgoing arguments in the function call with the incoming and outgoing arguments identified in the created parse tree data structure, the associating identifying a current location in the parse tree data structure; evaluate nodes surrounding the current location in the parse tree data structure to determine at least one of a forward precondition, precondition and post-condition; and display at least one usage hint interactively to a user based on the evaluating. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22, 23)
-
-
24. A non-transitory medium storing computer-executable instructions for analyzing source code to provide an interactive usage hint during a user function call, the instructions when executed causing a computing device to:
-
provide a collection of source code including at least one function, the collection of source code written in a typeless language in which variable types are not required to be explicitly declared; use a language processor to process a function in the source code written in the typeless language to create a parse tree data structure; identify arguments in the parse tree data structure; receive, subsequent to the creating of the parse tree data structure from the function written in the typeless language, a user function call of the function used to create the parse tree data structure, the user function call being at least partially completed; identify arguments in the function call; associate the identified arguments in the function call with the arguments identified in the created parse tree data structure, the associating identifying a current location in the parse tree data structure; evaluate nodes surrounding the current location in the parse tree data structure to determine at least one of a forward precondition, precondition and post-condition; and display at least one usage hint interactively to a user based on the evaluating. - View Dependent Claims (25)
-
-
26. A system for analyzing source code to provide an interactive usage hint during a user function call, the system comprising:
a computing device hosting a program development environment and including; a collection of source code from a program written in a typeless language in which variable types are not required to be explicitly declared, the source code including a plurality of functions; a language processor used to process the source code for at least one of the plurality of functions; and at least one parse tree data structure generated by the language processor processing the source code written in the typeless language for the at least one of the plurality of functions, the parse tree data structure used to provide an interactive usage hint for a user function call of the function used to generate the parse tree data structure, the user function call being at least partially completed, and where; arguments in the user function call are identified, the identified arguments in the user function call are associated with corresponding arguments in the parse tree data structure, the associating identifying a current location in the parse tree data structure, and nodes surrounding the current location in the parse tree data structure are evaluated to determine at least one of a forward precondition, precondition and post-condition; and a display device for displaying the interactive usage hint based on the evaluating. - View Dependent Claims (27)
Specification