ceptr
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
process.h
Go to the documentation of this file.
1 
13 #ifndef _CEPTR_PROCESS_H
14 #define _CEPTR_PROCESS_H
15 
16 #include "tree.h"
17 
18 enum ReductionError {Ascend=-1,Descend=-2,Pushed=-3,Pop=-4,Eval=-5,Block=-6,Done=0,noReductionErr=0,redoReduction,raiseReductionErr,tooFewParamsReductionErr=TOO_FEW_PARAMS_ERR_ID,tooManyParamsReductionErr=TOO_MANY_PARAMS_ERR_ID,signatureMismatchReductionErr=SIGNATURE_MISMATCH_ERR_ID,notProcessReductionError=NOT_A_PROCESS_ERR_ID,divideByZeroReductionErr=ZERO_DIVIDE_ERR_ID,notInSignalContextReductionError=NOT_IN_SIGNAL_CONTEXT_ERR_ID,incompatibleTypeReductionErr=INCOMPATIBLE_TYPE_ERR_ID,unixErrnoReductionErr=UNIX_ERRNO_ERR_ID,deadStreamReadReductionErr=DEAD_STREAM_READ_ERR_ID,missingSemanticMapReductionErr=MISSING_SEMANTIC_MAP_ERR_ID,mismatchSemanticMapReductionErr=MISMATCH_SEMANTIC_MAP_ERR_ID,structureMismatchReductionErr=STRUCTURE_MISMATCH_ERR_ID//,conversatonCompletedReductionErr=CONVERSATION_COMPLETED_ERR_ID
19 };
20 
21 enum QueueError {noErr = 0, contextNotFoundErr};
22 
23 enum MagicProcesses {MagicReceptors,MagicQuit,MagicDebug};
24 
25 enum IterationPhase {EvalCondition,EvalBody};
26 enum IterationType {IterateTypeCount,IterateTypeUnknown,IterateTypeCond,IterateTypeOnSymbol};
27 typedef struct IterationState {
28  T *code;
29  int phase;
30  int count;
31  int type;
33 
34 enum CondPhase {EvalCondCondtions,EvalCondResult};
35 typedef struct CondState {
36  int phase;
37  T *conditions;
38 } CondState;
39 
40 T *defaultRequestUntil();
41 R *__p_make_context(T *run_tree,R *caller,int process_id,T *sem_map);
42 Error _p_step(Q *q, R **contextP);
43 void _p_fill_from_match(SemTable *sem,T *t,T *match_results,T *match_tree);
44 Error __p_check_signature(SemTable *sem,Process p,T *params,T *sem_map);
45 Error __p_reduce_sys_proc(R *context,Symbol s,T *code,Q *q);
46 void _p_enqueue(Qe **listP,Qe *e);
47 Qe *__p_find_context(Qe *e,int process_id);
48 void __p_unblock(Q *q,Qe *e,Error err);
49 Error _p_unblock(Q *q,int id);
50 void _p_wakeup(Q *q,T *wakeup, T *with,Error err);
51 Error _p_reduce(SemTable *sem,T *run_tree);
52 Q *_p_newq(Receptor *r);
53 void _p_freeq(Q *q);
54 void _p_free_context(R *c);
55 #define _p_addrt2q(q,t) __p_addrt2q(q,t,NULL);
56 Qe *__p_addrt2q(Q *q,T *t,T *sem_map);
57 Error _p_reduceq(Q *q);
58 void *_p_reduceq_thread(void *arg);
59 T *_p_make_run_tree(SemTable *sem,Process p,T *params,T *sem_map);
60 T *__p_build_wakeup_info(T *code_point,int process_id);
61 T *__p_build_run_tree(T* code,int num_params,...);
62 void _p_cleanup(Q *q);
63 #define __p_make_signature(output_label,output_type,output_sem,...) __p_make_form(PROCESS_SIGNATURE,output_label,output_type,output_sem,__VA_ARGS__)
64 T *__p_make_form(Symbol sym,char *output_label,Symbol output_type,SemanticID output_sem,...);
65 #endif
66 
T * __p_build_wakeup_info(T *code_point, int process_id)
Definition: process.c:1931
Definition: ceptr_types.h:114
Qe * __p_addrt2q(Q *q, T *t, T *sem_map)
Definition: process.c:2068
Definition: ceptr_types.h:206
T * _p_make_run_tree(SemTable *sem, Process p, T *params, T *sem_map)
Definition: process.c:1974
Error __p_check_signature(SemTable *sem, Process p, T *params, T *sem_map)
Definition: process.c:291
Error _p_reduceq(Q *q)
Definition: process.c:2126
semantic trees header file
Error __p_reduce_sys_proc(R *context, Symbol s, T *code, Q *q)
Definition: process.c:395
Error _p_reduce(SemTable *sem, T *run_tree)
Definition: process.c:1506
Q * _p_newq(Receptor *r)
Definition: process.c:2015
void _p_fill_from_match(SemTable *sem, T *t, T *match_results, T *match_tree)
Definition: process.c:76
Error _p_unblock(Q *q, int id)
Definition: process.c:1426
R * __p_make_context(T *run_tree, R *caller, int process_id, T *sem_map)
Definition: process.c:1345
T * __p_make_form(Symbol sym, char *output_label, Symbol output_type, SemanticID output_sem,...)
Definition: process.c:2235
void * _p_reduceq_thread(void *arg)
Definition: process.c:2089
void _p_cleanup(Q *q)
Definition: process.c:2208
Definition: ceptr_types.h:168
void _p_freeq(Q *q)
Definition: process.c:2055
Error _p_step(Q *q, R **contextP)
Definition: process.c:1578
void _p_wakeup(Q *q, T *wakeup, T *with, Error err)
Definition: process.c:1458