Static semantic analysis of dynamic languages
AssigneeMicrosoft Corporation
InventorsMichael C. Fanning, Frederico A. Mameri, Zachary A. Nation
Life of this patent
Estimating the term…
Abstract
Analyzing dynamic source code. A method includes accessing a specific metadata format data structure. The data structure was created by obtaining one or more first data structures defining constructs in a body of dynamic language source code. From the one or more first data structures, identifier information is extracted for one or more of the defined constructs. Knowledge about the constructs is augmented. The metadata format data structure is parsed to compute metrics about the metadata format data structure. The metrics about the metadata format data structure are provided to a user.
Claims20
In a computing environment, a processor-implemented method of analyzing dynamic source code, the method comprising:
- parsing source code to generate one or more syntax trees defining constructs in a body of dynamic language source code;
- from the one or more syntax trees, extracting identifier information for one or more of the defined constructs;
- augmenting knowledge about the constructs by at least one of explicit inspection of the body of source code or implied references related to the source code;
- producing a correlation between identifiers and augmented knowledge;
- using the identifier information and augmented knowledge, generating metadata about the body of the dynamic language source code, the generated metadata being represented as a symbol table;
- parsing symbol table to compute metrics about the one or more syntax trees;
- and
- providing the metrics about the one or more syntax trees to a user, wherein the metrics provide code correctness analysis, and wherein the correctness analysis indicates parameter count mismatches.
One or more computer readable memory comprising computer executable instructions that when executed by one or more processors cause one or more processors to perform the following:
- parsing source code to generate one or more syntax trees defining constructs in a body of dynamic language source code;
- from the one or more syntax trees, extracting identifier information for one or more of the defined constructs;
- augmenting knowledge about the constructs by at least one of explicit inspection of the body of source code or implied references related to the source code;
- producing a correlation between identifiers and augmented knowledge;
- using the identifier information and augmented knowledge, generating metadata about the body of the dynamic language source code, the generated metadata being represented as a symbol table;
- parsing symbol table to compute metrics about the one or more syntax trees;
- and
- providing the metrics about the one or more syntax trees to a user, wherein the metrics provide code correctness analysis, and wherein the correctness analysis indicates parameter count mismatches.
In a computing environment, a system for analyzing dynamic code, the system comprising:
- one or more processors;
- one or more computer readable media coupled to the one or more processors, wherein the one or more computer readable media comprise computer executable instruction that when executed by one or more of the one or more processors cause one or more of the one or more processors to perform the following:
- parsing source code to generate one or more syntax trees defining constructs in a body of dynamic language source code;
- from the one or more syntax trees, extracting identifier information for one or more of the defined constructs;
- augmenting knowledge about the constructs by at least one of explicit inspection of the body of source code or implied references related to the source code;
- producing a correlation between identifiers and augmented knowledge;
- using the identifier information and augmented knowledge, generating metadata about the body of the dynamic language source code, the generated metadata being represented as a symbol table;
- parsing symbol table to compute metrics about the one or more syntax trees;
- and
- providing the metrics about the one or more syntax trees to a user wherein the metrics provide code correctness analysis, and wherein the correctness analysis indicates parameter count mismatches.
Dependencies are inferred from the claim text.