pione 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +14 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +94 -0
- data/Rakefile +118 -0
- data/bin/pione-broker +5 -0
- data/bin/pione-clean +5 -0
- data/bin/pione-client +5 -0
- data/bin/pione-eval +111 -0
- data/bin/pione-relay +5 -0
- data/bin/pione-relay-account-db +5 -0
- data/bin/pione-relay-client-db +5 -0
- data/bin/pione-search-log +30 -0
- data/bin/pione-syntax-checker +5 -0
- data/bin/pione-task-worker +5 -0
- data/bin/pione-tuple-space-provider +5 -0
- data/bin/pione-tuple-space-receiver +5 -0
- data/bin/pione-tuple-space-viewer +5 -0
- data/demo/demo.rb +311 -0
- data/demo/public/base.css +94 -0
- data/demo/public/demo.js +107 -0
- data/demo/public/index.html +91 -0
- data/demo/public/jquery-1.8.3.min.js +2 -0
- data/example/CountChar/CountChar.pione +64 -0
- data/example/CountChar/misc/CountChar.rb +22 -0
- data/example/CountChar/text/aidokushono_insho.txt +32 -0
- data/example/CountChar/text/aikokuka_shokan.txt +108 -0
- data/example/CountChar/text/carlyle_hakubutsukan.txt +58 -0
- data/example/CountChar/text/dark_minister.txt +2440 -0
- data/example/CountChar/text/kaikano_otto.txt +61 -0
- data/example/CountChar/text/kaikon.txt +30 -0
- data/example/CountChar/text/nagashimano_shi.txt +45 -0
- data/example/CountChar/text/saikachibuchi.txt +80 -0
- data/example/CountChar/text/saikonihonno_josei.txt +91 -0
- data/example/CountChar/text/taishojugonenno_bundan.txt +21 -0
- data/example/FeatureExample/FeatureExample.pione +7 -0
- data/example/Fib/Fib.pione +56 -0
- data/example/Fib/FibBC.pione +56 -0
- data/example/HelloWorld/HelloWorld.pione +5 -0
- data/example/LucasNumber/LucasNumber.pione +64 -0
- data/example/MakePair/MakePair.pione +14 -0
- data/example/MakePair/data/1.i +0 -0
- data/example/MakePair/data/2.i +0 -0
- data/example/MakePair/data/3.i +0 -0
- data/example/MakePair/data/4.i +0 -0
- data/example/MakePair/data/5.i +0 -0
- data/example/SieveOfEratosthenes/SieveOfEratosthenes.pione +61 -0
- data/example/SingleParticlesWithRef/Makefile +289 -0
- data/example/SingleParticlesWithRef/SingleParticlesWithRef.Makefile +153 -0
- data/example/SingleParticlesWithRef/SingleParticlesWithRef.pione +116 -0
- data/example/SingleParticlesWithRef/SingleParticlesWithRefFull.pione +400 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-0-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-120-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-180-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-240-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-300-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-60-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-0-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-120-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-180-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-240-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-300-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-0-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-120-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-180-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-240-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-300-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift-noise-60-60-0.roi +0 -0
- data/example/SingleParticlesWithRef/data/121p-shift.pdb +3381 -0
- data/example/SingleParticlesWithRef/data/all.ref2d +0 -0
- data/example/SingleParticlesWithRef/data/all.ref3d +0 -0
- data/example/Sum/Sum.pione +52 -0
- data/example/SyntaxError/call_rule_error.pione +6 -0
- data/example/SyntaxError/feature_line_error.pione +7 -0
- data/example/SyntaxError/flow_block_error.pione +5 -0
- data/example/SyntaxError/input_line_error.pione +6 -0
- data/example/SyntaxError/invalid_rule_name.pione +6 -0
- data/example/SyntaxError/param_line_error.pione +7 -0
- data/example/SyntaxError/variable-binding-error.pione +11 -0
- data/lib/pione.rb +241 -0
- data/lib/pione/agent/basic-agent.rb +333 -0
- data/lib/pione/agent/broker.rb +274 -0
- data/lib/pione/agent/command-listener.rb +47 -0
- data/lib/pione/agent/input-generator.rb +194 -0
- data/lib/pione/agent/logger.rb +65 -0
- data/lib/pione/agent/process-manager.rb +38 -0
- data/lib/pione/agent/rule-provider.rb +64 -0
- data/lib/pione/agent/task-worker.rb +274 -0
- data/lib/pione/agent/trivial-routine-worker.rb +28 -0
- data/lib/pione/agent/tuple-space-client.rb +146 -0
- data/lib/pione/agent/tuple-space-server-client-life-checker.rb +29 -0
- data/lib/pione/command-option/basic-option.rb +42 -0
- data/lib/pione/command-option/child-process-option.rb +17 -0
- data/lib/pione/command-option/common-option.rb +29 -0
- data/lib/pione/command-option/daemon-option.rb +12 -0
- data/lib/pione/command-option/presence-notifier-option.rb +15 -0
- data/lib/pione/command-option/task-worker-owner-option.rb +17 -0
- data/lib/pione/command-option/tuple-space-provider-option.rb +26 -0
- data/lib/pione/command-option/tuple-space-provider-owner-option.rb +16 -0
- data/lib/pione/command-option/tuple-space-receiver-option.rb +12 -0
- data/lib/pione/command/basic-command.rb +126 -0
- data/lib/pione/command/child-process.rb +43 -0
- data/lib/pione/command/daemon-process.rb +18 -0
- data/lib/pione/command/front-owner-command.rb +37 -0
- data/lib/pione/command/pione-broker.rb +53 -0
- data/lib/pione/command/pione-clean.rb +16 -0
- data/lib/pione/command/pione-client.rb +273 -0
- data/lib/pione/command/pione-relay-account-db.rb +85 -0
- data/lib/pione/command/pione-relay-client-db.rb +80 -0
- data/lib/pione/command/pione-relay.rb +47 -0
- data/lib/pione/command/pione-syntax-checker.rb +103 -0
- data/lib/pione/command/pione-task-worker.rb +123 -0
- data/lib/pione/command/pione-tuple-space-provider.rb +87 -0
- data/lib/pione/command/pione-tuple-space-receiver.rb +55 -0
- data/lib/pione/command/pione-tuple-space-viewer.rb +151 -0
- data/lib/pione/command/tuple-space-provider-owner.rb +6 -0
- data/lib/pione/front/basic-front.rb +64 -0
- data/lib/pione/front/broker-front.rb +30 -0
- data/lib/pione/front/client-front.rb +28 -0
- data/lib/pione/front/relay-front.rb +19 -0
- data/lib/pione/front/task-worker-front.rb +16 -0
- data/lib/pione/front/task-worker-owner.rb +42 -0
- data/lib/pione/front/tuple-space-provider-front.rb +22 -0
- data/lib/pione/front/tuple-space-provider-owner.rb +11 -0
- data/lib/pione/front/tuple-space-receiver-front.rb +18 -0
- data/lib/pione/model/assignment.rb +89 -0
- data/lib/pione/model/basic-model.rb +395 -0
- data/lib/pione/model/binary-operator.rb +80 -0
- data/lib/pione/model/block.rb +233 -0
- data/lib/pione/model/boolean.rb +138 -0
- data/lib/pione/model/call-rule.rb +69 -0
- data/lib/pione/model/data-expr.rb +360 -0
- data/lib/pione/model/feature-expr.rb +794 -0
- data/lib/pione/model/float.rb +107 -0
- data/lib/pione/model/integer.rb +140 -0
- data/lib/pione/model/list.rb +104 -0
- data/lib/pione/model/message.rb +80 -0
- data/lib/pione/model/package.rb +48 -0
- data/lib/pione/model/parameters.rb +282 -0
- data/lib/pione/model/rule-expr.rb +120 -0
- data/lib/pione/model/rule-io.rb +166 -0
- data/lib/pione/model/rule.rb +294 -0
- data/lib/pione/model/string.rb +111 -0
- data/lib/pione/model/undefined-value.rb +24 -0
- data/lib/pione/model/variable-table.rb +315 -0
- data/lib/pione/model/variable.rb +87 -0
- data/lib/pione/parser/block-parser.rb +83 -0
- data/lib/pione/parser/common-parser.rb +145 -0
- data/lib/pione/parser/document-parser.rb +58 -0
- data/lib/pione/parser/error-message.yml +4 -0
- data/lib/pione/parser/expr-parser.rb +266 -0
- data/lib/pione/parser/feature-expr-parser.rb +105 -0
- data/lib/pione/parser/flow-element-parser.rb +181 -0
- data/lib/pione/parser/literal-parser.rb +182 -0
- data/lib/pione/parser/rule-definition-parser.rb +163 -0
- data/lib/pione/parser/syntax-error.rb +61 -0
- data/lib/pione/patch/array-patch.rb +3 -0
- data/lib/pione/patch/drb-patch.rb +467 -0
- data/lib/pione/patch/monitor-patch.rb +16 -0
- data/lib/pione/patch/rinda-patch.rb +759 -0
- data/lib/pione/patch/uri-patch.rb +66 -0
- data/lib/pione/relay/receiver-socket.rb +69 -0
- data/lib/pione/relay/relay-account-db.rb +55 -0
- data/lib/pione/relay/relay-client-db.rb +53 -0
- data/lib/pione/relay/relay-socket.rb +215 -0
- data/lib/pione/relay/trampoline.rb +22 -0
- data/lib/pione/relay/transmitter-socket.rb +167 -0
- data/lib/pione/resource/basic-resource.rb +92 -0
- data/lib/pione/resource/dropbox-resource.rb +106 -0
- data/lib/pione/resource/ftp.rb +84 -0
- data/lib/pione/resource/local.rb +113 -0
- data/lib/pione/rule-handler/action-handler.rb +184 -0
- data/lib/pione/rule-handler/basic-handler.rb +217 -0
- data/lib/pione/rule-handler/flow-handler.rb +339 -0
- data/lib/pione/rule-handler/root-handler.rb +23 -0
- data/lib/pione/rule-handler/system-handler.rb +13 -0
- data/lib/pione/system/common.rb +22 -0
- data/lib/pione/system/config.rb +20 -0
- data/lib/pione/system/document.rb +81 -0
- data/lib/pione/system/file-cache.rb +150 -0
- data/lib/pione/system/global.rb +346 -0
- data/lib/pione/system/identifier.rb +61 -0
- data/lib/pione/system/init.rb +16 -0
- data/lib/pione/system/object.rb +35 -0
- data/lib/pione/transformer/block-transformer.rb +23 -0
- data/lib/pione/transformer/document-transformer.rb +36 -0
- data/lib/pione/transformer/expr-transformer.rb +89 -0
- data/lib/pione/transformer/feature-expr-transformer.rb +56 -0
- data/lib/pione/transformer/flow-element-transformer.rb +66 -0
- data/lib/pione/transformer/literal-transformer.rb +76 -0
- data/lib/pione/transformer/rule-definition-transformer.rb +62 -0
- data/lib/pione/transformer/transformer-module.rb +37 -0
- data/lib/pione/tuple-space/data-finder.rb +165 -0
- data/lib/pione/tuple-space/presence-notifier.rb +83 -0
- data/lib/pione/tuple-space/relay.rb +9 -0
- data/lib/pione/tuple-space/tuple-space-provider.rb +85 -0
- data/lib/pione/tuple-space/tuple-space-receiver.rb +140 -0
- data/lib/pione/tuple-space/tuple-space-server-interface.rb +60 -0
- data/lib/pione/tuple-space/tuple-space-server.rb +156 -0
- data/lib/pione/tuple-space/update-criteria.rb +96 -0
- data/lib/pione/tuple/agent-tuple.rb +10 -0
- data/lib/pione/tuple/attribute-tuple.rb +7 -0
- data/lib/pione/tuple/base-uri-tuple.rb +9 -0
- data/lib/pione/tuple/basic-tuple.rb +317 -0
- data/lib/pione/tuple/bye-tuple.rb +9 -0
- data/lib/pione/tuple/command-tuple.rb +9 -0
- data/lib/pione/tuple/data-tuple.rb +18 -0
- data/lib/pione/tuple/dry-run-tuple.rb +8 -0
- data/lib/pione/tuple/exception-tuple.rb +11 -0
- data/lib/pione/tuple/finished-tuple.rb +17 -0
- data/lib/pione/tuple/foreground-tuple.rb +7 -0
- data/lib/pione/tuple/log-tuple.rb +14 -0
- data/lib/pione/tuple/process-info-tuple.rb +9 -0
- data/lib/pione/tuple/request-rule-tuple.rb +9 -0
- data/lib/pione/tuple/rule-tuple.rb +10 -0
- data/lib/pione/tuple/shift-tuple.rb +13 -0
- data/lib/pione/tuple/task-tuple.rb +36 -0
- data/lib/pione/tuple/task-worker-resource-tuple.rb +9 -0
- data/lib/pione/tuple/working-tuple.rb +13 -0
- data/lib/pione/uri-scheme/basic-scheme.rb +40 -0
- data/lib/pione/uri-scheme/broadcast-scheme.rb +11 -0
- data/lib/pione/uri-scheme/dropbox-scheme.rb +9 -0
- data/lib/pione/uri-scheme/local-scheme.rb +28 -0
- data/lib/pione/util/error-report.rb +12 -0
- data/lib/pione/util/log.rb +79 -0
- data/lib/pione/util/message.rb +155 -0
- data/lib/pione/util/misc.rb +73 -0
- data/lib/pione/util/terminal.rb +78 -0
- data/lib/pione/util/waiter-table.rb +53 -0
- data/lib/pione/version.rb +3 -0
- data/misc/env.sh +2 -0
- data/misc/test-drb-stop-service.rb +34 -0
- data/misc/test-ensure-and-thread-kill.rb +40 -0
- data/misc/test-many-waiters-client.rb +56 -0
- data/misc/test-many-waiters-server.rb +14 -0
- data/misc/write_and_take_test.png +0 -0
- data/misc/write_and_take_test.rb +36 -0
- data/pione.gemspec +49 -0
- data/test/agent/spec_basic-agent.rb +170 -0
- data/test/agent/spec_broker.rb +36 -0
- data/test/agent/spec_command-listener.rb +30 -0
- data/test/agent/spec_input-generator.rb +123 -0
- data/test/agent/spec_logger.rb +71 -0
- data/test/agent/spec_rule-provider.rb +65 -0
- data/test/agent/spec_task-worker.rb +307 -0
- data/test/agent/spec_tuple-space-client.rb +30 -0
- data/test/model/spec_assignment.rb +51 -0
- data/test/model/spec_binary-operator.rb +39 -0
- data/test/model/spec_block.rb +154 -0
- data/test/model/spec_boolean.rb +115 -0
- data/test/model/spec_call-rule.rb +23 -0
- data/test/model/spec_data-expr.rb +312 -0
- data/test/model/spec_feature-expr.rb +359 -0
- data/test/model/spec_feature-expr.yml +16 -0
- data/test/model/spec_float.rb +141 -0
- data/test/model/spec_integer.rb +141 -0
- data/test/model/spec_list.rb +26 -0
- data/test/model/spec_message.rb +42 -0
- data/test/model/spec_package.rb +15 -0
- data/test/model/spec_parameters.rb +148 -0
- data/test/model/spec_rule-expr.rb +66 -0
- data/test/model/spec_rule-io.rb +32 -0
- data/test/model/spec_rule.rb +158 -0
- data/test/model/spec_string.rb +106 -0
- data/test/model/spec_variable-table.rb +117 -0
- data/test/model/spec_variable.rb +84 -0
- data/test/parser/spec_block-parser.rb +5 -0
- data/test/parser/spec_block-parser.yml +85 -0
- data/test/parser/spec_common-parser.rb +281 -0
- data/test/parser/spec_expr-parser.rb +6 -0
- data/test/parser/spec_expr-parser.yml +82 -0
- data/test/parser/spec_feature-expr-parser.rb +32 -0
- data/test/parser/spec_feature-expr-parser.yml +25 -0
- data/test/parser/spec_flow-element-parser.rb +5 -0
- data/test/parser/spec_flow-element-parser.yml +180 -0
- data/test/parser/spec_literal-parser.rb +5 -0
- data/test/parser/spec_literal-parser.yml +123 -0
- data/test/parser/spec_rule-definition-parser.rb +5 -0
- data/test/parser/spec_rule-definition-parser.yml +93 -0
- data/test/patch/spec_rinda-patch.rb +32 -0
- data/test/patch/spec_uri-patch.rb +23 -0
- data/test/rule-handler/spec_action-handler.rb +135 -0
- data/test/rule-handler/spec_flow-handler.rb +127 -0
- data/test/spec_common.rb +14 -0
- data/test/spec_data-finder.rb +88 -0
- data/test/spec_data-finder.yml +115 -0
- data/test/spec_document.rb +76 -0
- data/test/spec_identifier.rb +29 -0
- data/test/spec_log.rb +52 -0
- data/test/spec_object.rb +20 -0
- data/test/spec_resource.rb +73 -0
- data/test/spec_update-criteria.rb +83 -0
- data/test/test-util.rb +223 -0
- data/test/transformer/spec_block-transformer.rb +26 -0
- data/test/transformer/spec_expr-transformer.rb +106 -0
- data/test/transformer/spec_feature-expr-transformer.rb +21 -0
- data/test/transformer/spec_flow-element-transformer.rb +154 -0
- data/test/transformer/spec_literal-transformer.rb +58 -0
- data/test/transformer/spec_rule-definition-transformer.rb +168 -0
- data/test/tuple-space/spec_tuple-space-provider.rb +36 -0
- data/test/tuple-space/spec_tuple-space-receiver.rb +32 -0
- data/test/tuple-space/spec_tuple-space-server.rb +49 -0
- data/test/tuple/spec_basic-tuple.rb +87 -0
- data/test/tuple/spec_data-tuple.rb +85 -0
- data/test/tuple/spec_finished-tuple.rb +61 -0
- data/test/tuple/spec_task-tuple.rb +127 -0
- data/test/tuple/spec_working-tuple.rb +58 -0
- data/test/uri-scheme/spec_broadcast-scheme.rb +40 -0
- data/test/uri-scheme/spec_dropbox-scheme.rb +31 -0
- data/test/uri-scheme/spec_local-scheme.rb +69 -0
- metadata +660 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
module Pione
|
2
|
+
module System
|
3
|
+
# Identifier is a set of generators for id.
|
4
|
+
module Identifier
|
5
|
+
# Makes task id by input data names.
|
6
|
+
# @param [Array<Pione::Tuple::Data>] inputs
|
7
|
+
# input data tuples
|
8
|
+
# @param [Pione::Model::Parameters] params
|
9
|
+
# parameters object
|
10
|
+
# @return [String]
|
11
|
+
# task's digest string
|
12
|
+
def task_id(inputs, params)
|
13
|
+
raise ArgumentError.new(params) unless params.kind_of?(Parameters)
|
14
|
+
# FIXME: inputs.flatten?
|
15
|
+
input_names = inputs.flatten.map{|t| t.name}
|
16
|
+
is = input_names.join("\000")
|
17
|
+
ps = params.data.map do |key, val|
|
18
|
+
"%s:%s" % [key.textize, val.textize]
|
19
|
+
end.join("\000")
|
20
|
+
Digest::MD5.hexdigest("#{is}\001#{ps}\001")
|
21
|
+
end
|
22
|
+
module_function :task_id
|
23
|
+
|
24
|
+
# Makes target domain name by module name, inputs, and outputs.
|
25
|
+
# @param [String] package_name
|
26
|
+
# package name
|
27
|
+
# @param [String] rule_name
|
28
|
+
# rule name
|
29
|
+
# @param [Array<Pione::Tuple::Data>] inputs
|
30
|
+
# input data tuples
|
31
|
+
# @param [Pione::Model::Parameters] params
|
32
|
+
# parameters object
|
33
|
+
# @return [String]
|
34
|
+
# domain string
|
35
|
+
def domain_id(package_name, rule_name, inputs, params)
|
36
|
+
"%s-%s_%s" % [package_name, rule_name, task_id(inputs, params)]
|
37
|
+
end
|
38
|
+
module_function :domain_id
|
39
|
+
|
40
|
+
# Makes target domain name by module name, inputs, and outputs.
|
41
|
+
# @param [String] rule
|
42
|
+
# package name
|
43
|
+
# @param [Array<Pione::Tuple::Data>] inputs
|
44
|
+
# input data tuples
|
45
|
+
# @param [Pione::Model::] callee
|
46
|
+
# parameters object
|
47
|
+
# @return [String]
|
48
|
+
# domain string
|
49
|
+
def domain_id3(rule, inputs, callee)
|
50
|
+
package_name = rule.expr.package.name
|
51
|
+
rule_name = rule.expr.name
|
52
|
+
params = callee.expr.params
|
53
|
+
return domain_id(package_name, rule_name, inputs, params)
|
54
|
+
end
|
55
|
+
module_function :domain_id3
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Short name for Identifier.
|
60
|
+
ID = System::Identifier
|
61
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Pione
|
2
|
+
module System
|
3
|
+
class Init
|
4
|
+
def init
|
5
|
+
# init globals
|
6
|
+
Global.init
|
7
|
+
|
8
|
+
# relay client database
|
9
|
+
Global.relay_client_db = Relay::RelayClientDB.new(Global.relay_client_db_path)
|
10
|
+
|
11
|
+
# relay account database
|
12
|
+
Global.relay_account_db = Relay::RelayAccountDB.new(Global.relay_account_db_path)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Pione
|
2
|
+
module System
|
3
|
+
# PioneObject is a base class for PIONE system.
|
4
|
+
class PioneObject
|
5
|
+
# Checks argument type. Raises a type error if the value is not kind of
|
6
|
+
# the type.
|
7
|
+
# @param [Object] val
|
8
|
+
# check target
|
9
|
+
# @param [Class] klass
|
10
|
+
# expected type
|
11
|
+
# @return [void]
|
12
|
+
def check_argument_type(val, klass)
|
13
|
+
raise TypeError.new(val) unless val.kind_of?(klass)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Returns true.
|
17
|
+
def ping
|
18
|
+
true
|
19
|
+
end
|
20
|
+
|
21
|
+
# Returns this object's uuid.
|
22
|
+
# @return [String]
|
23
|
+
# UUID string
|
24
|
+
def uuid
|
25
|
+
@__uuid__ ||= Util.generate_uuid
|
26
|
+
end
|
27
|
+
|
28
|
+
# Finalizes this object.
|
29
|
+
# @return [void]
|
30
|
+
def finalize
|
31
|
+
# do nothing
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Pione
|
2
|
+
module Transformer
|
3
|
+
module BlockTransformer
|
4
|
+
include TransformerModule
|
5
|
+
|
6
|
+
# flow_block:
|
7
|
+
rule(:flow_block => sequence(:elements)) {
|
8
|
+
FlowBlock.new(*elements)
|
9
|
+
}
|
10
|
+
|
11
|
+
# action_block:
|
12
|
+
rule(:action_block =>
|
13
|
+
{ :key => simple(:keyword_Action),
|
14
|
+
:content => simple(:content) }
|
15
|
+
) {
|
16
|
+
line_and_column = keyword_Action.line_and_column
|
17
|
+
ActionBlock.new(content) do
|
18
|
+
set_line_and_column(line_and_column)
|
19
|
+
end
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Pione
|
2
|
+
module Transformer
|
3
|
+
class DocumentTransformer < Parslet::Transform
|
4
|
+
include LiteralTransformer
|
5
|
+
include FeatureExprTransformer
|
6
|
+
include ExprTransformer
|
7
|
+
include FlowElementTransformer
|
8
|
+
include BlockTransformer
|
9
|
+
include RuleDefinitionTransformer
|
10
|
+
|
11
|
+
def initialize(package_name="main")
|
12
|
+
super()
|
13
|
+
@current_package_name = package_name
|
14
|
+
Thread.current[:current_package_name] = @current_package_name
|
15
|
+
end
|
16
|
+
|
17
|
+
def apply(*args)
|
18
|
+
res = super
|
19
|
+
return res
|
20
|
+
end
|
21
|
+
|
22
|
+
def check_model_type(data, type)
|
23
|
+
data.pione_model_type == type
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# statement
|
28
|
+
#
|
29
|
+
|
30
|
+
# package
|
31
|
+
rule(:package => subtree(:tree)) {
|
32
|
+
@current_package = Package.new(tree[:package_name].to_s)
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module Pione
|
2
|
+
module Transformer
|
3
|
+
MessageArgument = Struct.new(:name, :parameters)
|
4
|
+
ParametersElement = Struct.new(:key, :value)
|
5
|
+
|
6
|
+
module ExprTransformer
|
7
|
+
include TransformerModule
|
8
|
+
|
9
|
+
# expr_operator_application
|
10
|
+
rule(:expr_operator_application =>
|
11
|
+
{ :left => simple(:left),
|
12
|
+
:operator => simple(:operator),
|
13
|
+
:right => simple(:right) }) {
|
14
|
+
Model::BinaryOperator.new(operator, left, right)
|
15
|
+
}
|
16
|
+
|
17
|
+
# expr
|
18
|
+
rule(:expr => simple(:obj)) { obj }
|
19
|
+
|
20
|
+
# receiver
|
21
|
+
rule({ :receiver => simple(:receiver),
|
22
|
+
:messages => sequence(:messages) }) {
|
23
|
+
obj = receiver
|
24
|
+
messages.each do |msg|
|
25
|
+
obj = Model::Message.new(msg.name, obj, *msg.parameters)
|
26
|
+
end
|
27
|
+
obj
|
28
|
+
}
|
29
|
+
rule({ :receiver => simple(:receiver),
|
30
|
+
:indexes => sequence(:indexes) }) {
|
31
|
+
obj = receiver
|
32
|
+
indexes.each do |msg|
|
33
|
+
obj = Model::Message.new("[]", obj, *msg.parameters)
|
34
|
+
end
|
35
|
+
obj
|
36
|
+
}
|
37
|
+
|
38
|
+
# message
|
39
|
+
rule(:message => {:message_name => simple(:name)}) {
|
40
|
+
MessageArgument.new(name)
|
41
|
+
}
|
42
|
+
rule(:message =>
|
43
|
+
{ :message_name => simple(:name),
|
44
|
+
:message_parameters => sequence(:parameters) }) {
|
45
|
+
MessageArgument.new(name, parameters)
|
46
|
+
}
|
47
|
+
rule(:message =>
|
48
|
+
{ :message_name => simple(:name),
|
49
|
+
:message_parameters => nil }) {
|
50
|
+
MessageArgument.new(name)
|
51
|
+
}
|
52
|
+
rule(:message =>
|
53
|
+
{ :message_name => simple(:name),
|
54
|
+
:message_parameters => simple(:arg) }) {
|
55
|
+
MessageArgument.new(name, arg)
|
56
|
+
}
|
57
|
+
|
58
|
+
# rule_expr
|
59
|
+
rule(:rule_expr => simple(:rule)) { rule }
|
60
|
+
rule(:rule_expr => {
|
61
|
+
:package => simple(:package),
|
62
|
+
:expr => simple(:expr)
|
63
|
+
}) {
|
64
|
+
expr.set_package(package)
|
65
|
+
}
|
66
|
+
|
67
|
+
# parameters
|
68
|
+
rule(:parameters => nil) { Parameters.new({}) }
|
69
|
+
rule(:parameters => simple(:elt)) {
|
70
|
+
Parameters.new({elt.key => elt.value})
|
71
|
+
}
|
72
|
+
rule(:parameters => sequence(:list)) {
|
73
|
+
elts = Hash[*list.map{|elt| [elt.key, elt.value]}.flatten(1)]
|
74
|
+
Parameters.new(elts)
|
75
|
+
}
|
76
|
+
|
77
|
+
rule(:parameters_element => {
|
78
|
+
:key => simple(:key),
|
79
|
+
:value => simple(:value)
|
80
|
+
}) {
|
81
|
+
ParametersElement.new(Variable.new(key.to_s), value)
|
82
|
+
}
|
83
|
+
|
84
|
+
rule(:index => sequence(:args)) {
|
85
|
+
MessageArgument.new("[]", args)
|
86
|
+
}
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Pione
|
2
|
+
module Transformer
|
3
|
+
module FeatureExprTransformer
|
4
|
+
include TransformerModule
|
5
|
+
|
6
|
+
# feature_name
|
7
|
+
# convert into plain string
|
8
|
+
rule(:atomic_feature =>
|
9
|
+
{ :operator => simple(:operator),
|
10
|
+
:symbol => simple(:symbol) }
|
11
|
+
) do
|
12
|
+
case operator
|
13
|
+
when "+"
|
14
|
+
Feature::RequisiteExpr.new(symbol.str)
|
15
|
+
when "-"
|
16
|
+
Feature::BlockingExpr.new(symbol.str)
|
17
|
+
when "?"
|
18
|
+
Feature::PreferredExpr.new(symbol.str)
|
19
|
+
when "^"
|
20
|
+
Feature::PossibleExpr.new(symbol.str)
|
21
|
+
when "!"
|
22
|
+
Feature::RestrictiveExpr.new(symbol.str)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
rule(:atomic_feature => {:symbol => simple(:symbol)}) {
|
26
|
+
case symbol
|
27
|
+
when "*"
|
28
|
+
Feature.empty
|
29
|
+
when "@"
|
30
|
+
Feature.boundless
|
31
|
+
end
|
32
|
+
}
|
33
|
+
|
34
|
+
# feature expr
|
35
|
+
rule(:feature_expr => simple(:expr)) do
|
36
|
+
expr
|
37
|
+
end
|
38
|
+
|
39
|
+
# feature conjunction
|
40
|
+
rule(:feature_conjunction => {
|
41
|
+
:left => simple(:left),
|
42
|
+
:right => simple(:right)
|
43
|
+
}) do
|
44
|
+
Feature::AndExpr.new(left, right)
|
45
|
+
end
|
46
|
+
|
47
|
+
# feature disjunction
|
48
|
+
rule(:feature_disjunction => {
|
49
|
+
:left => simple(:left),
|
50
|
+
:right => simple(:right)
|
51
|
+
}) do
|
52
|
+
Feature::OrExpr.new(left, right)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Pione
|
2
|
+
module Transformer
|
3
|
+
module FlowElementTransformer
|
4
|
+
include TransformerModule
|
5
|
+
|
6
|
+
# flow_elements returns just elements sequence
|
7
|
+
rule(:flow_elements => sequence(:elements)) {
|
8
|
+
elements
|
9
|
+
}
|
10
|
+
|
11
|
+
# call_rule
|
12
|
+
rule(:call_rule => subtree(:rule_expr)) {
|
13
|
+
TypeRuleExpr.check(rule_expr)
|
14
|
+
CallRule.new(rule_expr)
|
15
|
+
}
|
16
|
+
|
17
|
+
# if_block
|
18
|
+
rule(:if_block =>
|
19
|
+
{ :condition => simple(:condition),
|
20
|
+
:if_true_elements => sequence(:if_true),
|
21
|
+
:if_else_block => simple(:if_false)
|
22
|
+
}) {
|
23
|
+
block = { PioneBoolean.true => FlowBlock.new(*if_true) }
|
24
|
+
block[:else] = if_false if if_false
|
25
|
+
ConditionalBlock.new(condition, block)
|
26
|
+
}
|
27
|
+
|
28
|
+
# else_block
|
29
|
+
rule(:else_block =>
|
30
|
+
{ :elements => sequence(:elements) }) {
|
31
|
+
FlowBlock.new(*elements)
|
32
|
+
}
|
33
|
+
|
34
|
+
# case_block
|
35
|
+
rule(:case_block =>
|
36
|
+
{ :condition => simple(:condition),
|
37
|
+
:when_blocks => sequence(:when_blocks),
|
38
|
+
:case_else_block => simple(:else_block) }) {
|
39
|
+
block = {}
|
40
|
+
when_blocks.each do |when_block|
|
41
|
+
block[when_block.value] = when_block.body
|
42
|
+
end
|
43
|
+
block[:else] = else_block if else_block
|
44
|
+
ConditionalBlock.new(condition, block)
|
45
|
+
}
|
46
|
+
|
47
|
+
WhenBlock = Struct.new(:value, :body)
|
48
|
+
|
49
|
+
# when_block
|
50
|
+
rule(:when_block =>
|
51
|
+
{ :value => simple(:value),
|
52
|
+
:elements => sequence(:elements) }
|
53
|
+
) {
|
54
|
+
WhenBlock.new(value, FlowBlock.new(*elements))
|
55
|
+
}
|
56
|
+
|
57
|
+
# assignment
|
58
|
+
rule(:assignment =>
|
59
|
+
{ :symbol => simple(:symbol),
|
60
|
+
:value => simple(:value) }
|
61
|
+
) {
|
62
|
+
Assignment.new(symbol, value)
|
63
|
+
}
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module Pione
|
2
|
+
module Transformer
|
3
|
+
module LiteralTransformer
|
4
|
+
include TransformerModule
|
5
|
+
|
6
|
+
# boolean
|
7
|
+
rule(:boolean => simple(:s)) do
|
8
|
+
line_and_column = s.line_and_column
|
9
|
+
val = (s == "true")
|
10
|
+
Model::PioneBoolean.new(val) do
|
11
|
+
set_line_and_column(line_and_column)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# string
|
16
|
+
rule(:string => simple(:s)) do
|
17
|
+
line_and_column = s.line_and_column
|
18
|
+
Model::PioneString.new(s.str.gsub(/\\(.)/){$1}) do
|
19
|
+
set_line_and_column(line_and_column)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# integer
|
24
|
+
rule(:integer => simple(:i)) do
|
25
|
+
line_and_column = i.line_and_column
|
26
|
+
Model::PioneInteger.new(i.to_i) do
|
27
|
+
set_line_and_column(line_and_column)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# float
|
32
|
+
rule(:float => simple(:f)) do
|
33
|
+
line_and_column = f.line_and_column
|
34
|
+
Model::PioneFloat.new(f.to_f) do
|
35
|
+
set_line_and_column(line_and_column)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# variable
|
40
|
+
rule(:variable => simple(:v)) do
|
41
|
+
line_and_column = v.line_and_column
|
42
|
+
Model::Variable.new(v) do
|
43
|
+
set_line_and_column(line_and_column)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# data_name
|
48
|
+
# escape characters are substituted
|
49
|
+
rule(:data_name => simple(:name)) do
|
50
|
+
line_and_column = name.line_and_column
|
51
|
+
Model::DataExpr.new(name.str.gsub(/\\(.)/) {$1}) do
|
52
|
+
set_line_and_column(line_and_column)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# package_name
|
57
|
+
rule(:package_name => simple(:name)) do
|
58
|
+
line_and_column = name.line_and_column
|
59
|
+
Model::Package.new(name) do
|
60
|
+
set_line_and_column(line_and_column)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# rule_name
|
65
|
+
rule(:rule_name => simple(:name)) do
|
66
|
+
line_and_column = name.line_and_column
|
67
|
+
RuleExpr.new(
|
68
|
+
Package.new(Thread.current[:current_package_name]),
|
69
|
+
name
|
70
|
+
) do
|
71
|
+
set_line_and_column(line_and_column)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|