System and method for horizontal alignment of tokens in a structural representation program editor
First Claim
1. In a computer program editor configured to edit a computer program represented as a stream of tokens from a text flow representation display of said program, a method for forcing horizontal alignment between token positions in associated lines of edit text, the method comprising the following steps:
- (a) displaying each line of said computer program as it is entered by a user, wherein a displayed line represents a sequence of tokens and visual whitespace separating adjacent tokens;
(b) defining at least a first cursor-positionable alignment marker at a first insertion point in said stream corresponding to a user-selected first inter-token position in a first said displayed line, and defining at least a second cursor-positional alignment marker at a second insertion point in said stream corresponding to a user-selected second inter-token position in a second said display line of said computer program, said first display line and said second display line being associated with one another, each said alignment marker providing user interactability with a said displayed line;
(c) prettyprint displaying said first displayed line and said second displayed line such that said first inter-token position and said second inter-token position are forced into horizontal alignment with each other;
wherein a token adjacent said first inter-token position and a token adjacent said second inter-token position are themselves displayed in relative horizontal alignment; and
(d) maintaining boundaries between each said token and updating each said insertion position while said user edits a said line of said computer program as though said user were editing a said line of said computer program with a text editor.
1 Assignment
0 Petitions
Accused Products
Abstract
An editor for structurally represented computer programs transforms user-entered text on-the-fly into a stream of tokens that constitute words of the program under edit. Each token is classified as one of group of extended lexemes, and based upon token stream information the editor prettyprint displays the program as the user types. Prettyprinting involves typesetting each token in a visually distinct manner and displaying a varying amount of visual inter-token whitespace between the tokens, based upon token lexical type. The program may be user-edited from the prettyprinted display as though the program were internally represented as text. Cursor position and display appearance depend on the lexical types of tokens adjacent the cursor. To improve aesthetics of the prettyprinted display, a user may insert one or more alignment markers into lines of associated text. The presence of such marker(s) forces horizontal alignment between associated text lines containing such markers. The presence, number, and occurrence of such markers in associated lines of text is noted, and the pixel distance from a boundary edge to the first occurring marker in each line is calculated. The maximum such distance determines relative position of the first alignment marker. Pixel units are added to the whitespace gap preceding the first marker in the other associated lines to force such markers into alignment with the marker whose position represented the maximum distance. This process is then repeated for second alignment markers in each line, third alignment markers, and so on.
164 Citations
14 Claims
-
1. In a computer program editor configured to edit a computer program represented as a stream of tokens from a text flow representation display of said program, a method for forcing horizontal alignment between token positions in associated lines of edit text, the method comprising the following steps:
-
(a) displaying each line of said computer program as it is entered by a user, wherein a displayed line represents a sequence of tokens and visual whitespace separating adjacent tokens; (b) defining at least a first cursor-positionable alignment marker at a first insertion point in said stream corresponding to a user-selected first inter-token position in a first said displayed line, and defining at least a second cursor-positional alignment marker at a second insertion point in said stream corresponding to a user-selected second inter-token position in a second said display line of said computer program, said first display line and said second display line being associated with one another, each said alignment marker providing user interactability with a said displayed line; (c) prettyprint displaying said first displayed line and said second displayed line such that said first inter-token position and said second inter-token position are forced into horizontal alignment with each other; wherein a token adjacent said first inter-token position and a token adjacent said second inter-token position are themselves displayed in relative horizontal alignment; and (d) maintaining boundaries between each said token and updating each said insertion position while said user edits a said line of said computer program as though said user were editing a said line of said computer program with a text editor. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system permitting user-invoked horizontal alignment of token positions in associated text lines in a computer program editor that represents a computer program under edit as a stream of tokens and permits editing from a display of said program as though said program were represented as a text flow, the system comprising:
-
an input device configured to receive user-intended editing actions and to output an event stream of input events corresponding to said editing actions, said input events including at least a user defined first cursor-positionable alignment marker at a first insertion point in said stream corresponding to a user-selected first inter-token position in a first displayed line, and at least a user defined second cursor-positional alignment marker at a second insertion point in said stream corresponding to a user-selected second inter-token position in a second display line of said computer program, said first display line and said second display line being associated with one another and each said alignment marker providing user interactability with a said displayed line; a typographical display processor configured to determine said cursor-defined position and to display each line of said computer program as it is entered and to display said first displayed line and said second displayed line such that said a token bounded by said first inter-token position and a token bounded by said second inter-token position are displayed in horizontal alignment if said first displayed line and said second displayed line are associated. - View Dependent Claims (10, 11, 12, 13, 14)
-
Specification