--- parser3/src/main/compile.C 2001/02/21 07:19:40 1.5 +++ parser3/src/main/compile.C 2001/02/21 11:13:16 1.7 @@ -1,5 +1,5 @@ /* - $Id: compile.C,v 1.5 2001/02/21 07:19:40 paf Exp $ + $Id: compile.C,v 1.7 2001/02/21 11:13:16 paf Exp $ */ #include "pa_string.h" @@ -20,24 +20,30 @@ Array *real_compile(COMPILE_PARAMS) { Pool& pool=request.pool(); - yydebug=1; + // prepare to parse struct parse_control pc; - /* input */ + // input pc.pool=&pool; - pc.exception=&request.exception(); + pc.methods=new(pool) Array(pool); + // create new 'name' vclass, add it to request's classes pc.source=source; #ifndef NO_STRING_ORIGIN pc.file=file; - pc.line=pc.col=1; + pc.line=pc.col=0; #endif - /* state to initial */ + // initialise state pc.pending_state=0; pc.string=new(pool) String(pool); pc.ls=LS_USER; pc.sp=0; - /* parse! */ - yyparse(&pc); - /* result */ - return pc.result; + // parse! + yydebug=1; + if(yyparse(&pc)) // error? + request.exception().raise(0,0, + 0, + "%s @%s[%d:%d]", pc.error, file, 1+pc.line, pc.col/*already+1*/); + + // result + return pc.methods; }