meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
lookbehind [2020/09/25 11:41] – revusky | contextual_predicates [2021/02/08 18:14] – revusky | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | A //lookbehind | + | A //contextual |
The easiest way to describe this is with some actual examples. | The easiest way to describe this is with some actual examples. | ||
Line 7: | Line 7: | ||
==== Specifying that a production is non-reentrant ==== | ==== Specifying that a production is non-reentrant ==== | ||
- | Probably the most typical usage will be to guarantee that a production is not // | + | Probably the most typical usage will be to guarantee that a production is not // |
< | < | ||
Line 13: | Line 13: | ||
</ | </ | ||
- | First of all, the tilde " | + | First of all, the tilde " |
- | In the above example, the ellipsis " | + | The above sort of predicate will probably be the most commonly used pattern. However, more complex conditions can be formed. |
+ | |||
+ | ==== Scanning Forward vs. Backward, Ellipsis and Wild-card | ||
+ | |||
+ | Note that the elements in a // | ||
+ | |||
+ | In the above example, the ellipsis " | ||
< | < | ||
Line 31: | Line 37: | ||
would mean that we enter the '' | would mean that we enter the '' | ||
- | So, consider the following predicate: | + | Now, consider the following predicate |
< | < | ||
Line 38: | Line 44: | ||
This means that we enter the Baz production only if the root production is a '' | This means that we enter the Baz production only if the root production is a '' | ||
+ | |||
+ | ==== Optional Ending Slash ==== | ||
If the predicate begins with a forward slash, it may end // | If the predicate begins with a forward slash, it may end // | ||
Line 59: | Line 67: | ||
==== Summary ==== | ==== Summary ==== | ||
- | A //lookbehind | + | A //contextual |
An ellipsis " | An ellipsis " | ||
Line 79: | Line 87: | ||
In the above we specify that Foo must be // | In the above we specify that Foo must be // | ||
+ | NB. If you have a '' | ||
- | NB. If you have a '' | + | Note also that //contextual |
- | + | ||
- | Note also that //lookbehind | + | |