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

1.1       paf         1: /*
1.3     ! paf         2:   $Id: compile.C,v 1.2 2001/02/20 19:21:13 paf Exp $
1.1       paf         3: */
                      4: 
1.3     ! paf         5: #include "pa_string.h"
1.1       paf         6: #include "pa_array.h"
                      7: #include "code.h"
                      8: #include "compile_tools.h"
                      9: #include "compile.h"
                     10: 
                     11: #include <stdio.h>
                     12: 
                     13: extern int yydebug;
                     14: extern int yyparse (void *);
                     15: 
                     16: Array *real_compile(COMPILE_PARAMS) {
1.2       paf        17:        if(!source)
                     18:                return 0;
                     19: 
1.1       paf        20:        yydebug=1;
                     21:        struct parse_control pc;
                     22:        /* input */
                     23:        pc.pool=pool;
                     24:        pc.source=source;
                     25: #ifndef NO_STRING_ORIGIN
                     26:        pc.file=file;
                     27:        pc.line=1;
                     28: #endif
                     29:        /* state to initial */
                     30:        pc.pending_state=0;
1.3     ! paf        31:        pc.string=new(*pool) String(*pool);
1.1       paf        32:        pc.ls=LS_USER;
                     33:        pc.sp=0;
                     34:        /* parse! */
1.2       paf        35:        int parse_error=yyparse(&pc);
1.1       paf        36:        /* result */
1.2       paf        37:        return parse_error?0:static_cast<Array *>(pc.result);
1.1       paf        38: }

E-mail: