示例#1
0
 /// <summary>
 /// Creates a component.
 /// </summary>
 /// <param name="identifier">the component identifier</param>
 public Component(string identifier)
 {
     generic         = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
     port            = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
     scope           = Scopes.createScope(this, generic, port);
     this.identifier = identifier;
 }
示例#2
0
 /// <summary>
 /// Creates an root declarative region containing the Standard library.
 /// </summary>
 public RootDeclarativeRegion()
 {
     libraries = VhdlCollections.CreateNamedEntityList <LibraryDeclarativeRegion>(this);
     //libraries.Add(Libraries.STD);
     //libraries.Add(Libraries.IEEE);
     scope         = Scopes.createScope(this, libraries, new UseClauseResolvable(this));
     internalScope = Scopes.createScope(this, libraries);
 }
示例#3
0
 /// <summary>
 /// Creates a subprogram declaration.
 /// </summary>
 /// <param name="identifier">the identifier of this subprogram declaration</param>
 /// <param name="parameters">the parameters</param>
 public SubprogramDeclaration(string identifier, List <VhdlObjectProvider> parameters)
 {
     this.parameters = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
     this.identifier = identifier;
     foreach (VhdlObjectProvider provider in parameters)
     {
         VhdlObjectProvider p = (VhdlObjectProvider)provider;
         this.parameters.Add(p);
     }
 }
示例#4
0
        /// <summary>
        /// Creates a package body.
        /// </summary>
        /// <param name="pack">the associated package</param>
        public PackageBody(PackageDeclaration pack)
            : base(pack)
        {
            declarations = VhdlCollections.CreateDeclarationList <PackageBodyDeclarativeItem>();
            resolvable   = new ResolvableImpl(this);
            scope        = Scopes.createScope(this, declarations, resolvable, new LibraryUnitResolvable(this));

            this.pack        = pack;
            pack.PackageBody = this;
        }
            public List <object> GetListOfObjects()
            {
                List <object> res = new List <object>();
                IResolvableList <ProcessDeclarativeItem> decls = VhdlCollections.CreateDeclarationList <ProcessDeclarativeItem>(parent.Declarations);

                res.AddRange(decls.GetListOfObjects());
                IResolvableList <SequentialStatement> stmts = VhdlCollections.CreateLabeledElementList <SequentialStatement>(parent, parent.Statements);

                res.AddRange(stmts.GetListOfObjects());
                return(res);
            }
示例#6
0
 /// <summary>
 /// Creates an architecture.
 /// </summary>
 /// <param name="identifier">the architectures identifier</param>
 /// <param name="entity">the associated entity</param>
 public Architecture(string identifier, Entity entity)
     : base(entity)
 {
     declarations    = VhdlCollections.CreateDeclarationList <BlockDeclarativeItem>();
     statements      = VhdlCollections.CreateLabeledElementList <ConcurrentStatement>(this);
     this.identifier = identifier;
     this.entity     = entity;
     resolvable      = new ResolvableImpl(this);
     scope           = Scopes.createScope(this, declarations, statements, resolvable, new LibraryUnitResolvable(this));
     entity.AddArchitecture(this);
 }
示例#7
0
 /// <summary>
 /// Creates a block statement.
 /// </summary>
 /// <param name="label"></param>
 public BlockStatement(string label)
 {
     port         = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
     generic      = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
     declarations = VhdlCollections.CreateDeclarationList <BlockDeclarativeItem>();
     statements   = VhdlCollections.CreateLabeledElementList <ConcurrentStatement>(this);
     portMap      = new List <AssociationElement>();
     genericMap   = new List <AssociationElement>();
     scope        = Scopes.createScope(this, port, generic, declarations, new GuardSignalResolvable(this));
     Label        = label;
 }
示例#8
0
        /// <summary>
        /// Creates a entity.
        /// </summary>
        /// <param name="identifier">the identifier</param>
        public Entity(string identifier)
        {
            this.identifier = identifier;

            port          = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
            generic       = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
            declarations  = VhdlCollections.CreateDeclarationList <EntityDeclarativeItem>();
            architectures = new List <Architecture>();

            statements = new List <EntityStatement>();
            scope      = Scopes.createScope(this, generic, port, declarations, new LibraryUnitResolvable(this));
        }
            public virtual object Resolve(string identifier)
            {
                IResolvableList <SequentialStatement> stmts = VhdlCollections.CreateLabeledElementList <SequentialStatement>(parent, parent.Statements);
                object result = stmts.Resolve(identifier);

                if (result != null)
                {
                    return(result);
                }

                IResolvableList <ProcessDeclarativeItem> decls = VhdlCollections.CreateDeclarationList <ProcessDeclarativeItem>(parent.Declarations);

                return(decls.Resolve(identifier));
            }
示例#10
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);
            }
        }
示例#11
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);
            }
        }
示例#12
0
 /// <summary>
 /// Creates a component based on an entity.
 /// The identifier, port and generic of the entity is used to initialize the component.
 /// </summary>
 /// <param name="entity">the entity</param>
 public Component(Entity entity)
 {
     generic         = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
     port            = VhdlCollections.CreateVhdlObjectList <VhdlObjectProvider>();
     scope           = Scopes.createScope(this, generic, port);
     this.identifier = entity.Identifier;
     foreach (var o in entity.Generic)
     {
         generic.Add(o);
     }
     foreach (var o in entity.Port)
     {
         port.Add(o);
     }
 }
示例#13
0
 public VhdlFile()
 {
     elements = VhdlCollections.CreateNamedEntityList <LibraryUnit>(this);
     scope    = Scopes.createScope(this, elements);
 }
示例#14
0
 public AbstractGenerateStatement()
 {
     declarations = VhdlCollections.CreateDeclarationList <BlockDeclarativeItem>();
     statements   = VhdlCollections.CreateLabeledElementList <ConcurrentStatement>(this);
     scope        = Scopes.createScope(this, declarations, statements);
 }