Overview
Foundations
Examples / Case Study
- PicWeb
- MDD4DRES
java (≥ 1.5), bash-like shell
We're aware that the implementation of this compiler is quick'n dirty.
The compiler will transform a code written using the ADORE Textual DSL into a valid Prolog code (according to the facts).
It uses as input a file name containing the Adore code. The compiler prints on its standard output the associated facts representation.
We'll consider here the following fragment, written in a fragment.adore file:
fragment f { variables { in as struct; out as struct; } activities { h. out := hook(in);} relations { ^ < h; h < $;} }
To invoke the compiler, you just have to invoke the adore2facts.sh bash script:
mosser@asmodeus:~$ adore2facts.sh fragment.adore > fragment.pl
Here is the content of the fragment.pl file, containing the associated prolog facts:
:- createProcess(f), setAsFragment(f), createActivity(f_preds), setActivityKind(f_preds,predecessors), setContainment(f_preds,f), createActivity(f_succs), setActivityKind(f_succs,successors), setContainment(f_succs,f), createVariable(f_in), setVariableType(f_in,struct), traceRename(variable,in,f_in,compile(f)), createVariable(f_out), setVariableType(f_out,struct), traceRename(variable,out,f_out,compile(f)), createActivity(f_h), setActivityKind(f_h,hook), addAsInput(f_in,f_h), addAsOutput(f_out,f_h), setContainment(f_h,f), traceRename(activity,h,f_h,compile(f)), defWaitFor(f_h,f_preds), defWaitFor(f_succs,f_h).
antlr sub-directorymosser@asmodeus:~/tmp$ cd $ADORE_HOME mosser@asmodeus:~/repositories/adore$ cd antlr
build.sh scriptmosser@asmodeus:~/repositories/adore/antlr$ ./build.sh #### ## Generating Java Source file ## Compiling generated Java Code ## Creating JAR file #### mosser@asmodeus:~/repositories/adore/antlr$