Undo/Redo technique with computed of line information in a token-oriented representation of program code
First Claim
1. A method of providing undo operation support in an edit buffer represented as a ordered set of lexical tokens, the method comprising:
- maintaining, in correspondence with operations that modify contents of the edit buffer, an ordered set of undo objects that identify respective subsets of the lexical tokens corresponding to content removed by respective ones of the modifying operations; and
maintaining in correspondence with the undo objects, respective encodings of pre-modification states including state for at least some pre-modification line demarcations.
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. Such a tool (or tools) may be further configured to maintain, coincident with an operation that modifies contents of the token-oriented representation, an undo object that identifies pre-modification line demarcation state. Often, the pre-modification state also includes both a token coordinates and a line-coordinates representation of the insertion point and storage of pre-modification state in, or in association with, the undo object facilitates efficient implementation of a undo operation, e.g., generally without recomputation of a coordinate representation or line demarcation state, which would otherwise scale with buffer size. In this way, lexical tokens corresponding to an inserted substring can be readily and efficiently excised to restore a pre-insertion tokenized list and insertion point state. Similarly, lexical tokens corresponding to a removed substring can be readily and efficiently reinstated to restore a pre-deletion tokenized list and insertion point state.
127 Citations
36 Claims
-
1. A method of providing undo operation support in an edit buffer represented as a ordered set of lexical tokens, the method comprising:
-
maintaining, in correspondence with operations that modify contents of the edit buffer, an ordered set of undo objects that identify respective subsets of the lexical tokens corresponding to content removed by respective ones of the modifying operations; and
maintaining in correspondence with the undo objects, respective encodings of pre-modification states including state for at least some pre-modification line demarcations. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
-
-
18. A software engineering tool comprising:
-
a representation of program code encoded in a computer readable medium as a set of nodes, each node corresponding to a respective token recognized in accordance with an operative set of lexical rules;
functional encodings of edit methods executable to operate on the set of nodes; and
an undo-redo manager that maintains an ordered set of undo-redo objects in correspondence with operation of the edit methods, undo-type ones of the undo-redo objects including respective encodings of at least some line demarcation states prior to operation of the respective edit methods. - View Dependent Claims (19, 20, 21, 22, 23, 24)
-
- 25. A software engineering tool encoded in one or more computer readable media as instructions executable to represent program code as lexical tokens and to maintain, consistent with an operation that either removes one or more line demarcation tokens from the representation or introduces one or more line demarcation tokens into the representation, an undo object that encodes a pre-modification state that identifies at least some of the removed or introduced line demarcation tokens.
-
30. 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 correspond to line demarcations; and
an ordered representation of undo objects that identify (i) respective sublists of one or more lexical tokens introduced into or removed by a list modifying operation, (ii) a pre-modification state of an insertion point and (iii) pre-modification state of at least some line demarcations. - View Dependent Claims (31, 32, 33)
-
-
34. An apparatus comprising:
-
storage for a computer readable encoding of an edit buffer represented as a sequence of lexical tokens; and
means for maintaining an edit-operation-ordered representation of undo objects that each include respective encodings of both pre-modification line demarcation state and pre-modification insertion point state. - View Dependent Claims (35, 36)
-
Specification