# US 8,789,018 B2 · Statically derived symbolic references for dynamic languages

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,789,018 B2
- Document ID: US8789018B2
- Status: Granted
- Kind: B2
- Application number: 13/149,665
- Filed: 2011-05-31
- Published: 2012-12-06
- Granted: 2014-07-22
- Earliest claimed: 2011-05-31
- Assignees: Microsoft Corporation
- Applicants: Michael C. Fanning; Steven Edward Lucco; Frederico A. Mameri
- Inventors: Michael C. Fanning; Steven Edward Lucco; Frederico A. Mameri
- Web page: https://patentgrep.com/patent/US8789018B2

## CPC

- G06F 8/43: {Checking; Contextual analysis}
- G06F 8/75: Structural analysis for program understanding
- G06F 8/427: {Parsing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Creating metadata for dynamic code in a descriptive metadata language. The method includes 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. Metadata about the body of the dynamic language source code is provided, with the source code, in a specific metadata format, to a user.

## Claims

### Claim 1

In a computing environment a method of creating metadata for dynamic language source code in a descriptive metadata language, the method comprising:
obtaining one or more first data structures defining constructs in a body of the dynamic language source code, wherein the one or more first data structures comprise at least one of a syntax tree or an abstract syntax tree;
developing a symbol table by extracting identifier information for one or more of the defined constructs from the one or more first data structures;
augmenting the symbol table by at least:
(i) explicitly inspecting the body of the dynamic language source code, including inspecting code that is a surrogate for an actual implementation or which models code that is not explicitly expressed in source code form;
(ii) examining a supporting framework to determine how an object will be consumed by the supporting framework; and
(iii) modeling behaviors of one or more of the defined constructs, including:
(a) modeling one or more effects on the symbol table that would result from executing a call to one or more functions based on at least one of explicit, inferred or computed call site details;
(b) using type inference to model runtime type resolution of one or more of the defined constructs; and
(c) modeling code that is not explicitly expressed in source code form, including modeling a document object model application programming interface; and
providing the augmented symbol table, which defines metadata about the body of the dynamic language source code in a specific metadata format, to a user.

### Claim 2 (depends on 1)

The method of claim 1, wherein explicit inspection of the body of dynamic language source code also includes inspecting developer comments providing information about code in the body of the dynamic language source code.

### Claim 3 (depends on 1)

The method of claim 1, wherein augmenting is based on one or more inferences.

### Claim 4 (depends on 3)

The method of claim 3, wherein the one or more inferences relate to operations performed by code in the body of source code.

### Claim 5 (depends on 4)

The method of claim 4, wherein augmenting comprises determining that an object is a string based on the object being an operand in a concatenation operation resulting in a string literal.

### Claim 6 (depends on 4)

The method of claim 4, wherein augmenting comprises determining that an object is a numerical type based on the object being an operand in an arithmetic operation.

### Claim 7 (depends on 4)

The method of claim 4, wherein at least a portion of augmenting comprises determining how a browser will interact with an object.

### Claim 8 (depends on 1)

The method of claim 1, wherein augmenting is based at least in part on user input using a command line tool to augment the body of dynamic language source code.

### Claim 9 (depends on 1)

The method of claim 1, wherein augmenting is based at least in part on collected runtime data.

### Claim 10

One or more hardware storage media comprising computer executable instructions that when executed by one or more processors cause one or more processors to perform the following:
obtaining one or more first data structures defining constructs in a body of dynamic language source code, wherein the one or more first data structures comprise at least one of a syntax tree or an abstract syntax tree;
developing a symbol table by extracting identifier information for one or more of the defined constructs from the one or more first data structures;
augmenting the symbol table by at least:
(i) explicitly inspecting the body of the dynamic language source code, including inspecting code that is a surrogate for an actual implementation or which models code that is not explicitly expressed in source code form;
(ii) examining a supporting framework to determine how an object will be consumed by the supporting framework; and
(iii) modeling behaviors of one or more of the defined constructs, including:
(a) modeling one or more effects on the symbol table that would result from executing a call to one or more functions based on at least one of explicit, inferred or computed call site details;
(b) using type inference to model runtime type resolution of one or more of the defined constructs; and
(c) modeling code that is not explicitly expressed in source code form, including modeling a document object model application programming interface; and
providing the augmented symbol table, which defines metadata about the body of the dynamic language source code in a specific metadata format to a user.

### Claim 11 (depends on 10)

The hardware storage media of claim 10, wherein explicit inspection of the body of dynamic language source code also includes inspecting developer comments providing information about code in the body of the dynamic language source code.

### Claim 12

A computer system, comprising:
one or more processors; and
one or more computer-readable media having stored thereon computer-executable instructions that, when executed by the one or more processors, cause the computer system to implement a method of creating metadata for dynamic language source code in a descriptive metadata language, the method comprising:
obtaining one or more first data structures defining constructs in a body of the dynamic language source code, wherein the one or more first data structures comprise at least one of a syntax tree or an abstract syntax tree;
developing a symbol table by extracting identifier information for one or more of the defined constructs from the one or more first data structures;
augmenting the symbol table by at least:
(i) explicitly inspecting the body of the dynamic language source code, including inspecting code that is a surrogate for an actual implementation or which models code that is not explicitly expressed in source code form;
(ii) examining a supporting framework to determine how an object will be consumed by the supporting framework; and
(iii) modeling behaviors of one or more of the defined constructs, including:
(a) modeling one or more effects on the symbol table that would result from executing a call to one or more functions based on at least one of explicit, inferred or computed call site details;
(b) using type inference to model runtime type resolution of one or more of the defined constructs; and
(c) modeling code that is not explicitly expressed in source code form, including modeling a document object model application programming interface; and
providing the augmented symbol table, which defines metadata about the body of the dynamic language source code in a specific metadata format, to a user.

### Claim 13 (depends on 12)

The computer system of claim 12, wherein explicit inspection of the body of dynamic language source code also includes inspecting developer comments providing information about code in the body of the dynamic language source code.

### Claim 14 (depends on 12)

The computer system of claim 12, wherein augmenting is based on one or more inferences.
