Efficient computation of line information in a token-oriented representation of program code
First Claim
1. A software engineering tool encoded in one or more computer readable media as instructions executable to represent program code as a doubly-linked list of lexical tokens including at least some line demarcations corresponding to line boundaries in the represented program code, the instructions further executable to maintain, consistent with operations thereon, both a token-coordinates representation and a line-coordinates representation of an insertion point.
1 Assignment
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 a particular token of a token-oriented representation and offset thereinto, together with at least some line-oriented coordinates. Efficient implementations of insert and remove 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
48 Claims
- 1. A software engineering tool encoded in one or more computer readable media as instructions executable to represent program code as a doubly-linked list of lexical tokens including at least some line demarcations corresponding to line boundaries in the represented program code, the instructions further executable to maintain, consistent with operations thereon, both a token-coordinates representation and a line-coordinates representation of an insertion point.
-
17. A method of identifying an insertion point in 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 the insertion point in the edit buffer, the insertion point representation identifying;
(i) a particular one of the lexical tokens corresponding to the insertion point; and
(ii) line coordinates for the insertion point. - View Dependent Claims (18, 19, 20, 21, 22, 23, 24, 25, 26, 27)
-
-
28. One or more computer readable media encoding a data structure that represents contents of an edit buffer as a sequence of lexical tokens, 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 have associated string encodings; and
an insertion point representation identifying, for the insertion point, both a particular one of the lexical tokens and a particular line in which the particular token resides. - View Dependent Claims (29, 30, 31, 32, 33)
-
-
34. 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 line-delimited 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 thereof; and
responsive to repositioning of an insertion point, updating a representation thereof that identifies;
a particular one of the lexical tokens;
a character offset into a string associated with the particular lexical token; and
line coordinates corresponding to the identified token and character offset. - View Dependent Claims (35, 36, 37, 38, 39, 40, 41, 42)
-
-
43. 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 in the edit buffer, the insertion point identifying both a particular one of the lexical tokens and line coordinates. - View Dependent Claims (44, 45, 46, 47, 48)
-
Specification