Reset cond

This commit is contained in:
Ludovic Jacomme 2002-09-16 14:47:06 +00:00
parent ce33464465
commit 0cb2c2de1b
2 changed files with 59 additions and 1 deletions

View File

@ -80,7 +80,7 @@ static el_mc tab_mc []=
{"false" ,_FALSE},
{"high" ,_HIGH},
{"ift" ,_IFT},
{"initial" ,_INITIAL},
{"initial" ,_INITIAL},
{"is" ,IS},
{"left" ,_LEFT},
{"length" ,_LENGTH},
@ -95,6 +95,7 @@ static el_mc tab_mc []=
{"others" ,OTHERS},
{"range" ,_RANGE},
{"rem" ,REM},
{"reset_cond" ,_RESET_COND},
{"reverse_range" ,_REV_RANGE},
{"right" ,_RIGHT},
{"stable" ,_STABLE},

View File

@ -133,6 +133,7 @@
%token <valu> _DEFINE
%token <valu> _ASSUME
%token <valu> _INITIAL
%token <valu> _RESET_COND
%token <text> CharacterLit
%token <valu> Colon
%token <valu> Comma
@ -337,6 +338,7 @@ block_declarative_item
| variable_declaration
| assumption_declaration
| initial_declaration
| reset_cond_declaration
| type_declaration
| subtype_declaration
| error
@ -504,6 +506,51 @@ initial_declaration
}
;
reset_cond_declaration
: _RESET_COND
Identifier
constant_VarAsgn__expression
Semicolon_ERR
{
ctltype_list *Type;
ctldecl_list *CtlAss;
vexexpr *VexValue;
chain_list *HeadChain;
chain_list *ScanChain;
ctp_vexstr *VexStr;
short Signed;
long Left;
long Right;
short Width;
long AttrLeft;
long AttrRight;
VexValue = simpvexexpr( $3.VEX );
Type = val_type( "boolean" );
AttrLeft = -1;
AttrRight = -1;
CtlAss = (ctldecl_list *)ctp_addstr( 'R',0, Type,
VEX_TYPE_BOOLEAN, 0, $2, AttrLeft,AttrRight,VexValue);
Signed = 0;
Left = -1;
Right = -1;
addtab(hshtab,$2,CTP_MODNAM,CTP_SYMDFN,CTP_CSTDFN);
addtab(hshtab,$2,CTP_MODNAM,CTP_TYPDFN,VEX_TYPE_BOOLEAN);
addtab(hshtab,$2,CTP_MODNAM,CTP_WMNDFN,Left);
addtab(hshtab,$2,CTP_MODNAM,CTP_WMXDFN,Right);
addtab(hshtab,$2,CTP_MODNAM,CTP_ATLDFN,AttrLeft);
addtab(hshtab,$2,CTP_MODNAM,CTP_ATRDFN,AttrRight);
addtab(hshtab,$2,CTP_MODNAM,CTP_LBLDFN,0);
addtab(hshtab,$2,CTP_MODNAM,CTP_PNTDFN,(long)CtlAss->VEX_ATOM);
addtab(hshtab,$2,CTP_MODNAM,CTP_SUNDFN,Signed );
}
;
constant_VarAsgn__expression
: VarAsgn
@ -2197,6 +2244,16 @@ vexexpr *exp;
pnt = (void *)CtlDeclar;
}
else
if ( object == 'R' )
{
CtlDeclar = addctldeclreset( CTP_HEADFIG, vex_pnt );
CtlDeclar->TYPE = prtype;
CtlDeclar->VEX_INIT = exp;
addctlline( CTP_HEADFIG, &CtlDeclar->LINE, CTP_LINNUM );
pnt = (void *)CtlDeclar;
}
return (pnt);
}