This directory contains a small example of how to generate and compile a labcomm endpoint on the fly. the script static.sh builds and runs a very simple static labcomm demo the script dynamic.sh builds and runs an example where labcomm is generated and woven togerther with user-defined handler code. the test.sh script builds and runs the TestLabCommGen, which illustrates the on-the-fly compilation to RAM, reading the labcomm declarations and handlers from file The handlers declaration (in handlers.txt) is experimental, and has the following format: <sample name>:handler(<data type> <variable name>) { <handler method code> }### where the end marker (}###) is a kludge to avoid having to parse the method body while still allowing it to contain blocks. Thus, having the sequence "}###" in the method body breaks this. Caveat hacker! An example handlers declaration: foo:handler(foo value) { System.out.println("foo handler from handlers.txt"); System.out.println(value.x); System.out.println(value.y); System.out.println(value.z); for(int i=0; i<value.x; i++){ System.out.print("."+(value.x-i)); } System.out.println(); }### bar:handler(int value) { System.out.println(value); }### Note that parameters differ: the value for foo is an object but for bar it is a primitive type (int) value.
Forked from
Anders Blomdell / LabComm
429 commits behind the upstream repository.
Name | Last commit | Last update |
---|---|---|
.. | ||
test | ||
README | ||
dynamic.sh | ||
handlers.txt | ||
handlers2.txt | ||
simple.lc | ||
static.sh | ||
test.sh |