Annotation of parser3/src/main/compile.C, revision 1.80

1.32      paf         1: /** @file
1.33      paf         2:        Parser: compiler part of request class.
                      3: 
1.78      paf         4:        Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com)
1.58      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.64      paf         6: */
1.33      paf         7: 
1.80    ! misha       8: static const char * const IDENT_COMPILE_C="$Date: 2008-06-10 14:06:22 $";
1.1       paf         9: 
1.10      paf        10: #include "pa_request.h"
1.1       paf        11: #include "compile_tools.h"
                     12: 
                     13: extern int yydebug;
                     14: extern int yyparse (void *);
                     15: 
1.79      misha      16: ArrayClass& Request::compile(VStateless_class* aclass, 
1.70      paf        17:                                   const char* source, const String* main_alias, 
1.73      paf        18:                                   uint file_no,
                     19:                                   int line_no_offset) {
1.7       paf        20:        // prepare to parse
1.73      paf        21:        Parse_control pc(*this, aclass, source, main_alias, file_no, line_no_offset);
1.10      paf        22: 
1.12      paf        23:        // parse=compile! 
1.60      paf        24:        //yydebug=1;
1.10      paf        25:        if(yyparse(&pc)) { // error?
1.70      paf        26:                pc.pos_prev_c();
1.75      paf        27:                if(!pc.explicit_result)
                     28:                        if(pc.pos.col==0) // expecting something after EOL means they've expected it BEFORE
                     29:                                pc.pos_prev_c();
1.70      paf        30: 
1.63      paf        31:                throw Exception("parser.compile",
1.6       paf        32:                        0,
1.74      paf        33:                        "%s(%d:%d): %s",  file_list[file_no].cstr(), 1+pc.pos.line, 1+pc.pos.col,  pc.error);
1.8       paf        34:        }
1.7       paf        35: 
                     36:        // result
1.79      misha      37:        return *pc.cclasses;
1.1       paf        38: }

E-mail: