class documentation
Parser helper tracking mask branches within a parenthesized level.
starts, ends and active are sets: one mask occurs one time at most. Two different masks never share a child. Thus, the size of each set is not more than the number of masks in the result.
| Method | __init__ |
Create a new parsing level with a fresh root mask. |
| Method | add |
Advance active masks by adding/entering a wildcard branch. |
| Method | add |
Advance active masks by adding/entering the given key. |
| Method | new |
Start a new top-level mask branch (after a comma). |
| Method | pop |
Exit to the previous level, merging active branches. |
| Method | push |
Enter a nested parenthesized level. |
| Instance Variable | active |
Masks that are currently being extended. |
| Instance Variable | ends |
Finished masks retained when a suffix can extend them. |
| Instance Variable | pos |
Source position of the opening parenthesis. |
| Instance Variable | prev |
Previous level in the nesting stack. |
| Instance Variable | starts |
Masks that represent branch starts for the current level. |
| Method | _finish |
Move the active masks to ends. |
| Instance Variable | _collect |
True when a key or a wildcard can extend the masks that this level finishes. Only then the level fills ends. |
| Instance Variable | _ended |
Identities of the masks in ends. |
Advance active masks by adding/entering the given key.
Each active mask gets its own child.
| Parameters | |
k:FieldKey | Field key to add at the current level. |
Exit to the previous level, merging active branches.
The previous level gets no masks when this level does not collect them, because no token can use them.