virtual bool is_recoverable() const throw()
 {
     switch (get_errorcode()) {
     // these are the exceptions thrown during processing not supposed to 
     // produce any tokens on the context::iterator level
     case preprocess_exception::no_error:        // just a placeholder
     case preprocess_exception::macro_redefinition:
     case preprocess_exception::macro_insertion_error:
     case preprocess_exception::bad_macro_definition:
     case preprocess_exception::illegal_redefinition:
     case preprocess_exception::duplicate_parameter_name:
     case preprocess_exception::invalid_macroname:
     case preprocess_exception::bad_include_file:
     case preprocess_exception::bad_include_statement:
     case preprocess_exception::ill_formed_directive:
     case preprocess_exception::error_directive:
     case preprocess_exception::warning_directive:
     case preprocess_exception::ill_formed_expression:
     case preprocess_exception::missing_matching_if:
     case preprocess_exception::missing_matching_endif:
     case preprocess_exception::unbalanced_if_endif:
     case preprocess_exception::bad_define_statement:
     case preprocess_exception::bad_define_statement_va_args:
     case preprocess_exception::bad_line_statement:
     case preprocess_exception::bad_line_number:
     case preprocess_exception::bad_line_filename:
     case preprocess_exception::bad_undefine_statement:
     case preprocess_exception::division_by_zero:
     case preprocess_exception::integer_overflow:
     case preprocess_exception::ill_formed_integer_literal:
     case preprocess_exception::ill_formed_character_literal:
     case preprocess_exception::character_literal_out_of_range:
     case preprocess_exception::last_line_not_terminated:
     case preprocess_exception::include_nesting_too_deep:
     case preprocess_exception::illegal_operator_redefinition:
     case preprocess_exception::incompatible_config:
     case preprocess_exception::ill_formed_pragma_option:
     case preprocess_exception::ill_formed_pragma_message:
     case preprocess_exception::pragma_message_directive:
         return true;
         
     case preprocess_exception::unexpected_error:
     case preprocess_exception::ill_formed_operator:
     case preprocess_exception::too_few_macroarguments:
     case preprocess_exception::too_many_macroarguments:
     case preprocess_exception::empty_macroarguments:
     case preprocess_exception::improperly_terminated_macro:
     case preprocess_exception::invalid_concat:
     case preprocess_exception::could_not_open_output_file:
         break;
     }
     return false;
 }
Esempio n. 2
0
void socketexception::show_error()
{
        static const char* error_message[] = {
                "socket() failed.",
                "inet_ptons() failed.",
                "connect() failed.",
                "send() failed.",
                "recv() failed."
        };

        std::cout << error_message[get_errorcode()] << std::endl;
}
Esempio n. 3
0
 virtual bool is_recoverable() const throw()
 {
     switch (get_errorcode()) {
     case lexing_exception::universal_char_invalid:
     case lexing_exception::universal_char_base_charset:
     case lexing_exception::universal_char_not_allowed:
     case lexing_exception::invalid_long_long_literal:
         return true;    // for now allow all exceptions to be recoverable
         
     case lexing_exception::unexpected_error:
     default:
         break;
     }
     return false;
 }
Esempio n. 4
0
void socketexception::count_error(){

        this->m_array_errorcount[get_errorcode()]++;
        this->m_errorcount++;

}