sbdl 1.18.3__tar.gz → 1.18.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sbdl-1.18.5/PKG-INFO +9 -0
- sbdl-1.18.5/sbdl.egg-info/PKG-INFO +9 -0
- {sbdl-1.18.3 → sbdl-1.18.5}/sbdl.py +56 -56
- {sbdl-1.18.3 → sbdl-1.18.5}/setup.py +1 -1
- sbdl-1.18.3/PKG-INFO +0 -23
- sbdl-1.18.3/sbdl.egg-info/PKG-INFO +0 -23
- {sbdl-1.18.3 → sbdl-1.18.5}/csv-to-sbdl.py +0 -0
- {sbdl-1.18.3 → sbdl-1.18.5}/sbdl +0 -0
- {sbdl-1.18.3 → sbdl-1.18.5}/sbdl.egg-info/SOURCES.txt +0 -0
- {sbdl-1.18.3 → sbdl-1.18.5}/sbdl.egg-info/dependency_links.txt +0 -0
- {sbdl-1.18.3 → sbdl-1.18.5}/sbdl.egg-info/requires.txt +0 -0
- {sbdl-1.18.3 → sbdl-1.18.5}/sbdl.egg-info/top_level.txt +0 -0
- {sbdl-1.18.3 → sbdl-1.18.5}/sbdl_server.py +0 -0
- {sbdl-1.18.3 → sbdl-1.18.5}/setup.cfg +0 -0
sbdl-1.18.5/PKG-INFO
ADDED
|
@@ -169,12 +169,12 @@ _v='properties'
|
|
|
169
169
|
_u='occurrence'
|
|
170
170
|
_t='severity'
|
|
171
171
|
_s='detectability'
|
|
172
|
-
_r='
|
|
173
|
-
_q='
|
|
174
|
-
_p='
|
|
175
|
-
_o='
|
|
176
|
-
_n='
|
|
177
|
-
_m='
|
|
172
|
+
_r='utf-8'
|
|
173
|
+
_q='process_diagram_swimlanes'
|
|
174
|
+
_p='sbdl_grammar_native_freeform'
|
|
175
|
+
_o='control'
|
|
176
|
+
_n='Architecture'
|
|
177
|
+
_m='::'
|
|
178
178
|
_l='prolog_enabled'
|
|
179
179
|
_k='sbdl_ast_post_hooks'
|
|
180
180
|
_j='sbdl'
|
|
@@ -189,10 +189,10 @@ _b='effect'
|
|
|
189
189
|
_a='types'
|
|
190
190
|
_Z='requirement'
|
|
191
191
|
_Y='\\'
|
|
192
|
-
_X='
|
|
193
|
-
_W='
|
|
194
|
-
_V='
|
|
195
|
-
_U='
|
|
192
|
+
_X='universal_diagram_style'
|
|
193
|
+
_W='sbdl_output_pretty_format'
|
|
194
|
+
_V='-'
|
|
195
|
+
_U='_'
|
|
196
196
|
_T='parser_global_directives'
|
|
197
197
|
_S=','
|
|
198
198
|
_R='cause'
|
|
@@ -215,15 +215,15 @@ _B=None
|
|
|
215
215
|
_A=True
|
|
216
216
|
import argparse,base64,datetime,csv,functools,getpass,hashlib,importlib,io,json,os,pathlib,platform,re,shlex,string,subprocess,sys,tarfile,tempfile,textwrap,time,traceback,types,unittest,urllib.request,urllib.parse,warnings,zlib,zipfile
|
|
217
217
|
__NAME=_j
|
|
218
|
-
__VERSION='1.18.
|
|
219
|
-
__VERSION_DEV='
|
|
218
|
+
__VERSION='1.18.5'
|
|
219
|
+
__VERSION_DEV='f930310'
|
|
220
220
|
__VERSION_DSL='25.6'
|
|
221
221
|
__VERSION_REST_API='1.1.0'
|
|
222
222
|
__AUTHOR='contact@sbdl.dev'
|
|
223
223
|
__URL='https://sbdl.dev'
|
|
224
224
|
__LOGO=''
|
|
225
225
|
__HELP_TEXT=''
|
|
226
|
-
_CONFIG_DATA={_B2:'_sbdl\\s?\\(',_B3:'\\)$',_B4:'_sbdl_block_begin',_B5:'_sbdl_block_end',_B6:'^\\.\\.\\.$',_B7:_B,_B8:_A,_B9:_C,
|
|
226
|
+
_CONFIG_DATA={_B2:'_sbdl\\s?\\(',_B3:'\\)$',_B4:'_sbdl_block_begin',_B5:'_sbdl_block_end',_B6:'^\\.\\.\\.$',_B7:_B,_B8:_A,_B9:_C,_p:_A,_BA:{},_W:_C,_BB:_A,_BC:'.sbdl',_BD:_O,_BE:[],_k:[],_BF:5,_BG:_A,_BH:'sbdl-package.tar.gz',_AK:_C,_A1:_C,_A2:_C,_BI:_A,_BJ:_A,_BK:_A,_l:_A,_A3:_C,_AL:_B,_AM:_C,_BL:'plantuml',_BM:65536,_BN:'png',_BO:_A,_AN:_C,_AO:_C,_A4:_A,_BP:_A,_AP:_A,_AQ:_A,_T:{},_BQ:_A,_BR:_A,_BS:_A,_BT:38,_BU:22,_BV:_C,_BW:_A,_AR:20000,_BX:_C9,_BY:200,_BZ:'',_Ba:_C,_Bb:2,_Bc:_C,_X:"!pragma layout newlayouter\nskinparam dpi 200\nskinparam backgroundColor transparent\n'skinparam monochrome reverse\n\n",_Bd:'\n<style>\n node {\n HorizontalAlignment center\n MaximumWidth 150\n }\n wbsDiagram {\n Linecolor black\n arrow {\n LineColor black\n }\n .toplevel {\n }\n .source {\n LineStyle 2\n RoundCorner 10\n }\n .aspect {\n LineStyle 8.0;3.0\n LineColor lightgray\n BackgroundColor lightgray\n LineThickness 1.0\n RoundCorner 0\n Shadowing 0.0\n }\n }\n</style>',_Be:_B,_AS:'hide circle',_Bf:'frame',_Bg:'class',_Bh:_C,_AT:_CA,_Bi:_C,_Bj:'participant','process_diagram_style':_CA,_Bk:_C,_q:_C,_c:15,_Bl:40,_Bm:'',_Bn:_C,_Bo:'',_AU:_C,_Bp:0,_Bq:'[...]',_Br:_C,_Bs:'less -R'if os.name=='posix'else'',_Bt:'SBDL_NO_PRETTY',_Bu:_C,_Bv:_A,_Bw:_C,_Bx:'1879da28-0fc2-4f1d-8ff1-407f4c070c44',_By:'{base}/{endp}'.format(base=__URL,endp='rest.api'),_AV:'; ',_Bz:'',_B_:_A,_C0:_A,_C1:_C,_C2:'https://fmea.dev',_C3:_A,_C4:_C,_C5:_U,_C6:_B,_C7:8,_C8:'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'}
|
|
227
227
|
def name():return __NAME
|
|
228
228
|
def version():return __VERSION
|
|
229
229
|
def version_dev():return __VERSION_DEV
|
|
@@ -314,7 +314,7 @@ def rest_api_call(function_name,arguments_dict,print_l=print_null):
|
|
|
314
314
|
print_l('REST_API_CALL:: {} <-- {}'.format(API_END_POINT,response_struct),debug=_A)
|
|
315
315
|
if B in response_struct and isinstance(response_struct[B],list)and len(response_struct[B])>0:print_l('REST_API_CALL:: Response errors: \n {}'.format(_I.join(response_struct[B])),error=_A)
|
|
316
316
|
if get_config_value(_Bw,number=_A):
|
|
317
|
-
rest_object=create_rest_object(function_name,arguments_dict);print_l('REST_API_CALL:: {} --> {}'.format(API_END_POINT,rest_object),debug=_A);request_point=urllib.request.Request(API_END_POINT);request_point.add_header('Content-Type','application/json; charset=utf-8');request_data=json.dumps(rest_object).encode(
|
|
317
|
+
rest_object=create_rest_object(function_name,arguments_dict);print_l('REST_API_CALL:: {} --> {}'.format(API_END_POINT,rest_object),debug=_A);request_point=urllib.request.Request(API_END_POINT);request_point.add_header('Content-Type','application/json; charset=utf-8');request_data=json.dumps(rest_object).encode(_r);request_point.add_header('Content-Length',len(request_data))
|
|
318
318
|
try:rest_response=urllib.request.urlopen(request_point,request_data)
|
|
319
319
|
except(urllib.error.HTTPError,urllib.error.URLError)as e:print_l('REST_API_CALL:: Error: {}'.format(e),error=_A);rest_response=e
|
|
320
320
|
if rest_response.status!=200:
|
|
@@ -337,7 +337,7 @@ def rest_api_call_ping(print_l):print_l(rest_api_call('ping',{'date':get_date_st
|
|
|
337
337
|
class SBDL_Parser:
|
|
338
338
|
class Statements:declaration='declaration';using='using';scope='scope';operator='operator';customtype=_CC
|
|
339
339
|
class Types:aspect=_d;requirement=_Z;mode='fmea:mode';effect='fmea:effect';cause='fmea:cause';current_control='fmea:control';current_detection='fmea:detection';action_control='fmea:action-control';action_detection='fmea:action-detection';test='test';definition='definition';realisation='realisation';function=_AZ;event='event';state='state';transition='transition';usecase='usecase';interface=_A5;trace='trace';group='group'
|
|
340
|
-
class Tokens:declaration='is';declaration_group_delimeters=['{','}'];declaration_attribute_assign=' {} '.format(declaration);declaration_attribute_delimeter='"';general_separator=';';raw_content_delimiters=['[[[',']]]'];declaration_attribute_separator=general_separator;statement_separator=general_separator;hashbang='#!sbdl';prefix='@sbdl\\s';prefix_block_start='@sbdl\\-begin';prefix_block_end='@sbdl\\-end';comment='#';using='using';scope='scope';customtype=_CC;line_continuation=_Y;replacement_string_default='';replacement_map={_S:',',';':';'};declaration_token_rule='\\s+{}\\s+'.format(declaration);declaration_rule='^.+?{}\\S+\\s*{}.*?{}\\s*$'.format(declaration_token_rule,declaration_group_delimeters[0],declaration_group_delimeters[1]);using_rule=_CD.format(using,declaration_group_delimeters[0],declaration_group_delimeters[1]);scope_rule=_CD.format(scope,declaration_group_delimeters[0],declaration_group_delimeters[1]);customtype_rule='^\\s*{}\\s+{}'.format(customtype,declaration_rule.replace('^',''));macro_delimeters=['[',']'];macro_variable='@';macro_defer='%';macro_rule='\\{}{}(?:[^\\]\\\\]|\\\\.)*\\{}'.format(macro_delimeters[0],macro_variable,macro_delimeters[1]);macro_index_separator=':';whitespace_list=list(string.whitespace);escape=_Y;stereotype_separator='^';link_operator='||';source_link_operator='~|';operator_rule='\\s*({}|{})\\s*'.format(_Y+_Y.join(link_operator),_Y+_Y.join(source_link_operator));inherit='inherit';compose='compose';hash_separator='~';scope_prefix=
|
|
340
|
+
class Tokens:declaration='is';declaration_group_delimeters=['{','}'];declaration_attribute_assign=' {} '.format(declaration);declaration_attribute_delimeter='"';general_separator=';';raw_content_delimiters=['[[[',']]]'];declaration_attribute_separator=general_separator;statement_separator=general_separator;hashbang='#!sbdl';prefix='@sbdl\\s';prefix_block_start='@sbdl\\-begin';prefix_block_end='@sbdl\\-end';comment='#';using='using';scope='scope';customtype=_CC;line_continuation=_Y;replacement_string_default='';replacement_map={_S:',',';':';'};declaration_token_rule='\\s+{}\\s+'.format(declaration);declaration_rule='^.+?{}\\S+\\s*{}.*?{}\\s*$'.format(declaration_token_rule,declaration_group_delimeters[0],declaration_group_delimeters[1]);using_rule=_CD.format(using,declaration_group_delimeters[0],declaration_group_delimeters[1]);scope_rule=_CD.format(scope,declaration_group_delimeters[0],declaration_group_delimeters[1]);customtype_rule='^\\s*{}\\s+{}'.format(customtype,declaration_rule.replace('^',''));macro_delimeters=['[',']'];macro_variable='@';macro_defer='%';macro_rule='\\{}{}(?:[^\\]\\\\]|\\\\.)*\\{}'.format(macro_delimeters[0],macro_variable,macro_delimeters[1]);macro_index_separator=':';whitespace_list=list(string.whitespace);escape=_Y;stereotype_separator='^';link_operator='||';source_link_operator='~|';operator_rule='\\s*({}|{})\\s*'.format(_Y+_Y.join(link_operator),_Y+_Y.join(source_link_operator));inherit='inherit';compose='compose';hash_separator='~';scope_prefix=_m
|
|
341
341
|
class Attributes:description=_P;detectability=_s;detectability_post=_A6;severity=_t;occurrence=_u;occurrence_post=_A7;separator=_S;parent='parent';child='child';related='related';pragma='pragma';remark='remark';reference=_CE;identifier=_CF;type=_K;types=_a;stereotype='stereotype';actor=_Aa;tag='tag';description_bsci='description_bsci';precondition='precondition';postcondition='postcondition';invariant='invariant';output='output';input='input';custom_prefix='custom:';condition='condition';condition_alternative='alternative';custom_required_attr='required_property';custom_optional_attr='optional_property';custom_link_types='relation_type';color='color';control_only='control_only';return_control='return_control';raw_content='raw_content';loop_name='loop';parallel_name='parallel';port_name='port'
|
|
342
342
|
class Macros:self_element='SELF';self_reference='SELF_ID';self_reference_attr='SELF_PROP';abort='ABORT';message='MESSAGE';msg='MSG';date='DATE';user='USER';add='ADD';sub='SUB';equal='EQUAL';concat='CONCAT';instli='INSTLI';showall='SHOW_ALL';rmcom='RMCOM';mkid='MKID';dfp='DFP';requiredsl='REQUIRE_DSL_VERSION';requirecompiler='REQUIRE_COMPILER_VERSION';requiredsl_exact='REQUIRE_DSL_VERSION_EXACT';path='PATH';file_name='FILE';directory='DIR';context='CONTEXT';curline='=LINE';preline='-LINE';sucline='+LINE';line='LINE';import_sbdl='IMPORT';import_directive='IMPORT_DIRECTIVE';load_config='LOAD_CONFIG';git_commit_hash='GIT_COMMIT_HASH';define='DEFINE';define_append='DEFINE_APPEND';define_from_func='DEFUNC';define_from_index='DEFIND';define_from_file='DEFINEF';define_from_file_hash='DEFINEFH';expand_define='EXPAND';parsed_elements='PARSED_ELEMENTS';generated_elements='GENERATED_ELEMENTS';synthetic_element='SYNTHETIC_ELEMENT';cross_reference_available='CROSS_REFS_AVAILABLE';extend_cause='EXTEND_CAUSE';cpp_class='CPPCLASS';py_class='PYCLASS';c_func='CFUNC';py_func='PYFUNC';prolog_startup='PL_START';prolog_assert='PL_ASSERT';prolog_assert_n='PL_ASSERT!';prolog_cmd='PL_COMMAND';prolog_trace_file='PL_TRACE_FILE';prolog_result_output='PL_RESULT_OUTPUT';id_from_prop='ID_FROM_PROP'
|
|
343
343
|
class Parser_Element:
|
|
@@ -478,7 +478,7 @@ class SBDL_Parser:
|
|
|
478
478
|
else:base_str='{key}({value})'
|
|
479
479
|
return base_str.format(key=key,value=value)
|
|
480
480
|
def pstr(str_i):
|
|
481
|
-
result=str_i;pl_exclude=[_O,
|
|
481
|
+
result=str_i;pl_exclude=[_O,_V,':'];pl_repl=''
|
|
482
482
|
if str_i!=_B:
|
|
483
483
|
for pl_ex in pl_exclude:result=result.replace(pl_ex,pl_repl)
|
|
484
484
|
return result
|
|
@@ -854,11 +854,11 @@ class SBDL_Parser:
|
|
|
854
854
|
for escape_pair in escape_list:result=result.replace(*escape_pair[::incr])
|
|
855
855
|
return result
|
|
856
856
|
@classmethod
|
|
857
|
-
def remove_escape_chars(self,escaped_string):return escaped_string.encode(
|
|
857
|
+
def remove_escape_chars(self,escaped_string):return escaped_string.encode(_r).decode(_CG)
|
|
858
858
|
@classmethod
|
|
859
859
|
def attribute_string(self,statement_object):
|
|
860
860
|
indent_str='';newline_str='';spacing_str=_H
|
|
861
|
-
if get_config_value(
|
|
861
|
+
if get_config_value(_W,number=_A):indent_str=' ';newline_str=(self.Tokens.line_continuation if not get_config_value(_p,number=_A)else'')+_D;spacing_str=''
|
|
862
862
|
def needs_delim(attr_str):
|
|
863
863
|
result=_C
|
|
864
864
|
for wtsp in self.Tokens.whitespace_list:
|
|
@@ -875,12 +875,12 @@ class SBDL_Parser:
|
|
|
875
875
|
@classmethod
|
|
876
876
|
def declaration_string(self,declaration_object):
|
|
877
877
|
newline_str=''
|
|
878
|
-
if get_config_value(
|
|
878
|
+
if get_config_value(_W,number=_A):newline_str=(self.Tokens.line_continuation if not get_config_value(_p,number=_A)else'')+_D
|
|
879
879
|
return'{ident} {assignkw} {typename} {opencont}{newline}{attrset}{closecont}'.format(ident=declaration_object.identifier(),assignkw=SBDL_Parser.Tokens.declaration,typename=declaration_object.data_type(),opencont=newline_str+SBDL_Parser.Tokens.declaration_group_delimeters[0],attrset=self.attribute_string(declaration_object),closecont=SBDL_Parser.Tokens.declaration_group_delimeters[1],newline=newline_str)
|
|
880
880
|
@classmethod
|
|
881
881
|
def generic_elem_string(self,gen_object):
|
|
882
882
|
newline_str=''
|
|
883
|
-
if get_config_value(
|
|
883
|
+
if get_config_value(_W,number=_A):newline_str=(self.Tokens.line_continuation if not get_config_value(_p,number=_A)else'')+_D
|
|
884
884
|
return'{kw} {opencont}{newline}{attrset}{closecont}'.format(kw=gen_object.data_type(),opencont=SBDL_Parser.Tokens.declaration_group_delimeters[0],attrset=self.attribute_string(gen_object),closecont=SBDL_Parser.Tokens.declaration_group_delimeters[1],newline=newline_str)
|
|
885
885
|
@classmethod
|
|
886
886
|
def using_string(self,using_object):return self.generic_elem_string(using_object)
|
|
@@ -933,7 +933,7 @@ class SBDL_Parser:
|
|
|
933
933
|
@classmethod
|
|
934
934
|
def mk_type_info_struct(self,cat,desc):return{'category':cat,_P:desc}
|
|
935
935
|
class SBDL_Semantics:
|
|
936
|
-
type_links={SBDL_Parser.Types.mode:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.effect:_A,SBDL_Parser.Types.current_control:_A,SBDL_Parser.Types.current_detection:_A,SBDL_Parser.Types.test:_A,SBDL_Parser.Types.action_control:_A,SBDL_Parser.Types.action_detection:_A},SBDL_Parser.Types.cause:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.mode:_A,SBDL_Parser.Types.current_control:_A,SBDL_Parser.Types.current_detection:_A,SBDL_Parser.Types.test:_A,SBDL_Parser.Types.action_control:_A,SBDL_Parser.Types.action_detection:_A,SBDL_Parser.Types.event:_A},SBDL_Parser.Types.effect:{SBDL_Parser.Types.requirement:_A},SBDL_Parser.Types.aspect:dict.fromkeys(vars(SBDL_Parser.Types).values(),_A),SBDL_Parser.Statements.using:dict.fromkeys(vars(SBDL_Parser.Types).values(),_A),SBDL_Parser.Statements.scope:dict.fromkeys(vars(SBDL_Parser.Types).values(),_A),SBDL_Parser.Statements.customtype:dict.fromkeys(vars(SBDL_Parser.Types).values(),_A),SBDL_Parser.Types.trace:{SBDL_Parser.Types.cause:_A,SBDL_Parser.Types.mode:_A,SBDL_Parser.Types.effect:_A,SBDL_Parser.Types.current_control:_A,SBDL_Parser.Types.function:_A,SBDL_Parser.Types.transition:_A,SBDL_Parser.Types.event:_A,SBDL_Parser.Types.state:_A,SBDL_Parser.Types.interface:_A},SBDL_Parser.Types.test:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.definition:_A,SBDL_Parser.Types.realisation:_A,SBDL_Parser.Types.current_detection:_A},SBDL_Parser.Types.definition:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.function:_A,SBDL_Parser.Types.state:_A,SBDL_Parser.Types.usecase:_A,SBDL_Parser.Types.interface:_A,SBDL_Parser.Types.current_control:_A,SBDL_Parser.Types.current_detection:_A,SBDL_Parser.Types.action_control:_A,SBDL_Parser.Types.action_detection:_A},SBDL_Parser.Types.realisation:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.definition:_A,SBDL_Parser.Types.function:_A,SBDL_Parser.Types.state:_A,SBDL_Parser.Types.interface:_A},SBDL_Parser.Types.function:{SBDL_Parser.Types.event:_A,SBDL_Parser.Types.function:_A,SBDL_Parser.Types.usecase:_A,SBDL_Parser.Types.interface:_A,SBDL_Parser.Types.requirement:_A},SBDL_Parser.Types.transition:{SBDL_Parser.Types.state:_A,SBDL_Parser.Types.event:_A},SBDL_Parser.Types.usecase:{SBDL_Parser.Types.requirement:_A},SBDL_Parser.Types.interface:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.interface:_A},SBDL_Parser.Types.requirement:{SBDL_Parser.Types.current_control:_A}};global_properties={SBDL_Parser.Attributes.description:_A,SBDL_Parser.Attributes.remark:_A,SBDL_Parser.Attributes.reference:_C,SBDL_Parser.Attributes.tag:_A,SBDL_Parser.Attributes.pragma:_C};type_properties={SBDL_Parser.Types.aspect:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.related,SBDL_Parser.Attributes.color},SBDL_Parser.Types.requirement:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.related,SBDL_Parser.Attributes.color},SBDL_Parser.Types.mode:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.detectability,SBDL_Parser.Attributes.detectability_post},SBDL_Parser.Types.effect:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.severity},SBDL_Parser.Types.cause:{SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.occurrence,SBDL_Parser.Attributes.occurrence_post},SBDL_Parser.Types.function:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.precondition,SBDL_Parser.Attributes.postcondition,SBDL_Parser.Attributes.invariant,SBDL_Parser.Attributes.input,SBDL_Parser.Attributes.output,SBDL_Parser.Attributes.color},SBDL_Parser.Types.state:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.color},SBDL_Parser.Types.usecase:{SBDL_Parser.Attributes.actor},SBDL_Parser.Types.event:{SBDL_Parser.Attributes.precondition,SBDL_Parser.Attributes.postcondition,SBDL_Parser.Attributes.invariant,SBDL_Parser.Attributes.output,SBDL_Parser.Attributes.condition,SBDL_Parser.Attributes.condition_alternative,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.control_only,SBDL_Parser.Attributes.return_control,SBDL_Parser.Attributes.color},SBDL_Parser.Types.interface:{SBDL_Parser.Attributes.parent}};type_information={SBDL_Parser.Types.aspect:SBDL_Parser.mk_type_info_struct(_m,'Unit of system decomposition. May associate with a variety of perspectives: logical, functional ...'),SBDL_Parser.Types.requirement:SBDL_Parser.mk_type_info_struct(_m,'Requirement (or acceptance criteria) definition. Describes an expected behaviour at the associated level of abstraction.'),SBDL_Parser.Types.mode:SBDL_Parser.mk_type_info_struct(_Q,'Failure Mode. Describes the way in which a failure may occur, from the perspective of a requirement.'),SBDL_Parser.Types.effect:SBDL_Parser.mk_type_info_struct(_Q,'Failure Effect defintion. Describes the consequence of a failure mode.'),SBDL_Parser.Types.cause:SBDL_Parser.mk_type_info_struct(_Q,'Failure Cause. An underlying technical mechanism, scenario or sequence of events that may result in a failure mode.'),SBDL_Parser.Types.current_control:SBDL_Parser.mk_type_info_struct(_Q,'Existing controls which are present to prevent a failure cause either from occurring or leading to its associated failure mode.'),SBDL_Parser.Types.current_detection:SBDL_Parser.mk_type_info_struct(_Q,'Existing detections (tests) which are present to measure (before release) the occurence of a failure mode.'),SBDL_Parser.Types.action_control:SBDL_Parser.mk_type_info_struct(_Q,'Necessary steps that remain to be taken in order to prevent the occurance of a failure cause or mode.'),SBDL_Parser.Types.action_detection:SBDL_Parser.mk_type_info_struct(_Q,'Necessary steps that remain to be taken in order to increase the detectability of a failure mode.'),SBDL_Parser.Types.test:SBDL_Parser.mk_type_info_struct(_Ad,'Instance of a test for a particular part of a design.'),SBDL_Parser.Types.definition:SBDL_Parser.mk_type_info_struct(_Ae,'Prescriptive definition of a particular aspect of design.'),SBDL_Parser.Types.realisation:SBDL_Parser.mk_type_info_struct(_Ae,'Final realisation of a particular aspect of prescriptive design.'),SBDL_Parser.Types.function:SBDL_Parser.mk_type_info_struct(_Af,'Definition of a function.'),SBDL_Parser.Types.event:SBDL_Parser.mk_type_info_struct(_Af,'Definition of a dynamic event. May be a step within a broader function or cause a transition between states. Events may be composed as trees, with an event also entailing all of its children. Decisions can be expressed with the condition property; unmet conditions entail the alternative (property) children instead of default children.'),SBDL_Parser.Types.state:SBDL_Parser.mk_type_info_struct(_Ag,'Definition of a state.'),SBDL_Parser.Types.transition:SBDL_Parser.mk_type_info_struct(_Ag,'Definition of a transition between states. Takes an ordered pair of states (from,to).'),SBDL_Parser.Types.usecase:SBDL_Parser.mk_type_info_struct(_m,'Definition of a usecase within a particular abstraction of a the system.'),SBDL_Parser.Types.interface:SBDL_Parser.mk_type_info_struct(_m,'Definition of an interface exposing behaviour externally from the given abstraction.'),SBDL_Parser.Types.trace:SBDL_Parser.mk_type_info_struct(_Ad,'A dyanmic occurance of element instance (for example, an event or failure cause). Intended to be embedded within log files. Can be used to build and validate dynamic behaviour against the statically defined behaviour model.'),SBDL_Parser.Types.group:SBDL_Parser.mk_type_info_struct(_m,'Syntactic group of model elements. Used only to structure model representation and facilitate filtering; has no semantic implications for the model itself. May parent (contain) any other element type.')};category_descriptions={_m:'Architectural elements are used for specifying system decomposition. Such decompositions may be according to different views/schemes. for example: logical/structural, functional ...',_Q:'Failure Mode and Effect Analysis (FMEA) elements are used to describe risks present in a system, and the controls and actions mitigating them.',_Ae:'Design elements elaborate on the prescription and description of design decisions and their technical concepts.',_Ad:'Testing elements describe the implementation and coverage of tests (including dynamic traces).',_Af:'Dynamic elements describe and structure dynamic system behaviours, such as functions and events.',_Ag:'State elements capture the stateful behaviour of the system by offering a stateful view of dynamic elements.'};property_descriptions={SBDL_Parser.Attributes.description:'[string] Descriptive body of text for the given element.',SBDL_Parser.Attributes.detectability:'[number] Numerical rating on the interval [1(best)..10(worst)] indicating quality of a failure detection.',SBDL_Parser.Attributes.detectability_post:'[number] Numerical rating on the interval [1(best)..10(worst)] indicating quality of a failure detection AFTER realisation of an improvement action.',SBDL_Parser.Attributes.severity:'[number] Numerical rating on the interval [1(least)..10(most)] indicating the severity of a failure effect.',SBDL_Parser.Attributes.occurrence:'[number] Numerical rating on the interval [1(infrequent)..10(always)] indicating the probability of a failure cause occurring.',SBDL_Parser.Attributes.occurrence_post:'[number] Numerical rating on the interval [1(infrequent)..10(always)] indicating the probability of a failure cause occurring AFTER realisation of an improvement action.',SBDL_Parser.Attributes.parent:'[identifier] Hierarchical parent of the given element.',SBDL_Parser.Attributes.child:'[identifier] Hierarchical child of the given element.',SBDL_Parser.Attributes.related:'[identifier] Indicates a related element.',SBDL_Parser.Attributes.remark:'[string] General remark or more extensive information.',SBDL_Parser.Attributes.actor:'[string] Indicates the name of an actor affiliated with the given element.',SBDL_Parser.Attributes.tag:'[string] Comma separated list of tags which indicate some property of the given element.',SBDL_Parser.Attributes.precondition:'[string] Precondition for correct behaviour of the given element.',SBDL_Parser.Attributes.postcondition:"[string] Condition resulting from the given element's behaviour.",SBDL_Parser.Attributes.invariant:'[string] Conditions unaffected by the behaviour of the given element.',SBDL_Parser.Attributes.output:'[string] Output produced by the given element.',SBDL_Parser.Attributes.input:'[string] Input consumed by the given element.',SBDL_Parser.Attributes.condition:'[string] Element is conditional on the specified binary decision.',SBDL_Parser.Attributes.condition_alternative:'[identifier] Specifies an alternative for an unmet condition.',SBDL_Parser.Attributes.color:'[string] Color associated with element.',SBDL_Parser.Attributes.control_only:'[*] Presence indicates control flow only',SBDL_Parser.Attributes.return_control:'[*] Presence indicates immediate return of control flow'};directive_descriptons={SBDL_Parser.Macros.self_element:'[-> SBDL_Element] Element object for the current element (for internal cross-referencing)',SBDL_Parser.Macros.self_reference:'[-> string] Identifier of the current element (when embedded within an element property)',SBDL_Parser.Macros.self_reference_attr:"[-> string] Identifier of the current element's property (when embedded within an element property)",SBDL_Parser.Macros.abort:'[string ->] Abort compilation with error',SBDL_Parser.Macros.message:'[string ->] Show a message (on stdout) during compilation',SBDL_Parser.Macros.msg:'[string -> string] Show a message (on stdout) during compilation and replace occurence with the message inline',SBDL_Parser.Macros.date:"[-> string] Today's date",SBDL_Parser.Macros.add:'[int, ... -> int] Sum of arguments',SBDL_Parser.Macros.sub:'[int, ... -> int] Subtraction of subsequent arguments from the first argument',SBDL_Parser.Macros.equal:'[val, val ->] Raise a compiler error if two value arguments are not equal',SBDL_Parser.Macros.concat:'[string, ... -> string] Concatentate string arguments',SBDL_Parser.Macros.instli:'[string, ... -> string] Index a list of string terms separated by whitespaces',SBDL_Parser.Macros.showall:'[->] Show a message (on stdout) displaying all defined macros',SBDL_Parser.Macros.rmcom:'[string -> string] Remove comments from a string',SBDL_Parser.Macros.mkid:'[string -> string] Make a given string a valid SBDL identifier',SBDL_Parser.Macros.dfp:'[string -> string] Return a string defining a description as the previous line',SBDL_Parser.Macros.requiredsl:'[string ->] Raise a compiler error if the DSL version is not at least equal to the argument',SBDL_Parser.Macros.requiredsl_exact:'[string ->] Raise a compiler error if the DSL version is not exactly equal to the argument',SBDL_Parser.Macros.requirecompiler:'[string ->] Raise a compiler error if the current compiler version is not at least equal to the argument',SBDL_Parser.Macros.path:'[-> string] Path of the current file',SBDL_Parser.Macros.file_name:'[-> string] Name of the current file',SBDL_Parser.Macros.directory:'[-> string] Name of the current directory',SBDL_Parser.Macros.context:'[-> string] Context string (embedded statement)',SBDL_Parser.Macros.curline:'[-> string] Current line (embedded statement)',SBDL_Parser.Macros.preline:'[-> string] Previous line (embedded statement)',SBDL_Parser.Macros.sucline:'[-> string] Next line (embedded statement)',SBDL_Parser.Macros.line:'[-> string] Current line number',SBDL_Parser.Macros.import_sbdl:'[string ->] Import contents of another SBDL file',SBDL_Parser.Macros.import_directive:'[string ->] Import a custom directives file',SBDL_Parser.Macros.load_config:'[string ->] Load a compiler configuration file',SBDL_Parser.Macros.git_commit_hash:"[string -> string] Return the current (or stated path) Git repository's short commit hash",SBDL_Parser.Macros.id_from_prop:'[string, string -> string] Takes a property name and value. Returns the identifier list of elements with matching properties (which may be an empty string)',SBDL_Parser.Macros.define:'[string, string->] Create a key,value pair compiler definition',SBDL_Parser.Macros.define_append:'[string, string ->] Append to a named definition',SBDL_Parser.Macros.define_from_func:'[string, string, string ->] Create a definition from the result of a named compiler function application',SBDL_Parser.Macros.define_from_index:'[string, string, string ->] Create a definition from the result of indexing another name definition',SBDL_Parser.Macros.define_from_file:'[string, string ->] Create a definition from the contents of a named file',SBDL_Parser.Macros.define_from_file_hash:'[string, string ->] Create a definition from the hash of the contents of a named file',SBDL_Parser.Macros.expand_define:"[string -> string] 'Expand' and sanitize a named definition",SBDL_Parser.Macros.parsed_elements:'[->] Set of parsed elements (useable only programatically)',SBDL_Parser.Macros.generated_elements:'[->] Set of output elements generated by other directives (useable only programmatically)',SBDL_Parser.Macros.synthetic_element:'[->] Synthetic object class reference, used to generate elements dynamically (usable only programmatically)',SBDL_Parser.Macros.cross_reference_available:'[-> bool] Indicates whether cross references are available',SBDL_Parser.Macros.extend_cause:'[string, int -> string] In a failure cause to indicate it extends a name higher-level failure cause, args: [higher-cause, detectability] return [failure-mode-identifier]',SBDL_Parser.Macros.cpp_class:'[-> string] Most recently defined C++ Class (embedded statement)',SBDL_Parser.Macros.py_class:'[-> string] Most recently defined Python Class (embedded statement)',SBDL_Parser.Macros.c_func:'[-> string] Most recently defined C/C++ function (embedded statement)',SBDL_Parser.Macros.py_func:'[-> string] Most recently defined Python function (embedded statement)',SBDL_Parser.Macros.prolog_startup:'[->] Startup the Prolog environment (required at least once to use Prolog directives; indempotent)',SBDL_Parser.Macros.prolog_assert:'[string ->] Assert the truth of a Prolog query (throw a compiler error if not)',SBDL_Parser.Macros.prolog_assert_n:'[string ->] Assert a Prolog query as false (throw a compiler error if not)',SBDL_Parser.Macros.prolog_cmd:'[string ->] Issue a Prolog statement',SBDL_Parser.Macros.prolog_trace_file:'[string->] Write all generated Prolog facts, assertions and commands to a named file (for external use in Prolog)',SBDL_Parser.Macros.prolog_result_output:'[->] Output the result of Prolog assertions to stdout'};custom_types={}
|
|
936
|
+
type_links={SBDL_Parser.Types.mode:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.effect:_A,SBDL_Parser.Types.current_control:_A,SBDL_Parser.Types.current_detection:_A,SBDL_Parser.Types.test:_A,SBDL_Parser.Types.action_control:_A,SBDL_Parser.Types.action_detection:_A},SBDL_Parser.Types.cause:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.mode:_A,SBDL_Parser.Types.current_control:_A,SBDL_Parser.Types.current_detection:_A,SBDL_Parser.Types.test:_A,SBDL_Parser.Types.action_control:_A,SBDL_Parser.Types.action_detection:_A,SBDL_Parser.Types.event:_A},SBDL_Parser.Types.effect:{SBDL_Parser.Types.requirement:_A},SBDL_Parser.Types.aspect:dict.fromkeys(vars(SBDL_Parser.Types).values(),_A),SBDL_Parser.Statements.using:dict.fromkeys(vars(SBDL_Parser.Types).values(),_A),SBDL_Parser.Statements.scope:dict.fromkeys(vars(SBDL_Parser.Types).values(),_A),SBDL_Parser.Statements.customtype:dict.fromkeys(vars(SBDL_Parser.Types).values(),_A),SBDL_Parser.Types.trace:{SBDL_Parser.Types.cause:_A,SBDL_Parser.Types.mode:_A,SBDL_Parser.Types.effect:_A,SBDL_Parser.Types.current_control:_A,SBDL_Parser.Types.function:_A,SBDL_Parser.Types.transition:_A,SBDL_Parser.Types.event:_A,SBDL_Parser.Types.state:_A,SBDL_Parser.Types.interface:_A},SBDL_Parser.Types.test:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.definition:_A,SBDL_Parser.Types.realisation:_A,SBDL_Parser.Types.current_detection:_A},SBDL_Parser.Types.definition:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.function:_A,SBDL_Parser.Types.state:_A,SBDL_Parser.Types.usecase:_A,SBDL_Parser.Types.interface:_A,SBDL_Parser.Types.current_control:_A,SBDL_Parser.Types.current_detection:_A,SBDL_Parser.Types.action_control:_A,SBDL_Parser.Types.action_detection:_A},SBDL_Parser.Types.realisation:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.definition:_A,SBDL_Parser.Types.function:_A,SBDL_Parser.Types.state:_A,SBDL_Parser.Types.interface:_A},SBDL_Parser.Types.function:{SBDL_Parser.Types.event:_A,SBDL_Parser.Types.function:_A,SBDL_Parser.Types.usecase:_A,SBDL_Parser.Types.interface:_A,SBDL_Parser.Types.requirement:_A},SBDL_Parser.Types.transition:{SBDL_Parser.Types.state:_A,SBDL_Parser.Types.event:_A},SBDL_Parser.Types.usecase:{SBDL_Parser.Types.requirement:_A},SBDL_Parser.Types.interface:{SBDL_Parser.Types.requirement:_A,SBDL_Parser.Types.interface:_A},SBDL_Parser.Types.requirement:{SBDL_Parser.Types.current_control:_A}};global_properties={SBDL_Parser.Attributes.description:_A,SBDL_Parser.Attributes.remark:_A,SBDL_Parser.Attributes.reference:_C,SBDL_Parser.Attributes.tag:_A,SBDL_Parser.Attributes.pragma:_C};type_properties={SBDL_Parser.Types.aspect:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.related,SBDL_Parser.Attributes.color},SBDL_Parser.Types.requirement:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.related,SBDL_Parser.Attributes.color},SBDL_Parser.Types.mode:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.detectability,SBDL_Parser.Attributes.detectability_post},SBDL_Parser.Types.effect:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.severity},SBDL_Parser.Types.cause:{SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.occurrence,SBDL_Parser.Attributes.occurrence_post},SBDL_Parser.Types.function:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.precondition,SBDL_Parser.Attributes.postcondition,SBDL_Parser.Attributes.invariant,SBDL_Parser.Attributes.input,SBDL_Parser.Attributes.output,SBDL_Parser.Attributes.color},SBDL_Parser.Types.state:{SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.color},SBDL_Parser.Types.usecase:{SBDL_Parser.Attributes.actor},SBDL_Parser.Types.event:{SBDL_Parser.Attributes.precondition,SBDL_Parser.Attributes.postcondition,SBDL_Parser.Attributes.invariant,SBDL_Parser.Attributes.output,SBDL_Parser.Attributes.condition,SBDL_Parser.Attributes.condition_alternative,SBDL_Parser.Attributes.child,SBDL_Parser.Attributes.parent,SBDL_Parser.Attributes.control_only,SBDL_Parser.Attributes.return_control,SBDL_Parser.Attributes.color},SBDL_Parser.Types.interface:{SBDL_Parser.Attributes.parent}};type_information={SBDL_Parser.Types.aspect:SBDL_Parser.mk_type_info_struct(_n,'Unit of system decomposition. May associate with a variety of perspectives: logical, functional ...'),SBDL_Parser.Types.requirement:SBDL_Parser.mk_type_info_struct(_n,'Requirement (or acceptance criteria) definition. Describes an expected behaviour at the associated level of abstraction.'),SBDL_Parser.Types.mode:SBDL_Parser.mk_type_info_struct(_Q,'Failure Mode. Describes the way in which a failure may occur, from the perspective of a requirement.'),SBDL_Parser.Types.effect:SBDL_Parser.mk_type_info_struct(_Q,'Failure Effect defintion. Describes the consequence of a failure mode.'),SBDL_Parser.Types.cause:SBDL_Parser.mk_type_info_struct(_Q,'Failure Cause. An underlying technical mechanism, scenario or sequence of events that may result in a failure mode.'),SBDL_Parser.Types.current_control:SBDL_Parser.mk_type_info_struct(_Q,'Existing controls which are present to prevent a failure cause either from occurring or leading to its associated failure mode.'),SBDL_Parser.Types.current_detection:SBDL_Parser.mk_type_info_struct(_Q,'Existing detections (tests) which are present to measure (before release) the occurence of a failure mode.'),SBDL_Parser.Types.action_control:SBDL_Parser.mk_type_info_struct(_Q,'Necessary steps that remain to be taken in order to prevent the occurance of a failure cause or mode.'),SBDL_Parser.Types.action_detection:SBDL_Parser.mk_type_info_struct(_Q,'Necessary steps that remain to be taken in order to increase the detectability of a failure mode.'),SBDL_Parser.Types.test:SBDL_Parser.mk_type_info_struct(_Ad,'Instance of a test for a particular part of a design.'),SBDL_Parser.Types.definition:SBDL_Parser.mk_type_info_struct(_Ae,'Prescriptive definition of a particular aspect of design.'),SBDL_Parser.Types.realisation:SBDL_Parser.mk_type_info_struct(_Ae,'Final realisation of a particular aspect of prescriptive design.'),SBDL_Parser.Types.function:SBDL_Parser.mk_type_info_struct(_Af,'Definition of a function.'),SBDL_Parser.Types.event:SBDL_Parser.mk_type_info_struct(_Af,'Definition of a dynamic event. May be a step within a broader function or cause a transition between states. Events may be composed as trees, with an event also entailing all of its children. Decisions can be expressed with the condition property; unmet conditions entail the alternative (property) children instead of default children.'),SBDL_Parser.Types.state:SBDL_Parser.mk_type_info_struct(_Ag,'Definition of a state.'),SBDL_Parser.Types.transition:SBDL_Parser.mk_type_info_struct(_Ag,'Definition of a transition between states. Takes an ordered pair of states (from,to).'),SBDL_Parser.Types.usecase:SBDL_Parser.mk_type_info_struct(_n,'Definition of a usecase within a particular abstraction of a the system.'),SBDL_Parser.Types.interface:SBDL_Parser.mk_type_info_struct(_n,'Definition of an interface exposing behaviour externally from the given abstraction.'),SBDL_Parser.Types.trace:SBDL_Parser.mk_type_info_struct(_Ad,'A dyanmic occurance of element instance (for example, an event or failure cause). Intended to be embedded within log files. Can be used to build and validate dynamic behaviour against the statically defined behaviour model.'),SBDL_Parser.Types.group:SBDL_Parser.mk_type_info_struct(_n,'Syntactic group of model elements. Used only to structure model representation and facilitate filtering; has no semantic implications for the model itself. May parent (contain) any other element type.')};category_descriptions={_n:'Architectural elements are used for specifying system decomposition. Such decompositions may be according to different views/schemes. for example: logical/structural, functional ...',_Q:'Failure Mode and Effect Analysis (FMEA) elements are used to describe risks present in a system, and the controls and actions mitigating them.',_Ae:'Design elements elaborate on the prescription and description of design decisions and their technical concepts.',_Ad:'Testing elements describe the implementation and coverage of tests (including dynamic traces).',_Af:'Dynamic elements describe and structure dynamic system behaviours, such as functions and events.',_Ag:'State elements capture the stateful behaviour of the system by offering a stateful view of dynamic elements.'};property_descriptions={SBDL_Parser.Attributes.description:'[string] Descriptive body of text for the given element.',SBDL_Parser.Attributes.detectability:'[number] Numerical rating on the interval [1(best)..10(worst)] indicating quality of a failure detection.',SBDL_Parser.Attributes.detectability_post:'[number] Numerical rating on the interval [1(best)..10(worst)] indicating quality of a failure detection AFTER realisation of an improvement action.',SBDL_Parser.Attributes.severity:'[number] Numerical rating on the interval [1(least)..10(most)] indicating the severity of a failure effect.',SBDL_Parser.Attributes.occurrence:'[number] Numerical rating on the interval [1(infrequent)..10(always)] indicating the probability of a failure cause occurring.',SBDL_Parser.Attributes.occurrence_post:'[number] Numerical rating on the interval [1(infrequent)..10(always)] indicating the probability of a failure cause occurring AFTER realisation of an improvement action.',SBDL_Parser.Attributes.parent:'[identifier] Hierarchical parent of the given element.',SBDL_Parser.Attributes.child:'[identifier] Hierarchical child of the given element.',SBDL_Parser.Attributes.related:'[identifier] Indicates a related element.',SBDL_Parser.Attributes.remark:'[string] General remark or more extensive information.',SBDL_Parser.Attributes.actor:'[string] Indicates the name of an actor affiliated with the given element.',SBDL_Parser.Attributes.tag:'[string] Comma separated list of tags which indicate some property of the given element.',SBDL_Parser.Attributes.precondition:'[string] Precondition for correct behaviour of the given element.',SBDL_Parser.Attributes.postcondition:"[string] Condition resulting from the given element's behaviour.",SBDL_Parser.Attributes.invariant:'[string] Conditions unaffected by the behaviour of the given element.',SBDL_Parser.Attributes.output:'[string] Output produced by the given element.',SBDL_Parser.Attributes.input:'[string] Input consumed by the given element.',SBDL_Parser.Attributes.condition:'[string] Element is conditional on the specified binary decision.',SBDL_Parser.Attributes.condition_alternative:'[identifier] Specifies an alternative for an unmet condition.',SBDL_Parser.Attributes.color:'[string] Color associated with element.',SBDL_Parser.Attributes.control_only:'[*] Presence indicates control flow only',SBDL_Parser.Attributes.return_control:'[*] Presence indicates immediate return of control flow'};directive_descriptons={SBDL_Parser.Macros.self_element:'[-> SBDL_Element] Element object for the current element (for internal cross-referencing)',SBDL_Parser.Macros.self_reference:'[-> string] Identifier of the current element (when embedded within an element property)',SBDL_Parser.Macros.self_reference_attr:"[-> string] Identifier of the current element's property (when embedded within an element property)",SBDL_Parser.Macros.abort:'[string ->] Abort compilation with error',SBDL_Parser.Macros.message:'[string ->] Show a message (on stdout) during compilation',SBDL_Parser.Macros.msg:'[string -> string] Show a message (on stdout) during compilation and replace occurence with the message inline',SBDL_Parser.Macros.date:"[-> string] Today's date",SBDL_Parser.Macros.add:'[int, ... -> int] Sum of arguments',SBDL_Parser.Macros.sub:'[int, ... -> int] Subtraction of subsequent arguments from the first argument',SBDL_Parser.Macros.equal:'[val, val ->] Raise a compiler error if two value arguments are not equal',SBDL_Parser.Macros.concat:'[string, ... -> string] Concatentate string arguments',SBDL_Parser.Macros.instli:'[string, ... -> string] Index a list of string terms separated by whitespaces',SBDL_Parser.Macros.showall:'[->] Show a message (on stdout) displaying all defined macros',SBDL_Parser.Macros.rmcom:'[string -> string] Remove comments from a string',SBDL_Parser.Macros.mkid:'[string -> string] Make a given string a valid SBDL identifier',SBDL_Parser.Macros.dfp:'[string -> string] Return a string defining a description as the previous line',SBDL_Parser.Macros.requiredsl:'[string ->] Raise a compiler error if the DSL version is not at least equal to the argument',SBDL_Parser.Macros.requiredsl_exact:'[string ->] Raise a compiler error if the DSL version is not exactly equal to the argument',SBDL_Parser.Macros.requirecompiler:'[string ->] Raise a compiler error if the current compiler version is not at least equal to the argument',SBDL_Parser.Macros.path:'[-> string] Path of the current file',SBDL_Parser.Macros.file_name:'[-> string] Name of the current file',SBDL_Parser.Macros.directory:'[-> string] Name of the current directory',SBDL_Parser.Macros.context:'[-> string] Context string (embedded statement)',SBDL_Parser.Macros.curline:'[-> string] Current line (embedded statement)',SBDL_Parser.Macros.preline:'[-> string] Previous line (embedded statement)',SBDL_Parser.Macros.sucline:'[-> string] Next line (embedded statement)',SBDL_Parser.Macros.line:'[-> string] Current line number',SBDL_Parser.Macros.import_sbdl:'[string ->] Import contents of another SBDL file',SBDL_Parser.Macros.import_directive:'[string ->] Import a custom directives file',SBDL_Parser.Macros.load_config:'[string ->] Load a compiler configuration file',SBDL_Parser.Macros.git_commit_hash:"[string -> string] Return the current (or stated path) Git repository's short commit hash",SBDL_Parser.Macros.id_from_prop:'[string, string -> string] Takes a property name and value. Returns the identifier list of elements with matching properties (which may be an empty string)',SBDL_Parser.Macros.define:'[string, string->] Create a key,value pair compiler definition',SBDL_Parser.Macros.define_append:'[string, string ->] Append to a named definition',SBDL_Parser.Macros.define_from_func:'[string, string, string ->] Create a definition from the result of a named compiler function application',SBDL_Parser.Macros.define_from_index:'[string, string, string ->] Create a definition from the result of indexing another name definition',SBDL_Parser.Macros.define_from_file:'[string, string ->] Create a definition from the contents of a named file',SBDL_Parser.Macros.define_from_file_hash:'[string, string ->] Create a definition from the hash of the contents of a named file',SBDL_Parser.Macros.expand_define:"[string -> string] 'Expand' and sanitize a named definition",SBDL_Parser.Macros.parsed_elements:'[->] Set of parsed elements (useable only programatically)',SBDL_Parser.Macros.generated_elements:'[->] Set of output elements generated by other directives (useable only programmatically)',SBDL_Parser.Macros.synthetic_element:'[->] Synthetic object class reference, used to generate elements dynamically (usable only programmatically)',SBDL_Parser.Macros.cross_reference_available:'[-> bool] Indicates whether cross references are available',SBDL_Parser.Macros.extend_cause:'[string, int -> string] In a failure cause to indicate it extends a name higher-level failure cause, args: [higher-cause, detectability] return [failure-mode-identifier]',SBDL_Parser.Macros.cpp_class:'[-> string] Most recently defined C++ Class (embedded statement)',SBDL_Parser.Macros.py_class:'[-> string] Most recently defined Python Class (embedded statement)',SBDL_Parser.Macros.c_func:'[-> string] Most recently defined C/C++ function (embedded statement)',SBDL_Parser.Macros.py_func:'[-> string] Most recently defined Python function (embedded statement)',SBDL_Parser.Macros.prolog_startup:'[->] Startup the Prolog environment (required at least once to use Prolog directives; indempotent)',SBDL_Parser.Macros.prolog_assert:'[string ->] Assert the truth of a Prolog query (throw a compiler error if not)',SBDL_Parser.Macros.prolog_assert_n:'[string ->] Assert a Prolog query as false (throw a compiler error if not)',SBDL_Parser.Macros.prolog_cmd:'[string ->] Issue a Prolog statement',SBDL_Parser.Macros.prolog_trace_file:'[string->] Write all generated Prolog facts, assertions and commands to a named file (for external use in Prolog)',SBDL_Parser.Macros.prolog_result_output:'[->] Output the result of Prolog assertions to stdout'};custom_types={}
|
|
937
937
|
@classmethod
|
|
938
938
|
def get_valid_link_type_for_type_name(self,type_name):
|
|
939
939
|
valid_type_links=[];skip_types=[SBDL_Parser.Statements.using,SBDL_Parser.Statements.scope,_j]
|
|
@@ -1000,7 +1000,7 @@ class SBDL_Semantics:
|
|
|
1000
1000
|
if right_to_left:text_words.reverse()
|
|
1001
1001
|
text_words=[x.capitalize()if not x.isupper()else x for x in text_words];return SBDL_Parser.sanitize_identifier(separator.join(text_words))
|
|
1002
1002
|
@classmethod
|
|
1003
|
-
def get_identifier_from_string_eng_standard(self,input_string,aggressive_length=20,min_word_len=3,separator='',right_to_left=_A):stop_words={'the','and','of','to','in','a','on','for','with','at','by','an',_A8,'shall','should','must','will','can','may','might','could','be','have','use','perform','execute','define','configure','manage','then'};stop_chars={'a','e','i','o','u'};abbreviations={'acceleration':'accel','actuator':'act','aerodynamics':'aero','analysis':'anal','approximate':'approx','architecture':'arch','assembly':'assy','auxiliary':'aux','battery':'batt','calculation':'calc','center of gravity':'cg','center of mass':'cm','coefficient':'coeff','configuration':'config',
|
|
1003
|
+
def get_identifier_from_string_eng_standard(self,input_string,aggressive_length=20,min_word_len=3,separator='',right_to_left=_A):stop_words={'the','and','of','to','in','a','on','for','with','at','by','an',_A8,'shall','should','must','will','can','may','might','could','be','have','use','perform','execute','define','configure','manage','then'};stop_chars={'a','e','i','o','u'};abbreviations={'acceleration':'accel','actuator':'act','aerodynamics':'aero','analysis':'anal','approximate':'approx','architecture':'arch','assembly':'assy','auxiliary':'aux','battery':'batt','calculation':'calc','center of gravity':'cg','center of mass':'cm','coefficient':'coeff','configuration':'config',_o:'ctrl','controller':'cntrlr','coordinate':'coord','correction':'corr','current':'curr','data acquisition':'daq','decibel':'db','degrees of freedom':'dof','design':'des','development':'dev','diameter':'dia','dimension':'dim','dynamic':'dyn','efficiency':'eff','electrical':'elec','electromagnetic':'em','error':'err','estimate':'est','evaluation':'eval','failure mode and effects analysis':_x,'fatigue':'fat','feature':'feat','feedback':'fb','frequency':'freq',_AZ:'func','gradient':'grad','hardware':'hw','heat transfer':'ht','high voltage':'hv',_CF:'id','identification':'id','implementation':'impl','input':'in','inspection':'insp','instrumentation':'instr','integration':'intg',_A5:'intf','iteration':'iter','load':'ld','logic':'log','maintenance':'maint','management':'mgmt','manufacturing':'mfg','material':'matl','maximum':'max','measurement':'meas','mechanism':'mech','minimum':'min','model':'mdl','momentum':'mom','nominal':'nom','operating system':'os','optimization':'opt','output':'out','parameter':'param','performance':'perf','physics':'phys','position':'pos','power':'pwr','pressure':'pres','process':'proc','proportional-integral-derivative':'pid','quality assurance':'qa','radiation':'rad','redundancy':'redund',_CE:'ref','reliability':'rel',_Z:'req','resolution':'res','resistance':'resist','safety':'sfty','sensor':'sens','simulation':'sim','software':'sw','specification':'spec','stability':'stab','static':'stat','structure':'struc','subsystem':'subsys',_A8:'sys','temperature':'temp','tension':'tens','testing':'test','thermal':'therm','torque':'torq','transient':'trans','uncertainty':'uncert','validation':'val','verification':'verif','voltage':'volt','weight':'wt','target':'targ'};return self.get_identifier_from_string(re.sub('[^a-zA-Z0-9.:_ ]+|(?<=.)\\.$','',input_string),aggressive_length,min_word_len,separator,stop_words=stop_words,stop_chars=stop_chars,abbreviations=abbreviations,right_to_left=right_to_left)
|
|
1004
1004
|
@classmethod
|
|
1005
1005
|
def shorten_string_on_word_boundary(self,input_string,shorten_length):return _H.join(input_string.split()[-len(input_string[-shorten_length:].split()):])
|
|
1006
1006
|
@classmethod
|
|
@@ -1414,7 +1414,7 @@ class SBDL_Element_Synthetic(SBDL_Element_Rating):
|
|
|
1414
1414
|
types_list=[self.type()];matching_base_class=SBDL_Element.declaration_type_to_class(self.type(),raise_on_error=_C)
|
|
1415
1415
|
if matching_base_class is not _B:types_list=matching_base_class.types()
|
|
1416
1416
|
return types_list
|
|
1417
|
-
def definition(self):pp=get_config_value(
|
|
1417
|
+
def definition(self):pp=get_config_value(_W,number=_A);set_config_value(_W,_C);self._definition=SBDL_Declaration_Statement(SBDL_Parser.Parser_Element('',self._source,self._indexes),self.identifier(),self.type(),self._generate_data_dictionary());self._definition=SBDL_Declaration_Statement(SBDL_Parser.Parser_Element(super().definition().string(),self._source,self._indexes),self.identifier(),self.type(),self._generate_data_dictionary());set_config_value(_W,pp);return super().definition()
|
|
1418
1418
|
def set_identifier(self,identifier):self._identifier=identifier
|
|
1419
1419
|
def set_type(self,type_name):self._type=type_name
|
|
1420
1420
|
def set_rating(self,rating,post=_C):
|
|
@@ -1800,7 +1800,7 @@ class SBDL_AST:
|
|
|
1800
1800
|
return occurrence_counters,errors
|
|
1801
1801
|
def is_input_file(path):
|
|
1802
1802
|
result=_C
|
|
1803
|
-
if path==
|
|
1803
|
+
if path==_V or os.path.isfile(make_remote_file_local(path)):result=_A
|
|
1804
1804
|
return result
|
|
1805
1805
|
class base_file_object:
|
|
1806
1806
|
def __iter__(self):return self
|
|
@@ -1842,7 +1842,7 @@ def plain_text_input_handler(file_reference):
|
|
|
1842
1842
|
except FileNotFoundError as notfound:raise notfound
|
|
1843
1843
|
except Exception as _:debug_out('Ignoring: {}'.format(file_reference))
|
|
1844
1844
|
return _A,text_file_object
|
|
1845
|
-
def stdio_input_handler(file_reference):return file_reference==
|
|
1845
|
+
def stdio_input_handler(file_reference):return file_reference==_V,stdio_clone()
|
|
1846
1846
|
def ms_character_fix(input_string):return input_string.replace('“','"').replace('”','"')
|
|
1847
1847
|
def msword_input_handler(file_reference):
|
|
1848
1848
|
result=_C;handler=_B;_,extension=os.path.splitext(file_reference)
|
|
@@ -1876,7 +1876,7 @@ def open_input_file(file_reference):
|
|
|
1876
1876
|
can_handle,handler_object=potential_handler(make_remote_file_local(file_reference))
|
|
1877
1877
|
if can_handle:selected_handler=handler_object;break
|
|
1878
1878
|
return selected_handler
|
|
1879
|
-
def open_output_file(file_reference,is_text=_A,append=_C):std_out_ref=
|
|
1879
|
+
def open_output_file(file_reference,is_text=_A,append=_C):std_out_ref=_V;return open(file_reference,('a'if append else'w')+('t'if is_text else'b'),encoding=_r if is_text else _B)if file_reference!=std_out_ref else stdio_clone()
|
|
1880
1880
|
def context_directive_sniffer_class(matching_context,_,__):
|
|
1881
1881
|
class_string=_B;parts=matching_context.split()
|
|
1882
1882
|
for part in range(0,len(parts)):
|
|
@@ -1952,7 +1952,7 @@ def get_parser_elements_from_filepath(filepath,elements_list,print_l=print_null,
|
|
|
1952
1952
|
def is_line_continuation(line_content):
|
|
1953
1953
|
result=_C;line_content_1=line_content;cont_mark=SBDL_Parser.Tokens.line_continuation;end_str=line_content_1[-len(cont_mark):]
|
|
1954
1954
|
if end_str==cont_mark:line_content_1=line_content_1[:-len(cont_mark)];result=_A
|
|
1955
|
-
elif native_sbdl_file and get_config_value(
|
|
1955
|
+
elif native_sbdl_file and get_config_value(_p,number=_A):result=_A
|
|
1956
1956
|
return result,line_content_1
|
|
1957
1957
|
def line_buffer_markers_update():line_buffer_markers.append([len(line_buffer),line_count])
|
|
1958
1958
|
def apply_directives(input_line):
|
|
@@ -2097,8 +2097,8 @@ def plantuml_footer_generator():
|
|
|
2097
2097
|
if get_config_value(_BO,number=_A):footer_content+='footer \\nGenerated by {generator} on {date}\\n\\n\n'.format(generator='{} version {}'.format(__NAME,__VERSION),date=get_date_string())
|
|
2098
2098
|
return footer_content
|
|
2099
2099
|
def plantuml_identifier(in_string):
|
|
2100
|
-
result=in_string.strip(_H).replace('/',
|
|
2101
|
-
if result=='':result=
|
|
2100
|
+
result=in_string.strip(_H).replace('/',_U).replace(_N,_U).replace(_V,_U).replace(_m,_U)
|
|
2101
|
+
if result=='':result=_U
|
|
2102
2102
|
return result
|
|
2103
2103
|
def write_requirement_graph_output(sbdl_ast,output_file,file_opener,arguments,print_l):
|
|
2104
2104
|
B='rtype';A='rid';elements,errors=sbdl_ast.elements(print_l,prune_missing_references=_A);requirements={k:v for(k,v)in elements.items()if v.is_a(SBDL_Requirement)};title_sanitized=SBDL_Parser.sanitize_identifier(arguments.title);root_requirement=SBDL_Element_Synthetic(title_sanitized,'',SBDL_Parser.Types.requirement,_B);root_requirement.add_link(SBDL_Element.Element_Link(title_sanitized,SBDL_Parser.Types.aspect));top_level_requirements=[]
|
|
@@ -2132,7 +2132,7 @@ def write_requirement_graph_output(sbdl_ast,output_file,file_opener,arguments,pr
|
|
|
2132
2132
|
def plantuml_requirement_diagram_wrap(content):
|
|
2133
2133
|
header=plantuml_footer_generator();legend_text='';legend=get_config_value(_Be)
|
|
2134
2134
|
if legend!=_B:legend_text='legend\n{legend_content}\nendlegend\n'.format(legend_content=legend)
|
|
2135
|
-
plant_uml_prepost='@startwbs\n{style}\n\n{header}\n{content}\n{legend}@endwbs\n';return plant_uml_prepost.format(style=get_config_value(
|
|
2135
|
+
plant_uml_prepost='@startwbs\n{style}\n\n{header}\n{content}\n{legend}@endwbs\n';return plant_uml_prepost.format(style=get_config_value(_X)+get_config_value(_Bd),header=header,content=content,legend=legend_text)
|
|
2136
2136
|
plantuml_writer(file_opener,output_file,plantuml_requirement_diagram_wrap(output_requirement_tree(root_requirement)),print_l);return errors
|
|
2137
2137
|
def write_decomposition_graph_output(sbdl_ast,output_file,file_opener,arguments,print_l):
|
|
2138
2138
|
elements,errors=sbdl_ast.elements(print_l,prune_missing_references=_A)
|
|
@@ -2154,7 +2154,7 @@ def write_decomposition_graph_output(sbdl_ast,output_file,file_opener,arguments,
|
|
|
2154
2154
|
else:add_interface_line(interface,_A5);stereotype=interface.stereotype();relations+='[{}] -{}- {}{}\n'.format(puml_id(elem_id),interface_rel_pos(interface_count),puml_id(interface.identifier()),''if not stereotype else': '+stereotype);interface_count+=1
|
|
2155
2155
|
aspect_stereotype=elements[elem_id].stereotype()
|
|
2156
2156
|
if not aspect_stereotype:aspect_stereotype=elements[elem_id].type()
|
|
2157
|
-
else:aspect_stereotype=elements[elem_id].type()+
|
|
2157
|
+
else:aspect_stereotype=elements[elem_id].type()+_m+aspect_stereotype
|
|
2158
2158
|
aspect_stereotype=_Ai.format(aspect_stereotype);content+=_CK.format(pref,get_config_value(_Bf),elem_id,puml_id(elem_id),aspect_stereotype,''if not SBDL_Parser.Attributes.color in elements[elem_id].properties()else' #'+elements[elem_id].get_property(SBDL_Parser.Attributes.color));children=SBDL_AST.get_all_children_for_element(elements[elem_id],elements)
|
|
2159
2159
|
if len(children)>0 or len(interfaces):
|
|
2160
2160
|
content+=' { '
|
|
@@ -2174,13 +2174,13 @@ def write_decomposition_graph_output(sbdl_ast,output_file,file_opener,arguments,
|
|
|
2174
2174
|
for elem in elements_ordered:handle_elem(elem)
|
|
2175
2175
|
for interface_id in interface_mem:
|
|
2176
2176
|
for int_link in interface_mem[interface_id]:relations+='{} .{}. {}\n'.format(puml_id(interface_id),interface_rel_pos(interface_count),puml_id(int_link.identifier()));interface_count+=1
|
|
2177
|
-
return plant_uml_prepost.format(style=(_CM if get_config_value(_AO,number=_A)else'')+get_config_value(
|
|
2177
|
+
return plant_uml_prepost.format(style=(_CM if get_config_value(_AO,number=_A)else'')+get_config_value(_X)+get_config_value(_AS),header=header+title,content=content+_D+relations+_D+(_D+notes if descriptions or arguments.source else''))
|
|
2178
2178
|
plantuml_writer(file_opener,output_file,plantuml_decomposition_diagram(),print_l);return errors
|
|
2179
2179
|
def write_element_graph_output(sbdl_ast,output_file,file_opener,arguments,print_l):
|
|
2180
2180
|
elements,errors=sbdl_ast.elements(print_l,prune_missing_references=_A)
|
|
2181
2181
|
def plantuml_decomposition_diagram():
|
|
2182
2182
|
header=plantuml_footer_generator();title=_y.format(arguments.title)if arguments.title!=''else'';plant_uml_prepost=_z;content='';relations='';interface_mem={};handled_elems=[]
|
|
2183
|
-
def puml_id(elem_id):return plantuml_identifier(elem_id).replace('(','').replace(')','').replace('[]','').replace(']','').replace(':',
|
|
2183
|
+
def puml_id(elem_id):return plantuml_identifier(elem_id).replace('(','').replace(')','').replace('[]','').replace(']','').replace(':',_U).encode(_Ac,_AY).decode(_Ac)
|
|
2184
2184
|
def interface_rel_pos(posindex):positions={0:'up',1:'down',2:_A9,3:_AA};return positions[posindex%4]if get_config_value(_AN,number=_A)else''
|
|
2185
2185
|
def detailed_content(elem_id):
|
|
2186
2186
|
props=[];links={};result='\t{}: **{}**\n'.format(SBDL_Parser.Attributes.type,elements[elem_id].type());elem=elements[elem_id]
|
|
@@ -2204,7 +2204,7 @@ def write_element_graph_output(sbdl_ast,output_file,file_opener,arguments,print_
|
|
|
2204
2204
|
relations+='{} -{}- {}\n'.format(puml_id(elem_id),interface_rel_pos(interface_count),puml_id(interface.identifier()));interface_count+=1
|
|
2205
2205
|
aspect_stereotype=elements[elem_id].stereotype()
|
|
2206
2206
|
if not aspect_stereotype:aspect_stereotype=elements[elem_id].type()
|
|
2207
|
-
else:aspect_stereotype=elements[elem_id].type()+
|
|
2207
|
+
else:aspect_stereotype=elements[elem_id].type()+_m+aspect_stereotype
|
|
2208
2208
|
aspect_stereotype=_Ai.format(aspect_stereotype);content+=_CK.format(pref,get_config_value(_Bg),elem_id,puml_id(elem_id),aspect_stereotype,''if not SBDL_Parser.Attributes.color in elements[elem_id].properties()else' #'+elements[elem_id].get_property(SBDL_Parser.Attributes.color));content+='{{\n{}\n}}\n'.format(detailed_content(elem_id));related=elements[elem_id].related();related.extend([link for link in elements[elem_id].links()])
|
|
2209
2209
|
for relation in related:
|
|
2210
2210
|
relation_type=relation.stereotype();relation_type=relation_type if relation_type else'';link_text=': '+relation_type if relation_type else'';relation_end='>'
|
|
@@ -2215,7 +2215,7 @@ def write_element_graph_output(sbdl_ast,output_file,file_opener,arguments,print_
|
|
|
2215
2215
|
else:0
|
|
2216
2216
|
elements_ordered=list(elements.keys())
|
|
2217
2217
|
for elem in elements_ordered:handle_elem(elem)
|
|
2218
|
-
return plant_uml_prepost.format(style=(_CM if get_config_value(_AO,number=_A)else'')+get_config_value(
|
|
2218
|
+
return plant_uml_prepost.format(style=(_CM if get_config_value(_AO,number=_A)else'')+get_config_value(_X)+get_config_value(_AS),header=header+title,content=content+_D+relations+_D+(_D+''))
|
|
2219
2219
|
plantuml_writer(file_opener,output_file,plantuml_decomposition_diagram(),print_l);return errors
|
|
2220
2220
|
def write_function_graph_output(sbdl_ast,output_file,file_opener,arguments,print_l):
|
|
2221
2221
|
elements,errors=sbdl_ast.elements(print_l,prune_missing_references=_A);show_descriptions=get_config_value(_Bi,number=_A);event_count=0;entities={}
|
|
@@ -2235,7 +2235,7 @@ def write_function_graph_output(sbdl_ast,output_file,file_opener,arguments,print
|
|
|
2235
2235
|
if not aspect_name in entities:
|
|
2236
2236
|
entities[aspect_name]=_A;aspect_stereotype=elements[aspect_name].stereotype()if aspect_name in elements else _B
|
|
2237
2237
|
if not aspect_stereotype:aspect_stereotype=elements[aspect_name].type()
|
|
2238
|
-
else:aspect_stereotype=elements[aspect_name].type()+
|
|
2238
|
+
else:aspect_stereotype=elements[aspect_name].type()+_m+aspect_stereotype
|
|
2239
2239
|
aspect_stereotype=_Ai.format(aspect_stereotype);aspect_color=''
|
|
2240
2240
|
if aspect_name in elements and SBDL_Parser.Attributes.color in elements[aspect_name].properties():aspect_color=f" #{elements[aspect_name].get_property(SBDL_Parser.Attributes.color)}"
|
|
2241
2241
|
content+='{}{} "{}{}" as {} {}{}\n'.format(_M*depth,get_config_value(_Bj),aspect_name,_G+elements[aspect_name].reference()if arguments.source else'',puml_id(aspect_name),aspect_stereotype,aspect_color)
|
|
@@ -2273,7 +2273,7 @@ def write_function_graph_output(sbdl_ast,output_file,file_opener,arguments,print
|
|
|
2273
2273
|
top_level_elems=SBDL_AST.get_top_level_element_set(elements)
|
|
2274
2274
|
for func in[elements[x].identifier()for x in top_level_elems if elements[x].is_a(SBDL_Function)]:handle_func(func)
|
|
2275
2275
|
if event_count>0:content='autonumber "[000]"\n'+content
|
|
2276
|
-
return plant_uml_prepost.format(style=get_config_value(
|
|
2276
|
+
return plant_uml_prepost.format(style=get_config_value(_X)+get_config_value(_AT),header=header+title,content=content)
|
|
2277
2277
|
plantuml_writer(file_opener,output_file,plantuml_function_diagram(),print_l);return errors
|
|
2278
2278
|
def write_process_graph_output(sbdl_ast,output_file,file_opener,_,print_l):
|
|
2279
2279
|
errors=0;elements,errors=sbdl_ast.elements(print_l,prune_missing_references=_A);show_descriptions=get_config_value(_Bk,number=_A);first_event=_A;g_process_elem=_B;note_stagger=_C
|
|
@@ -2287,7 +2287,7 @@ def write_process_graph_output(sbdl_ast,output_file,file_opener,_,print_l):
|
|
|
2287
2287
|
def emit_note():
|
|
2288
2288
|
nonlocal event_cont,note_stagger
|
|
2289
2289
|
if show_descriptions and event_elem.description():event_cont+=f"{indent_str}note {_A9 if note_stagger else _AA}\n{indent_str}{event_elem.description()}\n{indent_str}end note\n";note_stagger=not note_stagger
|
|
2290
|
-
if ev_aspect!=current_aspect and get_config_value(
|
|
2290
|
+
if ev_aspect!=current_aspect and get_config_value(_q,number=_A):
|
|
2291
2291
|
event_cont+=f"{indent_str}"
|
|
2292
2292
|
if ev_aspect in elements:
|
|
2293
2293
|
colour=elem_colour_prefix(elements[ev_aspect])
|
|
@@ -2295,7 +2295,7 @@ def write_process_graph_output(sbdl_ast,output_file,file_opener,_,print_l):
|
|
|
2295
2295
|
event_cont+=f"|{ev_aspect}|\n"
|
|
2296
2296
|
if first_event:
|
|
2297
2297
|
event_cont+=f"{indent_str}start\n";first_event=_C
|
|
2298
|
-
if get_config_value(
|
|
2298
|
+
if get_config_value(_q,number=_A):event_cont+=f"{indent_str}{elem_colour_prefix(g_process_elem)}:{g_process_elem.identifier()}; <<procedure>>\n";emit_note()
|
|
2299
2299
|
if is_loop:event_cont+=f"{indent_str}repeat{_D if control_only else""}"
|
|
2300
2300
|
if not control_only:event_cont+=f"{indent_str}{elem_colour_prefix(event_elem)if not is_loop else""}:{event_elem.identifier()}; <<task>>\n";emit_note()
|
|
2301
2301
|
if ev_links and condition and not is_loop:event_cont+=f"{indent_str}if ({condition}) then (condition met)\n"
|
|
@@ -2312,16 +2312,16 @@ def write_process_graph_output(sbdl_ast,output_file,file_opener,_,print_l):
|
|
|
2312
2312
|
return event_cont
|
|
2313
2313
|
def handle_process_element(process_elem):
|
|
2314
2314
|
nonlocal g_process_elem,first_event;first_event=_A;g_process_elem=process_elem;process_cont=''
|
|
2315
|
-
if not get_config_value(
|
|
2315
|
+
if not get_config_value(_q,number=_A):
|
|
2316
2316
|
process_cont+=f'group {elem_colour_prefix(process_elem)}"**{f"{process_elem.type()}::{process_elem.stereotype()}"if process_elem.stereotype()else process_elem.type()}** {process_elem.identifier()}" {{\n';description=process_elem.description()
|
|
2317
2317
|
if show_descriptions and description:process_cont+=f"note\n{description}\nend note\n"
|
|
2318
2318
|
process_links=SBDL_AST.get_all_links_for_element(process_elem,elements)
|
|
2319
2319
|
for event_id in[x.identifier()for x in process_links if x.is_a(SBDL_Event)and x.identifier()in elements]:process_cont+=recurse_event_contents(elements[event_id])
|
|
2320
2320
|
process_cont+=' stop\n'
|
|
2321
|
-
if not get_config_value(
|
|
2321
|
+
if not get_config_value(_q,number=_A):process_cont+='}\n'
|
|
2322
2322
|
return process_cont
|
|
2323
2323
|
def plantuml_process_diagram():
|
|
2324
|
-
process_dia_cont='';process_dia_cont+='@startuml\n';process_dia_cont+=get_config_value(
|
|
2324
|
+
process_dia_cont='';process_dia_cont+='@startuml\n';process_dia_cont+=get_config_value(_X)+get_config_value(_AT)+_f
|
|
2325
2325
|
for process_elem in[elements[f]for f in elements if elements[f].is_a(SBDL_Function)]:process_dia_cont+=handle_process_element(process_elem)
|
|
2326
2326
|
process_dia_cont+='\n@enduml\n';return process_dia_cont
|
|
2327
2327
|
plantuml_writer(file_opener,output_file,plantuml_process_diagram(),print_l);return errors
|
|
@@ -2342,7 +2342,7 @@ def write_state_graph_output(sbdl_ast,output_file,file_opener,arguments,print_l)
|
|
|
2342
2342
|
for elem_id in top_level_elems:
|
|
2343
2343
|
if elements[elem_id].is_a(SBDL_State):handle_elem(elem_id)
|
|
2344
2344
|
for statedef in statedefs_dict:statedefs+=statedefs_dict[statedef]+_D
|
|
2345
|
-
return plant_uml_prepost.format(style=get_config_value(
|
|
2345
|
+
return plant_uml_prepost.format(style=get_config_value(_X)+get_config_value(_Bm),header=header+title,content=statedefs+content+_D+relations)
|
|
2346
2346
|
plantuml_writer(file_opener,output_file,plantuml_state_diagram(),print_l);return errors
|
|
2347
2347
|
def write_usecase_graph_output(sbdl_ast,output_file,file_opener,arguments,print_l):
|
|
2348
2348
|
elements,errors=sbdl_ast.elements(print_l,prune_missing_references=_A)
|
|
@@ -2360,12 +2360,12 @@ def write_usecase_graph_output(sbdl_ast,output_file,file_opener,arguments,print_
|
|
|
2360
2360
|
content+='\nframe "{}" {{\n'.format(puml_id(aspect))
|
|
2361
2361
|
for usecase_tuple in aspects[aspect]:content+=' usecase "{}" as {}\n'.format('**{}**\\n{}{}'.format(usecase_tuple[3],_G.join(textwrap.wrap(usecase_tuple[4],get_config_value(_c,number=_A))),_G+usecase_tuple[6]if arguments.source else'')if get_config_value(_AU,number=_A)else usecase_tuple[3],puml_id(usecase_tuple[3]));relations+='\n{} --> {}: {}{}\n'.format(puml_id(usecase_tuple[0]),puml_id(usecase_tuple[3]),'**{}**\\n{}'.format(usecase_tuple[1],_G.join(textwrap.wrap(usecase_tuple[2],get_config_value(_c,number=_A))))if get_config_value(_AU,number=_A)else usecase_tuple[1],_G+usecase_tuple[5]if arguments.source else'')
|
|
2362
2362
|
content+='}\n'
|
|
2363
|
-
content+=relations;return plant_uml_prepost.format(style=get_config_value(
|
|
2363
|
+
content+=relations;return plant_uml_prepost.format(style=get_config_value(_X)+get_config_value(_Bo),header=header+title,content=content)
|
|
2364
2364
|
plantuml_writer(file_opener,output_file,plantuml_usecase_diagram(),print_l);return errors
|
|
2365
2365
|
def write_network_graph_output(sbdl_ast,output_file,_,arguments,print_l):
|
|
2366
2366
|
try:import networkx as nx,matplotlib.pyplot as plt
|
|
2367
2367
|
except Exception as _:print_l('Could not import Python packages necessary for network graph rendering: networkx, matplotlib',error=_A);return 1
|
|
2368
|
-
elements,errors=sbdl_ast.elements(print_l,prune_missing_references=_A);sbdl_graph=nx.MultiDiGraph();skip_types={x for x in get_config_value(_BZ,number=_C).split(_S)};node_name_sep=
|
|
2368
|
+
elements,errors=sbdl_ast.elements(print_l,prune_missing_references=_A);sbdl_graph=nx.MultiDiGraph();skip_types={x for x in get_config_value(_BZ,number=_C).split(_S)};node_name_sep=_m;node_text_wrap_width=25
|
|
2369
2369
|
def node_name(elem_id):
|
|
2370
2370
|
etype=elements[elem_id].type();stereotype=elements[elem_id].stereotype()
|
|
2371
2371
|
if stereotype:stereotype=f"\n<<{etype}∷{stereotype}>>"
|
|
@@ -2393,7 +2393,7 @@ class OpenFMEA:
|
|
|
2393
2393
|
def generate_sbdl_table_from_ast(self,sbdl_ast,id_in_body=_C,source_in_body=_C,print_l=print_null,multi_field_separator=_B):
|
|
2394
2394
|
A='key'
|
|
2395
2395
|
if multi_field_separator is _B:multi_field_separator=get_config_value(_AV)
|
|
2396
|
-
id_counter=0;sbdl_row={A:_B,_d:_B,_Z:_B,_L:_B,_b:_B,_R:_B,
|
|
2396
|
+
id_counter=0;sbdl_row={A:_B,_d:_B,_Z:_B,_L:_B,_b:_B,_R:_B,_o:_B,_g:_B,_t:_B,_u:_B,_A7:_B,_s:_B,_A6:_B,_A0:_B,_h:_B}
|
|
2397
2397
|
def is_row_empty(row):
|
|
2398
2398
|
for column in row:
|
|
2399
2399
|
if row[column]!=_B:return _C
|
|
@@ -2476,7 +2476,7 @@ class OpenFMEA:
|
|
|
2476
2476
|
recurse_links(end_node.type())
|
|
2477
2477
|
elif element.is_a(SBDL_Aspect):element.visited=_A;assign_column(_d)
|
|
2478
2478
|
elif element.is_a(SBDL_Requirement):element.visited=_A;assign_column(_Z);recurse_links(SBDL_Aspect,append=_A)
|
|
2479
|
-
elif element.is_a(SBDL_Failure_Current_Control):element.visited=_A;assign_column(
|
|
2479
|
+
elif element.is_a(SBDL_Failure_Current_Control):element.visited=_A;assign_column(_o)
|
|
2480
2480
|
elif element.is_a(SBDL_Failure_Current_Detection)or element.is_a(SBDL_Test_Definition):element.visited=_A;assign_column(_g)
|
|
2481
2481
|
elif element.is_a(SBDL_Failure_Action_Control):element.visited=_A;assign_column(_A0)
|
|
2482
2482
|
elif element.is_a(SBDL_Failure_Action_Detection):element.visited=_A;assign_column(_h)
|
|
@@ -2540,7 +2540,7 @@ class OpenFMEA:
|
|
|
2540
2540
|
with file_opener(output_file)as open_sbdl_file:OpenFMEA.write_struct_to_file(OpenFMEA.struct_from_table(arguments.title,self.replace_table_entries_in_place(sbdl_table,_B,'')),open_sbdl_file)
|
|
2541
2541
|
return errors
|
|
2542
2542
|
@classmethod
|
|
2543
|
-
def get_quickshare_output(self,sbdl_ast,arguments,print_l):mem_file=io.StringIO();sbdl_table,errors=OpenFMEA.generate_sbdl_table_from_ast(sbdl_ast,id_in_body=arguments.identifier,source_in_body=arguments.source,print_l=print_l);OpenFMEA.write_struct_to_file(OpenFMEA.struct_from_table(arguments.title,self.replace_table_entries_in_place(sbdl_table,_B,'')),mem_file,pretty=_C);mem_file.seek(0);compressed_openfmea=base64.b64encode(zlib.compress(mem_file.read().encode(
|
|
2543
|
+
def get_quickshare_output(self,sbdl_ast,arguments,print_l):mem_file=io.StringIO();sbdl_table,errors=OpenFMEA.generate_sbdl_table_from_ast(sbdl_ast,id_in_body=arguments.identifier,source_in_body=arguments.source,print_l=print_l);OpenFMEA.write_struct_to_file(OpenFMEA.struct_from_table(arguments.title,self.replace_table_entries_in_place(sbdl_table,_B,'')),mem_file,pretty=_C);mem_file.seek(0);compressed_openfmea=base64.b64encode(zlib.compress(mem_file.read().encode(_r))).decode(_r);mem_file.close();output_uri='{baseurl}/analyzer/?QUICK_SHARE#>>{content}<<'.format(baseurl=get_config_value(_C2),content=compressed_openfmea);return errors,output_uri
|
|
2544
2544
|
@classmethod
|
|
2545
2545
|
def write_quickshare_output(self,sbdl_ast,output_file,file_opener,arguments,print_l):
|
|
2546
2546
|
errors,output_uri=self.get_quickshare_output(sbdl_ast,arguments,print_l)
|
|
@@ -2581,7 +2581,7 @@ class OpenFMEA:
|
|
|
2581
2581
|
def sbdl_elements_from_table(self,sbdl_table,_):return self.elements_from_table(sbdl_table,_)
|
|
2582
2582
|
@classmethod
|
|
2583
2583
|
def elements_from_table(self,sbdl_table,_):
|
|
2584
|
-
multi_field_separator=get_config_value(_AV);elems_to_consider={_d:SBDL_Parser.Types.aspect,_Z:SBDL_Parser.Types.requirement,_L:SBDL_Parser.Types.mode,_b:SBDL_Parser.Types.effect,_R:SBDL_Parser.Types.cause,
|
|
2584
|
+
multi_field_separator=get_config_value(_AV);elems_to_consider={_d:SBDL_Parser.Types.aspect,_Z:SBDL_Parser.Types.requirement,_L:SBDL_Parser.Types.mode,_b:SBDL_Parser.Types.effect,_R:SBDL_Parser.Types.cause,_o:SBDL_Parser.Types.current_control,_g:SBDL_Parser.Types.current_detection,_A0:SBDL_Parser.Types.action_control,_h:SBDL_Parser.Types.action_detection};elem_rating={_b:_t,_R:_u,_L:_s};elem_rating_post={_R:_A7,_L:_A6};elem_link={_R:[_L,_o,_A0,_g,_h],_L:[_d,_b,_g,_Z,_h,_R],_Z:[_d,_L],_b:[_L],_o:[_R],_g:[_L],_A0:[_R],_h:[_L]};elem_present_every_row={_g,_h};replace_str=SBDL_Parser.Tokens.replacement_string_default;elements={};id_lookup={}
|
|
2585
2585
|
if not get_config_value(_C4,number=_A):elem_link[_L].remove(_R);elem_link[_b].remove(_L)
|
|
2586
2586
|
def get_id_from_attr(attr_type,attr):
|
|
2587
2587
|
A='$COUNTER$';result=self.get_id_from_string(attr)
|
|
@@ -2711,7 +2711,7 @@ def write_csv_output(sbdl_ast,output_file,file_opener,arguments,print_l):
|
|
|
2711
2711
|
csv_writer.writerow(output_row)
|
|
2712
2712
|
return errors
|
|
2713
2713
|
def write_aggregated_output(sbdl_ast,output_file,file_opener,__,print_l):
|
|
2714
|
-
print_l('Writing aggregate output: {}'.format(output_file),debug=_A);new_line_str=_f if get_config_value(
|
|
2714
|
+
print_l('Writing aggregate output: {}'.format(output_file),debug=_A);new_line_str=_f if get_config_value(_W,number=_A)else _D
|
|
2715
2715
|
with file_opener(output_file)as fmfile:
|
|
2716
2716
|
sbdl_element_set,errors=sbdl_ast.elements(print_l=print_l);sbdl_elements=[sbdl_element_set[x]for x in sbdl_element_set];sort_by_type=get_config_value(_A1,number=_A);sort_by_iden=get_config_value(_A2,number=_A)
|
|
2717
2717
|
def gen_sort_key(elem):
|
|
@@ -2799,7 +2799,7 @@ def write_type_information(_,output_file,file_opener,____,_____):
|
|
|
2799
2799
|
output_file.write('Types');output_file.write(_D);output_file.write('=====');output_file.write(_f)
|
|
2800
2800
|
for type_name in all_types:
|
|
2801
2801
|
if not type_name in skip_types:
|
|
2802
|
-
type_ancestors=SBDL_Element.declaration_type_to_class(type_name).types();output_file.write(type_name);output_file.write(_D);output_file.write(
|
|
2802
|
+
type_ancestors=SBDL_Element.declaration_type_to_class(type_name).types();output_file.write(type_name);output_file.write(_D);output_file.write(_V*len(type_name));output_file.write(_D);output_file.write(' Description: ')
|
|
2803
2803
|
if type_name in SBDL_Semantics.type_information:output_file.write(SBDL_Semantics.type_information[type_name][_P])
|
|
2804
2804
|
else:output_file.write('N/A')
|
|
2805
2805
|
output_file.write(_D);output_file.write(' Relations: ');output_file.write(_I.join(SBDL_Semantics.get_valid_link_type_for_type_name(type_name)));output_file.write(_D);output_file.write(' Properties: ');output_file.write(_I.join(SBDL_Semantics.global_properties.keys()))
|
|
@@ -2812,7 +2812,7 @@ def write_type_information(_,output_file,file_opener,____,_____):
|
|
|
2812
2812
|
return 0
|
|
2813
2813
|
def affinity_graph():
|
|
2814
2814
|
A='\n + ';pre_post_content='@startuml\nskinparam linetype ortho\nskinparam backgroundColor transparent\nskinparam dpi 300\nhide circle\n\nframe "SBDL Type Affinity" #transparent {{\n\n{content}\n\n}}\n@enduml\n';graph_output='';skip_types=[SBDL_Parser.Tokens.using,SBDL_Parser.Tokens.scope,SBDL_Parser.Tokens.customtype,SBDL_Parser.Types.group,SBDL_Parser.Types.current_control,SBDL_Parser.Types.current_detection,SBDL_Parser.Types.action_control,SBDL_Parser.Types.action_detection,_j];emph=[SBDL_Parser.Attributes.description]
|
|
2815
|
-
def puml_id(input_str):return input_str.replace(_H,
|
|
2815
|
+
def puml_id(input_str):return input_str.replace(_H,_U).replace(_V,_U)
|
|
2816
2816
|
lang_info_struct=SBDL_Semantics.get_language_information_struct()
|
|
2817
2817
|
for category in lang_info_struct[_e]:
|
|
2818
2818
|
graph_output+='frame "{}" {{\n'.format(category)
|
|
@@ -2889,8 +2889,8 @@ def main(arguments):
|
|
|
2889
2889
|
aggregate_methods={_An:OpenFMEA.aggregate_all_parser_elements_from_files,A:OpenFMEA.aggregate_all_parser_elements_from_quickshare,C:OpenFMEA.aggregate_all_parser_elements_from_files,B:OpenFMEA.aggregate_all_parser_elements_from_quickshare,_AG:aggregate_all_parser_elements_from_json,_Aw:aggregate_all_parser_elements_from_yaml,_AH:aggregate_all_parser_elements_from_csv};aggregation_method=aggregate_all_parser_elements_from_files if not arguments.mode in aggregate_methods else aggregate_methods[arguments.mode];parser_elements,read_errors=aggregation_method([fix_wsl_path(x)for x in arguments.source_files],arguments.recurse,arguments.hidden,print_l);check_step('File reading',read_errors);sbdl_ast=SBDL_AST(parser_elements);check_step('Parsing',sbdl_ast.check_parsing(print_l))
|
|
2890
2890
|
for pre_hook in get_config_value(_BE):check_step('Pre Hook: {}'.format(pre_hook.__name__),pre_hook(sbdl_ast,print_l))
|
|
2891
2891
|
sbdl_elements,statement_errors=sbdl_ast.elements(print_l);check_step('Element instantiation',statement_errors)
|
|
2892
|
-
if arguments.
|
|
2893
|
-
if arguments.
|
|
2892
|
+
if arguments.filter_related!=_B:sbdl_ast.add_filter_element_set_connected(arguments.filter_related,arguments.filter_depth)
|
|
2893
|
+
if arguments.filter_related_x!=_B:sbdl_ast.add_filter_element_set_linked(arguments.filter_related_x,arguments.filter_depth)
|
|
2894
2894
|
if arguments.filter_parents!=_B:sbdl_ast.add_filter_element_set_parents(arguments.filter_parents,arguments.filter_depth)
|
|
2895
2895
|
if arguments.filter_children!=_B:sbdl_ast.add_filter_element_set_children(arguments.filter_children,arguments.filter_depth)
|
|
2896
2896
|
if arguments.filter_group!=_B:sbdl_ast.add_filter_element_set_children(arguments.filter_group,arguments.filter_depth);sbdl_ast.add_filter_element_set_id('(?!{})'.format(arguments.filter_group))
|
|
@@ -2902,11 +2902,11 @@ def main(arguments):
|
|
|
2902
2902
|
if arguments.trace:trace_elements,trace_errors=aggregate_all_parser_elements_from_files(arguments.trace,arguments.recurse,arguments.hidden,print_l);_,trace_process_errors=sbdl_ast.process_trace_elements(trace_elements,print_l);trace_errors+=trace_process_errors;check_step('Tracing',trace_errors)
|
|
2903
2903
|
for post_hook in get_config_value(_k):check_step('Post Hook: {}'.format(post_hook.__name__),post_hook(sbdl_ast,print_l))
|
|
2904
2904
|
print_l('Mode: {}'.format(arguments.mode));print_l('Writing: {}'.format(arguments.output));check_step('Output writing',operations[arguments.mode](sbdl_ast,arguments.output,open_output_file,arguments,print_l));print_l('C_DEF GLOBALS: {}'.format(get_config_value(_T)),debug=_A);print_l(f"All operations complete [{time.time()-start_time_point:.3f}s]");return total_errors if not arguments.skip_errors else 0
|
|
2905
|
-
def handle_arguments(args_l):F='append';E='config_file';D='normal';C='output_file';B='element_identifier';A='store_true';operating_modes={_Ak:'Parse all specified input files, gather SBDL elements, validate model, apply filters, write SBDL-formatted output','query':'Compile inputs, then pretty print the results (after filtering)',_AE:'Compile inputs, then write a CSV-formatted representation of the SBDL elements to the output',_AF:'Compile inputs, then write a JSON-formatted representation of the SBDL elements to the output',_Al:'Compile inputs, then write a YAML-formatted representation of the SBDL elements to the output',_AH:'Read SBDL-schema CSV-matrix inputs and write SBDL-formatted output',_AG:'Read SBDL-schema JSON-tree inputs and write SBDL-formatted output',_Aw:'Read SBDL-schema YAML-tree inputs and write SBDL-formatted output',_AD:'Compile inputs, then write the FMEA-related content to an OpenFMEA-formatted ouput',_Am:'Compile inputs, then write the FMEA-related content to an OpenFMEA Portfolio-formatted ouput, organised by aspect hierarchy',_An:'Read OpenFMEA-formatted input and write SBDL-formatted output',_CN:'Compile inputs, then write the FMEA-related content to a CSV-formatted ouput',_Ar:'Compile inputs, then write a PNG-formatted output, visually representing the network of SBDL elements',_Aq:'Compile inputs, then write a SysML-style requirements diagram to rendering-backend-formatted output',_Ao:'Compile inputs, then write a SysML-style block diagram to rendering-backend-formatted output (simplified, aspects only)',_Ap:'Compile inputs, then write a SysML-style block diagram to rendering-backend-formatted output (detailed, with properties and relations)',_As:'Compile inputs, then write a SysML-style sequence diagram to rendering-backend-formatted output',_At:'Compile inputs, then write a SysML-style activity diagram to rendering-backend-formatted output',_Au:'Compile inputs, then write a SysML-style state diagram to rendering-backend-formatted output',_Av:'Compile inputs, then write a SysML-style use-case diagram to rendering-backend-formatted output',_CO:"Compile inputs, then provide an object, 'sbdl', in a Jinja parsing environment and apply it to the specified template file",'rpc':'Compile inputs, then transmit to the RPC server for processing by the specified RPC (see --rpc)'};parser=argparse.ArgumentParser(description='{}\n\n{} Version {} (DSL Version {}). System Behaviour Description Language (SBDL) compiler.\nWWW: {}. Author: {}.'.format(logo(),name().upper(),version(),version_dsl(),url(),author()),epilog='e.g. "'+os.path.basename(sys.argv[0])+' <file 1> <file 2> <file n>"\n\n---------------\nOperating Modes\n---------------\n{}'.format(_D.join(['{}: {}'.format(x.rjust(25),operating_modes[x])for x in operating_modes])),formatter_class=argparse.RawDescriptionHelpFormatter);parser._positionals.title='Base Arguments';parser._optionals.title='Optional Arguments';parser.add_argument('source_files',help='List of files to compile ["-" implies stdin]',nargs=_O);parser.add_argument(_F,'--mode',metavar='operating_mode',help='Specify the mode of operation',default=_Ak);parser.add_argument(_E,'--output',metavar=C,help='Specify the name of the output file',default=
|
|
2905
|
+
def handle_arguments(args_l):F='append';E='config_file';D='normal';C='output_file';B='element_identifier';A='store_true';operating_modes={_Ak:'Parse all specified input files, gather SBDL elements, validate model, apply filters, write SBDL-formatted output','query':'Compile inputs, then pretty print the results (after filtering)',_AE:'Compile inputs, then write a CSV-formatted representation of the SBDL elements to the output',_AF:'Compile inputs, then write a JSON-formatted representation of the SBDL elements to the output',_Al:'Compile inputs, then write a YAML-formatted representation of the SBDL elements to the output',_AH:'Read SBDL-schema CSV-matrix inputs and write SBDL-formatted output',_AG:'Read SBDL-schema JSON-tree inputs and write SBDL-formatted output',_Aw:'Read SBDL-schema YAML-tree inputs and write SBDL-formatted output',_AD:'Compile inputs, then write the FMEA-related content to an OpenFMEA-formatted ouput',_Am:'Compile inputs, then write the FMEA-related content to an OpenFMEA Portfolio-formatted ouput, organised by aspect hierarchy',_An:'Read OpenFMEA-formatted input and write SBDL-formatted output',_CN:'Compile inputs, then write the FMEA-related content to a CSV-formatted ouput',_Ar:'Compile inputs, then write a PNG-formatted output, visually representing the network of SBDL elements',_Aq:'Compile inputs, then write a SysML-style requirements diagram to rendering-backend-formatted output',_Ao:'Compile inputs, then write a SysML-style block diagram to rendering-backend-formatted output (simplified, aspects only)',_Ap:'Compile inputs, then write a SysML-style block diagram to rendering-backend-formatted output (detailed, with properties and relations)',_As:'Compile inputs, then write a SysML-style sequence diagram to rendering-backend-formatted output',_At:'Compile inputs, then write a SysML-style activity diagram to rendering-backend-formatted output',_Au:'Compile inputs, then write a SysML-style state diagram to rendering-backend-formatted output',_Av:'Compile inputs, then write a SysML-style use-case diagram to rendering-backend-formatted output',_CO:"Compile inputs, then provide an object, 'sbdl', in a Jinja parsing environment and apply it to the specified template file",'rpc':'Compile inputs, then transmit to the RPC server for processing by the specified RPC (see --rpc)'};parser=argparse.ArgumentParser(description='{}\n\n{} Version {} (DSL Version {}). System Behaviour Description Language (SBDL) compiler.\nWWW: {}. Author: {}.'.format(logo(),name().upper(),version(),version_dsl(),url(),author()),epilog='e.g. "'+os.path.basename(sys.argv[0])+' <file 1> <file 2> <file n>"\n\n---------------\nOperating Modes\n---------------\n{}'.format(_D.join(['{}: {}'.format(x.rjust(25),operating_modes[x])for x in operating_modes])),formatter_class=argparse.RawDescriptionHelpFormatter);parser._positionals.title='Base Arguments';parser._optionals.title='Optional Arguments';parser.add_argument('source_files',help='List of files to compile ["-" implies stdin]',nargs=_O);parser.add_argument(_F,'--mode',metavar='operating_mode',help='Specify the mode of operation',default=_Ak);parser.add_argument(_E,'--output',metavar=C,help='Specify the name of the output file',default=_V);parser.add_argument('--version',help='Print the current version',action=A,default=_C);parser.add_argument('--debug',help=argparse.SUPPRESS,action=A,default=_C);parser.add_argument('-W','-w','--warning',help='Set warning level',choices=[D,'all'],default=D);parser.add_argument('--hidden',help='Include hidden files when recursing',action=A,default=_C);parser.add_argument('-i','--identifier',help='Include element identifiers in applicable output formats',action=A,default=_C);parser.add_argument('-s','--source',help='Include source reference in applicable output formats',action=A,default=_C);parser.add_argument('-r','--recurse',help='Recurse on directories specified in the input list',action=A,default=_C);parser.add_argument('--skip-errors',help='Do not stop for errors (emit warning instead)',action=A,default=_C);parser.add_argument('--skip-validation',help='Do not validate model elements and relations',action=A,default=_C);parser.add_argument('--already-processed',help='Disables certain processing actions (implies --skip-validation). Useful when input has already been processed',action=A,default=_C);parser.add_argument('--title',help='Provide a default title for certain output formats',default='');parser.add_argument('-v','--verbose',help='Enable verbose output during execution',action=A,default=_C);parser.add_argument('--dumpaffinitygraph',metavar=C,help=argparse.SUPPRESS,action=_B);parser.add_argument('--dumplanginfo',metavar=C,help=argparse.SUPPRESS,action=_B);parser.add_argument('--run_tests','--run-tests',action=A,help=argparse.SUPPRESS);parser.add_argument('--rest-api-ping',action=A,help=argparse.SUPPRESS);parser.add_argument('--manual',help='Show extensive {} manual page'.format(name().upper()),action=A);parser.add_argument('--dump-config','--dumpconfig',metavar=E,help='Dump the internal configuration to a named JSON file',action=_B);parser.add_argument('--load-config','--loadconfig',metavar=E,help='Load the internal configuration from a named JSON file',default=_B);parser.add_argument('--list-config','--listconfig',help='List internal configuration options',action=A,default=_C);parser.add_argument('--set-config','--setconfig',metavar=('config_option','config_value'),help='Set a named configuration option',action=F,nargs=2);parser.add_argument('-D','--define',metavar=('name','value'),help='Specify a named global definition',action=F,nargs=2);parser.add_argument('--trace',metavar='trace_files',help='Provide a trace file to be processed',default=_B,nargs=_O);parser.add_argument('--template',metavar='template_file',help="Specify a template file for the 'template-fill' mode",default=_B);parser.add_argument('-fr','--filter-related',metavar=B,help='Filter everything but those elements with a direct or indirect relation to the specified element identifier (regex) [INCLUDES: parents/children]',default=_B);parser.add_argument('-frx','--filter-related-x',metavar=B,help='Filter everything but those elements with a direct or indirect connection to the specified element identifier (regex) [EXCLUDES: parents/children]',default=_B);parser.add_argument('-fch','--filter-children',metavar=B,help='Filter everything but those elements which are children of the specified element identifier (regex)',default=_B);parser.add_argument('-fpa','--filter-parents',metavar=B,help='Filter everything but those elements which are parental ancestors of the specified element identifier (regex)',default=_B);parser.add_argument('-fd','--filter-depth',metavar='filter_depth',help='Maximum depth for filters which pursue links (natural number)',type=int,default=_B);parser.add_argument('-ft','--filter-type',metavar='element_type',help='Filter everything but those elements which are of the specified element type (regex)',default=_B);parser.add_argument('-fi','--filter-identifier',metavar=B,help='Filter everything but those elements whose identifiers match the specified string (regex)',default=_B);parser.add_argument('-fpr','--filter-property',metavar=('property_name','property_value'),help='Filter everything but those elements possessing a named property matching the specified string (regex)',default=_B,nargs=2);parser.add_argument('-fg','--filter-group',metavar='group_identifier',help='Shortcut filter for everything but those elements which are children of the specified group identifier (regex) -- excludes the group element itself',default=_B);parser.add_argument(_CP,metavar='compiler_definitions',help='Specify a file path defining custom compiler directives',default=[],nargs=_O);parser.add_argument(_CQ,'--custom_mode',metavar='mode_definitions',help='Specify a file path containing custom compiler modes',default=[],nargs=_O);parser.add_argument('--rpc',help='Remote Procedure Call to be used by RPC-based modes',default=_B);parser.add_argument('--update',help=argparse.SUPPRESS,action=A,default=_C);parser.add_argument('--update-force',help=argparse.SUPPRESS,action=A,default=_C);parser.add_argument('--install-deps',help=argparse.SUPPRESS,action=A,default=_C);help_tmp=io.StringIO();parser.print_help(file=help_tmp);help_tmp.seek(0);global __HELP_TEXT;__HELP_TEXT=help_tmp.read();return parser.parse_args(args_l)
|
|
2906
2906
|
def show_manual(_):
|
|
2907
2907
|
B='----------------------\n';A='===========================================================\n';manual_text=A;manual_text+=' {} Manual\n'.format(name().upper());manual_text+=A;manual_text+=help_text()+_D;manual_text+=B;manual_text+='Model Type Information\n';manual_text+=B
|
|
2908
2908
|
def add_manual(strcon=''):nonlocal manual_text;manual_text+=strcon+_D
|
|
2909
|
-
def add_manual_header(strhead,double=_C,headchar=
|
|
2909
|
+
def add_manual_header(strhead,double=_C,headchar=_V):
|
|
2910
2910
|
hrline=headchar*len(strhead);add_manual()
|
|
2911
2911
|
if double:add_manual(hrline)
|
|
2912
2912
|
add_manual(strhead);add_manual(hrline)
|
sbdl-1.18.3/PKG-INFO
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sbdl
|
|
3
|
-
Version: 1.18.3
|
|
4
|
-
Summary: System Behaviour Description Language (Compiler)
|
|
5
|
-
Home-page: https://sbdl.dev
|
|
6
|
-
Author: Michael A. Hicks
|
|
7
|
-
Author-email: michael@mahicks.org
|
|
8
|
-
License: Proprietary
|
|
9
|
-
Requires-Python: >=3.6
|
|
10
|
-
Requires-Dist: networkx
|
|
11
|
-
Requires-Dist: matplotlib
|
|
12
|
-
Requires-Dist: docx2txt
|
|
13
|
-
Requires-Dist: pandas
|
|
14
|
-
Requires-Dist: openpyxl
|
|
15
|
-
Requires-Dist: docxtpl
|
|
16
|
-
Requires-Dist: jinja2
|
|
17
|
-
Dynamic: author
|
|
18
|
-
Dynamic: author-email
|
|
19
|
-
Dynamic: home-page
|
|
20
|
-
Dynamic: license
|
|
21
|
-
Dynamic: requires-dist
|
|
22
|
-
Dynamic: requires-python
|
|
23
|
-
Dynamic: summary
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sbdl
|
|
3
|
-
Version: 1.18.3
|
|
4
|
-
Summary: System Behaviour Description Language (Compiler)
|
|
5
|
-
Home-page: https://sbdl.dev
|
|
6
|
-
Author: Michael A. Hicks
|
|
7
|
-
Author-email: michael@mahicks.org
|
|
8
|
-
License: Proprietary
|
|
9
|
-
Requires-Python: >=3.6
|
|
10
|
-
Requires-Dist: networkx
|
|
11
|
-
Requires-Dist: matplotlib
|
|
12
|
-
Requires-Dist: docx2txt
|
|
13
|
-
Requires-Dist: pandas
|
|
14
|
-
Requires-Dist: openpyxl
|
|
15
|
-
Requires-Dist: docxtpl
|
|
16
|
-
Requires-Dist: jinja2
|
|
17
|
-
Dynamic: author
|
|
18
|
-
Dynamic: author-email
|
|
19
|
-
Dynamic: home-page
|
|
20
|
-
Dynamic: license
|
|
21
|
-
Dynamic: requires-dist
|
|
22
|
-
Dynamic: requires-python
|
|
23
|
-
Dynamic: summary
|
|
File without changes
|
{sbdl-1.18.3 → sbdl-1.18.5}/sbdl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|