meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
lookbehind [2020/09/25 11:21] – revusky | contextual_predicates [2023/03/03 14:23] (current) – 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. | ||
- | Probably the most typical usage will be to guarantee that a production is not // | + | ==== Specifying that a production is non-reentrant ==== |
+ | |||
+ | Probably the most typical usage will be to guarantee that a production is not // | ||
< | < | ||
Line 11: | Line 13: | ||
</ | </ | ||
- | First of all, the tilde " | + | First of all, the tilde " |
+ | |||
+ | 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 //contextual | ||
- | In the above example, the ellipsis " | + | In the above example, the ellipsis " |
< | < | ||
Line 29: | 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 36: | 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 55: | Line 65: | ||
</ | </ | ||
+ | ==== Summary ==== | ||
- | ===== Summary ===== | + | A //contextual |
- | + | ||
- | A //lookbehind | + | |
An ellipsis " | An ellipsis " | ||
Line 78: | 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 | + | |