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