parser module
Parse the definition file and build the logic network.
Used in the Logic Simulator project to analyse the syntactic and semantic correctness of the symbols received from the scanner and then builds the logic network.
- class parse.Parser(names, devices, network, monitors, scanner, errors: exceptions.Errors)
Bases:
object
Parse the definition file and build the logic network.
The parser deals with error handling. It analyses the syntactic and semantic correctness of the symbols it receives from the scanner, and then builds the logic network. If there are errors in the definition file, the parser detects this and tries to recover from it, giving helpful error messages.
- Parameters
names – instance of the names.Names() class.
devices – instance of the devices.Devices() class.
network – instance of the network.Network() class.
monitors – instance of the monitors.Monitors() class.
scanner – instance of the scanner.Scanner() class.
errors – instance of the exceptions.Errors() class
- parse_network()
Parse the circuit definition file.
Returns: True if parsing was successful and simulation should run, False if there were errors.