tla-sbuilder 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +328 -0
- data/VERSION +1 -0
- data/bin/sbuilder.rb +5 -0
- data/lib/cli/cli-customer.rb +420 -0
- data/lib/cli/cli-example.rb +92 -0
- data/lib/cli/cli-pet.rb +767 -0
- data/lib/cli/cli-text.rb +226 -0
- data/lib/cli/cli.rb +298 -0
- data/lib/sbuilder.rb +52 -0
- data/lib/sbuilder/constants.rb +72 -0
- data/lib/sbuilder/controller.rb +798 -0
- data/lib/sbuilder/default-sbuilder.yaml +372 -0
- data/lib/sbuilder/domain.rb +124 -0
- data/lib/sbuilder/domain_cardinality.rb +37 -0
- data/lib/sbuilder/domain_value.rb +81 -0
- data/lib/sbuilder/exception.rb +27 -0
- data/lib/sbuilder/extension_loader.rb +721 -0
- data/lib/sbuilder/factory.rb +234 -0
- data/lib/sbuilder/model.rb +356 -0
- data/lib/sbuilder/mustache/template.rb +125 -0
- data/lib/sbuilder/mustache/template_reader.rb +206 -0
- data/lib/sbuilder/mustache/template_reader_context.rb +371 -0
- data/lib/sbuilder/param_set.rb +132 -0
- data/lib/sbuilder/param_set_db.rb +20 -0
- data/lib/sbuilder/param_set_def.rb +57 -0
- data/lib/sbuilder/param_set_if.rb +68 -0
- data/lib/sbuilder/param_set_loader.rb +77 -0
- data/lib/sbuilder/param_set_loader_swagger.rb +424 -0
- data/lib/sbuilder/param_set_step.rb +62 -0
- data/lib/sbuilder/param_sets.rb +54 -0
- data/lib/sbuilder/parameter.rb +97 -0
- data/lib/sbuilder/parameter_container.rb +72 -0
- data/lib/sbuilder/parameter_dom.rb +70 -0
- data/lib/sbuilder/parameter_ref.rb +71 -0
- data/lib/sbuilder/resolver.rb +78 -0
- data/lib/sbuilder/resolver_loader.rb +79 -0
- data/lib/sbuilder/resolver_loader_yaml.rb +103 -0
- data/lib/sbuilder/resolver_rule.rb +36 -0
- data/lib/sbuilder/resolver_rule_match.rb +55 -0
- data/lib/sbuilder/resolver_rule_ref.rb +37 -0
- data/lib/utils/hash_inject.rb +12 -0
- data/lib/utils/logger.rb +80 -0
- data/lib/utils/netio.rb +58 -0
- data/lib/utils/string_inject.rb +10 -0
- data/lib/utils/version.rb +13 -0
- data/mustache/cfg/const_def.mustache +8 -0
- data/mustache/cfg/const_run.mustache +3 -0
- data/mustache/cfg/invariant-infrastructure-service.mustache +4 -0
- data/mustache/cfg/macro_run.mustache +6 -0
- data/mustache/cfg/module_footer.mustache +0 -0
- data/mustache/cfg/module_header.mustache +7 -0
- data/mustache/data-model-dump.mustache +19 -0
- data/mustache/data-model-footer.mustache +5 -0
- data/mustache/data-model-header.mustache +16 -0
- data/mustache/definition_types.mustache +40 -0
- data/mustache/domains.mustache +20 -0
- data/mustache/domains_assign.mustache +22 -0
- data/mustache/domains_run.mustache +21 -0
- data/mustache/extend/extend_assumptions.mustache +7 -0
- data/mustache/extend/extend_const.mustache +5 -0
- data/mustache/extend/extend_implementation.mustache +9 -0
- data/mustache/extend/extend_invariant.mustache +7 -0
- data/mustache/extend/extend_invariant_cfg.mustache +7 -0
- data/mustache/extend/extend_macros.mustache +19 -0
- data/mustache/extend/extend_operations.mustache +9 -0
- data/mustache/extend/extend_state.mustache +9 -0
- data/mustache/infrastructure-service-init.mustache +36 -0
- data/mustache/infrastructure-service-variables.mustache +10 -0
- data/mustache/interface_processes.mustache +38 -0
- data/mustache/interface_stubs_dummy.mustache +13 -0
- data/mustache/interface_types.mustache +52 -0
- data/mustache/markdown-header.mustache +24 -0
- data/mustache/markdown-toc.mustache +13 -0
- data/mustache/name_definition_type.mustache +5 -0
- data/mustache/name_domain.mustache +5 -0
- data/mustache/name_domain_value.mustache +5 -0
- data/mustache/name_domain_value_prefix.mustache +5 -0
- data/mustache/name_interface_response_type.mustache +6 -0
- data/mustache/name_interface_type.mustache +6 -0
- data/mustache/name_parameter_definition.mustache +5 -0
- data/mustache/name_parameter_type.mustache +6 -0
- data/mustache/name_process.mustache +6 -0
- data/mustache/name_type_invariant.mustache +5 -0
- data/mustache/name_variable.mustache +6 -0
- data/mustache/operator-infrastructure-service.mustache +13 -0
- data/mustache/possibility/module_extends.mustache +1 -0
- data/mustache/possibility/module_footer.mustache +1 -0
- data/mustache/possibility/module_header.mustache +8 -0
- data/mustache/possibility/possibility_definition.mustache +12 -0
- data/mustache/possibility/possibility_directive.mustache +1 -0
- data/mustache/possibility/possility_setup.mustache +28 -0
- data/mustache/setup/module_footer.mustache +1 -0
- data/mustache/setup/module_header.mustache +9 -0
- data/mustache/setup/operator_run.mustache +7 -0
- data/mustache/setup/operator_tick.mustache +2 -0
- data/mustache/setup/steps_run.mustache +22 -0
- data/mustache/setup/steps_run_bind_rule.mustache +51 -0
- data/mustache/setup/steps_run_bind_set.mustache +37 -0
- data/mustache/setup/steps_run_parameterBind.mustache +80 -0
- data/mustache/setup/steps_run_parameterExact.mustache +79 -0
- data/mustache/state_type_invariant-infrastructure-service.mustache +49 -0
- data/mustache/state_type_invariant.mustache +17 -0
- data/mustache/state_type_invariant_cfg.mustache +18 -0
- data/mustache/state_variables.mustache +20 -0
- data/mustache/tla/const_def.mustache +5 -0
- data/mustache/tla/const_run.mustache +3 -0
- data/mustache/tla/macro-infrastructure-service.mustache +14 -0
- data/mustache/tla/macro_run.mustache +40 -0
- data/mustache/tla/module_footer.mustache +2 -0
- data/mustache/tla/module_header.mustache +9 -0
- data/mustache/tla/operator_run.mustache +8 -0
- data/mustache/tla/operators-infrastructure-service.mustache +12 -0
- data/mustache/tla/plc_define_footer.mustache +1 -0
- data/mustache/tla/plc_define_header.mustache +1 -0
- data/mustache/tla/plc_define_run.mustache +59 -0
- data/mustache/tla/plc_footer.mustache +2 -0
- data/mustache/tla/plc_header.mustache +2 -0
- data/mustache/tla/plc_run_state.mustache +12 -0
- data/mustache/tla/plc_tail.mustache +8 -0
- data/mustache/tla/plc_translation.mustache +2 -0
- data/resources/schema/json_schema/draft-04.json +150 -0
- data/resources/schema/swagger/2.0/schema.json +1591 -0
- data/src-extend/README +2 -0
- data/src-extend/extend/extend_assumptions.mustache +7 -0
- data/src-extend/extend/extend_const.mustache +5 -0
- data/src-extend/extend/extend_implementation.mustache +9 -0
- data/src-extend/extend/extend_invariant.mustache +11 -0
- data/src-extend/extend/extend_invariant_cfg.mustache +7 -0
- data/src-extend/extend/extend_macros.mustache +19 -0
- data/src-extend/extend/extend_operations.mustache +9 -0
- data/src-extend/extend/extend_state.mustache +9 -0
- data/src-extend/extend_app/assumption +20 -0
- data/src-extend/extend_app/correctness +19 -0
- data/src-extend/extend_app/correctness.cfg +9 -0
- data/src-extend/extend_app/infrastructure +25 -0
- data/src-extend/extend_app/interface +11 -0
- data/src-extend/extend_app/operator +18 -0
- data/src-extend/extend_app/possibility +16 -0
- data/src-extend/extend_app/service +33 -0
- data/src-extend/extend_app/state +16 -0
- data/src-extend/extend_app/transaction +22 -0
- data/src/pet/assumption +29 -0
- data/src/pet/assumption_address_domains.tla +12 -0
- data/src/pet/assumption_domains.tla +16 -0
- data/src/pet/assumption_generic.tla +8 -0
- data/src/pet/assumption_id_domains.tla +2 -0
- data/src/pet/assumption_owner_domains.tla +14 -0
- data/src/pet/assumption_pet_domains.tla +16 -0
- data/src/pet/assumption_tag_domains.tla +13 -0
- data/src/pet/correctness +24 -0
- data/src/pet/correctness.cfg +9 -0
- data/src/pet/correctness_coherent_owner_address.tla +6 -0
- data/src/pet/correctness_pet_name.tla +4 -0
- data/src/pet/correctness_ref_tag.tla +13 -0
- data/src/pet/correctness_type_invariants.tla +12 -0
- data/src/pet/correctness_unique_pet.tla +3 -0
- data/src/pet/correctness_unique_tag.tla +3 -0
- data/src/pet/docs/Petstore.md +117 -0
- data/src/pet/extend/extend_assumptions.mustache +7 -0
- data/src/pet/extend/extend_implementation.mustache +9 -0
- data/src/pet/extend/extend_invariant.mustache +11 -0
- data/src/pet/extend/extend_invariant_cfg.mustache +7 -0
- data/src/pet/extend/extend_macros.mustache +19 -0
- data/src/pet/extend/extend_operations.mustache +9 -0
- data/src/pet/extend/extend_state.mustache +9 -0
- data/src/pet/infrastructure +25 -0
- data/src/pet/infrastructure_id_get.tla +24 -0
- data/src/pet/interface +12 -0
- data/src/pet/interface_delete_pet.tla +5 -0
- data/src/pet/interface_get_pet.tla +4 -0
- data/src/pet/interface_post_pet.tla +5 -0
- data/src/pet/interface_post_tag.tla +5 -0
- data/src/pet/interface_put_tag.tla +3 -0
- data/src/pet/operator +30 -0
- data/src/pet/operator_find_tag_by_owner_name.tla +1 -0
- data/src/pet/operator_get_pet.tla +4 -0
- data/src/pet/operator_get_pet_by_tag.tla +4 -0
- data/src/pet/operator_get_tag.tla +10 -0
- data/src/pet/operator_new_owner.tla +3 -0
- data/src/pet/operator_new_pet.tla +13 -0
- data/src/pet/operator_new_tag.tla +3 -0
- data/src/pet/operator_next_pet_id.tla +3 -0
- data/src/pet/operator_responses.tla +8 -0
- data/src/pet/operator_tag_exists.tla +2 -0
- data/src/pet/operator_tag_owner_validated.tla +2 -0
- data/src/pet/operator_tag_referenced.tla +4 -0
- data/src/pet/operator_valid_owner.tla +17 -0
- data/src/pet/operator_valid_pet.tla +6 -0
- data/src/pet/operator_valid_tag.tla +5 -0
- data/src/pet/possibility +18 -0
- data/src/pet/possibility_at_least_two_tags.tla +12 -0
- data/src/pet/possibility_invalid_tag_address.tla +8 -0
- data/src/pet/service +35 -0
- data/src/pet/service_pet_delete.tla +11 -0
- data/src/pet/service_pet_get.tla +27 -0
- data/src/pet/service_pet_post.tla +78 -0
- data/src/pet/service_tag_post.tla +53 -0
- data/src/pet/service_tag_put.tla +82 -0
- data/src/pet/state +16 -0
- data/src/pet/state_infra.tla +6 -0
- data/src/pet/state_pet.tla +5 -0
- data/src/pet/state_tag_id.tla +2 -0
- data/src/pet/transaction +23 -0
- data/src/pet/transaction_delete_pet.tla +13 -0
- data/src/pet/transaction_enter_pet.tla +13 -0
- data/src/pet/transaction_enter_tag.tla +56 -0
- data/src/pet/transaction_error.tla +23 -0
- data/tla-sbuilder.gemspec +43 -0
- metadata +353 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
# http://stackoverflow.com/questions/3772864/how-do-i-remove-leading-whitespace-chars-from-ruby-heredoc
|
2
|
+
|
3
|
+
class String
|
4
|
+
# Strip leading whitespace from each line that is the same as the
|
5
|
+
# amount of whitespace on the first line of the string.
|
6
|
+
# Leaves _additional_ indentation on later lines intact.
|
7
|
+
def unindent
|
8
|
+
gsub /^#{self[/\A[ \t]*/]}/, ''
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Sbuilder
|
2
|
+
|
3
|
+
|
4
|
+
def self.version
|
5
|
+
File.readlines( File.join File.dirname( __FILE__ ), "../../VERSION" ).first.gsub( /\n/, "" )
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.model_version
|
9
|
+
return File.readlines( "VERSION" ).first.gsub( /\n/, "" ) if File.exist?( "VERSION" )
|
10
|
+
return "Model version file #{Dir.pwd}/VERSION not found"
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
(* 'enabled' macro check is process enables *)
|
2
|
+
CONSTANT ProcessEnabled <- RunProcessEnabled
|
3
|
+
CONSTANT ProcessRunning <- RunProcessRunning
|
4
|
+
CONSTANT ProcessParameter <- RunProcessParameter
|
5
|
+
CONSTANT ProcessesToRun <- RunProcessesToRun
|
6
|
+
CONSTANT TickNext <- RunTickNext
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
data-model.dump.mustache - dump content of model data using markdown markup
|
4
|
+
|
5
|
+
- output header
|
6
|
+
- dump model data content
|
7
|
+
|
8
|
+
|
9
|
+
}}
|
10
|
+
|
11
|
+
## {{META.desc}} - data model element '{{META.modelData}}'
|
12
|
+
|
13
|
+
<!-- a class='navigator' href='#top'>[top]</a -->
|
14
|
+
|
15
|
+
<pre>
|
16
|
+
{{{dump}}}
|
17
|
+
</pre>
|
18
|
+
|
19
|
+
<!-- a class='navigator' href='#top'>[top]</a -->
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
data-model-header.mustache - output header in data-model dump
|
4
|
+
}}
|
5
|
+
|
6
|
+
# Data model
|
7
|
+
|
8
|
+
|
9
|
+
<!-- ul>
|
10
|
+
<li><a href="#interfaces">Model interfaces</a></li>
|
11
|
+
<li><a href="#definitions">Model definitions</a></li>
|
12
|
+
<li><a href="#domains">Model domains</a></li>
|
13
|
+
<li><a href="#variables">Model variables</a></li>
|
14
|
+
<li><a href="#steps">Model steps</a></li>
|
15
|
+
</ul -->
|
16
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
(******************************************************************
|
3
|
+
Defined types {{META.desc}}
|
4
|
+
- modelData {{META.modelData}}
|
5
|
+
- template {{META.template}}
|
6
|
+
*******************************************************************)
|
7
|
+
|
8
|
+
{{#definitions}}
|
9
|
+
{{>name_definition_type.mustache}} == {{!
|
10
|
+
|
11
|
+
Start of definition.
|
12
|
+
|
13
|
+
Add 'SUBSET ' for an array type
|
14
|
+
|
15
|
+
}}{{#isArray}}SUBSET {{/isArray}}{{!
|
16
|
+
|
17
|
+
Start of record and
|
18
|
+
|
19
|
+
}}[{{!
|
20
|
+
|
21
|
+
add fiels from #parameter_definitions
|
22
|
+
}}
|
23
|
+
{{#parameter_definitions}}
|
24
|
+
{{>name_parameter_definition.mustache}}: {{#isArray}}SUBSET {{/isArray}}{{>name_parameter_type.mustache}}{{_comma}}
|
25
|
+
{{/parameter_definitions}}{{!
|
26
|
+
|
27
|
+
end of definition
|
28
|
+
}}]{{!
|
29
|
+
|
30
|
+
|
31
|
+
End of array
|
32
|
+
|
33
|
+
|
34
|
+
}}{{#isArray}}{{/isArray}}{{!
|
35
|
+
|
36
|
+
Comment in the end
|
37
|
+
|
38
|
+
}} \* definition '{{definition_name}}'
|
39
|
+
|
40
|
+
{{/definitions}}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
domains.mustache
|
4
|
+
|
5
|
+
Iterate domains
|
6
|
+
|
7
|
+
}}
|
8
|
+
|
9
|
+
|
10
|
+
(******************************************************************
|
11
|
+
{{META.desc}}
|
12
|
+
- modelData {{META.modelData}}
|
13
|
+
- template {{META.template}}
|
14
|
+
******************************************************************)
|
15
|
+
|
16
|
+
{{#domains}}
|
17
|
+
CONSTANTS {{>name_domain.mustache}}
|
18
|
+
{{/domains}}
|
19
|
+
|
20
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
assign_domains.mustache
|
4
|
+
|
5
|
+
Assign run-domain to domains
|
6
|
+
|
7
|
+
}}
|
8
|
+
|
9
|
+
|
10
|
+
(******************************************************************
|
11
|
+
Map domain ranges in setup to specification domains:
|
12
|
+
|
13
|
+
{{META.desc}}
|
14
|
+
- modelData {{META.modelData}}
|
15
|
+
- template {{META.template}}
|
16
|
+
******************************************************************)
|
17
|
+
|
18
|
+
{{#domains}}
|
19
|
+
CONSTANT {{>name_domain.mustache}} <- Run_{{>name_domain.mustache}}
|
20
|
+
{{/domains}}
|
21
|
+
|
22
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
run_domains.mustache - define domain values
|
4
|
+
|
5
|
+
- iterate #domain_values
|
6
|
+
- include Nil to valid domain value
|
7
|
+
|
8
|
+
}}
|
9
|
+
|
10
|
+
(******************************************************************
|
11
|
+
Assign values to skeleton domains: {{META.desc}}
|
12
|
+
- modelData {{META.modelData}}
|
13
|
+
- template {{META.template}}
|
14
|
+
*******************************************************************)
|
15
|
+
|
16
|
+
(* Domains for {{META.setup}} start *)
|
17
|
+
{{#domains}}
|
18
|
+
Run_{{>name_domain.mustache}} == { {{#domain_values}}"{{>name_domain_value.mustache}}"{{_comma}} {{/domain_values}} } \cup {Nil} \*
|
19
|
+
{{/domains}}
|
20
|
+
(* Domains for {{META.setup}} end *)
|
21
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
(*
|
2
|
+
{{META.desc}}
|
3
|
+
- modelData {{META.modelData}}
|
4
|
+
- template {{META.template}}
|
5
|
+
*)
|
6
|
+
|
7
|
+
(* ******************************************************************
|
8
|
+
Transactions (modify state)
|
9
|
+
* ******************************************************************)
|
10
|
+
|
11
|
+
{{!>transaction}}
|
12
|
+
|
13
|
+
|
14
|
+
(* ******************************************************************
|
15
|
+
Macros implmeneting entries to interface services
|
16
|
+
* ******************************************************************)
|
17
|
+
|
18
|
+
{{!>interface}}
|
19
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
(******************************************************************
|
2
|
+
{{META.desc}}
|
3
|
+
- modelData {{META.modelData}}
|
4
|
+
- template {{META.template}}
|
5
|
+
|
6
|
+
******************************************************************)
|
7
|
+
|
8
|
+
\* create record to put into 'responses'variable field
|
9
|
+
InfrastructureServiceResponse( status, response ) == [ status |-> status, response |-> response ]
|
10
|
+
|
11
|
+
\* Initial value to variable 'responses'
|
12
|
+
InfrastructureServiceInit == {{!
|
13
|
+
|
14
|
+
No infrastructure services defined
|
15
|
+
|
16
|
+
}}{{^infrastructureServices.length}} Nil \* No infrastructure services defined
|
17
|
+
|
18
|
+
{{/infrastructureServices.length}}{{!
|
19
|
+
|
20
|
+
Some infrastructure services defined
|
21
|
+
|
22
|
+
}}{{#infrastructureServices.length}} [ {{/infrastructureServices.length}} {{!
|
23
|
+
|
24
|
+
iterate infrastructureServices
|
25
|
+
|
26
|
+
- output: <interface_name> |-> Nil,
|
27
|
+
|
28
|
+
|
29
|
+
}}{{#infrastructureServices}} {{>name_process.mustache}} |-> InfrastructureServiceResponse( Nil, Nil ){{_comma}}{{/infrastructureServices}}{{!
|
30
|
+
|
31
|
+
Infrastructure-services defined && end
|
32
|
+
|
33
|
+
- ouput: ];
|
34
|
+
|
35
|
+
}}{{#infrastructureServices.length}} ] {{/infrastructureServices.length}}
|
36
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
(******************************************************************
|
2
|
+
{{META.desc}}
|
3
|
+
- modelData {{META.modelData}}
|
4
|
+
- template {{META.template}}
|
5
|
+
|
6
|
+
******************************************************************)
|
7
|
+
|
8
|
+
\* Variable for returning responses from infrastructure services
|
9
|
+
responses = InfrastructureServiceInit;
|
10
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
interface_processes: speficy a process for each interface
|
4
|
+
|
5
|
+
|
6
|
+
}}
|
7
|
+
|
8
|
+
(******************************************************************
|
9
|
+
Interfaces generated {{META.desc}}
|
10
|
+
- modelData {{META.modelData}}
|
11
|
+
- template {{META.template}}
|
12
|
+
******************************************************************)
|
13
|
+
|
14
|
+
{{#interfaces}}
|
15
|
+
(* Process {{interface_operation}} *)
|
16
|
+
fair process ({{>name_process.mustache}}="{{interface_operation}}") {
|
17
|
+
{{>name_process.mustache}}_enter: while (TRUE) {
|
18
|
+
enable( "{{>name_process.mustache}}" );
|
19
|
+
(* enable next process to run parallel *)
|
20
|
+
\* process_done( "{{interface_operation}}" );
|
21
|
+
with ( _input \in { t \in ProcessParameterInput( {{>name_interface_type.mustache}} ) : ProcessParameterBind( t ) } ) {
|
22
|
+
\* PREFERENCES.debug-output: {{PREFERENCES.debug-output}}
|
23
|
+
{{^PREFERENCES.debug-output}}\* {{/PREFERENCES.debug-output}}print <<"Default process {{>name_process.mustache}} for operation '{{interface_operation}}',tick=", currentTime>>;
|
24
|
+
{{^implementation}}
|
25
|
+
{{^PREFERENCES.debug-output}}\* {{/PREFERENCES.debug-output}}print <<" - input=>", _input >>;
|
26
|
+
(* print <<" - {{>name_interface_type.mustache}}=>", {{>name_interface_type.mustache}} >>; *)
|
27
|
+
{{/implementation}}
|
28
|
+
(* Valid input type? *)
|
29
|
+
assert( _input \in {{>name_interface_type.mustache}} );
|
30
|
+
{{#implementation}}{{implementation}}( _input );{{/implementation}}
|
31
|
+
}; \* with _input
|
32
|
+
(* enable next process - after current process *)
|
33
|
+
{{>name_process.mustache}}_exit: process_done( "{{interface_operation}}" );
|
34
|
+
} \* while(TRUE)
|
35
|
+
} \* failr process {{>name_process.mustache}}
|
36
|
+
|
37
|
+
{{/interfaces}}
|
38
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
(******************************************************************
|
2
|
+
Interfaces generated {{META.desc}}
|
3
|
+
- modelData {{META.modelData}}
|
4
|
+
- template {{META.template}}
|
5
|
+
******************************************************************)
|
6
|
+
|
7
|
+
(* Create a dummy procedure with input variable so that pcal creates
|
8
|
+
constant defaultInitValue (which is assigned a value in setup.tla)
|
9
|
+
*)
|
10
|
+
|
11
|
+
procedure dummy( dummy_input ) {
|
12
|
+
dummy_start: skip;
|
13
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
interface_types.mustache : types for
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
}}
|
8
|
+
|
9
|
+
|
10
|
+
(******************************************************************
|
11
|
+
Interface input types: {{META.desc}}
|
12
|
+
- modelData {{META.modelData}}
|
13
|
+
- template {{META.template}}
|
14
|
+
*******************************************************************)
|
15
|
+
|
16
|
+
{{#interfaces}}
|
17
|
+
{{>name_interface_type.mustache}} == [{{#parameter_definitions}}
|
18
|
+
{{>name_parameter_definition.mustache}}: {{>name_parameter_type.mustache}}{{_comma}}{{/parameter_definitions}}{{!
|
19
|
+
|
20
|
+
Empty parameter definition (passes swagger schema validation).
|
21
|
+
|
22
|
+
ouput 'dummy : Nil'
|
23
|
+
|
24
|
+
}}{{^parameter_definitions.length}}dummy: Nil{{/parameter_definitions.length}}
|
25
|
+
] \* operation '{{interface_operation}}' --> process '{{>name_process.mustache}}'
|
26
|
+
|
27
|
+
{{/interfaces}}
|
28
|
+
|
29
|
+
\* end of Interface input types
|
30
|
+
|
31
|
+
(******************************************************************
|
32
|
+
Interface response types: {{META.desc}}
|
33
|
+
- modelData {{META.modelData}}
|
34
|
+
- template {{META.template}}
|
35
|
+
*******************************************************************)
|
36
|
+
|
37
|
+
{{#interfaces}}
|
38
|
+
{{>name_interface_response_type.mustache}} =={{!
|
39
|
+
|
40
|
+
When something defined as a response i.e. 'response_definitions.length' exists
|
41
|
+
|
42
|
+
}}{{#response_definitions.length}}[{{/response_definitions.length}}{{#response_definitions}}
|
43
|
+
{{>name_parameter_definition.mustache}}: {{>name_parameter_type.mustache}}{{_comma}}{{/response_definitions}}
|
44
|
+
{{#response_definitions.length}}]{{/response_definitions.length}}{{!
|
45
|
+
|
46
|
+
When no response defidined i.e. 'response_definitions.length' exists
|
47
|
+
|
48
|
+
}}{{^response_definitions.length}}{ Nil }{{/response_definitions.length}}{{!
|
49
|
+
|
50
|
+
Put a comment in the end
|
51
|
+
}} \* interface '{{interface_name}}' response type
|
52
|
+
{{/interfaces}}
|