Skip to content

Commit 842675a

Browse files
committed
fix: Updated complete set of input and output grammar files
1 parent 19f700a commit 842675a

24 files changed

Lines changed: 19261 additions & 2827 deletions

tool-support/bnf_grammar_tools/tests/KerML_and_SysML_grammars/KerML-textual-bnf-corrected-elements.json

Lines changed: 4254 additions & 0 deletions
Large diffs are not rendered by default.

tool-support/bnf_grammar_tools/tests/KerML_and_SysML_grammars/KerML-textual-bnf-corrected-marked_up.kebnf

Lines changed: 51 additions & 35 deletions
Large diffs are not rendered by default.

tool-support/bnf_grammar_tools/tests/KerML_and_SysML_grammars/KerML-textual-bnf-corrected.html

Lines changed: 631 additions & 613 deletions
Large diffs are not rendered by default.

tool-support/bnf_grammar_tools/tests/KerML_and_SysML_grammars/KerML-textual-bnf-corrected.kebnf

Lines changed: 50 additions & 52 deletions
Large diffs are not rendered by default.

tool-support/bnf_grammar_tools/tests/KerML_and_SysML_grammars/KerML-textual-bnf-elements.json

Lines changed: 29 additions & 102 deletions
Large diffs are not rendered by default.

tool-support/bnf_grammar_tools/tests/KerML_and_SysML_grammars/KerML-textual-bnf-marked_up.kebnf

Lines changed: 48 additions & 33 deletions
Large diffs are not rendered by default.

