diff --git a/alliance/src/ctp/src/ctp_l.l b/alliance/src/ctp/src/ctp_l.l index 5b413bed..06336950 100644 --- a/alliance/src/ctp/src/ctp_l.l +++ b/alliance/src/ctp/src/ctp_l.l @@ -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}, diff --git a/alliance/src/ctp/src/ctp_y.y b/alliance/src/ctp/src/ctp_y.y index 849ecf38..cd3c5e3b 100644 --- a/alliance/src/ctp/src/ctp_y.y +++ b/alliance/src/ctp/src/ctp_y.y @@ -133,6 +133,7 @@ %token _DEFINE %token _ASSUME %token _INITIAL +%token _RESET_COND %token CharacterLit %token Colon %token 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); }