コード例 #1
0
ファイル: cp_enum.c プロジェクト: mildrock/dummy
extern void f_EnumDestroy( Enum_t Enum )
{
   if( Enum )
   {
      if( Enum->iCheck != ENUM_CHECK ) Abort();
      f_NameDestroy( Enum->Name );
      f_ListDestroy( Enum->ListEnumerator, (void(*)()) f_EnumeratorDestroy );
      ckfree( (char*)Enum );
   }
}
コード例 #2
0
ファイル: cp_init.c プロジェクト: AndresGG/sn-8.4
extern void f_InitDestroy( Init_t Init )
{
   if( Init )
   {
      if( Init->iCheck != INIT_CHECK ) Abort();
      if( Init->Expr )
         f_ExprDestroy( Init->Expr );
      if( Init->ListInit )
         f_ListDestroy( Init->ListInit, (void(*)()) f_InitDestroy );
      ckfree( (char*)Init );
   }
}
コード例 #3
0
ファイル: cp_argument.c プロジェクト: mildrock/dummy
extern List_t f_ArgumentDeclarationList( void )
{
   Save();
   List_t List;
   Declaration_t Declaration;

   if( token( 0 ) != '(' )
   {
      return 0;
   }

   step( 1 );

   List = f_ListCreate();

   if( token( 0 ) == ')' )
   {
      step( 1 );
      return List;   /* empty argument_declaration_list */
   }

   while( True )
   {
      if( token( 0 ) == SN_ELLIPSIS )
      {
         step( 1 );
         if( token( 0 ) == ')' )
         {
            step( 1 );
            Declaration = f_DeclarationCreate( DECLARATION_ARGUMENT );
            Declaration->s_ellipsis = True;
            f_ListAddLast( &List, (Elem_t) Declaration );
            return List;
         }
         else  /* csak az utolso argumentum lehet SN_ELLIPSIS */
         {
            f_ListDestroy( List, (void(*)()) f_DeclarationDestroy );
            Restore();
            return 0;
         }
      }

      if(( Declaration = f_ArgumentDeclaration()))
      {
         f_ListAddLast( &List, (Elem_t) Declaration );
         switch( token( 0 ))
         {
         case ','     : step( 1 ); break;
         case ')'     : step( 1 ); return List;
         case SN_ELLIPSIS: break;
         default      : 
            f_ListDestroy( List, (void(*)()) f_DeclarationDestroy );
            Restore();
            return 0;
         }
      }  
      else
      {
         f_ListDestroy( List, (void(*)()) f_DeclarationDestroy );
         Restore();
         return 0;
      }
   }
}