Annotation of parser3/src/main/compile.C, revision 1.69.2.6.2.6
1.32 paf 1: /** @file
1.33 paf 2: Parser: compiler part of request class.
3:
1.69.2.4 paf 4: Copyright (c) 2001-2003 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.69.2.6.2.6! paf 8: static const char* IDENT_COMPILE_C="$Date: 2003/04/02 14:16:18 $";
1.1 paf 9:
1.36 paf 10: #include "pa_opcode.h"
1.10 paf 11: #include "pa_request.h"
1.1 paf 12: #include "compile_tools.h"
13:
14: extern int yydebug;
15: extern int yyparse (void *);
16:
1.69.2.6.2.5 paf 17: VStateless_class& Request::compile(VStateless_class* aclass, const char* source, uint file_no) {
1.7 paf 18: // prepare to parse
1.69.2.6.2.6! paf 19: Parse_control pc(*this, aclass, source, file_no);
1.10 paf 20:
1.12 paf 21: // parse=compile!
1.69.2.6 paf 22: //yydebug=1;
1.10 paf 23: if(yyparse(&pc)) { // error?
1.69.2.6.2.6! paf 24: if(pc.pos.col==0) { // expecting something after EOL means they've expected it BEFORE
1.15 paf 25: // step back. -1 col means EOL
1.69.2.6.2.6! paf 26: pc.pos.line--;
! 27: pc.pos.col=-1;
1.16 paf 28: }
1.63 paf 29: throw Exception("parser.compile",
1.69.2.6.2.2 paf 30: 0,
1.69.2.6.2.6! paf 31: "%s(%d:%d): %s", file_list[file_no].cstr(), 1+pc.pos.line, pc.pos.col, pc.error);
1.8 paf 32: }
1.7 paf 33:
34: // result
1.27 paf 35: return *pc.cclass;
1.1 paf 36: }
E-mail: