00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #pragma GCC dependency "Makefile" maybe some command line defines have changed
00026
00027 #include "plint.h"
00028 #include "share.h"
00029 #include "error.h"
00030
00031 #include "data.h"
00032 #include "var.h"
00033 #include "stack.h"
00034 #include "flow.h"
00035 #include "action.h"
00036 #include "iterate.h"
00037
00038 #include "misc/file.h"
00039 #include "misc/sys.h"
00040
00041
00042 void plint_start_run()
00043 {
00044 plint_ins.prnt = 0;
00045
00046 plint_code.root->flag = 4;
00047 plint_stack_push(plint_code.root);
00048 plint_stack.bot = plint_stack.top;
00049
00050 PLINT_VAR_ADD(plint_var_dup(plint->data.argo), plint_str_sn(plint_argo_str));
00051 PLINT_VAR_ADD(plint_var_dup(plint->data.argv), plint_str_sn(plint_argv_str));
00052 }
00053
00054 void plint_end_run()
00055 {
00056 }
00057
00058
00059
00060 #include "parse/mygrm.h"
00061 int plint_run_eof()
00062 {
00063 if (plint->flow.ctl.type == PLINT_CTL_NONE)
00064 {
00065 if (plint->act._type == PLINT_ACT_NONE)
00066 {
00067 if (plint->iter == PLINT_ITER_NONE)
00068 goto flow_eof;
00069
00070 switch (plint->iter)
00071 {
00072 case PLINT_ITER_NEXT:
00073 return ITER_NEXT;
00074
00075 case PLINT_ITER_DONE:
00076 return ITER_DONE;
00077
00078 default:
00079 }
00080 assert(0);
00081 return 0;
00082 }
00083
00084 switch (plint->act._type)
00085 {
00086 case PLINT_ACT_DONE:
00087 return ACT_DONE;
00088
00089 case PLINT_ACT_CALL:
00090 case PLINT_ACT_SEEK:
00091 return ACT_REDO;
00092
00093 default:
00094 }
00095 assert(0);
00096 return 0;
00097 }
00098
00099 flow_eof:
00100
00101 switch (plint->flow.ctl.type)
00102 {
00103 case PLINT_CTL_EXIT:
00104 case PLINT_CTL_RETN:
00105 case PLINT_CTL_ESCP:
00106 case PLINT_CTL_BREK:
00107 return RUN_DONE;
00108
00109 default:
00110 if (plint->flow.ctl.count)
00111 return RUN_DONE;
00112 }
00113
00114 if (PLINT_CTRL_LOOP || !PLINT_MAP_BLOCK(EXIT, plint_stack.top->block.src->blk, &plint_stack.top->block))
00115 {
00116 plint->flow.ctl.type = PLINT_CTL_LOOP;
00117 return RUN_REDO;
00118 }
00119
00120 return RUN_DONE;
00121 }