修訂 | 06de47922d4c4cdf99175699c6ed587d16970736 (tree) |
---|---|
時間 | 2023-11-07 01:05:07 |
作者 | Albert Mietus < albert AT mietus DOT nl > |
Commiter | Albert Mietus < albert AT mietus DOT nl > |
Added (Local) Design/AR documents (asis/busy)
@@ -0,0 +1,80 @@ | ||
1 | +.. (C) 2023 Albert Mietus. Part of CCastle project | |
2 | +.. _AR_pipeline: | |
3 | + | |
4 | +====================== | |
5 | +Architectural overview | |
6 | +====================== | |
7 | + | |
8 | +The (new) CastleCompiler(s) share a common "pipeline" architecture. Which is flexible, both in functionality and | |
9 | +implementation, as they share the :ref:`AIGR <AIGR>` --see below -- for input and/or output. | |
10 | + | |
11 | +AIGR pipeline | |
12 | +============== | |
13 | + | |
14 | +The pipeline starts with source, in text format, that is explored by the :ref:`Readers` and translated in the | |
15 | +:ref:`AIGR`. The next components all read this format, like the :ref:`Transformers`, that transform it to a "better" | |
16 | +form -- see later. Last, the `AIGR` is converted into a binary by (one of the) the :ref:`Backends` | |
17 | +|BR| | |
18 | +Most :ref:`Backends` consist of two main parts: the :ref:`Writers` (which is part of CCastle), and a *Translator*: an | |
19 | +external *compiler* that translate/compiles the generated intermediate code into a binary. | |
20 | + | |
21 | +.. uml:: AIGR_pipeline.puml | |
22 | + | |
23 | +As the `AIGR` is a format (not a call-interface!), this architecture gives flexibility on deployment of the components. | |
24 | +A simple (Castle)compiler can hold them as (plug-in) libraries in one process. | |
25 | +|BR| | |
26 | +Alternatively, each component can be a process, where te several processes communicate with e.g. unix-pipes, or | |
27 | +network-connections). And there are many more option, not only separated in space, but also in time: As the AIGR can be | |
28 | +serialised [#pickle]_, it is possible to save it in file, and read it for the next component, later ... | |
29 | + | |
30 | +.. Important:: Although it is possible to saving a (pickled) AIGR, that component (nor action) is **NOT** a `Writer`! | |
31 | + | |
32 | + One should typically speak about “saving” the AIGR, and “loading the (AIGR) file”. It is a feature of the | |
33 | + :ref:`AIGR_component` (see below). | |
34 | + | |
35 | + | |
36 | +The Reader(s) | |
37 | +============= | |
38 | + | |
39 | +A typical reader reads (some) source-files and then translate that, in a few steps, into the :ref:`AIGR`, as | |
40 | +shown below. | |
41 | +|BR| | |
42 | +The :ref:`mockReader` is different: it does output (needed) ‘`AIGR`’, and so can act as the starts of a | |
43 | +pipeline (and therefor considered as a ‘`Reader`’), but has no input. | |
44 | + | |
45 | +Some sub-components in the ‘`Reader`’ may also work on the ‘`AIGR`’, as shown. The difference (to a ‘`Translator`’) is | |
46 | +simple: the '`Reader'` should do all error-checking, etc, to make sure the inputs (so the code of the developer) is | |
47 | +valid. A normal Translator (nor the '`Backend'`) should ever find errors. | |
48 | +|BR| | |
49 | +When implementing that (`Reader`) functionality is more convenient as after converting the :ref:`ATS into the AIGR | |
50 | +<AST-2-AIGR>` an “AIGR-analyser” is build. | |
51 | + | |
52 | +.. uml:: AIGR_Reader.puml | |
53 | + | |
54 | +Transformers | |
55 | +============ | |
56 | +ToDo | |
57 | + | |
58 | +.. uml:: AIGR_Transformers.puml | |
59 | + | |
60 | + | |
61 | +Writers (in the backend) | |
62 | +======================== | |
63 | +ToDo | |
64 | + | |
65 | +.. _AIGR_component: | |
66 | + | |
67 | +The AIGR auxiliary component | |
68 | +============================ | |
69 | +ToDo | |
70 | + | |
71 | + | |
72 | + | |
73 | + | |
74 | + | |
75 | +-------- | |
76 | + | |
77 | +.. rubric:: Footnotes | |
78 | + | |
79 | +.. [#pickle] | |
80 | + This can be done by *pickling* in python, or using an XML format, or ... |
@@ -0,0 +1,39 @@ | ||
1 | +ToDo: Temporary landings for AR-references | |
2 | +========================================== | |
3 | + | |
4 | +.. _ToDoARC: | |
5 | + | |
6 | +Describing AR components (todo) | |
7 | +------------------------------- | |
8 | + | |
9 | + | |
10 | +.. _Readers: | |
11 | + | |
12 | +Readers [ToDo] | |
13 | +************** | |
14 | + | |
15 | +.. _Writers: | |
16 | + | |
17 | +Writers [ToDo] | |
18 | +************** | |
19 | + | |
20 | +.. _Transformers: | |
21 | + | |
22 | +Transformers [ToDo] | |
23 | +******************* | |
24 | + | |
25 | +.. _Backends: | |
26 | + | |
27 | +Backends [ToDo] | |
28 | +*************** | |
29 | + | |
30 | + | |
31 | +.. _mockReader: | |
32 | + | |
33 | +mockReader [ToDo] | |
34 | +***************** | |
35 | + | |
36 | +.. _AST-2-AIGR: | |
37 | + | |
38 | +AST-2-AIGR [ToDo] | |
39 | +***************** |
@@ -0,0 +1,33 @@ | ||
1 | +@startuml | |
2 | +skin rose | |
3 | +!include AR_skins.inc | |
4 | + | |
5 | +frame "CCastle Compiler" as CCC #c0c0c0 { | |
6 | + package Readers #white { | |
7 | + | |
8 | + node typicalReader { | |
9 | + [parser] | |
10 | + [analyse\n(ast)] as ast_ana | |
11 | + [AST 2 AIGR] as AST2AIGR | |
12 | + () "AIGR" as aigr1 | |
13 | + [analyse\n(aigr)] as aigr_ana | |
14 | + () "AIGR" as aigr2 | |
15 | + | |
16 | + parser -> ast_ana : AST | |
17 | + ast_ana -> AST2AIGR : AST | |
18 | + AST2AIGR -> aigr1 | |
19 | + aigr1 -> aigr_ana | |
20 | + aigr_ana -( aigr2 | |
21 | + } | |
22 | + TXT -> typicalReader | |
23 | + | |
24 | + node mockReader { | |
25 | + [TestDoubles/\nAIGR] as mock | |
26 | + () "AIGR" as aigr3 | |
27 | + mock -( aigr3 | |
28 | + } | |
29 | + | |
30 | + typicalReader -[hidden]down-> mockReader | |
31 | +} | |
32 | + | |
33 | +@enduml |
@@ -0,0 +1,36 @@ | ||
1 | +@startuml | |
2 | +skin rose | |
3 | +!include AR_skins.inc | |
4 | +left to right direction | |
5 | + | |
6 | +''NOTE: Old RTD/plantuml.1.2020.2.jar syntax! | |
7 | + | |
8 | +'!procedure $comp($name) | |
9 | +!function $comp($name) | |
10 | + !$in = $name + "in" | |
11 | + !$out = $name + "out" | |
12 | + | |
13 | + [$name] | |
14 | + () "AIGR" as $in | |
15 | + () "AIGR" as $out | |
16 | + | |
17 | + $in )-- $name | |
18 | + $name --( $out | |
19 | +'!endprocedure | |
20 | +!endfunction | |
21 | + | |
22 | + | |
23 | +frame "CCastle Compiler" as CCC #c0c0c0 { | |
24 | + folder Transformers #white { | |
25 | + package FSM { | |
26 | + $comp("FSM.SuperStates") | |
27 | + $comp("FSM.NFA_2_FSM") | |
28 | + $comp("FSM.Epsilon") | |
29 | + $comp("FSM_2_Routine") | |
30 | + $comp("FSM....") | |
31 | + } | |
32 | + } | |
33 | +} | |
34 | + | |
35 | + | |
36 | +@enduml |
@@ -0,0 +1,43 @@ | ||
1 | +@startuml | |
2 | +skin rose | |
3 | +!include AR_skins.inc | |
4 | + | |
5 | +' it stat with txt-src | |
6 | +file "*.Castle" as f1 | |
7 | +file "*.Moat" as f2 | |
8 | + | |
9 | +' those files are input | |
10 | +() "files" as txt | |
11 | + f1 --> txt | |
12 | + f2 --> txt | |
13 | + | |
14 | +package "CCastle Compiler" as CCC { | |
15 | + txt -> CCC | |
16 | + | |
17 | + () "AIGR" as a1 | |
18 | + () "AIGR" as a2 | |
19 | + | |
20 | + [Readers] | |
21 | + [Transformers] | |
22 | + Folder Backends { | |
23 | + [Writers] | |
24 | + [Translators] | |
25 | + | |
26 | + Backends #->Writers | |
27 | + | |
28 | + () "files" as txt2 | |
29 | + Writers -( txt2 | |
30 | + txt2 )-> Translators | |
31 | + } | |
32 | + | |
33 | + | |
34 | + | |
35 | + Readers -( a1 | |
36 | + a1 )-> Transformers | |
37 | + Transformers -( a2 | |
38 | + a2 )-> Backends | |
39 | +} | |
40 | + | |
41 | +Translators 0)-> bin | |
42 | + | |
43 | +@enduml |
@@ -0,0 +1,29 @@ | ||
1 | +'' -*- mode: plantuml -*- '' | |
2 | +skinparam componentStyle uml2 | |
3 | + | |
4 | +skinparam component { | |
5 | + BorderColor white | |
6 | + BackgroundColor #000066 | |
7 | + FontColor white | |
8 | +} | |
9 | +skinparam package { | |
10 | + BorderColor #000066 | |
11 | + BackgroundColor #eeeeff | |
12 | +} | |
13 | +skinparam interface { | |
14 | + BorderColor #000066 | |
15 | + BackgroundColor #000066 | |
16 | + FontColor #000066 | |
17 | +} | |
18 | +skinparam file { | |
19 | + BorderColor #c0c0c0 | |
20 | + BackgroundColor #808080 | |
21 | + FontColor #000066 | |
22 | +} | |
23 | +skinparam { | |
24 | + ArrowColor #000066 | |
25 | +} | |
26 | +skinparam node { | |
27 | + BorderColor #000066 | |
28 | + BackgroundColor #eeeeff | |
29 | +} |
@@ -0,0 +1,9 @@ | ||
1 | +Top Level architecture (LOCAL only) | |
2 | +=================================== | |
3 | + | |
4 | + | |
5 | +.. toctree:: | |
6 | + :glob: | |
7 | + | |
8 | + * | |
9 | + */index |
@@ -0,0 +1,34 @@ | ||
1 | +analyse_imports (220122) | |
2 | +======================== | |
3 | + | |
4 | +.. UML:: | |
5 | + | |
6 | + @startuml | |
7 | + skinparam ArrowColor green | |
8 | + | |
9 | + skinparam component { | |
10 | + BackgroundColor #0077ff | |
11 | + BorderColor black | |
12 | + } | |
13 | + skinparam folder { | |
14 | + BackgroundColor lightblue | |
15 | + BorderColor black | |
16 | + } | |
17 | + | |
18 | + cloud "AsIS 2022/Jan/22" #pink { | |
19 | + | |
20 | + folder AST { | |
21 | + folder castle { | |
22 | + [peg] --> [_base] | |
23 | + [_base] | |
24 | + [~__init __] | |
25 | + } | |
26 | + } | |
27 | + | |
28 | + folder Arpeggio { | |
29 | + [grammar] | |
30 | + [vistor] --> [peg] | |
31 | + } | |
32 | + | |
33 | + } | |
34 | + @enduml |
@@ -0,0 +1,50 @@ | ||
1 | +.. -*- plantuml -*- | |
2 | +.. filename: date of start | |
3 | +.. date in title: last version | |
4 | + | |
5 | +AIGR:: ComponentInterface and Protocols (231009) | |
6 | +================================================ | |
7 | + | |
8 | +.. uml:: | |
9 | + | |
10 | + @startuml | |
11 | + | |
12 | + abstract AIGR | |
13 | + class ComponentInterface | |
14 | + class Protocol | |
15 | + class EventProtocol | |
16 | + class Port { | |
17 | + - direction :PortDirection | |
18 | + - type :PortType | |
19 | + } | |
20 | + abstract ProtocolWrapper { | |
21 | + -based_on\n(the Generic Protocol) | |
22 | + } | |
23 | + class Argument <<(S,lightgreen)>> { | |
24 | + +value :Any | |
25 | + +name :Optional[Str] | |
26 | + } | |
27 | + class TypedParameters <<(S,lightgreen)>> { | |
28 | + +name :str | |
29 | + +type :Type | |
30 | + } | |
31 | + class Type <<(T,lightblue)>> | |
32 | + '-------------------- | |
33 | + | |
34 | + ComponentInterface <--- ComponentInterface: based_on | |
35 | + Port "*" -* ComponentInterface | |
36 | + | |
37 | + Protocol <--- Protocol: based_on | |
38 | + Protocol <-- EventProtocol | |
39 | + Protocol <-- ProtocolWrapper | |
40 | + | |
41 | + ProtocolWrapper *- "+"Argument | |
42 | + | |
43 | + EventProtocol *- "*" Event: events | |
44 | + Event *-- "*" TypedParameters : typedParameters | |
45 | + Event o- "?" Type: returns | |
46 | + | |
47 | + Port o. Protocol: type | |
48 | + | |
49 | + @enduml | |
50 | + |
@@ -0,0 +1,50 @@ | ||
1 | +.. -*- plantuml -*- | |
2 | + | |
3 | +TestDoubles/AIGR: The protocols of the Sieve | |
4 | +============================================ | |
5 | + | |
6 | +.. uml:: | |
7 | + | |
8 | + @startuml | |
9 | + | |
10 | + object StartSieve <<EventProtocol>> | |
11 | + object runTo <<Event>>{ | |
12 | + max: int | |
13 | + } | |
14 | + object newMax <<Event>> { | |
15 | + max: int | |
16 | + } | |
17 | + StartSieve *-- runTo | |
18 | + StartSieve *-- newMax | |
19 | + | |
20 | + '--- | |
21 | + | |
22 | + object SlowStart << EventProtocol>> | |
23 | + object queue_max <<TypedParameter>> { | |
24 | + :int | |
25 | + } | |
26 | + object setMax <<Event>> { | |
27 | + setMax :int | |
28 | + } | |
29 | + SlowStart *-- setMax | |
30 | + SlowStart *- queue_max | |
31 | + | |
32 | + '--- | |
33 | + | |
34 | + object "SlowStart(1)" as SlowStart_1 <<ProtocolWrapper>> { | |
35 | + queue_max=1 | |
36 | + } | |
37 | + SlowStart <-- SlowStart_1: based on | |
38 | + | |
39 | + | |
40 | + '--- | |
41 | + | |
42 | + object SimpleSieve <<EventProtocol>> | |
43 | + SlowStart_1 <-- SimpleSieve: based_on | |
44 | + | |
45 | + object input <<Event>> { | |
46 | + try :int | |
47 | + } | |
48 | + SimpleSieve *--input | |
49 | + | |
50 | + @enduml |
@@ -0,0 +1,26 @@ | ||
1 | +.. -*- plantuml -*- | |
2 | + | |
3 | +TestDoubles/AIGR: The interfaces of the SIEVE (BUSY) | |
4 | +==================================================== | |
5 | + | |
6 | +.. uml:: | |
7 | + | |
8 | + @startuml | |
9 | + | |
10 | + object "**Sieve**" as Sieve <<ComponentInterface>> { | |
11 | + + {static} new(onPrime:int) | |
12 | + } | |
13 | + note right of Sieve: alt-name: **SieveMoat** | |
14 | + object try <<Port>>{ | |
15 | + In: PortDirection | |
16 | + SimpleSieve: type | |
17 | + } | |
18 | + object corprime <<Port>> { | |
19 | + Out: PortDirection | |
20 | + SimpleSieve: type | |
21 | + } | |
22 | + | |
23 | + Sieve *-- try | |
24 | + Sieve *-- corprime | |
25 | + | |
26 | + @enduml |
@@ -0,0 +1,79 @@ | ||
1 | +Namespace & protocols | |
2 | +********************* | |
3 | + | |
4 | +.. uml:: | |
5 | + | |
6 | + @startuml | |
7 | + | |
8 | + package "Protocols in ‘TheSieve’" as P1 <<Node>> { | |
9 | + | |
10 | + package start_sieve as P1A { | |
11 | + object start_sieve <<Source_NS>> #LightSkyBlue { | |
12 | + file: 'start_sieve.Castle' | |
13 | + } | |
14 | + object " " as P1A_d <<dict>> #lightcyan { | |
15 | + StartSieve | |
16 | + base :NS | |
17 | + } | |
18 | + object StartSieve <<EventProtocol>> | |
19 | + | |
20 | + start_sieve o-- P1A_d | |
21 | + start_sieve <-- StartSieve | |
22 | + P1A_d::StartSieve -> StartSieve #DarkMagenta | |
23 | + P1A_d::base --> base #DarkMagenta | |
24 | + } | |
25 | + | |
26 | + package slow_start as P1B { | |
27 | + object slow_start <<Source_NS>> #LightSkyBlue { | |
28 | + file: 'slow_start.Castle' | |
29 | + } | |
30 | + object " " as P1B_d <<dict>> #lightcyan { | |
31 | + SlowStart | |
32 | + base :NS | |
33 | + } | |
34 | + object SlowStart <<EventProtocol>> { | |
35 | + queue_max :int | |
36 | + } | |
37 | + | |
38 | + slow_start o-- P1B_d | |
39 | + slow_start <-- SlowStart | |
40 | + P1B_d::SlowStart -> SlowStart #DarkMagenta | |
41 | + P1B_d::base -> base #DarkMagenta | |
42 | + } | |
43 | + | |
44 | + package simple_sieve as P1C { | |
45 | + object simple_sieve <<Source_NS>> #LightSkyBlue { | |
46 | + file: 'simple_sieve.Castle' | |
47 | + } | |
48 | + object " " as P1C_d <<dict>> #lightcyan { | |
49 | + SlowStart(1) | |
50 | + SimpleSieve | |
51 | + } | |
52 | + object "SlowStart(1)" as SlowStart_1 <<ProtocolWrapper>> { | |
53 | + queue_max=1 | |
54 | + } | |
55 | + object SimpleSieve <<EventProtocol>> | |
56 | + SlowStart_1 <|-- SimpleSieve: based_on | |
57 | + | |
58 | + simple_sieve o-- P1C_d | |
59 | + simple_sieve <-- SlowStart_1 | |
60 | + simple_sieve <--- SimpleSieve | |
61 | + P1C_d::SlowStart_1 -> SlowStart_1 #DarkMagenta | |
62 | + P1C_d::SimpleSieve -> SimpleSieve #DarkMagenta | |
63 | + } | |
64 | + | |
65 | + SlowStart <|---- SlowStart_1 #SkyBlue : based_on | |
66 | + } | |
67 | + | |
68 | + package "Build-in Protocols" as P2 <<Node>> { | |
69 | + package base { | |
70 | + object Protocol <<_RootProtocol>> | |
71 | + } | |
72 | + package buildin { | |
73 | + } | |
74 | + } | |
75 | + | |
76 | + Protocol <|-- StartSieve #SkyBlue : based_on | |
77 | + Protocol <|-- SlowStart #SkyBlue : based_on | |
78 | + | |
79 | + @enduml |
@@ -0,0 +1,15 @@ | ||
1 | +Some (LOCAL only) Design Notes | |
2 | +============================== | |
3 | + | |
4 | +This are “quick and dirty” design diagrams. That where useful when created (see file-name), but may be less relevant | |
5 | +later. | |
6 | + | |
7 | +* Sound designs, are typically worked out (adding text & view), and move to a stable, to-be-maintained, location | |
8 | +* Outdated ones are (will be) moved to :ref:`DocParts_Design_old` (and will never be maintained). | |
9 | +* the one here, a undecided, may or may-not be maintained. | |
10 | + | |
11 | +.. toctree:: | |
12 | + :glob: | |
13 | + | |
14 | + * | |
15 | + */index |
@@ -0,0 +1,139 @@ | ||
1 | +OLD-Peg Diagram | |
2 | +=============== | |
3 | + | |
4 | +This anayse/design(?) date from around 2021/2022 | |
5 | + | |
6 | +.. UML:: | |
7 | + | |
8 | + @startuml | |
9 | + | |
10 | + package _base { | |
11 | + | |
12 | + abstract AST_BASE { | |
13 | + -_parse_tree | |
14 | + +position() | |
15 | + +position_end() | |
16 | + ~serialize() | |
17 | + } | |
18 | + | |
19 | + class ID { | |
20 | + +name | |
21 | + #validate_or_raise() | |
22 | + } | |
23 | + | |
24 | + ID =|> AST_BASE | |
25 | + } | |
26 | + | |
27 | + package MixIns #Gray { | |
28 | + | |
29 | + class MixIn_value_attribute<MixIn> { | |
30 | + _value | |
31 | + value() | |
32 | + } | |
33 | + | |
34 | + class MixIn_expr_attribute<MixIn> { | |
35 | + _expr | |
36 | + expr() | |
37 | + } | |
38 | + | |
39 | + class MixIn_children_tuple<MixIn> { | |
40 | + _children :Tuple | |
41 | + __len__() | |
42 | + __getitem__() | |
43 | + __iter__() | |
44 | + } | |
45 | + } | |
46 | + | |
47 | + package Peg #0077ff { | |
48 | + | |
49 | + abstract PEG | |
50 | + AST_BASE <|== PEG | |
51 | + | |
52 | + | |
53 | + | |
54 | + abstract Terminal | |
55 | + PEG <|== Terminal | |
56 | + MixIn_value_attribute <|... Terminal | |
57 | + Terminal <|== StrTerm | |
58 | + Terminal <|== RexExpTerm | |
59 | + Terminal <|== Number | |
60 | + | |
61 | + abstract Markers #Orange | |
62 | + annotation EOF #Orange | |
63 | + PEG <|== Markers | |
64 | + Markers <|== EOF | |
65 | + | |
66 | + abstract NonTerminal | |
67 | + PEG <|== NonTerminal | |
68 | + abstract Expression | |
69 | + NonTerminal <|== Expression | |
70 | + | |
71 | + class Setting { | |
72 | + name : ID | |
73 | + value | |
74 | + } | |
75 | + PEG <|== Setting | |
76 | + | |
77 | + class Rule { | |
78 | + name :ID | |
79 | + expr :[] Expression | |
80 | + } | |
81 | + NonTerminal <|== Rule | |
82 | + | |
83 | + interface Rules | |
84 | + PEG <|== Rules | |
85 | + MixIn_children_tuple <|... Rules | |
86 | + Rules <|== ParseRules | |
87 | + Rules <|== Settings | |
88 | + | |
89 | + class Grammar { | |
90 | + +all_rules :Rules | |
91 | + -parse_rules :ParseRules | |
92 | + -settings :Settings | |
93 | + } | |
94 | + NonTerminal <|== Grammar | |
95 | + | |
96 | + | |
97 | + abstract Group | |
98 | + Expression <|== Group | |
99 | + Group <|== UnorderedGroup | |
100 | + MixIn_expr_attribute <|... UnorderedGroup | |
101 | + abstract Quantity | |
102 | + Group <|== Quantity | |
103 | + MixIn_expr_attribute <|... Quantity | |
104 | + Expression <|== Sequence | |
105 | + MixIn_children_tuple <|... Sequence | |
106 | + | |
107 | + Expression <|== OrderedChoice | |
108 | + MixIn_children_tuple <|... OrderedChoice | |
109 | + | |
110 | + class Optional << (?, #0077ff) >> | |
111 | + Quantity <|== Optional | |
112 | + class ZeroOrMore << (*, #0077ff) >> | |
113 | + Quantity <|== ZeroOrMore | |
114 | + class OneOrMore << (+, #0077ff) >> | |
115 | + Quantity <|== OneOrMore | |
116 | + | |
117 | + abstract Predicate | |
118 | + Expression <|== Predicate | |
119 | + MixIn_expr_attribute <|... Predicate | |
120 | + class AndPredicate << (&, #0077ff) notconsuming >> | |
121 | + Predicate <|== AndPredicate | |
122 | + class NotPredicate << (! ,#0077ff) not consuming >> | |
123 | + Predicate <|== NotPredicate | |
124 | + | |
125 | + } | |
126 | + @enduml | |
127 | + | |
128 | + | |
129 | + | |
130 | + | |
131 | + | |
132 | + | |
133 | + | |
134 | + | |
135 | + | |
136 | + | |
137 | + | |
138 | + | |
139 | + |
@@ -0,0 +1,12 @@ | ||
1 | +.. __DocParts_Design_old:: | |
2 | + | |
3 | +Old (design) notes (LOCAL only) | |
4 | +=============================== | |
5 | + | |
6 | +These are outdated, and not maintain | |
7 | + | |
8 | +.. toctree:: | |
9 | + :glob: | |
10 | + | |
11 | + * | |
12 | + */index |
@@ -1,96 +0,0 @@ | ||
1 | -.. -*- plantuml -*- | |
2 | - | |
3 | -============= | |
4 | -AIGR pipeline | |
5 | -============= | |
6 | - | |
7 | -Overview | |
8 | -======== | |
9 | - | |
10 | -.. uml:: | |
11 | - | |
12 | - @startuml | |
13 | - skin rose | |
14 | - !include ../../DocParts/skins.inc | |
15 | - | |
16 | - () "files" as txt1 | |
17 | - | |
18 | - file "*.Castle" as f1 | |
19 | - f1 --> txt1 | |
20 | - file "*.Moat" as f2 | |
21 | - f2 --> txt1 | |
22 | - | |
23 | - package CC{ | |
24 | - txt1 -> CC | |
25 | - | |
26 | - () "AIGR" as a1 | |
27 | - () "AIGR" as a2 | |
28 | - | |
29 | - [Readers] | |
30 | - CC #-> Readers | |
31 | - [Transformers] | |
32 | - Folder Backend { | |
33 | - [Writers] | |
34 | - [Translators] | |
35 | - | |
36 | - Backend #->Writers | |
37 | - | |
38 | - () "files" as txt2 | |
39 | - Writers -( txt2 | |
40 | - txt2 )-> Translators | |
41 | - } | |
42 | - | |
43 | - | |
44 | - | |
45 | - Readers -( a1 | |
46 | - a1 )-> Transformers | |
47 | - Transformers -( a2 | |
48 | - a2 )-> Backend | |
49 | - } | |
50 | - | |
51 | - Translators 0)-> bin | |
52 | - | |
53 | - @enduml | |
54 | - | |
55 | -The Reader(s) | |
56 | -============= | |
57 | - | |
58 | -.. uml:: | |
59 | - | |
60 | - @startuml | |
61 | - skin rose | |
62 | - !include ../../DocParts/skins.inc | |
63 | - | |
64 | - frame "CC” #c0c0c0 { | |
65 | - package Readers #white { | |
66 | - 'portout AIGR | |
67 | - 'portin TXT | |
68 | - | |
69 | - node Reader { | |
70 | - [parser] | |
71 | - [analyse\n(ast)] as ast_ana | |
72 | - [AST 2 AIGR] as AST2AIGR | |
73 | - () "AIGR" as aigr1 | |
74 | - [analyse\n(aigr)] as aigr_ana | |
75 | - () "AIGR" as aigr2 | |
76 | - | |
77 | - parser -> ast_ana : AST | |
78 | - ast_ana -> AST2AIGR : AST | |
79 | - AST2AIGR -> aigr1 | |
80 | - aigr1 -> aigr_ana | |
81 | - aigr_ana -( aigr2 | |
82 | - } | |
83 | - | |
84 | - TXT -> Reader | |
85 | - node mock { | |
86 | - [py_data] | |
87 | - () "AIGR" as aigr3 | |
88 | - | |
89 | - py_data -( aigr3 | |
90 | - } | |
91 | - Reader -[hidden]down-> mock | |
92 | - } | |
93 | - } | |
94 | - | |
95 | - @enduml | |
96 | - |
@@ -1,9 +0,0 @@ | ||
1 | -Top Level architecture (LOCAL only) | |
2 | -================================== | |
3 | - | |
4 | - | |
5 | -.. toctree:: | |
6 | - :glob: | |
7 | - | |
8 | - * | |
9 | - */index |
@@ -1,139 +0,0 @@ | ||
1 | -OLD-Peg Diagram | |
2 | -=============== | |
3 | - | |
4 | -This anayse/design(?) date from around 2021/2022 | |
5 | - | |
6 | -.. UML:: | |
7 | - | |
8 | - @startuml | |
9 | - | |
10 | - package _base { | |
11 | - | |
12 | - abstract AST_BASE { | |
13 | - -_parse_tree | |
14 | - +position() | |
15 | - +position_end() | |
16 | - ~serialize() | |
17 | - } | |
18 | - | |
19 | - class ID { | |
20 | - +name | |
21 | - #validate_or_raise() | |
22 | - } | |
23 | - | |
24 | - ID =|> AST_BASE | |
25 | - } | |
26 | - | |
27 | - package MixIns #Gray { | |
28 | - | |
29 | - class MixIn_value_attribute<MixIn> { | |
30 | - _value | |
31 | - value() | |
32 | - } | |
33 | - | |
34 | - class MixIn_expr_attribute<MixIn> { | |
35 | - _expr | |
36 | - expr() | |
37 | - } | |
38 | - | |
39 | - class MixIn_children_tuple<MixIn> { | |
40 | - _children :Tuple | |
41 | - __len__() | |
42 | - __getitem__() | |
43 | - __iter__() | |
44 | - } | |
45 | - } | |
46 | - | |
47 | - package Peg #0077ff { | |
48 | - | |
49 | - abstract PEG | |
50 | - AST_BASE <|== PEG | |
51 | - | |
52 | - | |
53 | - | |
54 | - abstract Terminal | |
55 | - PEG <|== Terminal | |
56 | - MixIn_value_attribute <|... Terminal | |
57 | - Terminal <|== StrTerm | |
58 | - Terminal <|== RexExpTerm | |
59 | - Terminal <|== Number | |
60 | - | |
61 | - abstract Markers #Orange | |
62 | - annotation EOF #Orange | |
63 | - PEG <|== Markers | |
64 | - Markers <|== EOF | |
65 | - | |
66 | - abstract NonTerminal | |
67 | - PEG <|== NonTerminal | |
68 | - abstract Expression | |
69 | - NonTerminal <|== Expression | |
70 | - | |
71 | - class Setting { | |
72 | - name : ID | |
73 | - value | |
74 | - } | |
75 | - PEG <|== Setting | |
76 | - | |
77 | - class Rule { | |
78 | - name :ID | |
79 | - expr :[] Expression | |
80 | - } | |
81 | - NonTerminal <|== Rule | |
82 | - | |
83 | - interface Rules | |
84 | - PEG <|== Rules | |
85 | - MixIn_children_tuple <|... Rules | |
86 | - Rules <|== ParseRules | |
87 | - Rules <|== Settings | |
88 | - | |
89 | - class Grammar { | |
90 | - +all_rules :Rules | |
91 | - -parse_rules :ParseRules | |
92 | - -settings :Settings | |
93 | - } | |
94 | - NonTerminal <|== Grammar | |
95 | - | |
96 | - | |
97 | - abstract Group | |
98 | - Expression <|== Group | |
99 | - Group <|== UnorderedGroup | |
100 | - MixIn_expr_attribute <|... UnorderedGroup | |
101 | - abstract Quantity | |
102 | - Group <|== Quantity | |
103 | - MixIn_expr_attribute <|... Quantity | |
104 | - Expression <|== Sequence | |
105 | - MixIn_children_tuple <|... Sequence | |
106 | - | |
107 | - Expression <|== OrderedChoice | |
108 | - MixIn_children_tuple <|... OrderedChoice | |
109 | - | |
110 | - class Optional << (?, #0077ff) >> | |
111 | - Quantity <|== Optional | |
112 | - class ZeroOrMore << (*, #0077ff) >> | |
113 | - Quantity <|== ZeroOrMore | |
114 | - class OneOrMore << (+, #0077ff) >> | |
115 | - Quantity <|== OneOrMore | |
116 | - | |
117 | - abstract Predicate | |
118 | - Expression <|== Predicate | |
119 | - MixIn_expr_attribute <|... Predicate | |
120 | - class AndPredicate << (&, #0077ff) notconsuming >> | |
121 | - Predicate <|== AndPredicate | |
122 | - class NotPredicate << (! ,#0077ff) not consuming >> | |
123 | - Predicate <|== NotPredicate | |
124 | - | |
125 | - } | |
126 | - @enduml | |
127 | - | |
128 | - | |
129 | - | |
130 | - | |
131 | - | |
132 | - | |
133 | - | |
134 | - | |
135 | - | |
136 | - | |
137 | - | |
138 | - | |
139 | - |
@@ -1,10 +0,0 @@ | ||
1 | -Old (design) notes (LOCAL only) | |
2 | -=============================== | |
3 | - | |
4 | -These are outdated, and not maintain | |
5 | - | |
6 | -.. toctree:: | |
7 | - :glob: | |
8 | - | |
9 | - * | |
10 | - */index |
@@ -1,34 +0,0 @@ | ||
1 | -analyse_imports (220122) | |
2 | -======================== | |
3 | - | |
4 | -.. UML:: | |
5 | - | |
6 | - @startuml | |
7 | - skinparam ArrowColor green | |
8 | - | |
9 | - skinparam component { | |
10 | - BackgroundColor #0077ff | |
11 | - BorderColor black | |
12 | - } | |
13 | - skinparam folder { | |
14 | - BackgroundColor lightblue | |
15 | - BorderColor black | |
16 | - } | |
17 | - | |
18 | - cloud "AsIS 2022/Jan/22" #pink { | |
19 | - | |
20 | - folder AST { | |
21 | - folder castle { | |
22 | - [peg] --> [_base] | |
23 | - [_base] | |
24 | - [~__init __] | |
25 | - } | |
26 | - } | |
27 | - | |
28 | - folder Arpeggio { | |
29 | - [grammar] | |
30 | - [vistor] --> [peg] | |
31 | - } | |
32 | - | |
33 | - } | |
34 | - @enduml |
@@ -1,50 +0,0 @@ | ||
1 | -.. -*- plantuml -*- | |
2 | -.. filename: date of start | |
3 | -.. date in title: last version | |
4 | - | |
5 | -AIGR:: ComponentInterface and Protocols (231009) | |
6 | -================================================ | |
7 | - | |
8 | -.. uml:: | |
9 | - | |
10 | - @startuml | |
11 | - | |
12 | - abstract AIGR | |
13 | - class ComponentInterface | |
14 | - class Protocol | |
15 | - class EventProtocol | |
16 | - class Port { | |
17 | - - direction :PortDirection | |
18 | - - type :PortType | |
19 | - } | |
20 | - abstract ProtocolWrapper { | |
21 | - -based_on\n(the Generic Protocol) | |
22 | - } | |
23 | - class Argument <<(S,lightgreen)>> { | |
24 | - +value :Any | |
25 | - +name :Optional[Str] | |
26 | - } | |
27 | - class TypedParameters <<(S,lightgreen)>> { | |
28 | - +name :str | |
29 | - +type :Type | |
30 | - } | |
31 | - class Type <<(T,lightblue)>> | |
32 | - '-------------------- | |
33 | - | |
34 | - ComponentInterface <--- ComponentInterface: based_on | |
35 | - Port "*" -* ComponentInterface | |
36 | - | |
37 | - Protocol <--- Protocol: based_on | |
38 | - Protocol <-- EventProtocol | |
39 | - Protocol <-- ProtocolWrapper | |
40 | - | |
41 | - ProtocolWrapper *- "+"Argument | |
42 | - | |
43 | - EventProtocol *- "*" Event: events | |
44 | - Event *-- "*" TypedParameters : typedParameters | |
45 | - Event o- "?" Type: returns | |
46 | - | |
47 | - Port o. Protocol: type | |
48 | - | |
49 | - @enduml | |
50 | - |
@@ -1,50 +0,0 @@ | ||
1 | -.. -*- plantuml -*- | |
2 | - | |
3 | -TestDoubles/AIGR: The protocols of the Sieve | |
4 | -============================================ | |
5 | - | |
6 | -.. uml:: | |
7 | - | |
8 | - @startuml | |
9 | - | |
10 | - object StartSieve <<EventProtocol>> | |
11 | - object runTo <<Event>>{ | |
12 | - max: int | |
13 | - } | |
14 | - object newMax <<Event>> { | |
15 | - max: int | |
16 | - } | |
17 | - StartSieve *-- runTo | |
18 | - StartSieve *-- newMax | |
19 | - | |
20 | - '--- | |
21 | - | |
22 | - object SlowStart << EventProtocol>> | |
23 | - object queue_max <<TypedParameter>> { | |
24 | - :int | |
25 | - } | |
26 | - object setMax <<Event>> { | |
27 | - setMax :int | |
28 | - } | |
29 | - SlowStart *-- setMax | |
30 | - SlowStart *- queue_max | |
31 | - | |
32 | - '--- | |
33 | - | |
34 | - object "SlowStart(1)" as SlowStart_1 <<ProtocolWrapper>> { | |
35 | - queue_max=1 | |
36 | - } | |
37 | - SlowStart <-- SlowStart_1: based on | |
38 | - | |
39 | - | |
40 | - '--- | |
41 | - | |
42 | - object SimpleSieve <<EventProtocol>> | |
43 | - SlowStart_1 <-- SimpleSieve: based_on | |
44 | - | |
45 | - object input <<Event>> { | |
46 | - try :int | |
47 | - } | |
48 | - SimpleSieve *--input | |
49 | - | |
50 | - @enduml |
@@ -1,26 +0,0 @@ | ||
1 | -.. -*- plantuml -*- | |
2 | - | |
3 | -TestDoubles/AIGR: The interfaces of the SIEVE (BUSY) | |
4 | -==================================================== | |
5 | - | |
6 | -.. uml:: | |
7 | - | |
8 | - @startuml | |
9 | - | |
10 | - object "**Sieve**" as Sieve <<ComponentInterface>> { | |
11 | - + {static} new(onPrime:int) | |
12 | - } | |
13 | - note right of Sieve: alt-name: **SieveMoat** | |
14 | - object try <<Port>>{ | |
15 | - In: PortDirection | |
16 | - SimpleSieve: type | |
17 | - } | |
18 | - object corprime <<Port>> { | |
19 | - Out: PortDirection | |
20 | - SimpleSieve: type | |
21 | - } | |
22 | - | |
23 | - Sieve *-- try | |
24 | - Sieve *-- corprime | |
25 | - | |
26 | - @enduml |
@@ -1,79 +0,0 @@ | ||
1 | -Namespace & protocols | |
2 | -********************* | |
3 | - | |
4 | -.. uml:: | |
5 | - | |
6 | - @startuml | |
7 | - | |
8 | - package "Protocols in ‘TheSieve’" as P1 <<Node>> { | |
9 | - | |
10 | - package start_sieve as P1A { | |
11 | - object start_sieve <<Source_NS>> #LightSkyBlue { | |
12 | - file: 'start_sieve.Castle' | |
13 | - } | |
14 | - object " " as P1A_d <<dict>> #lightcyan { | |
15 | - StartSieve | |
16 | - base :NS | |
17 | - } | |
18 | - object StartSieve <<EventProtocol>> | |
19 | - | |
20 | - start_sieve o-- P1A_d | |
21 | - start_sieve <-- StartSieve | |
22 | - P1A_d::StartSieve -> StartSieve #DarkMagenta | |
23 | - P1A_d::base --> base #DarkMagenta | |
24 | - } | |
25 | - | |
26 | - package slow_start as P1B { | |
27 | - object slow_start <<Source_NS>> #LightSkyBlue { | |
28 | - file: 'slow_start.Castle' | |
29 | - } | |
30 | - object " " as P1B_d <<dict>> #lightcyan { | |
31 | - SlowStart | |
32 | - base :NS | |
33 | - } | |
34 | - object SlowStart <<EventProtocol>> { | |
35 | - queue_max :int | |
36 | - } | |
37 | - | |
38 | - slow_start o-- P1B_d | |
39 | - slow_start <-- SlowStart | |
40 | - P1B_d::SlowStart -> SlowStart #DarkMagenta | |
41 | - P1B_d::base -> base #DarkMagenta | |
42 | - } | |
43 | - | |
44 | - package simple_sieve as P1C { | |
45 | - object simple_sieve <<Source_NS>> #LightSkyBlue { | |
46 | - file: 'simple_sieve.Castle' | |
47 | - } | |
48 | - object " " as P1C_d <<dict>> #lightcyan { | |
49 | - SlowStart(1) | |
50 | - SimpleSieve | |
51 | - } | |
52 | - object "SlowStart(1)" as SlowStart_1 <<ProtocolWrapper>> { | |
53 | - queue_max=1 | |
54 | - } | |
55 | - object SimpleSieve <<EventProtocol>> | |
56 | - SlowStart_1 <|-- SimpleSieve: based_on | |
57 | - | |
58 | - simple_sieve o-- P1C_d | |
59 | - simple_sieve <-- SlowStart_1 | |
60 | - simple_sieve <--- SimpleSieve | |
61 | - P1C_d::SlowStart_1 -> SlowStart_1 #DarkMagenta | |
62 | - P1C_d::SimpleSieve -> SimpleSieve #DarkMagenta | |
63 | - } | |
64 | - | |
65 | - SlowStart <|---- SlowStart_1 #SkyBlue : based_on | |
66 | - } | |
67 | - | |
68 | - package "Build-in Protocols" as P2 <<Node>> { | |
69 | - package base { | |
70 | - object Protocol <<_RootProtocol>> | |
71 | - } | |
72 | - package buildin { | |
73 | - } | |
74 | - } | |
75 | - | |
76 | - Protocol <|-- StartSieve #SkyBlue : based_on | |
77 | - Protocol <|-- SlowStart #SkyBlue : based_on | |
78 | - | |
79 | - @enduml |
@@ -1,15 +0,0 @@ | ||
1 | -Some (LOCAL only) Design Notes | |
2 | -============================== | |
3 | - | |
4 | -This are “quick and dirty” design diagrams. That where useful when created (see file-name), but may be less relevant | |
5 | -later. | |
6 | - | |
7 | -* Sound designs, are typically worked out (adding text & view), and move to a stable, to-be-maintained, location | |
8 | -* Outdated one are (will be) moved to :doc:`/../archived/index.rst` (and will never be maintained | |
9 | -* the one here, a undecided, may or may-not be maintained. | |
10 | - | |
11 | -.. toctree:: | |
12 | - :glob: | |
13 | - | |
14 | - * | |
15 | - */index |
@@ -1,29 +0,0 @@ | ||
1 | -'' -*- mode: plantuml -*- '' | |
2 | -skinparam componentStyle uml1 | |
3 | - | |
4 | -skinparam component { | |
5 | - BorderColor white | |
6 | - BackgroundColor #000066 | |
7 | - FontColor white | |
8 | -} | |
9 | -skinparam package { | |
10 | - BorderColor #000066 | |
11 | - BackgroundColor #eeeeff | |
12 | -} | |
13 | -skinparam interface { | |
14 | - BorderColor #000066 | |
15 | - BackgroundColor #000066 | |
16 | - FontColor #000066 | |
17 | -} | |
18 | -skinparam file { | |
19 | - BorderColor #c0c0c0 | |
20 | - BackgroundColor #808080 | |
21 | - FontColor #000066 | |
22 | -} | |
23 | -skinparam { | |
24 | - ArrowColor #000066 | |
25 | -} | |
26 | -skinparam node { | |
27 | - BorderColor #000066 | |
28 | - BackgroundColor #eeeeff | |
29 | -} |