IR1045 , , / , , , :
library ieee;
use ieee.std_logic_1164.all;
entity foo is
port (
a: in std_logic;
b: out std_logic_vector (3 downto 0)
);
end entity;
architecture behave of foo is
begin
b <= std_logic_vector'('0','1','1','0') when a = '1' else
(others =>'0') when a = '0' else
(others => 'X');
end architecture behave;
?
VHDL.
Nick Gasson nvc flex, 1045.
nvc/src/lexer.l, GPLv3.
last_token:
#define TOKEN(t) return (last_token = (t))
if (standard() < lrm) { \
warn_at(&yylloc, "%s is a reserved word in VHDL-%s", \
yytext, standard_text(lrm)); \
return parse_id(yytext); \
} \
else \
return (last_token = (t));
ââ :
static int resolve_ir1045(void);
static int last_token = -1;
:
%%
static int resolve_ir1045(void)
{
switch (last_token) {
case tRSQUARE:
case tRPAREN:
case tALL:
case tID:
return 0;
default:
return 1;
}
}
IR1045 comp.lang.vhdl
http://www.eda-twiki.org/isac/IRs-VHDL-93/IR1045.txt
resol_ir1045 lexer.l.
static int resolve_ir1045(void);
{CHAR} { if (resolve_ir1045()) {
yylval.s = strdup(yytext);
TOKEN(tID);
, nvc .
. IR-1045 , . , , Ada flex, .
Ada 27 3 2006 PDF 30 31 ( 27 . 159 160), , .
, , :
entity ir1045 is
end entity;
architecture foo of ir1045 is
begin
THIS_PROCESS:
process
type twovalue is ('0', '1');
subtype string4 is string(1 to 4);
attribute a: string4;
attribute a of '1' : literal is "TRUE";
begin
assert THIS_PROCESS.'1''a /= "TRUE"
report "'1''a /= ""TRUE"" is FALSE";
report "This_PROCESS.'1''a'RIGHT = " &
integer'image(This_PROCESS.'1''a'RIGHT);
wait;
end process;
end architecture;
, , , , , :
ghdl -a ir1045.vhdl
ghdl -e ir1045
ghdl -r ir1045
ir1045.vhdl:13:9:@0ms:(assertion error): '1''a /= "TRUE" is FALSE
ir1045.vhdl:15:9:@0ms:(report note): This_PROCESS.'1''a'RIGHT = 4
, , , "" ( entity_class, . IEEE Std 1076-2008 7.2) , .
VHDL. , nvc . 7.2.
, twovalue. , , (5.2.2.1).