Skip to content

Commit

Permalink
renamed LISTENER -> EXPECTATION
Browse files Browse the repository at this point in the history
the EXPECTATION semtrex symbol is now PATTERN
  • Loading branch information
zippy committed Nov 13, 2015
1 parent 07ad683 commit 632fce5
Show file tree
Hide file tree
Showing 19 changed files with 97 additions and 97 deletions.
2 changes: 1 addition & 1 deletion doxy/sys_processes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<tr><td><a name="ITERATE"></a>ITERATE</td><td><ol><li>condtion(PROCESS:<a href="ref_sys_symbols.html#BOOLEAN">BOOLEAN</a>)</li><li>do(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</li></ol></td><td>result(PASSTHRU:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</td><td><i>iterate a process</i><br /> this process checks the structure of the result of the "condition" param, if it's a BOOLEAN, it treats the iteration as a while loop and iterates until the BOOLEAN is false; if it's an INTEGER it treats the iteration as repeat loop and iterates as many times as the value of the INTEGER</td></tr>
<tr><td><a name="SAY"></a>SAY</td><td><ol><li>to(SYMBOL:<a href="ref_sys_symbols.html#RECEPTOR_ADDRESS">RECEPTOR_ADDRESS</a>)</li><li>on(SYMBOL:<a href="ref_sys_symbols.html#ASPECT">ASPECT</a>)</li><li>message(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</li></ol></td><td>signal id(SYMBOL:<a href="ref_sys_symbols.html#SIGNAL_UUID">SIGNAL_UUID</a>)</td><td><i>send a message to a receptor</i></td></tr>
<tr><td><a name="REQUEST"></a>REQUEST</td><td><ol><li>of(SYMBOL:<a href="ref_sys_symbols.html#RECEPTOR_ADDRESS">RECEPTOR_ADDRESS</a>)</li><li>on(SYMBOL:<a href="ref_sys_symbols.html#ASPECT">ASPECT</a>)</li><li>message(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</li><li>respond on(SYMBOL:<a href="ref_sys_symbols.html#RESPONSE_CARRIER">RESPONSE_CARRIER</a>)</li><li>[until(SYMBOL:<a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>)]</li><li>[callback(PROCESS:<a href="ref_sys_symbols.html#NULL_SYMBOL">NULL_SYMBOL</a>)]</li></ol></td><td>response(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</td><td><i>send a request to a receptor</i><br /> if there is no "callback" param, then this process will block until the result comes back or the "until" causes cleanup of pending request.</td></tr>
<tr><td><a name="LISTEN"></a>LISTEN</td><td><ol><li>on(SYMBOL:<a href="ref_sys_symbols.html#ASPECT">ASPECT</a>)</li><li>for(SYMBOL:<a href="ref_sys_symbols.html#CARRIER">CARRIER</a>)</li><li>match(SYMBOL:<a href="ref_sys_symbols.html#EXPECTATION">EXPECTATION</a>)</li><li>[do(SYMBOL:<a href="ref_sys_symbols.html#ACTION">ACTION</a>)]</li><li>[with(SYMBOL:<a href="ref_sys_symbols.html#PARAMS">PARAMS</a>)]</li><li>[until(SYMBOL:<a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>)]</li></ol></td><td>error(SYMBOL:<a href="ref_sys_symbols.html#REDUCTION_ERROR_SYMBOL">REDUCTION_ERROR_SYMBOL</a>)</td><td><i>plant a listener</i><br /> If you don't provide an action, the assumption is that the LISTEN process will block and will reduce to the SEMTREX_MATCH. This will also force the END_CONDITIONS/REPETITIONS to ONCE</td></tr>
<tr><td><a name="LISTEN"></a>LISTEN</td><td><ol><li>on(SYMBOL:<a href="ref_sys_symbols.html#ASPECT">ASPECT</a>)</li><li>for(SYMBOL:<a href="ref_sys_symbols.html#CARRIER">CARRIER</a>)</li><li>match(SYMBOL:<a href="ref_sys_symbols.html#PATTERN">PATTERN</a>)</li><li>[do(SYMBOL:<a href="ref_sys_symbols.html#ACTION">ACTION</a>)]</li><li>[with(SYMBOL:<a href="ref_sys_symbols.html#PARAMS">PARAMS</a>)]</li><li>[until(SYMBOL:<a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>)]</li></ol></td><td>error(SYMBOL:<a href="ref_sys_symbols.html#REDUCTION_ERROR_SYMBOL">REDUCTION_ERROR_SYMBOL</a>)</td><td><i>plant a listener</i><br /> If you don't provide an action, the assumption is that the LISTEN process will block and will reduce to the SEMTREX_MATCH. This will also force the END_CONDITIONS/REPETITIONS to ONCE</td></tr>
<tr><td><a name="RESPOND"></a>RESPOND</td><td><ol><li>response contents(ANY:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</li></ol></td><td>response id(SYMBOL:<a href="ref_sys_symbols.html#SIGNAL_UUID">SIGNAL_UUID</a>)</td><td><i>respond to signal</i></td></tr>
<tr><td><a name="QUOTE"></a>QUOTE</td><td><ol><li>process(PROCESS:<a href="ref_sys_symbols.html#NULL_PROCESS">NULL_PROCESS</a>)</li></ol></td><td>result(PASSTHRU:<a href="ref_sys_symbols.html#NULL_STRUCTURE">NULL_STRUCTURE</a>)</td><td><i>quote a process so that it can be passed as a value</i></td></tr>
<tr><td><a name="INTERPOLATE_FROM_MATCH"></a>INTERPOLATE_FROM_MATCH</td><td><ol></ol></td><td>result(STRUCTURE:<a href="ref_sys_symbols.html#TREE">TREE</a>)</td><td><i>interploate match result in place</i></td></tr>
Expand Down
4 changes: 2 additions & 2 deletions doxy/sys_structures.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<tr><td><a name="TUPLE_OF_PROCESS_IDENT_AND_CODE_PATH"></a>TUPLE-OF-PROCESS-IDENT-AND-CODE-PATH</td><td>SEQ(<a href="ref_sys_symbols.html#PROCESS_IDENT">PROCESS_IDENT</a>, <a href="ref_sys_symbols.html#CODE_PATH">CODE_PATH</a>)</td><td></td></tr>
<tr><td><a name="LIST_OF_SIGNAL_UUID_AND_CARRIER_AND_WAKEUP_REFERENCE_AND_END_CONDITIONS"></a>LIST-OF-SIGNAL-UUID-AND-CARRIER-AND-WAKEUP-REFERENCE-AND-END-CONDITIONS</td><td>SEQ(<a href="ref_sys_symbols.html#SIGNAL_UUID">SIGNAL_UUID</a>, <a href="ref_sys_symbols.html#CARRIER">CARRIER</a>, <a href="ref_sys_symbols.html#WAKEUP_REFERENCE">WAKEUP_REFERENCE</a>, <a href="ref_sys_symbols.html#END_CONDITIONS">END_CONDITIONS</a>)</td><td></td></tr>
<tr><td><a name="ZERO_OR_MORE_OF_PENDING_RESPONSE"></a>ZERO-OR-MORE-OF-PENDING-RESPONSE</td><td>*(<a href="ref_sys_symbols.html#PENDING_RESPONSE">PENDING_RESPONSE</a>)</td><td></td></tr>
<tr><td><a name="ZERO_OR_MORE_OF_LISTENER"></a>ZERO-OR-MORE-OF-LISTENER</td><td>*(<a href="ref_sys_symbols.html#LISTENER">LISTENER</a>)</td><td></td></tr>
<tr><td><a name="ZERO_OR_MORE_OF_EXPECTATION"></a>ZERO-OR-MORE-OF-EXPECTATION</td><td>*(<a href="ref_sys_symbols.html#EXPECTATION">EXPECTATION</a>)</td><td></td></tr>
<tr><td><a name="LIST_OF_PROCESS_NAME_AND_PROCESS_INTENTION_AND_PROCESS_AND_PROCESS_SIGNATURE"></a>LIST-OF-PROCESS-NAME-AND-PROCESS-INTENTION-AND-PROCESS-AND-PROCESS-SIGNATURE</td><td>SEQ(<a href="ref_sys_symbols.html#PROCESS_NAME">PROCESS_NAME</a>, <a href="ref_sys_symbols.html#PROCESS_INTENTION">PROCESS_INTENTION</a>, <a href="ref_sys_symbols.html#PROCESS">PROCESS</a>, <a href="ref_sys_symbols.html#PROCESS_SIGNATURE">PROCESS_SIGNATURE</a>)</td><td></td></tr>
<tr><td><a name="ZERO_OR_MORE_OF_PROCESS_CODING"></a>ZERO-OR-MORE-OF-PROCESS-CODING</td><td>*(<a href="ref_sys_symbols.html#PROCESS_CODING">PROCESS_CODING</a>)</td><td></td></tr>
<tr><td><a name="ONE_OF_SIGNATURE_STRUCTURE_AND_SIGNATURE_SYMBOL_AND_SIGNATURE_PROCESS_AND_SIGNATURE_PASSTHRU"></a>ONE-OF-SIGNATURE-STRUCTURE-AND-SIGNATURE-SYMBOL-AND-SIGNATURE-PROCESS-AND-SIGNATURE-PASSTHRU</td><td>SET(<a href="ref_sys_symbols.html#SIGNATURE_STRUCTURE">SIGNATURE_STRUCTURE</a>, <a href="ref_sys_symbols.html#SIGNATURE_SYMBOL">SIGNATURE_SYMBOL</a>, <a href="ref_sys_symbols.html#SIGNATURE_PROCESS">SIGNATURE_PROCESS</a>, <a href="ref_sys_symbols.html#SIGNATURE_PASSTHRU">SIGNATURE_PASSTHRU</a>)</td><td></td></tr>
Expand All @@ -49,7 +49,7 @@
<tr><td><a name="TUPLE_OF_SIGNATURE_LABEL_AND_SIGNATURE_OUTPUT_TYPE"></a>TUPLE-OF-SIGNATURE-LABEL-AND-SIGNATURE-OUTPUT-TYPE</td><td>SEQ(<a href="ref_sys_symbols.html#SIGNATURE_LABEL">SIGNATURE_LABEL</a>, <a href="ref_sys_symbols.html#SIGNATURE_OUTPUT_TYPE">SIGNATURE_OUTPUT_TYPE</a>)</td><td></td></tr>
<tr><td><a name="TUPLE_OF_OUTPUT_SIGNATURE_AND_ZERO_OR_MORE_OF_INPUT_SIGNATURE"></a>TUPLE-OF-OUTPUT-SIGNATURE-AND-ZERO-OR-MORE-OF-INPUT-SIGNATURE</td><td>SEQ(<a href="ref_sys_symbols.html#OUTPUT_SIGNATURE">OUTPUT_SIGNATURE</a>, *(<a href="ref_sys_symbols.html#INPUT_SIGNATURE">INPUT_SIGNATURE</a>))</td><td></td></tr>
<tr><td><a name="SEQUENCE"></a>SEQUENCE</td><td>+(<a href="ref_sys_symbols.html#STEP_SYMBOL">STEP_SYMBOL</a>)</td><td></td></tr>
<tr><td><a name="PROTOCOL_STEP"></a>PROTOCOL_STEP</td><td>SEQ(<a href="ref_sys_symbols.html#EXPECTATION">EXPECTATION</a>, <a href="ref_sys_symbols.html#PARAMS">PARAMS</a>, <a href="ref_sys_symbols.html#ACTION">ACTION</a>)</td><td></td></tr>
<tr><td><a name="PROTOCOL_STEP"></a>PROTOCOL_STEP</td><td>SEQ(<a href="ref_sys_symbols.html#PATTERN">PATTERN</a>, <a href="ref_sys_symbols.html#PARAMS">PARAMS</a>, <a href="ref_sys_symbols.html#ACTION">ACTION</a>)</td><td></td></tr>
<tr><td><a name="ONE_OR_MORE_OF_INTERACTION"></a>ONE-OR-MORE-OF-INTERACTION</td><td>+(<a href="ref_sys_symbols.html#INTERACTION">INTERACTION</a>)</td><td></td></tr>
<tr><td><a name="PROTOCOL"></a>PROTOCOL</td><td>SEQ(<a href="ref_sys_symbols.html#STEPS">STEPS</a>, <a href="ref_sys_symbols.html#SEQUENCES">SEQUENCES</a>)</td><td></td></tr>
<tr><td><a name="LIST_OF_ZERO_OR_ONE_OF_RECEPTOR_ELAPSED_TIME"></a>LIST-OF-ZERO-OR-ONE-OF-RECEPTOR-ELAPSED-TIME</td><td>SEQ(?(<a href="ref_sys_symbols.html#RECEPTOR_ELAPSED_TIME">RECEPTOR_ELAPSED_TIME</a>))</td><td></td></tr>
Expand Down
6 changes: 3 additions & 3 deletions doxy/sys_symbols.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
<tr><td><a name="PENDING_RESPONSE"></a>PENDING_RESPONSE</td><td><a href="ref_sys_structures.html#LIST_OF_SIGNAL_UUID_AND_CARRIER_AND_WAKEUP_REFERENCE_AND_END_CONDITIONS">LIST-OF-SIGNAL-UUID-AND-CARRIER-AND-WAKEUP-REFERENCE-AND-END-CONDITIONS</a></td><td></td></tr>
<tr><td><a name="PENDING_RESPONSES"></a>PENDING_RESPONSES</td><td><a href="ref_sys_structures.html#ZERO_OR_MORE_OF_PENDING_RESPONSE">ZERO-OR-MORE-OF-PENDING-RESPONSE</a></td><td></td></tr>
<tr><td><a name="RESPONSE_CARRIER"></a>RESPONSE_CARRIER</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td> expected carrier for the response to a signal</td></tr>
<tr><td><a name="LISTENER"></a>LISTENER</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td> surface of the listener is the carrier symbol, and it has two children_ID, expectation semtrex and action code tree</td></tr>
<tr><td><a name="LISTENERS"></a>LISTENERS</td><td><a href="ref_sys_structures.html#ZERO_OR_MORE_OF_LISTENER">ZERO-OR-MORE-OF-LISTENER</a></td><td> list of carrier/expectation/action tress that "listen" to changes on the flux</td></tr>
<tr><td><a name="EXPECTATION"></a>EXPECTATION</td><td><a href="ref_sys_structures.html#SEMTREX">SEMTREX</a></td><td> expectation is a semtrex (thus has one child which is the first part of the semtrex)</td></tr>
<tr><td><a name="EXPECTATION"></a>EXPECTATION</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td> surface of the listener is the carrier symbol, and it has two children_ID, expectation semtrex and action code tree</td></tr>
<tr><td><a name="EXPECTATIONS"></a>EXPECTATIONS</td><td><a href="ref_sys_structures.html#ZERO_OR_MORE_OF_EXPECTATION">ZERO-OR-MORE-OF-EXPECTATION</a></td><td> list of carrier/expectation/action tress that "listen" to changes on the flux</td></tr>
<tr><td><a name="PATTERN"></a>PATTERN</td><td><a href="ref_sys_structures.html#SEMTREX">SEMTREX</a></td><td> expectation is a semtrex (thus has one child which is the first part of the semtrex)</td></tr>
<tr><td><a name="ACTION"></a>ACTION</td><td><a href="ref_sys_structures.html#PROCESS">PROCESS</a></td><td> code tree_ID, which specifies the action to perform when an expectation's semtrex matches</td></tr>
<tr><td><a name="INTERPOLATE_SYMBOL"></a>INTERPOLATE_SYMBOL</td><td><a href="ref_sys_structures.html#SYMBOL">SYMBOL</a></td><td> a place holder to indicate which symbol to insert into this part of the tree</td></tr>
<tr><td><a name="PROCESS_NAME"></a>PROCESS_NAME</td><td><a href="ref_sys_structures.html#CSTRING">CSTRING</a></td><td></td></tr>
Expand Down
2 changes: 1 addition & 1 deletion spec/http_example.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ T *parseHTML(char *html) {

/////////////////////////////////////////////////////
// build the token stream out of an ascii stream
// EXPECTATION
// PATTERN
T *s;
char *stx = "/ASCII_CHARS/<HTML_TOKENS:(ASCII_CHAR='<',<HTML_TOK_TAG_SELFCLOSE:ASCII_CHAR!={'>',' '}+>,<HTML_ATTRIBUTES:(ASCII_CHAR=' ',<HTML_ATTRIBUTE:<PARAM_KEY:ASCII_CHAR!={'>',' ','='}+>,ASCII_CHAR='=',ASCII_CHAR='\"',<PARAM_VALUE:ASCII_CHAR!='\"'+>,ASCII_CHAR='\"'>)*>,ASCII_CHAR='/',ASCII_CHAR='>'|ASCII_CHAR='<',ASCII_CHAR='/',<HTML_TOK_TAG_CLOSE:ASCII_CHAR!='>'+>,ASCII_CHAR='>'|ASCII_CHAR='<',<HTML_TOK_TAG_OPEN:ASCII_CHAR!={'>',' '}+>,<HTML_ATTRIBUTES:(ASCII_CHAR=' ',<HTML_ATTRIBUTE:<PARAM_KEY:ASCII_CHAR!={'>',' ','='}+>,ASCII_CHAR='=',ASCII_CHAR='\"',<PARAM_VALUE:ASCII_CHAR!='\"'+>,ASCII_CHAR='\"'>)*>,ASCII_CHAR='>'|<HTML_TEXT:ASCII_CHAR!='<'+>)+>";

Expand Down
2 changes: 1 addition & 1 deletion spec/mtree_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void testMTreeReceptor() {
spec_is_ptr_equal(*(Receptor **)_m_surface(hr),r);
spec_is_ptr_equal(_t_surface(t2),r);

spec_is_str_equal(t2s(t2),"(TEST_RECEPTOR_SYMBOL:{(TEST_RECEPTOR_SYMBOL (DEFINITIONS (STRUCTURES) (SYMBOLS) (PROCESSES) (PROTOCOLS) (SCAPES)) (ASPECTS) (FLUX (ASPECT:1 (LISTENERS) (SIGNALS))) (RECEPTOR_STATE) (PENDING_SIGNALS) (PENDING_RESPONSES))})");
spec_is_str_equal(t2s(t2),"(TEST_RECEPTOR_SYMBOL:{(TEST_RECEPTOR_SYMBOL (DEFINITIONS (STRUCTURES) (SYMBOLS) (PROCESSES) (PROTOCOLS) (SCAPES)) (ASPECTS) (FLUX (ASPECT:1 (EXPECTATIONS) (SIGNALS))) (RECEPTOR_STATE) (PENDING_SIGNALS) (PENDING_RESPONSES))})");

_t_free(t);
_t_free(t2);
Expand Down
8 changes: 4 additions & 4 deletions spec/process_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ void testProcessListen() {
T *n = _t_new_root(LISTEN);
_t_newi(n,ASPECT,DEFAULT_ASPECT);
_t_news(n,CARRIER,TICK);
T *match = _t_newr(n,EXPECTATION);
T *match = _t_newr(n,PATTERN);
_sl(match,TICK);
T *a = _t_newp(n,ACTION,NOOP);
_t_newi(a,TEST_INT_SYMBOL,314);
Expand All @@ -887,15 +887,15 @@ void testProcessListen() {
_t_free(n);

T *l = __r_get_listeners(r,DEFAULT_ASPECT);
spec_is_str_equal(t2s(l),"(LISTENERS (LISTENER:TICK (EXPECTATION (SEMTREX_SYMBOL_LITERAL (SEMTREX_SYMBOL:TICK))) (PARAMS (INTERPOLATE_SYMBOL:NULL_SYMBOL)) (ACTION:NOOP (TEST_INT_SYMBOL:314))))");
spec_is_str_equal(t2s(l),"(EXPECTATIONS (EXPECTATION:TICK (PATTERN (SEMTREX_SYMBOL_LITERAL (SEMTREX_SYMBOL:TICK))) (PARAMS (INTERPOLATE_SYMBOL:NULL_SYMBOL)) (ACTION:NOOP (TEST_INT_SYMBOL:314))))");

_r_remove_listener(r, _t_child(l,1));

// test listen that blocks
n = _t_new_root(LISTEN);
_t_newi(n,ASPECT,DEFAULT_ASPECT);
_t_news(n,CARRIER,TEST_STR_SYMBOL);
match = _t_newr(n,EXPECTATION);
match = _t_newr(n,PATTERN);
_sl(match,TEST_STR_SYMBOL);

G_next_process_id = 0; // reset the process ids so the test will always work
Expand All @@ -910,7 +910,7 @@ void testProcessListen() {
spec_is_ptr_equal(q->blocked,e);
spec_is_str_equal(t2s(run_tree),"(RUN_TREE (process:LISTEN) (PARAMS))");

spec_is_str_equal(t2s(__r_get_listeners(r,DEFAULT_ASPECT)),"(LISTENERS (LISTENER:TEST_STR_SYMBOL (EXPECTATION (SEMTREX_SYMBOL_LITERAL (SEMTREX_SYMBOL:TEST_STR_SYMBOL))) (PARAMS (INTERPOLATE_SYMBOL:NULL_SYMBOL)) (WAKEUP_REFERENCE (PROCESS_IDENT:1) (CODE_PATH:/1))))");
spec_is_str_equal(t2s(__r_get_listeners(r,DEFAULT_ASPECT)),"(EXPECTATIONS (EXPECTATION:TEST_STR_SYMBOL (PATTERN (SEMTREX_SYMBOL_LITERAL (SEMTREX_SYMBOL:TEST_STR_SYMBOL))) (PARAMS (INTERPOLATE_SYMBOL:NULL_SYMBOL)) (WAKEUP_REFERENCE (PROCESS_IDENT:1) (CODE_PATH:/1))))");

T *s = __r_make_signal(0,0,DEFAULT_ASPECT,_t_new_str(0,TEST_STR_SYMBOL,"fishy!"),0,0);
_r_deliver(r,s);
Expand Down
Loading

0 comments on commit 632fce5

Please sign in to comment.