Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2
Revision | 0802f43c877e1b2466a6575b71f0afe35fec7bed (tree) |
---|---|
Zeit | 2022-04-19 22:35:56 |
Autor | Albert Mietus < albert AT mietus DOT nl > |
Commiter | Albert Mietus < albert AT mietus DOT nl > |
Design/Peg.puml now forced downward, by using =up=|> :: Ugly but it works. Also added _base package
@@ -1,23 +1,21 @@ | ||
1 | 1 | @startuml |
2 | 2 | |
3 | +package _base { | |
4 | + | |
3 | 5 | abstract AST_BASE { |
4 | - _parse_tree | |
5 | - position() | |
6 | - position_end() | |
7 | - serialize() | |
6 | + -_parse_tree | |
7 | + +position() | |
8 | + +position_end() | |
9 | + ~serialize() | |
8 | 10 | } |
9 | 11 | |
10 | 12 | class ID { |
11 | - name | |
12 | - validate_or_raise() | |
13 | + +name | |
14 | + #validate_or_raise() | |
13 | 15 | } |
14 | 16 | |
15 | 17 | ID =|> AST_BASE |
16 | - | |
17 | -package Peg #0077ff { | |
18 | - | |
19 | -abstract PEG | |
20 | -PEG ==|> AST_BASE | |
18 | +} | |
21 | 19 | |
22 | 20 | package MixIns #Gray { |
23 | 21 |
@@ -39,45 +37,51 @@ | ||
39 | 37 | } |
40 | 38 | } |
41 | 39 | |
40 | +package Peg #0077ff { | |
41 | + | |
42 | +abstract PEG | |
43 | +PEG =up=|> AST_BASE | |
44 | + | |
45 | + | |
42 | 46 | |
43 | 47 | abstract Terminal |
44 | -Terminal ==|> PEG | |
45 | -Terminal ---|> MixIn_value_attribute | |
46 | -StrTerm ==|> Terminal | |
47 | -RexExpTerm ==|> Terminal | |
48 | -Number ==|> Terminal | |
48 | +Terminal =up=|> PEG | |
49 | +Terminal --up--|> MixIn_value_attribute | |
50 | +StrTerm =up=|> Terminal | |
51 | +RexExpTerm =up=|> Terminal | |
52 | +Number =up=|> Terminal | |
49 | 53 | |
50 | 54 | abstract Markers #ORANGE |
51 | -Markers ==|> PEG | |
55 | +Markers =up=|> PEG | |
52 | 56 | annotation EOF #ORANGE |
53 | -EOF ==|> Markers | |
57 | +EOF =up=|> Markers | |
54 | 58 | |
55 | 59 | abstract NonTerminal |
56 | -NonTerminal ==|> PEG | |
60 | +NonTerminal =up=|> PEG | |
57 | 61 | abstract Expression |
58 | -Expression ==|> NonTerminal | |
62 | +Expression =up=|> NonTerminal | |
59 | 63 | |
60 | 64 | class Setting { |
61 | 65 | name : ID |
62 | 66 | value |
63 | 67 | } |
64 | -Setting ==|> PEG | |
65 | -Setting ---> ID | |
68 | +Setting =up=|> PEG | |
69 | +Setting -up-> ID | |
66 | 70 | |
67 | 71 | class Rule { |
68 | 72 | name :ID |
69 | 73 | expr :[] Expression |
70 | 74 | } |
71 | -Rule ==|> NonTerminal | |
72 | -Rule ---> ID | |
75 | +Rule =up=|> NonTerminal | |
76 | +Rule -up-> ID | |
73 | 77 | Rule ---> Expression |
74 | 78 | |
75 | 79 | interface Rules |
76 | -Rules ==|> PEG | |
77 | -Rules ---|> MixIn_children_tuple | |
80 | +Rules =up=|> PEG | |
81 | +Rules --up--|> MixIn_children_tuple | |
78 | 82 | |
79 | -ParseRules ==|> Rules | |
80 | -Settings ==|> Rules | |
83 | +ParseRules =up=|> Rules | |
84 | +Settings =up=|> Rules | |
81 | 85 | |
82 | 86 | |
83 | 87 | class Grammar { |
@@ -85,42 +89,36 @@ | ||
85 | 89 | -parse_rules :ParseRules |
86 | 90 | -settings :Settings |
87 | 91 | } |
88 | -Grammar ==|> NonTerminal | |
92 | +Grammar =up=|> NonTerminal | |
89 | 93 | |
90 | 94 | |
91 | 95 | abstract Group |
92 | -Group ==|> Expression | |
93 | -UnorderedGroup ==|> Group | |
94 | -UnorderedGroup ---|> MixIn_expr_attribute | |
96 | +Group =up=|> Expression | |
97 | +UnorderedGroup =up=|> Group | |
98 | +UnorderedGroup --up--|> MixIn_expr_attribute | |
95 | 99 | abstract Quantity |
96 | -Quantity ==|> Group | |
97 | -Quantity ---|> MixIn_expr_attribute | |
98 | - | |
99 | -Sequence ==|> Expression | |
100 | -Sequence ---|> MixIn_children_tuple | |
100 | +Quantity =up=|> Group | |
101 | +Quantity --up--|> MixIn_expr_attribute | |
102 | +Sequence =up=|> Expression | |
103 | +Sequence --up--|> MixIn_children_tuple | |
101 | 104 | |
102 | -OrderedChoice ==|> Expression | |
103 | -OrderedChoice ---|> MixIn_children_tuple | |
105 | +OrderedChoice =up=|> Expression | |
106 | +OrderedChoice --up--|> MixIn_children_tuple | |
104 | 107 | |
105 | -'======================== | |
106 | 108 | class Optional << (?, #0077ff) >> |
107 | -Optional ==|> Quantity | |
109 | +Optional =up=|> Quantity | |
108 | 110 | class ZeroOrMore << (*, #0077ff) >> |
109 | -ZeroOrMore ==|> Quantity | |
111 | +ZeroOrMore =up=|> Quantity | |
110 | 112 | class OneOrMore << (+, #0077ff) >> |
111 | -OneOrMore ==|> Quantity | |
113 | +OneOrMore =up=|> Quantity | |
112 | 114 | |
113 | 115 | abstract Predicate |
114 | -Predicate ==|> Expression | |
115 | -Predicate ---|> MixIn_expr_attribute | |
116 | +Predicate =up=|> Expression | |
117 | +Predicate --up--|> MixIn_expr_attribute | |
116 | 118 | class AndPredicate << (&, #0077ff) notconsuming >> |
117 | -AndPredicate ==|> Predicate | |
119 | +AndPredicate =up=|> Predicate | |
118 | 120 | class NotPredicate << (! ,#0077ff) not consuming >> |
119 | -NotPredicate ==|> Predicate | |
120 | - | |
121 | - | |
122 | - | |
123 | - | |
121 | +NotPredicate =up=|> Predicate | |
124 | 122 | |
125 | 123 | } |
126 | 124 | @enduml |