diff options
author | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2012-05-07 20:01:51 (GMT) |
commit | 420d2ef464d4a741028e132e662d5626806a41f5 (patch) | |
tree | 1aca6eb512e4ed0fb5f3c10c528cb998b6ffd695 /toolbin |
Diffstat (limited to 'toolbin')
-rwxr-xr-x | toolbin/dbg_format_pla | 15 | ||||
-rwxr-xr-x | toolbin/dbg_untemplate | 7 | ||||
-rwxr-xr-x | toolbin/extract_weight_dist | 34 | ||||
-rwxr-xr-x | toolbin/gen_include_dep_graph.sh | 19 | ||||
-rwxr-xr-x | toolbin/gen_model_deps.sh | 19 | ||||
-rwxr-xr-x | toolbin/groupact_over_ofreq | 49 | ||||
-rwxr-xr-x | toolbin/topo | 34 | ||||
-rwxr-xr-x | toolbin/transform_dsl.pl | 276 | ||||
-rwxr-xr-x | toolbin/warn_data | 8 |
9 files changed, 461 insertions, 0 deletions
diff --git a/toolbin/dbg_format_pla b/toolbin/dbg_format_pla new file mode 100755 index 0000000..55c7f01 --- /dev/null +++ b/toolbin/dbg_format_pla @@ -0,0 +1,15 @@ +#!/bin/bash + +I="" +while read; do + if echo "$REPLY" | grep -q '^PLA'; then + echo "$I$REPLY" + I=" $I" + else + if echo "$REPLY" | grep -q '^leave'; then + I=$(echo "$I" |sed 's/ //') + else + echo "$I$REPLY" + fi + fi +done
\ No newline at end of file diff --git a/toolbin/dbg_untemplate b/toolbin/dbg_untemplate new file mode 100755 index 0000000..0421452 --- /dev/null +++ b/toolbin/dbg_untemplate @@ -0,0 +1,7 @@ +#!/bin/sh + +sed 's/, mpl_::na//g +s/, boost::tuples::null_type//g +s/boost::tuples::null_type//g +s/boost::mpl:://g +s/mpl_:://g'
\ No newline at end of file diff --git a/toolbin/extract_weight_dist b/toolbin/extract_weight_dist new file mode 100755 index 0000000..5377838 --- /dev/null +++ b/toolbin/extract_weight_dist @@ -0,0 +1,34 @@ +#!/bin/bash + +T0=0 +T1=990 +N=900 + +TOPO=~/rasimu/bin/list_synapses +CP=~/rasimu/bin/default-coarse_replay + +NI=0-99 +NO=88-187 +NWO=$(for i in $(seq 0 99); do echo $(($i * 937 % 800)); done | sort -n | tr "\n" ',' | sed 's/,$//') +NRO=$(for i in $(seq 0 99); do echo $(($i * 967 % 800)); done | sort -n | tr "\n" ',' | sed 's/,$//') +NN=$(seq 0 799 | sort -R | head -n100 | sort -n | tr "\n" ',' | sed 's/,$//') + +SIO=$($TOPO $NI $NO | cut -f1 | head -n$N |sort -n | tr "\n" ',' | sed 's/,$//') +SIN=$($TOPO $NI $NN | cut -f1 | head -n$N |sort -n | tr "\n" ',' | sed 's/,$//') +SNN=$($TOPO $NN $NN | cut -f1 | head -n$N |sort -n | tr "\n" ',' | sed 's/,$//') +SNO=$($TOPO $NN $NO | cut -f1 | head -n$N |sort -n | tr "\n" ',' | sed 's/,$//') +SOO=$($TOPO $NO $NO | cut -f1 | head -n$N |sort -n | tr "\n" ',' | sed 's/,$//') +SIWO=$($TOPO $NI $NWO | cut -f1 | head -n$N |sort -n | tr "\n" ',' | sed 's/,$//') +SROO=$($TOPO $NRO $NO | cut -f1 | head -n$N | sort -n | tr "\n" ',' | sed 's/,$//') + +SMANY=$($TOPO 0-799 0-799 | cut -f1 | head -n5000 | sort -n | tr "\n" ',' | sed 's/,$//') + +$CP Weight $SIO $T1 $(($T1+9)) | tail -n1 | cut -f2-$(($N+1)) +$CP Weight $SIN $T1 $(($T1+9)) | tail -n1 | cut -f2-$(($N+1)) +$CP Weight $SNN $T1 $(($T1+9)) | tail -n1 | cut -f2-$(($N+1)) +$CP Weight $SNO $T1 $(($T1+9)) | tail -n1 | cut -f2-$(($N+1)) +$CP Weight $SOO $T1 $(($T1+9)) | tail -n1 | cut -f2-$(($N+1)) +$CP Weight $SIWO $T1 $(($T1+9)) | tail -n1 | cut -f2-$(($N+1)) +$CP Weight $SROO $T1 $(($T1+9)) | tail -n1 | cut -f2-$(($N+1)) + +$CP Weight $SMANY $T1 $(($T1+9)) | tail -n1 | cut -f2-5001 >&3
\ No newline at end of file diff --git a/toolbin/gen_include_dep_graph.sh b/toolbin/gen_include_dep_graph.sh new file mode 100755 index 0000000..7162944 --- /dev/null +++ b/toolbin/gen_include_dep_graph.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +echo " + +digraph { +rankdir=LR" + +for src in $@; do + # do not include test cases (it makes the graph to dense) + if ! echo $src | grep -q test; then + # only display nodes which use another file (or are used) +# if [ -n "$(grep '#include \"' $src | grep -v '/')" ]; then + echo $(echo $src|tr .- __) ' [label=" '$src' "]' + grep '#include "' $src | grep -v '/' | sed 's/^.*"\([^"]*\)"$/'$src' #> \1/' | tr '#.-' '-__' +# fi + fi +done + +echo "}" diff --git a/toolbin/gen_model_deps.sh b/toolbin/gen_model_deps.sh new file mode 100755 index 0000000..2c5e618 --- /dev/null +++ b/toolbin/gen_model_deps.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +function gi { + I=$(grep include $1 \ + | grep -o '".*"' \ + | tr -d '"' \ + | sed 's/\(.*\)/model\/\1.model/' \ + | tr "\n" " ") + echo -n "$I " + for i in $I; do + gi $i + done +} + +for i in model/*.model; do + echo $i | sed 's/model\/\(.*\)\.model/properties\/\1\/properties.hpp: /' | tr -d "\n" + gi $i + echo +done
\ No newline at end of file diff --git a/toolbin/groupact_over_ofreq b/toolbin/groupact_over_ofreq new file mode 100755 index 0000000..ca0d1cd --- /dev/null +++ b/toolbin/groupact_over_ofreq @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e +#for EXP in \ + # "EligibilityTrace 24456,15746,16263,25347,19718,14985,14090,13186,12802,21251,19844,20352,12930,18568,16128,14987,15109,17281,16269,13187 71688,86404,27521,43524,62594,59787,7174,55424,23182,75779,59778,42241,40711,86414,97665,7812,16899,96135,86403,22528" \ + # "LTPTrace 24456,15746,16263,25347,19718,14985,14090,13186,12802,21251,19844,20352,12930,18568,16128,14987,15109,17281,16269,13187 71688,86404,27521,43524,62594,59787,7174,55424,23182,75779,59778,42241,40711,86414,97665,7812,16899,96135,86403,22528" \ + # "LTDTrace 100,101,103,110,117,118,123,126,127,135,145,154,155,159,166,191,198 137,274,411,548,685,22,159,296,433,570,707,44,181,318,455,592,729"; do + +# for EXP in \ +# "EligibilityTrace 20361,19200,22148,18176,18177,16131,22278,11400,11267,18051,20483,18050,14983,14724,21256,14338,16386,17159,11916,11910,12685,22657,18693,23297,14599,21376,16768,12294,14851,17419,20864,21001,22543,14339,12163,19076,21379,23552,11398,19593,20613,17538,23171,18823,20362,11655,18309,20101,12418,21123,22547,19850,22665,22273,13450,14083,18179,23175,16648,11906,23560,23946,18945,17415,11904,22402,16515,21383,22401,22275,14084,12292,16257,20228,20354,18564,16262,19078,12546,19972,19074,12553,14080,11917,18432,17289,23565,14464,23425,17287,12677,15873,23048,22658,21251,14211,15497,14219,13063,16136 49545,35075,27394,75650,7,74121,8,42757,25856,12931,30472,90759,76298,19077,651,74119,65536,82437,9863,35080,76293,94724,48003,55687,35077,76290,74762,52609,47372,68613,44295,52610,46465,13,14466,40324,44928,2180,69511,67971,75654,61829,97793,48903,6784,12936,51077,74118,87042,80904,44293,85510,74114,17545,47371,74758,16646,51086,30465,12930,76291,6786,44936,33543,83975,63368,77828,40326,38153,49540,20615,67969,20614,3718,32001,96257,8320,73225,6788,66434,52611,92299,39683,16650,74767,99971,63375,30471,52612,41221,67973,22785,79369,70157,6790,97800,17540,44297,2178,21253" \ +# "LTPTrace 20361,19200,22148,18176,18177,16131,22278,11400,11267,18051,20483,18050,14983,14724,21256,14338,16386,17159,11916,11910,12685,22657,18693,23297,14599,21376,16768,12294,14851,17419,20864,21001,22543,14339,12163,19076,21379,23552,11398,19593,20613,17538,23171,18823,20362,11655,18309,20101,12418,21123,22547,19850,22665,22273,13450,14083,18179,23175,16648,11906,23560,23946,18945,17415,11904,22402,16515,21383,22401,22275,14084,12292,16257,20228,20354,18564,16262,19078,12546,19972,19074,12553,14080,11917,18432,17289,23565,14464,23425,17287,12677,15873,23048,22658,21251,14211,15497,14219,13063,16136 49545,35075,27394,75650,7,74121,8,42757,25856,12931,30472,90759,76298,19077,651,74119,65536,82437,9863,35080,76293,94724,48003,55687,35077,76290,74762,52609,47372,68613,44295,52610,46465,13,14466,40324,44928,2180,69511,67971,75654,61829,97793,48903,6784,12936,51077,74118,87042,80904,44293,85510,74114,17545,47371,74758,16646,51086,30465,12930,76291,6786,44936,33543,83975,63368,77828,40326,38153,49540,20615,67969,20614,3718,32001,96257,8320,73225,6788,66434,52611,92299,39683,16650,74767,99971,63375,30471,52612,41221,67973,22785,79369,70157,6790,97800,17540,44297,2178,21253" \ +# "LTDTrace 159,150,173,142,142,126,174,89,88,141,160,141,117,115,166,112,128,134,93,93,99,177,146,182,114,167,131,96,116,136,163,164,176,112,95,149,167,184,89,153,161,137,181,147,159,91,143,157,97,165,176,155,177,174,105,110,142,181,130,93,184,187,148,136,93,175,129,167,175,174,110,96,127,158,159,145,127,149,98,156,149,98,110,93,144,135,184,113,183,135,99,124,180,177,166,111,121,111,102,126 387,274,214,591,0,579,0,334,202,101,238,709,596,149,5,579,512,644,77,274,596,740,375,435,274,596,584,411,370,536,346,411,363,0,113,315,351,17,543,531,591,483,764,382,53,101,399,579,680,632,346,668,579,137,370,584,130,399,238,101,596,53,351,262,656,495,608,315,298,387,161,531,161,29,250,752,65,572,53,519,411,721,310,130,584,781,495,238,411,322,531,178,620,548,53,764,137,346,17,166"; do +# for EXP in \ +for EXP in \ + "EligibilityTrace 20996,22019,19716,17922,23177,21379,11779,17418,11658,16897,22531,21376,22018,22028,18304,14474,17543,18048,20739,23044,18562,13571,23302,17415,17414,22410,16768,15752,14981,22659,19975,21385,16384,20613,11661,16010,19333,22914,16770,21125,17416,17667,11265,11915,18956,15877,17544,22664,23939,22787,17025,15235,16261,14221,22149,21123,23172,14214,20736,11919,22536,13318,19852,19971,17028,14090,16652,13058,19206,23297,23554,14977,18437,11652,21251,11914,11273,14601,19718,11266,12929,13954,23682,22784,12686,16257,13829,15107,12418,21377,16901,15234,18183,16136,15244,17413,23811,16518,11904,15499 9987,50057,76672,30344,47873,23427,12161,70402,102019,9992,53510,23429,52873,44417,78850,67586,7173,47240,99840,52865,46598,38154,33157,26888,5892,99843,44416,77315,5897,76033,12165,100485,26890,7171,73861,73217,56320,70406,8707,9347,24068,97032,43782,35976,31874,93571,259,14986,94215,27523,9344,65410,97027,5898,58497,32516,256,14339,3718,93573,3072,58504,99844,47872,64131,88579,62595,42253,17797,102024,17160,73225,44419,17164,76041,42244,96391,49413,68226,7182,59137,44426,61318,77316,97670,81668,70413,18436,23426,55688,18439,81675,85762,81664,55683,90754,35335,56322,47232,35336"; do + PROP=$(echo $EXP | cut -f1 -d" ") + INST=$(echo $EXP | cut -f2- -d" ") + FD=$(pwd | sed 's#/sim/#/plot/#')/$PROP''_over_act.mean.manual_data + FP=$(pwd | sed 's#/sim/#/plot/#')/$PROP''_over_act.mean.svg + SIM=$(pwd | sed 's#.*/sim/\(.*\)/0#\1#') + echo $FD + cat .*simulate.log \ + | egrep 'WINNER|READOUT' |grep -v SIGNAL | tr "\n" " " \ + | sed 's/READOUT/\n/g' | cut -d" " -f2,3,6 \ + | grep . \ + | while read FO FWO RAWTIME; do + TIME=$(echo "$RAWTIME - 0.0000001" |bc); + echo -en "$FO\t$FWO\t"; + for TGT in $INST; do + echo -ne "scale=10\n(" + ~/rasimu/bin/$SIM-replay $PROP $TGT $TIME 10000 10001 \ + | tail -n1 | cut -f2- | tr "\t\n" + \ + | tee -a ~/rasimu/fuckup | sed 's/e/*10^/g' + echo "0)/"$(( $(echo $TGT | tr -dc , | wc -c) + 1)) + done | bc | tr "\n" "\t" + echo + done > $FD + + echo " +f(x)=a*x+b +g(x)=c*x+d +fit f(x) \"$FD\" using 1:3 via a,b +fit g(x) \"$FD\" using 2:4 via c,d +set term svg +set out \"$FP\" +plot '$FD' using 1:3 title 'IO', f(x) title 'IO fit', '$FD' using 2:4 title 'IWO', g(x) title 'IWO fit' +" | gnuplot + echo $FP +done
\ No newline at end of file diff --git a/toolbin/topo b/toolbin/topo new file mode 100755 index 0000000..b712433 --- /dev/null +++ b/toolbin/topo @@ -0,0 +1,34 @@ +#!/bin/bash + +set -e + +function neurons { + for i in $(seq 0 99); do + echo $((($i + $2) * $1 % 800)); + done \ + | sort -un | tr "\n" , \ + | sed 's/,$//' +} + +function synapses { + ~/rasimu/bin/list_synapses $1 $2 \ + | sort -R \ + | head -n100 \ + | cut -f1 | tr "\n" , \ + | sed 's/,$//' +} + +I1=$(neurons 1 0) +I2=$(neurons 997 0) +O1=$(neurons 1 88) +O2=$(neurons 937 88) +I1O1=$(synapses $I1 $O1) +I1O2=$(synapses $I1 $O2) + + +echo "I1 $I1 +I2 $I2 +O1 $O1 +O2 $O2 +I1O2 $I1O1 +I1O2 $I1O2"
\ No newline at end of file diff --git a/toolbin/transform_dsl.pl b/toolbin/transform_dsl.pl new file mode 100755 index 0000000..ebb1241 --- /dev/null +++ b/toolbin/transform_dsl.pl @@ -0,0 +1,276 @@ +#!/usr/bin/perl6 +use v6; + +grammar DSL { + my $e = "document start"; + token TOP { ^ <include_block>* <quant_block>* $ } + + token include_block { + 'include' \s+ '"' <filename> '"' \s* ';' \s* + } + token quant_block { + <quant_type> \s+ <name> \s* '{' \s* + [[{$e=$/} <decl>|<evolve>|<on_block>|<emit_block>|<comment>] \s*] * + \s* '}' \s* } + token on_block { + 'on' \s+ <name> \s* '{' \s* + [[{$e=$/} <evolve>|<comment>] \s*] * + \s* '}' } + token emit_block { + 'emit' \s+ <name> \s* '{' \s* + [[{$e=$/} <evolve>|<default>|<after>|<if_>|<comment>] \s*] * + \s* '}' } + + token decl { <type> \s+ <name> \s* ['=' \s* <expr> \s*]? ';' } + token evolve { <name>\' \s* '=' \s* <expr> \s* ';' } + token default { 'default' \s+ <bool> \s* ';' } + token if_ { 'if' \s+ <name>\' <expr> \s* ';' } + token after { 'after' \s+ <expr> \s* ';' } + token comment { '//' \N* $$ } + + token name { \w+ } + token filename { \w+ } + token type { [':'|\w]+ } + token quant_type { ['discrete'|'continuous'|'const'] } + token bool { ['true'|'false'] } + token expr { <-[;{}]>* } # MAYBE TODO: improve + + method error() { + return $e; + } +} + +sub transform($quant_blocks) { + my %quant_types; + my %vars; + my %consts; + my %res = :const(''), :decl(''), :evolve(''), :on(''), + :qdq(''), :emit(''), :gpe(''), :gen(''), :debug(''); + + my %rawexpr_evolve; + + # funs to replace def strings to C++-Code + sub replace_consts($expr is copy) { + for %consts.kv -> $name, $val { + $expr = $expr.subst(rx/<<$name>>/, "$val /* $name */", :g); + } + return $expr; + } + + sub replace_dt($expr is copy) { + $expr = $expr.subst(rx/<<'dt'>>/, "td()", :g); + return $expr; + } + + sub replace_expr($expr is copy, %local_exprs) { + # replace post-event vars ONCE + for %vars.kv -> $prop, $quant { + # post event is only defined for continuous quants + next if %quant_types{$quant} eq 'discrete'; + $expr = $expr.subst(rx/<<$prop>>"'"/, "(%local_exprs{$prop})", :g); + } + return $expr; + } + + sub replace_vars($expr is copy) { + # replace normal vars + for %vars.kv -> $prop, $quant { + if %quant_types{$quant} eq 'continuous' { + $expr = $expr.subst(rx/<<$prop>>/, "_CP($prop)", :g); + } else { + die unless %quant_types{$quant} eq 'discrete'; + $expr = $expr.subst(rx/<<$prop>>/, "_DP($prop)", :g); + } + } + return $expr; + } + + sub replace_all($expr is copy, %local_exprs) { + $expr = replace_consts( + replace_dt( + replace_vars( + replace_expr($expr, %local_exprs)))); + $expr = $expr.subst(rx/"_PROT">>/, "q", :g); + return $expr; + } + + sub replace_all_after($expr is copy, %local_exprs) { + $expr = $expr.subst(rx/"'"/, "_PROTTICK", :g); + $expr = replace_vars($expr); + $expr = $expr.subst(rx/"_PROTTICK"/, "'", :g); + return replace_consts( + replace_expr($expr, %local_exprs)); + } + + # gather all properties (required to patch expressions) + for @($quant_blocks) { + my $qc = $_<name>; + my $qt = $_<quant_type>; + %quant_types{$qc} = $qt; + for @($_<decl>) { + my $name = $_<name>; + if $qt eq 'const' { + if not %consts{$name} { + my $type = $_<type>; + %consts{$name} = $_<expr>; + %res<const> ~= "const $type $name = $_<expr>;\n"; + } + } else { + die "multiple declaration of $_<name>" if %(%vars, %consts){$name}; + %vars{$name} = $qc; + } + } + for @($_<evolve>) { %rawexpr_evolve{$_<name>} = $_<expr>; } + } + + # print definitions + for @($quant_blocks) { + my $qc = $_<name>; + my $emit = $_<emit_block>; + my %types; + next if ($qc eq 'const'); + %res = %res <<~>> "// Quantor: $qc\n"; + for @($_<decl>) { + %types{$_<name>} = $_<type>; + if %quant_types{%vars{$_<name>}} eq 'continuous' { + %res<decl> ~= + "GEN_CP($qc, $_<name>, \"$_<name>\", $_<type>, (" + ~ replace_consts($_<expr>) ~ "));\n"; + } else { + %res<decl> ~= + "GEN_DP($qc, $_<name>, \"$_<name>\", $_<type>);\n"; + } + } + for @($_<evolve>) { + %res<evolve> ~= "GEN_CP_EVOLVE($_<name>, " + ~ replace_all($_<expr>, %rawexpr_evolve) ~ ");\n"; + } + for @($_<emit_block>) { + my $dqc = $_<name>; + my %rawexpr_emit = + gather for @($_<evolve>) { take %($_<name>, $_<expr>); }; + my %rawexpr_after = + gather for @(%vars) { my $k=$_.key; take %($k, "_TP($k)"); }; + + %res<emit> ~= "GEN_QUANT_EMIT($qc, $dqc, $_<default>[0]<bool>);\n"; + if $_<after>.elems > 0 { + # TODO: generate has-var-delay statement at most + # once per discrete quant + %res<emit> ~= + "GEN_QUANT_HASVARDELAY($dqc);\n" + ~ "GEN_DP_DELAY($dqc, $qc, " + ~ replace_all_after($_<after>[0]<expr>, %rawexpr_after) + ~ ");\n"; + } + for @($_<evolve>) { + die "$_<name> of %vars{$_<name>} != $qc, $dqc" + unless (%vars{$_<name>} eq $dqc) || (%vars{$_<name>} eq $qc); + %res<gpe> ~= + "GEN_CP_GENERATE($qc, $dqc, $_<name>) \{ " + ~ "value = " ~ replace_all($_<expr>, %rawexpr_emit) + ~ "; \}\};\n"; + } + } + for @($_<on_block>) { + my $src_quant = $_<name>; + %res<qdq> ~= "GEN_QDQ($_<name>, $qc);\n"; + my %is_evolved; + my %rawexpr_on = + gather for @($_<evolve>) { take %($_<name>, $_<expr>); }; + for @($_<evolve>) { + my $dprop = $_<name>; + %res<on> ~= "GEN_CP_APPLY($dprop, $src_quant, true) \{\n" + ~ " const %types{$dprop} tmp = " + ~ replace_all($_<expr>, %rawexpr_on) ~ ";\n" + ~ " transaction.template set<$dprop>(tmp);\n"; + for @($emit) { + my $dst_quant = $_<name>; + my %rawexpr_emit = + gather for @($_<evolve>) { take %($_<name>, $_<expr>); }; + for @($_<if_>) { + if $_<name> eq $dprop { + # %res<on> ~= "std::cout << \"combine(tmp($dprop" ~ replace_consts($_<expr>) ~ ")\" << std::endl;"; + %res<on> ~= " intent.template get<$dst_quant>()" + ~ ".combine(tmp" ~ replace_consts($_<expr>) + ~ ");\n"; + } + } + } + %res<on> ~= "\}\};\n"; # sic! + %is_evolved{$dprop} = True; + } + for @($emit) { + my $dst_quant = $_<name>; + for @($_<if_>) { + unless %is_evolved{$_<name>} { + # HINT: use _CP for access because the value is unchanged + %res<on> ~= + "GEN_CP_APPLY($_<name>, $src_quant, false) \{\n" + # ~ "std::cout << \"combine(_CP($_<name>" ~ replace_consts($_<expr>) ~ ")\" << std::endl;" + ~ " intent.template get<$dst_quant>()" + ~ ".combine(_CP($_<name>)" ~ replace_consts($_<expr>) + ~ ");\n\}\};\n"; + # TODO: replace consts + } + } + } + } + } + + # create list of + %res<lists> = + "typedef boost::mpl::list<\n\t" + ~ %vars.keys.map({"boost::mpl::pair<$_, boost::mpl::bool_<true>>"}).join(",\n\t") + ~ "\n> all;\n\n" + ~ "typedef boost::mpl::list<\n\t" + ~ %vars.keys.map({"boost::mpl::pair<$_, boost::mpl::bool_<false>>"}).join(",\n\t") + ~ "\n> all_ro;"; + + # push results + %res = %res <<~>> "\n"; + say "#ifndef RASIMU_SIMULATION_DEFINITION +#define RASIMU_SIMULATION_DEFINITION + +#include \"core/property_abbrevations_begin.hpp\" + +namespace ModelConsts \{ +%res<const> +\} +%res<decl> +%res<evolve> +%res<on> +%res<qdq> +%res<emit> +%res<gen> +%res<gpe>"," + +namespace Lists \{ +%res<lists>"," +\} + +// generated by ",qqx{perl6 --version|grep version}," + +/* DEBUG MSGS +%res<debug> +*/ +#include \"core/property_abbrevations_end.hpp\" +#endif // RASIMU_SIMULATION_DEFINITION"; +} + +sub parse($src) { + my $p = DSL.new; + if $p.parse(slurp $src) { + my @qbs = @($<quant_block>); + for @($<include_block>) { + @qbs.push(parse($_<filename> ~ ".model")); + } + return @qbs; + } else { + die "Error after:\n", $p.error; + } +} + +sub MAIN($src) { + transform(parse($src)); + #parse($src).perl.say; +} diff --git a/toolbin/warn_data b/toolbin/warn_data new file mode 100755 index 0000000..25839b4 --- /dev/null +++ b/toolbin/warn_data @@ -0,0 +1,8 @@ +#!/bin/sh + +toilet you tried +toilet to destroy +toilet simulation +toilet DATA "!!!" + +exit -1
\ No newline at end of file |