IP Library Granted Patent US 7,958,493
Granted Patent B2
US 7,958,493 · App. 11/655,729 · Granted Jun 7, 2011

Type inference system and method

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,958,493
App. No.
11/655,729
Granted
Jun 7, 2011
Kind
B2
Abstract

Systems and methods of representing and extracting type information from typeless and dynamically-typed programming languages are provided. These systems and methods can be immune to source file edits and the order in which those edits are executed. Deriving type information from these languages allows tools to perform operations, for example, refactoring, intellisense, recognition of semantic errors, etc. These systems and methods can be implemented using processes that, implicitly or explicitly, gather type information for the program, and can also accept user input as well.

Claims (25)

1. A method for extracting type information from a dynamically-typed programming language, the method comprising:

generating a plurality of nodes, the nodes generated by a parser, wherein each of the plurality of nodes comprise an abstract syntax tree node associated with a symbol in a runtime environment, wherein a symbol has a different type information at a different position in a source code;

requesting type information from the dynamically-typed programming language based on a particular symbol and a position, the type information requested by an integrated development environment;

locating the particular symbol at the position in the runtime environment; and

returning a value associated with the particular symbol at the position to be read by a processor, the particular symbol at the position used to retrieve information about an underlying object being queried.

2. The method of claim 1 , wherein the requesting step is performed during editing of code.

3. The method of claim 1 , wherein the returning step includes evaluating the value based on a current state of an environment and returning a type at that moment in time for a given file and file offset.

4. The method of claim 1 , further including storing information for each occurrence of a symbol and inferring a type for each occurrence of the symbol.

5. A method for populating a type environment when loading a JAVASCRIPT core library, the method comprising:

identifying lexemes in a source code in the dynamically-type programming language;

organizing the lexemes into a stream of lexemes;

detecting patterns in the stream of lexemes;

generating a plurality of abstract syntax trees representing the detected patterns, the plurality of abstract syntax trees generated by a parser;

associating a symbol with each of the plurality of abstract syntax trees using a tree walker to evaluate each of the plurality of abstract syntax trees, wherein a symbol has a different the type information at a different position in a source code;

populating a type environment with the type information;

storing the type information as metadata within the type environment as the type environment is created;

and

performing one or more queries on the type information by requesting type information based on a particular symbol and a position, the type information requested by an integrated development environment, locating the particular symbol at the position in the runtime environment, and returning a value associated with the particular symbol at the position to be read by a processor, the particular symbol at the position used to retrieve information about an underlying object being queried.

6. The method of claim 5 , further comprising using a hash table to implement the type environment, wherein the hash table comprises information pertaining to a reference count that indicates the number of times a variable is referenced and information pertaining to the one or more values that a referenced variable may take at a given point in the source code.

7. A computer program product comprising a non-transitory computer useable medium having computer program logic recorded thereon for populating a type environment from a dynamically-typed programming language, the computer program product comprising:

a computer program code logic configured to process source files obtained from one or more sources into type information, the computer program code logic configured to identify lexemes in the inputs, organize the lexemes into a stream of lexemes, detect patterns in the stream of lexemes, generate a plurality of abstract syntax trees representing the detected patterns, the plurality of abstract syntax trees generated by a parser, and associate a symbol with each of the plurality of abstract syntax trees using a tree walker to evaluate each of the plurality of abstract syntax trees wherein a symbol has a different type information at a different position in a source code;

a computer program code logic configured to populate a type environment with the type information;

a computer program code logic configured to store the type information as metadata as the type environment is created; and

a computer program code logic configured to perform one or more queries on the type information by requesting the type information based on a particular symbol and a position, the type information requested by an integrated development environment, locating the particular symbol at the position in the runtime environment, and returning a value associated with the particular symbol at the position to be read by a processor, the particular symbol at the position used to retrieve information about an underlying object being queried.

8. The computer program product of claim 7 , further comprising computer program code logic configured to use a hash table to implement the type environment, wherein the hash table comprises information pertaining to a reference count that indicates the number of times a variable is referenced and information pertaining to the one or more values that a referenced variable may take at a given point in the source code.

Assignments (5)
SECURITY INTEREST Recorded Aug 27, 2015
From: APPCELERATOR, INC.
To: SILICON VALLEY BANK
Reel/Frame 036442/0008 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 24, 2012
From: WASHBURN, DONALD A.
To: APPCELERATOR, INC.
Reel/Frame 029181/0625 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 8, 2012
From: DEBREUIL, ROBIN S.
To: APPCELERATOR, INC.
Reel/Frame 028747/0635 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 7, 2011
From: LINDSEY, KEVIN EDWARD
To: APPCELERATOR, INC.
Reel/Frame 026552/0639 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 6, 2011
From: COLTON, PAUL
To: APPCELERATOR, INC.
Reel/Frame 026546/0128 →
Continuity (2)
Provisional Application 60760754 · Jan 20, 2006
Related Publication 20070234288A1 · Oct 4, 2007