class documentation

class Level: (source)

Constructor: Level()

View In Hierarchy

Parser helper tracking mask branches within a parenthesized level.

Method __init__ Create a new parsing level with a fresh root mask.
Method add_any Advance active masks by adding/entering a wildcard branch.
Method add_key Advance active masks by adding/entering the given key.
Method new_mask Start a new top-level mask branch (after a comma).
Method pop_level Exit to the previous level, merging active branches.
Method push_level Enter a nested parenthesized level.
Instance Variable active Masks that are currently being extended.
Instance Variable ends Masks that were completed by commas in this level.
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.
def __init__(self): (source)

Create a new parsing level with a fresh root mask.

def add_any(self): (source)

Advance active masks by adding/entering a wildcard branch.

def add_key(self, k: FieldKey): (source)

Advance active masks by adding/entering the given key.

Parameters
k:FieldKeyField key to add at the current level.
def new_mask(self): (source)

Start a new top-level mask branch (after a comma).

def pop_level(self) -> Level | None: (source)

Exit to the previous level, merging active branches.

def push_level(self, pos: int) -> Level: (source)

Enter a nested parenthesized level.

Parameters
pos:intSource position of the opening parenthesis.
Returns
LevelNew Level instance.

Masks that are currently being extended.

Masks that were completed by commas in this level.

Source position of the opening parenthesis.

Previous level in the nesting stack.

Masks that represent branch starts for the current level.