Package pyxb :: Package utils :: Module fac :: Class MultiConfiguration |
[hide private]
[frames] | no frames]

# type MultiConfiguration

source code

           object --+
                    |
    Configuration_ABC --+
                        |
                       MultiConfiguration

Support parallel execution of state machine.

This holds a set of configurations, and executes each transition on each one. Configurations which fail to accept a step are silently dropped; only if this results in no remaining configurations will UnrecognizedSymbolError be raised. If a step admits multiple valid transitions, a configuration is added for each one.

See pyxb.binding.content.AutomatonConfiguration for an alternative solution which holds actions associated with the transition until the non-determinism is resolved.

Instance Methods | [hide private]
__init__(self, configuration) | source code
acceptableSymbols(self) Return the acceptable Symbols given the current configuration. | source code
step(self, symbol) Execute an automaton transition using the given symbol. | source code
acceptingConfigurations(self) Return the set of configurations that are in an accepting state. | source code

Class Variables | [hide private]
| __configurations = `None`

Method Details | [hide private]

### __init__(self, configuration) (Constructor) | source code
Overrides: object.__init__ (inherited documentation)

### acceptableSymbols(self) | source code
Return the acceptable Symbols given the current configuration. This method extracts the symbol from all candidate transitions that are permitted based on the current counter values. Because transitions are presented in a preferred order, the symbols are as well. Overrides: Configuration_ABC.acceptableSymbols (inherited documentation)

### step(self, symbol) | source code
Execute an automaton transition using the given symbol. Parameters: `symbol` - A symbol from the alphabet of the automaton's language. This is a Python value that should be accepted by the SymbolMatch_mixin.match method of a State.symbol. It is not a Symbol instance. Returns: The new configuration resulting from the step. Raises: `AutomatonStepError` - UnrecognizedSymbolError when no transition compatible with `symbol` is available, and NondeterministicSymbolError if `symbol` admits multiple transitions and the subclass does not support non-deterministic steps (see MultiConfiguration). Overrides: Configuration_ABC.step (inherited documentation)

### acceptingConfigurations(self) | source code
Return the set of configurations that are in an accepting state. Note that some of the configurations may be within a sub-automaton; their presence in the return value is because the root configuration is also accepting.