tool-support/bnf_grammar_tools/tests/KerML_and_SysML_grammars/KerML-textual-bnf.html

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</head>
88
<body>
99
<p>// Source document: tests/KerML_and_SysML_spec_sources/KerML-spec.html<br>
10-
// Generated by bnf_grammar_extractor at: 2025-12-02T13:27:26Z
10+
// Generated by bnf_grammar_processor at: 2025-12-04T19:31:35Z
1111
</p>
1212
<h1>// Part 1 - Kernel Modeling Language (KerML)</h1>
1313
<h2><a id="c8.2"></a>// Clause 8.2 Concrete Syntax</h2>
@@ -26,8 +26,7 @@ <h4><a id="c8.2.2.1"></a>// Clause 8.2.2.1 Line Terminators and White Space</h4>
2626
<pre>WHITE_SPACE =
2727
space | tab | form_feed | <a href="#LINE_TERMINATOR_">LINE_TERMINATOR</a>
2828
</pre>
29-
<p>
30-
// <strong>Notes:</strong></p>
29+
<p>// <strong>Notes:</strong></p>
3130
<ol>
3231
<li>// 1. Notation text is divided up into lines separated by <em>line terminators</em>. A line terminator may be a single character (such as a line feed) or a sequence of characters (such as a carriage return/line feed combination). This specification does not require any specific encoding for a line terminator, but any encoding used must be consistent throughout any specific input text.</li>
3332
<li>// 2. Any characters in text line that are not a part of the line terminator are referred to as <em>line text</em>.</li>
@@ -92,8 +91,7 @@ <h4><a id="c8.2.2.3"></a>// Clause 8.2.2.3 Names</h4>
9291
<pre>ESCAPE_SEQUENCE =
9392
</pre>
9493
<p>// (See Note 2)</p>
95-
<p>
96-
// <strong>Notes:</strong></p>
94+
<p>// <strong>Notes:</strong></p>
9795
<ol>
9896
<li>// 1. The <code>single_quote</code> character is <code>'</code>. The name represented by an <code>UNRESTRICTED_NAME</code> shall consist of the characters <em>within</em> the single quotes, with escape characters resolved as described below. The surrounding single quote characters are <em>not</em> part of the represented name.</li>
9997
<li>// 2. An <code>ESCAPE_SEQUENCE</code><em> </em>is a sequence of two text characters starting with a backslash that actually denotes only a single character, except for the newline escape sequence, which represents however many characters is necessary to represent an end of line in a specific implementation (see also <a href="#c8.2.2.1">8.2.2.1</a>). Table 4 shows the meaning of the allowed escape sequences. The <code>ESCAPE_SEQUENCES</code> in an <code>UNRESTRICTED_NAME</code> shall be replaced by the characters specified as their meanings in the actual represented name.</li>
@@ -107,8 +105,7 @@ <h4><a id="c8.2.2.4"></a>// Clause 8.2.2.4 Numeric Values</h4>
107105
<pre>EXPONENTIAL_VALUE =
108106
<a href="#DECIMAL_VALUE_">DECIMAL_VALUE</a> ('e' | 'E') ('+' | '-')? <a href="#DECIMAL_VALUE_">DECIMAL_VALUE</a>
109107
</pre>
110-
<p>
111-
// <strong>Notes:</strong></p>
108+
<p>// <strong>Notes:</strong></p>
112109
<ol>
113110
<li>// 1. A <code>DECIMAL_VALUE</code> may specify a natural literal, or it may be part of the specification of a real literal (see <a href="#c8.2.5.8.4">8.2.5.8.4</a>). Note that a <code>DECIMAL_VALUE</code> does not include a sign, because negating a literal is an operator in the KerML <code>Expression</code> syntax.</li>
114111
<li>// 2. An <code>EXPONENTIAL_VALUE</code> may be used in the specification of a real literal (see <a href="#c8.2.5.8.4">8.2.5.8.4</a>). Note that a decimal point and fractional part are not included in the lexical structure of an exponential value. They are handled as part of the syntax of real literals.</li>
@@ -122,8 +119,7 @@ <h4><a id="c8.2.2.5"></a>// Clause 8.2.2.5 String Value</h4>
122119
<pre>STRING_CHARACTER =
123120
any printable character other than backslash or '"'
124121
</pre>
125-
<p>
126-
// <strong>Notes:</strong></p>
122+
<p>// <strong>Notes:</strong></p>
127123
<ol>
128124
<li>// 1. <code>ESCAPE_SEQUENCE</code> is specified in <a href="#c8.2.2.3">8.2.2.3</a>.</li>
129125
</ol>
@@ -199,8 +195,7 @@ <h4><a id="c8.2.3.2"></a>// Clause 8.2.3.2 Dependencies Concrete Syntax</h4>
199195
supplier += [<a href="#QualifiedName">QualifiedName</a>] ( ',' supplier += [<a href="#QualifiedName">QualifiedName</a>] )*
200196
<a href="#RelationshipBody">RelationshipBody</a>
201197
</pre>
202-
<p>
203-
// <strong>Notes:</strong></p>
198+
<p>// <strong>Notes:</strong></p>
204199
<ol>
205200
<li>// 1. <code>PrefixMetadataAnnotation</code> is defined in the Kernel layer (see <a href="#c8.2.5.12">8.2.5.12</a>).</li>
206201
</ol>
@@ -221,8 +216,7 @@ <h5><a id="c8.2.3.3.1"></a>// Clause 8.2.3.3.1 Annotations</h5>
221216
| <a href="#TextualRepresentation">TextualRepresentation</a>
222217
| <a href="#MetadataFeature">MetadataFeature</a>
223218
</pre>
224-
<p>
225-
// <strong>Notes:</strong></p>
219+
<p>// <strong>Notes:</strong></p>
226220
<ol>
227221
<li>// 1. <code>MetadataFeature</code> is defined in the Kernel layer (see <a href="#c8.2.5.12">8.2.5.12</a>).</li>
228222
</ol>
@@ -243,8 +237,7 @@ <h5><a id="c8.2.3.3.2"></a>// Clause 8.2.3.3.2 Comments and Documentation</h5>
243237
( 'locale' locale = <a href="#STRING_VALUE_">STRING_VALUE</a> )?
244238
body = <a href="#REGULAR_COMMENT_">REGULAR_COMMENT</a>
245239
</pre>
246-
<p>
247-
// <strong>Notes:</strong></p>
240+
<p>// <strong>Notes:</strong></p>
248241
<ol>
249242
<li>// 1. The text of a lexical <code>REGULAR_COMMENT</code> or <code>PREFIX_COMMENT</code> shall be processed as follows before it is included as the body of a <code>Comment</code> or <code>Documentation</code>:
250243
<ul>
@@ -268,8 +261,7 @@ <h5><a id="c8.2.3.3.3"></a>// Clause 8.2.3.3.3 Textual Representation</h5>
268261
'language' language = <a href="#STRING_VALUE_">STRING_VALUE</a>
269262
body = <a href="#REGULAR_COMMENT_">REGULAR_COMMENT</a>
270263
</pre>
271-
<p>
272-
// <strong>Notes:</strong></p>
264+
<p>// <strong>Notes:</strong></p>
273265
<ol>
274266
<li>// 1. The lexical text of a <code>REGULAR_COMMENT</code> shall be processed as specified in <a href="#c8.2.3.3.2">8.2.3.3.2</a> for <code>Comments</code> before being included as the body of a <code>TextualRepresentation</code>.</li>
275267
<li>// 2. See also 8.3.2.3.6 on the standard <code>language</code> names recognized for a <code>TextualRepresentation</code>.</li>
@@ -337,8 +329,7 @@ <h5><a id="c8.2.3.4.1"></a>// Clause 8.2.3.4.1 Namespaces</h5>
337329
( '$' '::' )? ( <a href="#NAME_">NAME</a> '::' )* <a href="#NAME_">NAME</a>
338330
</pre>
339331
<p>// (See Note 3)</p>
340-
<p>
341-
// <strong>Notes:</strong></p>
332+
<p>// <strong>Notes:</strong></p>
342333
<ol>
343334
<li>// 1. A <em>root</em> <code>Namespace</code> is a <code>Namespace</code> that has no <code>owningNamespace</code> (see 8.3.2.4). Every <code>Element</code> other than a root <code>Namespace</code> must be contained, directly or indirectly, within some root <code>Namespace</code>. Therefore, every valid KerML concrete syntax text can be parsed starting from the <code>RootNamespace</code> production.</li>
344335
<li>// 2. <code>PrefixMetadataMember</code> is defined in the Kernel layer (see <a href="#c8.2.5.12">8.2.5.12</a>).</li>
@@ -377,8 +368,7 @@ <h5><a id="c8.2.3.4.2"></a>// Clause 8.2.3.4.2 Imports</h5>
377368
<pre>FilterPackageMember : ElementFilterMembership =
378369
'[' ownedRelatedElement += <a href="#OwnedExpression">OwnedExpression</a> ']'
379370
</pre>
380-
<p>
381-
// <strong>Notes:</strong></p>
371+
<p>// <strong>Notes:</strong></p>
382372
<ol>
383373
<li>// 1. The <code>importedMembership</code> of a <code>MembershipImport</code> is the single case in which the <code>Element</code> required from the resolution <code>[QualifiedName]</code> is the actual <code>Membership</code> identified by the <code>QualifedName</code>, <em>not</em> the <code>memberElement</code> of that <code>Membership</code> (see <a href="#c8.2.3.5">8.2.3.5</a>).</li>
384374
</ol>
@@ -762,8 +752,7 @@ <h5><a id="c8.2.4.3.1"></a>// Clause 8.2.4.3.1 Features</h5>
762752
<pre>Redefines : Feature =
763753
<a href="#REDEFINES_">REDEFINES</a> ownedRelationship += <a href="#OwnedRedefinition">OwnedRedefinition</a>
764754
</pre>
765-
<p>
766-
// <strong>Notes:</strong></p>
755+
<p>// <strong>Notes:</strong></p>
767756
<ol>
768757
<li>// 1. <code>PrefixMetadataMember</code> is defined in the Kernel layer (see 8.3.4.12).</li>
769758
</ol>
@@ -1208,8 +1197,7 @@ <h5><a id="c8.2.5.8.1"></a>// Clause 8.2.5.8.1 Operator Expressions</h5>
12081197
<pre>EmptyFeature : Feature =
12091198
{ }
12101199
</pre>
1211-
<p>
1212-
// <strong>Notes:</strong></p>
1200+
<p>// <strong>Notes:</strong></p>
12131201
<ol>
12141202
<li>// 1. <code>OperatorExpressions</code> provide a shorthand notation for <code>InvocationExpressions</code> that invoke a library <code>Function</code> represented as an <code>operator</code><em> symbol.</em> Table 5 shows the mapping from <code>operator</code> symbols to the <code>Functions</code> they represent from the Kernel Model Library (see Clause 9). An <code>OperatorExpression</code> contains subexpressions called its <em>operands</em> that generally correspond to the <code>argument</code> <code>Expressions</code> of the <code>OperatorExpression</code>, except in the case of <code>operators</code> representing <em>control </em><code>Functions</code>, in which case the evaluation of certain operands is as determined by the <code>Function</code> (see 8.4.4.9 for details).</li>
12151203
<li>// 2. Though not directly expressed in the syntactic productions given above, in any <code>OperatorExpression</code> containing nested <code>OperatorExpressions</code>, the nested <code>OperatorExpressions</code> shall be implicitly grouped according to the <em>precedence</em> of the <code>operators</code> involved, as given in Table 6. <code>OperatorExpressions</code> with higher precedence <code>operators</code> shall be grouped more tightly than those with lower precedence <code>operators</code>. Further, all <code>BinaryOperators</code> other than exponentiation are left-associative (i.e, they group to the left), while the exponentiation operators (<code>^</code> and <code>**</code>) are right-associative (i.e., they group to the right).</li>
@@ -1353,8 +1341,7 @@ <h5><a id="c8.2.5.8.2"></a>// Clause 8.2.5.8.2 Primary Expressions</h5>
13531341
<pre>OwnedFeatureChainMember : OwningMembership =
13541342
ownedMemberElement = <a href="#FeatureChain">FeatureChain</a>
13551343
</pre>
1356-
<p>
1357-
// <strong>Notes:</strong></p>
1344+
<p>// <strong>Notes:</strong></p>
13581345
<ol>
13591346
<li>// 1. Primary expressions provide additional shorthand notations for certain kinds of <code>InvocationExpressions</code>. For those cases in which the <code>InvocationExpression</code> is an <code>OperatorExpression</code>, its <code>operator</code> shall be resolved to the appropriate library function as given in Table 7. Note also that, for a <code>CollectionExpression</code> or <code>SelectExpression</code>, the abstract syntax constrains the <code>operator</code> to be <em><code>collect</code></em> and <em><code>select</code></em>, respectively, separately from the <code>.</code> and <code>.?</code> symbols used in their concrete syntax notation (see 8.3.4.8.2 and 8.3.4.8.18).</li>
13601347
<li>// 2. The grammar allows a bracket syntax <code>[</code>...<code>]</code>that parses to an invocation of the library <code>Function</code> <code><em>Base</em></code><em><code>Functions::'['</code>,</em> as shown in Table 7. This notation is available for use with domain-specific library models that given a concrete definition to the abstract base <code>'['</code> <code>Function</code>, but no default definition is provided in the Kernel Functions Library. If no domain-specific definition is available, a tool should give a warning if this operator is used.</li>
@@ -1569,8 +1556,7 @@ <h5><a id="c8.2.5.9.2"></a>// Clause 8.2.5.9.2 Flows</h5>
15691556
<pre>FlowFeatureRedefinition : Redefinition =
15701557
redefinedFeature = [<a href="#QualifiedName">QualifiedName</a>]
15711558
</pre>
1572-
<p>
1573-
// <strong>Notes:</strong></p>
1559+
<p>// <strong>Notes:</strong></p>
15741560
<ol>
15751561
<li>// 1. To ensure that an <code>FlowFeature</code> passes the <code>validateRedefinitionDirectionConformance</code> constraint (see 8.3.3.3.8), its <code>direction</code> must be set to the direction of its <code>redefinedFeature</code>, relative to its owning <code>FlowEnd</code>, that is, the result of the following OCL expression: <code>owningType.directionOf(ownedRedefinition-&gt;at(1).redefinedFeature)</code></li>
15761562
</ol>

