int frontend_owfn_error ( const char *  msg  ) 

signal a syntax error

This function is invoked by the parser and the lexer during the syntax analysis. When an error occurs, it prints an accordant message and shows the lines of the input files where the error occured.

Parameters:
msg a message (mostly "Parse error") and some more information e.g. the location of the syntax error.
Returns:
1, since an error occured

Definition at line 277 of file debug.cc.

References debug_level, colorconsole::fg_blue(), colorconsole::fg_standard(), globals::filename, globals::last_error_line, globals::last_error_token, toString(), TRACE_ERROR, and TRACE_WARNINGS.

00278 { 
00279   /* defined by flex */
00280   extern int frontend_owfn_lineno;      // line number of current token
00281   extern char *frontend_owfn_text;      // text of the current token
00282 
00283   cerr << colorconsole::fg_blue;
00284   cerr << globals::filename << ":" << frontend_owfn_lineno+1 << " - [SYNTAX]\n";
00285   cerr << colorconsole::fg_standard;
00286 
00287   if (debug_level == TRACE_ERROR)
00288     return 1;
00289 
00290   cerr << string(msg);
00291 
00292   if (debug_level >= TRACE_WARNINGS)
00293     cerr << "; last token read: `" << string(frontend_owfn_text) << "'" << endl << endl;
00294   else
00295     cerr << endl << endl;
00296 
00297   // remember the last token
00298   globals::last_error_token = string(frontend_owfn_text);
00299   globals::last_error_line = toString(frontend_owfn_lineno);
00300 
00301   return 1;
00302 }

Here is the call graph for this function:


Generated on Thu Jan 24 04:01:02 2008 for GNU BPEL2oWFN by  doxygen 1.5.2