Permalink
Browse files

[pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.

git-svn-id: https://svn.parrot.org/parrot/trunk@29952 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 993d961 commit 2255840fb5c41c08bfb1b89acedbc21b916ae3b5 @allisonrandal allisonrandal committed Aug 2, 2008
Showing 356 changed files with 7,123 additions and 7,304 deletions.
View
@@ -3089,7 +3089,7 @@ src/pmc/env.pmc []
src/pmc/eval.pmc []
src/pmc/eventhandler.pmc []
src/pmc/exception.pmc []
-src/pmc/exception_handler.pmc []
+src/pmc/exceptionhandler.pmc []
src/pmc/exporter.pmc []
src/pmc/file.pmc []
src/pmc/fixedbooleanarray.pmc []
@@ -83,7 +83,8 @@ This method starts the code generation phase.
BCG_start_code_gen(bcg_info);
}
BCG_CATCH(BCG_EXCEPTION) {
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
}
@@ -104,7 +105,8 @@ This method concludes the code generation phase.
BCG_end_code_gen(bcg_info);
}
BCG_CATCH(BCG_EXCEPTION) {
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
@@ -131,7 +133,8 @@ This method is called to generate byte code for start subroutine.
string_cstring_free(pragma_str);
}
BCG_CATCH(BCG_EXCEPTION) {
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
}
@@ -153,7 +156,8 @@ This method is called to generate bytecode for end subroutine
BCG_end_sub(bcg_info);
}
BCG_CATCH(BCG_EXCEPTION) {
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
}
@@ -176,7 +180,8 @@ This method generates code for a subroutine call.
string_cstring_free(name_str);
}
BCG_CATCH(BCG_EXCEPTION) {
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
}
@@ -198,7 +203,8 @@ This method generated code for ending a subroutine call.
BCG_end_call(bcg_info);
}
BCG_CATCH(BCG_EXCEPTION) {
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
}
@@ -222,7 +228,8 @@ This method generates code for an opertion.
string_cstring_free(op_name);
}
BCG_CATCH(BCG_EXCEPTION) {
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
}
@@ -244,7 +251,8 @@ This method marks the end of an operation.
BCG_end_op(bcg_info);
}
BCG_CATCH(BCG_EXCEPTION) {
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
}
@@ -272,7 +280,8 @@ This method generates bytecode for a variable.
}
BCG_CATCH(BCG_EXCEPTION) {
string_cstring_free(val_str);
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
@@ -303,7 +312,8 @@ This method generates bytecode for a constant.
}
BCG_CATCH(BCG_EXCEPTION) {
string_cstring_free(name_str);
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
@@ -330,7 +340,8 @@ This method generates bytecode for label.
}
BCG_CATCH(BCG_EXCEPTION) {
string_cstring_free(label_str);
- real_exception(INTERP, NULL, E_Exception, bcg_info->error_msg);
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+ bcg_info->error_msg);
}
BCG_END_TRY;
@@ -362,7 +373,8 @@ get_data_type_from_cstring(Interp *interp, char *data_type)
return 'S';
}
- real_exception(interp, NULL, E_Exception, "Invalid data type.");
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ "Invalid data type.");
}
/*
View
@@ -431,7 +431,7 @@ SP [ ]
c = yylex_skip(valp, interp, " ", yyscanner);
if (c != IDENTIFIER)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"Constant names must be identifiers");
IMCC_INFO(interp)->cur_macro_name = valp->s;
@@ -440,7 +440,7 @@ SP [ ]
c = yylex_skip(valp, interp, " ", yyscanner);
if (c != INTC && c != FLOATC && c != STRINGC && c != REG)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"Constant '%s' value must be a number, "
"stringliteral or register", IMCC_INFO(interp)->cur_macro_name);
@@ -474,7 +474,7 @@ SP [ ]
YYCHOP();
if (!IMCC_INFO(interp)->frames || !IMCC_INFO(interp)->frames->label)
- IMCC_fataly(interp, E_SyntaxError, "missing space?");
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "missing space?");
len = yyleng + 10;
label = (char *)mem_sys_allocate(len);
@@ -496,7 +496,7 @@ SP [ ]
/* RT #32421 if$I0 is parsed as if$ I0 */
if (!IMCC_INFO(interp)->frames || !IMCC_INFO(interp)->frames->label)
- IMCC_fataly(interp, E_SyntaxError, "missing space?");
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "missing space?");
len = yyleng + 10;
label = (char *)mem_sys_allocate(len);
@@ -600,13 +600,12 @@ SP [ ]
/* Save the string we want to mark the end of the heredoc and snip
off newline and quote. */
if (IMCC_INFO(interp)->frames->heredoc_rest)
- IMCC_fataly(interp, E_SyntaxError,
- "nested heredoc not supported");
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "nested heredoc not supported");
IMCC_INFO(interp)->heredoc_end = str_dup(yytext + 3);
IMCC_INFO(interp)->heredoc_end[strlen(IMCC_INFO(interp)->heredoc_end) - 1] = 0;
if (!strlen(IMCC_INFO(interp)->heredoc_end))
- IMCC_fataly(interp, E_SyntaxError, "empty heredoc delimiter");
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "empty heredoc delimiter");
frame = new_frame(interp);
frame->s.next = (parser_state_t *)IMCC_INFO(interp)->frames;
@@ -634,37 +633,37 @@ SP [ ]
<emit,INITIAL>\$I[0-9]+ {
if (valp) (valp)->s = yytext;
if (IMCC_INFO(interp)->state->pasm_file)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"'%s' is not a valid register name in pasm mode", yytext);
return IREG;
}
<emit,INITIAL>\$N[0-9]+ {
if (valp) (valp)->s = yytext;
if (IMCC_INFO(interp)->state->pasm_file)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"'%s' is not a valid register name in pasm mode", yytext);
return NREG;
}
<emit,INITIAL>\$S[0-9]+ {
if (valp) (valp)->s = yytext;
if (IMCC_INFO(interp)->state->pasm_file)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"'%s' is not a valid register name in pasm mode", yytext);
return SREG;
}
<emit,INITIAL>\$P[0-9]+ {
if (valp) (valp)->s = yytext;
if (IMCC_INFO(interp)->state->pasm_file)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"'%s' is not a valid register name in pasm mode", yytext);
return PREG;
}
<emit,INITIAL>\$[a-zA-Z0-9]+ {
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"'%s' is not a valid register name", yytext);
}
@@ -701,7 +700,7 @@ SP [ ]
<macro>".label"{WS}+ {
if (yylex(valp, yyscanner, interp) != LABEL)
- IMCC_fataly(interp, E_SyntaxError, "LABEL expected");
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "LABEL expected");
if (valp) {
char *label;
@@ -872,7 +871,7 @@ read_braced(YYSTYPE *valp, PARROT_INTERP, const char *macro_name,
count++;
if (c <= 0)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"End of file reached while reading arguments in '%s'",
macro_name);
@@ -912,17 +911,17 @@ read_params(YYSTYPE *valp, PARROT_INTERP, params_t *params,
while (c != ')') {
if (YYSTATE == heredoc2)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"Heredoc in macro '%s' not allowed", macro_name);
if (c <= 0)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"End of file reached while reading arguments in '%s'",
macro_name);
else if (c == ',') {
if (params->num_param == MAX_PARAM)
- IMCC_fataly(interp, E_SyntaxError,
- "More then %d params in '%s'",
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+ "More than %d params in '%s'",
MAX_PARAM, macro_name);
params->name[params->num_param++] = current;
@@ -932,7 +931,7 @@ read_params(YYSTYPE *valp, PARROT_INTERP, params_t *params,
c = yylex_skip(&val, interp, " \n", yyscanner);
}
else if (need_id && (*current || c != IDENTIFIER) && c != ' ') {
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"Parameter definition in '%s' must be IDENTIFIER",
macro_name);
}
@@ -979,7 +978,7 @@ read_macro(YYSTYPE *valp, PARROT_INTERP, void *yyscanner)
c = yylex_skip(valp, interp, " ", yyscanner);
if (c != IDENTIFIER)
- IMCC_fataly(interp, E_SyntaxError, "Macro names must be identifiers");
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "Macro names must be identifiers");
IMCC_INFO(interp)->cur_macro_name = valp->s;
start_line = IMCC_INFO(interp)->line++;
@@ -1003,7 +1002,7 @@ read_macro(YYSTYPE *valp, PARROT_INTERP, void *yyscanner)
int elem_len;
if (c <= 0)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"File ended before macro '%s' was complete",
IMCC_INFO(interp)->cur_macro_name);
@@ -1144,7 +1143,7 @@ expand_macro(PARROT_INTERP, ARGIN(const char *name), void *yyscanner)
if (c != '(') {
if (m->params.num_param != 0)
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"Macro '%s' needs %d arguments",
name, m->params.num_param);
unput(c);
@@ -1165,7 +1164,7 @@ expand_macro(PARROT_INTERP, ARGIN(const char *name), void *yyscanner)
}
if (frame->expansion.num_param != m->params.num_param) {
- IMCC_fataly(interp, E_SyntaxError,
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"Macro '%s' requires %d arguments, but %d given",
name, m->params.num_param, frame->expansion.num_param);
}
@@ -1219,7 +1218,7 @@ include_file(PARROT_INTERP, char *file_name, void *yyscanner)
FILE *file;
if (!s || !(file = fopen(s, "r")))
- IMCC_fataly(interp, E_IOError, strerror(errno));
+ IMCC_fataly(interp, EXCEPTION_EXTERNAL_ERROR, strerror(errno));
mem_sys_free(s);
frame->s.file = file_name;
Oops, something went wrong.

0 comments on commit 2255840

Please sign in to comment.