tool-support/bnf_grammar_tools/tests/KerML_and_SysML_grammars/KerML-textual-bnf.kebnf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Source document: tests/KerML_and_SysML_spec_sources/KerML-spec.html
2-
3-
// Generated by bnf_grammar_extractor at: 2025-12-02T13:27:26Z
2+
// Generated by bnf_grammar_processor at: 2025-12-04T19:31:35Z
43

54

65
// Part 1 - Kernel Modeling Language (KerML)
@@ -212,7 +211,7 @@ Documentation =
212211
// • Strip initial white space other than line terminators.
213212
// • Then, if the first remaining character is "*", remove it.
214213
// • Then, if the first remaining character is now a space, remove it.
215-
// 2. The body text of a Comment can include markup information (such as HTML), and a conforming tool may display such text as rendered according to the markup. However, marked up "rich text" for a Comment written using the KerML textual concrete syntax shall be stored in the Comment body in plain text including all mark up text, with all line terminators and white space included as entered, other than what is removed according to the rules above.
214+
// 2. The body text of a Comment can include markup information (such as HTML), and a conforming tool may display such text as rendered according to the markup. However, marked up "rich text" for a Comment written using the KerML textual concrete syntax shall be stored in the Comment body in plain text including all mark up text, with all line terminators and white space included as entered, other than what is removed according to the rules above.
216215

217216
// Clause 8.2.3.3.3 Textual Representation
218217

0 commit comments

Comments
 (0)