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:39] – 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. | ||
- | 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 54: | Line 64: | ||
[ SCAN / | [ SCAN / | ||
</ | </ | ||
- | |||
- | |||
- | |||
==== Summary ==== | ==== Summary ==== | ||
- | A //lookbehind | + | A //contextual |
An ellipsis " | An ellipsis " | ||
Line 80: | 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 | + | |