摘要 |
A method and apparatus for displaying text which efficiently couples information derived from the parse tree for the text with the display of the text. Use of parse tree information allows the system to display different parts of the text in a context-sensitive manner. The method involves creating a parse array from a parse tree for the text. The parse array contains a compressed representation of the nodes of the parse tree. This parse array is used to find the parse node which corresponds to a particular location in the text. The parse array can be traversed to a chosen character using a stack. In one embodiment the stack can be saved periodically to improve performance so that the parse node corresponding to a character can be more quickly determined. The parse array is also used to find the entire portion of the text which corresponds to the parse node. The text corresponding to a particular parse node is displayed with a display characteristic which differentiates this portion of the text from the remainder of the text. Thus, a user of this display can view the text in a context-sensitive fashion.
|