Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > strange VHDL syntax question

Reply
Thread Tools

strange VHDL syntax question

 
 
Michael Riepe
Guest
Posts: n/a
 
      10-06-2004
Hi everybody,

this is something for the language experts out there.

I know that it's legal to override implicitly declared operators (from a
type declaration) with an explicit declaration, but is it also allowed
to override an implicit _alias_ declaration of such an operator (as
created by an alias declaration for the type)?

That is, may I write something like this?

package strange is
alias mytype is bit;
-- this implicitly declares, among others:
-- alias "and" is std.standard."and" [ bit, bit return bit ];
-- and now, declare a homograph:
function "and" (l, r : mytype) return mytype;
end strange;

The standard isn't very clear about that, it just mentions that "an
implicit declaration of a predefined operation" is overridden by a
second homograph in the same declarative region.

Thanks in advance,
--
Michael "Tired" Riepe <>
"All I wanna do is have a little fun before I die"
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      10-11-2004
Michael Riepe <> wrote in message news:<ck1pjh$geg$>...

> may I write something like this?
>
> package strange is
> alias mytype is bit;
> -- this implicitly declares, among others:
> -- alias "and" is std.standard."and" [ bit, bit return bit ];


An alias doen't declare anything except an
alternate name for an existing identifier.
See Ashenden 2ed pp 260-263.

> -- and now, declare a homograph:
> function "and" (l, r : mytype) return mytype;
> end strange;


Looks like you've overloaded the bit "and" function,
but you are missing a package body.
Try it on modelsim and see.

What is you objective?

-- Mike Treseler
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL Syntax Question grommetik Software 0 05-08-2012 02:16 PM
VHDL standard question (VHDL 93 chapter 4.3.2.2) Kim Enkovaara VHDL 9 10-15-2008 11:04 PM
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
A question about syntax of VHDL Jim Huang VHDL 6 04-24-2005 03:28 PM
Question About Strange 'C' Code Syntax ( Well strange to me anyway ) Harvey Twyman C Programming 8 10-25-2003 05:54 AM



Advertisments