Example #1
0
        /// <summary>
        /// Creates a loop statement.
        /// </summary>
        public LoopStatement()
        {
            resolvable = new ResolvableImpl(this);
            statements = ParentSetList <SequentialStatement> .Create(this);

            scope = Scopes.createScope(this, resolvable);
        }
        /// <summary>
        /// Creates a library declarative region.
        /// </summary>
        /// <param name="identifier">the identifier of the library</param>
        public LibraryDeclarativeRegion(string identifier)
        {
            files = ParentSetList <VhdlFile> .Create(this);

            resolvable      = new ResolvableImpl(this);
            scope           = Scopes.createScope(this, resolvable);
            this.identifier = identifier;
        }
Example #3
0
        /// <summary>
        /// Creates an if statement.
        /// </summary>
        /// <param name="condition">the if condition</param>
        public IfStatement(Expression condition)
        {
            statements = ParentSetList <SequentialStatement> .CreateProxyList(this);

            elsifParts     = new List <ElsifPart>();
            elseStatements = ParentSetList <SequentialStatement> .CreateProxyList(this);

            this.condition = condition;
        }
        /// <summary>
        /// Creates a process statement.
        /// </summary>
        /// <param name="label">the process label</param>
        public ProcessStatement(string label)
            : base(label)
        {
            declarations = new List <ProcessDeclarativeItem>();
            statements   = ParentSetList <SequentialStatement> .Create(this);

            sensitivityList = new List <Signal>();
            Label           = label;
        }
        /// <summary>
        /// Creates a process statement without a label.
        /// </summary>
        public ProcessStatement()
            : base()
        {
            declarations = new List <ProcessDeclarativeItem>();
            statements   = ParentSetList <SequentialStatement> .Create(this);

            sensitivityList = new List <Signal>();
            Label           = "UnnamedProcess";
        }
Example #6
0
            public StateMachineProcess(StateMachine fsm)
            {
                this.fsm          = fsm;
                caseStatement     = new CaseStatement(Name.reference(fsm.currentStateSignal));
                caseStatementList = new List <SequentialStatement>(new SequentialStatement[] { caseStatement });
                statements        = ParentSetList <SequentialStatement> .Create(this);

                statements.AddRange(statementsBefore);
                statements.AddRange(caseStatementList);
                statements.AddRange(statementsAfter);
            }
Example #7
0
        //TODO: link subprogram body to declaration
        /// <summary>
        /// Creates a subprogram body based on a subprogram declaration.
        /// </summary>
        /// <param name="declaration">the subprogam declaration</param>
        public SubprogramBody(SubprogramDeclaration declaration)
        {
            this.parameters   = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
            this.declarations = VhdlCollections.CreateDeclarationList <ISubprogramDeclarativeItem>();
            this.statements   = ParentSetList <SequentialStatement> .Create(this);

            this.scope = Scopes.createScope(this, this.parameters, this.declarations);

            this.identifier = declaration.Identifier;
            foreach (var o in declaration.Parameters)
            {
                this.parameters.Add(o);
            }
        }
Example #8
0
        /// <summary>
        /// Creates a subprogram body.
        /// </summary>
        /// <param name="identifier">the identifier of this subprogram body</param>
        /// <param name="parameters">the parameters</param>
        public SubprogramBody(string identifier, List <VhdlObjectProvider> parameters)
        {
            this.parameters   = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
            this.declarations = VhdlCollections.CreateDeclarationList <ISubprogramDeclarativeItem>();
            this.statements   = ParentSetList <SequentialStatement> .Create(this);

            this.scope = Scopes.createScope(this, this.parameters, this.declarations);

            this.identifier = identifier;
            foreach (VhdlObjectProvider provider in parameters)
            {
                this.parameters.Add(provider);
            }
        }