Annotation of parser3/src/main/compile.C, revision 1.69.2.6.2.4
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.4! paf 8: static const char* IDENT_COMPILE_C="$Date: 2003/03/21 13:42:29 $";
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.4! paf 17: VStateless_class& Request::compile(VStateless_class* aclass, const char* source, const char* file) {
1.7 paf 18: // prepare to parse
1.69.2.6.2.3 paf 19: parse_control pc(*this, aclass, source, file);
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.15 paf 24: if(pc.col==0) { // expecting something after EOL means they've expected it BEFORE
25: // step back. -1 col means EOL
1.8 paf 26: pc.line--;
1.16 paf 27: pc.col=-1;
28: }
1.63 paf 29: throw Exception("parser.compile",
1.69.2.6.2.2 paf 30: 0,
1.62 paf 31: "%s(%d:%d): %s", file, 1+pc.line, pc.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: