Token-oriented representation of program code with support for textual editing thereof
First Claim
1. A method of efficiently supporting operations on contents of an edit buffer represented as a sequence of lexical tokens, the method comprising:
- representing the edit buffer as a doubly-linked list of nodes, each node corresponding to a respective one of the lexical tokens; and
representing an insertion point in the edit buffer, the insertion point representation identifying both a particular one of the lexical tokens and an offset into a text string associated with the particular token.
2 Assignments
0 Petitions
Accused Products
Abstract
An editor, software engineering tool or collection of such tools may be configured to encode (or employ an encoding of) an insertion point representation that identifies both a particular token of a token-oriented representation and a character offset thereinto. Efficient implementations of insert, remove and replace operations that employ such a representation are described herein. Computational costs of such operations typically scale at worst with the size of fragments inserted into and/or removed from such a token-oriented representation, rather than with buffer size. Accordingly, such implementations are particularly well-suited to providing efficient support for programming tool environments in which a token stream is updated incrementally in correspondence with user edits.
-
Citations
32 Claims
-
1. A method of efficiently supporting operations on contents of an edit buffer represented as a sequence of lexical tokens, the method comprising:
-
representing the edit buffer as a doubly-linked list of nodes, each node corresponding to a respective one of the lexical tokens; and
representing an insertion point in the edit buffer, the insertion point representation identifying both a particular one of the lexical tokens and an offset into a text string associated with the particular token. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15)
-
-
13. The method of claim 13,
wherein at least one additional text strings, which is identical to the particular strings, is represented as a separate instance.
-
16. One or more computer readable media encoding a data structure that represents as a sequence of lexical tokens an edit buffer of functionally descriptive program code, the encoded data structure comprising:
-
a doubly linked list of nodes;
token representations each corresponding to at least one respective node of the list, wherein at least some of the token representations include associated text string encodings; and
an insertion point encoding a position in the edit buffer, the insertion point identifying both a particular one of the lexical tokens and an offset thereinto. - View Dependent Claims (17, 18, 19, 20, 21, 22, 23)
-
- 24. A software engineering tool that represents program code as a stream of lexical tokens and represents a cursor position therein by identifying both a particular one of the lexical tokens and an offset thereinto corresponding to the cursor position.
-
27. A method of supporting access by one or more software engineering tools to program code, wherein at least one such tool operates on the program code as a token sequence and at least one such tool operates on the program code as a character sequence, the method comprising:
-
maintaining a representation of the program code as a doubly-linked list of nodes, each node corresponding to a lexical token, wherein at least some of the nodes have associated text string encodings; and
responsive to updates to the program code and consistent with state of the program code representation, maintaining an insertion point identifier that identifies both a particular one of the nodes and offset into a corresponding one of the text string encodings, if any. - View Dependent Claims (28, 29)
-
-
30. An apparatus comprising:
-
storage for a computer readable encoding of an edit buffer represented as a sequence of lexical tokens; and
means for representing an insertion point encoding a position in the edit buffer, the insertion point identifying both a particular one of the lexical tokens and an offset thereinto. - View Dependent Claims (31, 32)
-
Specification