Undo/redo technique with insertion point state handling for 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 of an insertion point into the edit buffer.
2 Assignments
0 Petitions
Accused Products
Abstract
An editor or other software engineering tool may be configured to represent program code as an ordered set of lexical tokens and to maintain, coincident with an operation that modifies contents of the set, an undo object that identifies a pre-modification state of an insertion point. Often, the pre-modification state includes both a token coordinates and a character 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 that 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.
-
Citations
31 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 of an insertion point into the edit buffer. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. 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 insertion point states prior to operation of the respective edit methods. - View Dependent Claims (14, 15, 16, 17)
-
- 18. 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 removes one or more lexical tokens from the representation, an undo object that identifies the removed lexical tokens and a pre-modification state of an insertion point.
-
25. 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 substring encodings; 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 and (ii) a pre-modification state of an insertion point. - View Dependent Claims (26, 27, 28)
-
-
29. 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 respective sublists of one or more lexical tokens introduced into or removed by a list modifying edit operation and a pre-modification state of an insertion point. - View Dependent Claims (30, 31)
-
Specification