示例#1
0
文件: print.c 项目: ksbhat/CoCoKS
node *
PRTerror (node * arg_node, info * arg_info)
{
  bool first_error;

  DBUG_ENTER ("PRTerror");

  if (NODE_ERROR (arg_node) != NULL) {
    NODE_ERROR (arg_node) = TRAVdo (NODE_ERROR (arg_node), arg_info);
  }

  first_error = INFO_FIRSTERROR( arg_info);

  if( (global.outfile != NULL)
      && (ERROR_ANYPHASE( arg_node) == global.compiler_anyphase)) {

    if ( first_error) {
      printf ( "\n/******* BEGIN TREE CORRUPTION ********\n");
      INFO_FIRSTERROR( arg_info) = FALSE;
    }

    printf ( "%s\n", ERROR_MESSAGE( arg_node));

    if (ERROR_NEXT (arg_node) != NULL) {
      TRAVopt (ERROR_NEXT (arg_node), arg_info);
    }

    if ( first_error) {
      printf ( "********  END TREE CORRUPTION  *******/\n");
      INFO_FIRSTERROR( arg_info) = TRUE;
    }
  }

  DBUG_RETURN (arg_node);
}
示例#2
0
/** <!--******************************************************************-->
 *
 * @fn CHKMerror
 *
 * @brief Touched the node and its sons/attributes
 *
 * @param arg_node Error node to process
 * @param arg_info pointer to info structure
 *
 * @return processed node
 *
 ***************************************************************************/
node *
CHKMerror (node * arg_node, info * arg_info)
{
  DBUG_ENTER ("CHKMerror");
  NODE_ERROR (arg_node) = CHKMTRAV (NODE_ERROR (arg_node), arg_info);
  ERROR_NEXT (arg_node) = CHKMTRAV (ERROR_NEXT (arg_node), arg_info);
  ERROR_MESSAGE (arg_node) =
    CHKMattribString (ERROR_MESSAGE (arg_node), arg_info);
  DBUG_RETURN (arg_node);
}
示例#3
0
文件: copy_node.c 项目: ksbhat/CoCoKS
/** <!--******************************************************************-->
 *
 * @fn COPYerror
 *
 * @brief Copies the node and its sons/attributes
 *
 * @param arg_node Error node to process
 * @param arg_info pointer to info structure
 *
 * @return processed node
 *
 ***************************************************************************/
node *
COPYerror (node * arg_node, info * arg_info)
{
  node *result = TBmakeError (NULL, PH_initial, NULL);
  DBUG_ENTER ("COPYerror");
  LUTinsertIntoLutP (INFO_LUT (arg_info), arg_node, result);
  /* Copy attributes */
  ERROR_MESSAGE (result) = STRcpy (ERROR_MESSAGE (arg_node));
  ERROR_ANYPHASE (result) = ERROR_ANYPHASE (arg_node);
  /* Copy sons */
  ERROR_NEXT (result) = COPYTRAV (ERROR_NEXT (arg_node), arg_info);
  /* Return value */
  DBUG_RETURN (result);
}
示例#4
0
/** <!--******************************************************************-->
 *
 * @fn MERRCODEerror
 *
 * @brief Sets error code for the node and its sons
 *
 * @param arg_node Error node to process
 * @param arg_info pointer to info structure
 *
 * @return processed node
 *
 ***************************************************************************/
node *MERRCODEerror( node *arg_node, info *arg_info ){
  DBUG_ENTER("MERRCODEerror");

  /* Set error code */
  NODE_ERRCODE(arg_node)= STRcpy(INFO_ERRCODE(arg_info));

  /* Visit sons */
  if(ERROR_NEXT( arg_node)!= NULL){
    ERROR_NEXT( arg_node)= TRAVdo( ERROR_NEXT( arg_node), arg_info);
  }

  /* Return value */
  DBUG_RETURN(arg_node);
}
示例#5
0
/** <!--**********************************************************************-->
 *
 * @fn node *CHKinsertError( node *arg_node, char *string)
 *******************************************************************************/
node *CHKinsertError( node *arg_node, char *string)
{
  DBUG_ENTER( "CHKinsertError");

  if ( arg_node == NULL) {
    
    CTIwarn( "%s", string);

    arg_node = TBmakeError( STRcpy( string), global.compiler_anyphase, arg_node);
  } 
  else {
    if ( !(STReq( string, ERROR_MESSAGE( arg_node)))) {
      ERROR_NEXT( arg_node) = CHKinsertError( ERROR_NEXT( arg_node), string);
    }
    else {
      ERROR_ANYPHASE( arg_node) = global.compiler_anyphase;
    }
  } 
  
  DBUG_RETURN( arg_node);
}