/// <summary> /// Constructs a new instance of the bus /// </summary> /// <param name="source">The process declaration</param> /// <param name="process">The resolved process definition</param> /// <param name="type">The process type</param> public Process(AST.InstanceDeclaration source, AST.Process process, ProcessType type) { Source = source ?? throw new ArgumentNullException(nameof(source)); ProcessDefinition = process ?? throw new ArgumentNullException(nameof(process)); Type = type; Statements = ProcessDefinition.Statements.Select(x => x.Clone()).ToArray(); }
/// <summary> /// Creates all sub-instances for a network /// </summary> /// <param name="state">The state to use</param> /// <param name="network">The parent network instance</param> private Instance.Network CreateAndRegisterInstance(ValidationState state, AST.InstanceDeclaration instDecl, AST.Network network) { // Create the network instance var netinstance = new Instance.Network(instDecl, network); // We have registered the network by this name already //state.TryAddSymbol(netinstance.Name, netinstance); using (state.StartScope(network, netinstance)) CreateAndRegisterInstances(state, netinstance.NetworkDefinition.Declarations, netinstance.Instances); return(netinstance); }
/// <summary> /// Constructs a new instance of the bus /// </summary> /// <param name="source">The process declaration</param> /// <param name="network">The resolved network definition</param> public Network(AST.InstanceDeclaration source, AST.Network network) { Source = source ?? throw new ArgumentNullException(nameof(source)); NetworkDefinition = network ?? throw new ArgumentNullException(nameof(network)); }