Check out the new USENIX Web site.

next up previous
Next: Definitions and Constraint Systems Up: Text Constraints Previous: Delimiter Operators

Concatenation and Background

Concatenation of regions is indicated by then. The expression "Gettysburg" then "Address" matches regions that consist of ``Gettysburg'' followed by ``Address'', with nothing important in between. The meaning of nothing important depends on a parameter called the background. The background is a set of regions. Characters in the background regions are ignored when concatenating constraint expressions. For example, when the background is Whitespace, the expression "Gettysburg" then "Address" finds not only ``GettysburgAddress'', but also ``Gettysburg Address'', and even ``Gettysburg Address'' split across two lines. Relational operators that require adjacency also use the background, so the expression "Gettysburg" just before "Address" will successfully match the first word of ``Gettysburg Address''.

The LAPIS browser chooses a default background based on the current document view, following the guideline that any text not printed on the screen is part of the background. In the plain text view, the default background is Whitespace. In the HTML view, the default background is the union of Whitespace and Tag, since tags affect rendering but are not actually displayed.

The background can also be set explicitly using the ignoring directive. To change the background to R for the duration of a constraint expression expr, use the form expr ignoring R. For example, a query on source code might take the form expr ignoring (Comment | Whitespace). The background can be removed by setting it to nothing, which generates the empty region set.



Robert C. Miller and Brad A. Myers
Mon Apr 26 11:34:19 EDT 1999