Methods for type-independent source code editing
First Claim
1. A method for editing a source code file, comprising:
- modifying the source code file using a language-independent source code editor, wherein the language-independent source code editor does not include a language-specific lexical analyzer or parser;
sending a change notification to an extensible multi-language compiler framework identifying a changed file, changed text, and type of change, wherein the editor communicates to the compiler framework using language-independent metadata, and wherein the compiler framework provides a stream of token nodes, supports mixing and nesting of languages within a source file, and provides the editor with information about the source file, comprising signatures of classes defined by the source file, errors found in the source file, stacks of nested languages at any point in the source file, and information exposed by any language;
retokenizing the source code file and updating token and node information;
enqueueing a task for the extensible multi-language compiler framework to complete compilation in a background thread;
repainting a screen giving immediate feedback to a user; and
emptying enqueued tasks and completing remaining steps in the background thread;
wherein the extensible multi-language compiler framework has error correction in code-generation, permitting the user to run code even if there is an error in the code;
wherein a thread pool allows compilation of multiple files to be performed in parallel;
wherein a type cache contains signatures for classes.
2 Assignments
0 Petitions
Accused Products
Abstract
An extensible, data-driven, language independent source code editor is presented, with an embedded, extensible multi-language compiler framework. Such an editor can be tightly integrated with a compiler framework that provides detailed information about the language currently being edited by the user. This information can be provided in a language-neutral way effectively decoupling the editor from the underlying set of languages being edited. In addition, a language-independent editor can expose a set of APIs that makes it easy to customize behavior for specific languages that have characteristics not shared by most languages. This set of APIs can also enable the development of customized views, such as for developing visual editors that represent and allow the user to manipulate aspects of the source code pictorially.
This description is not intended to be a complete description of, or limit the scope of, the invention. Other features, aspects, and objects of the invention can be obtained from a review of the specification, the figures, and the claims.
311 Citations
38 Claims
-
1. A method for editing a source code file, comprising:
-
modifying the source code file using a language-independent source code editor, wherein the language-independent source code editor does not include a language-specific lexical analyzer or parser; sending a change notification to an extensible multi-language compiler framework identifying a changed file, changed text, and type of change, wherein the editor communicates to the compiler framework using language-independent metadata, and wherein the compiler framework provides a stream of token nodes, supports mixing and nesting of languages within a source file, and provides the editor with information about the source file, comprising signatures of classes defined by the source file, errors found in the source file, stacks of nested languages at any point in the source file, and information exposed by any language; retokenizing the source code file and updating token and node information; enqueueing a task for the extensible multi-language compiler framework to complete compilation in a background thread; repainting a screen giving immediate feedback to a user; and emptying enqueued tasks and completing remaining steps in the background thread; wherein the extensible multi-language compiler framework has error correction in code-generation, permitting the user to run code even if there is an error in the code; wherein a thread pool allows compilation of multiple files to be performed in parallel; wherein a type cache contains signatures for classes. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27)
-
-
28. A system, comprising:
-
one or more compilers and one or more processors, wherein the compilers, executed by the one or more processors, support mixing and nesting of languages within a source file and provide streams of token nodes; an extensible multi-language compiler framework, wherein the compiler framework provides a language-independent source code editor with information about the source file, comprising signatures of classes defined by the source file, errors found in the source file, stack of nested languages at any point in the source file, and information exposed by any languages; wherein the language-independent source code editor does not include a language-specific lexical analyzer or parser; wherein the language-independent source code editor communicates to the compiler framework using language-independent metadata identifying a changed file, changed text, and type of change; wherein the extensible multi-language compiler framework has error correction in code-generation, permitting a user to run code even if there is an error in the code; wherein the compiler framework retokenizes the source code file and updates token and node information; wherein the compiler framework enqueues a task from the compiler framework to complete compilation in a background thread; wherein the language-independent source code editor repaints a screen (living immediate feedback to a user; wherein the compiler framework empties enqueued tasks and completes remaining steps in the background thread; wherein a thread pool allows compilation of multiple files to be performed in parallel; and wherein a type cache contains signatures for classes. - View Dependent Claims (29, 30, 31, 32, 33, 34, 35, 36)
-
-
37. A non-transitory computer readable medium having instructions stored thereon that, when executed by a processor, cause the processor to:
-
modify a source code file using a language-independent source code editor, wherein the language-independent source code editor does not include a language-specific lexical analyzer or parser; send a change notification to an extensible multi-language compiler framework identifying a changed file, changed text, and type of change, wherein the editor communicates to the compiler framework using language-independent metadata, and wherein the compiler framework provides a stream of token nodes, supports mixing and nesting of languages within a source file, and provides the editor with information about the source file, comprising signatures of classes defined by the source file, errors found in the source file, stack of nested languages at any point in the source file, and information exposed by any language; retokenize the source code file and update token and node information; enqueue a task for the extensible multi-language compiler framework to complete compilation in a background thread; repaint a screen giving immediate feedback to a user; and empty enqueued tasks and completing remaining steps in the background thread; wherein the extensible multi-language compiler framework has error correction in code-generation, permitting the user to run code even if there is an error in the code; wherein a thread pool allows compilation of multiple files to be performed in parallel; wherein a type cache contains signatures for classes. - View Dependent Claims (38)
-
Specification