Skip to content

Commit 9adc25b

Browse files
zrgtsebbader-sap
andauthored
Fix AASQL grammar bugs #433, #434, #435 (#436)
* Use partials for bnf Before the bnf grammar was in an .adoc file. In this commit we place it in .bnf file in partials similar as in aas-specs-security repo. * Small fix * Add missing $ for ends-with Fixes #435 * Set brackets mandatory for items in iterables Fixes #433 * Remove redundancy in `stringComparison` --------- Co-authored-by: sebbader-sap <107036549+sebbader-sap@users.noreply.github.com>
1 parent 823acc5 commit 9adc25b

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

documentation/IDTA-01002-3/modules/ROOT/pages/query-language.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ The content and structure of the AAS Query Language is defined in the context-fr
6969

7070
This is the combined grammar for the AAS Query Language and the AAS Access Rules defined by the AAS Security specification xref:bibliography.adoc#bib3[[3\]].
7171

72-
73-
include::./grammar.adoc[]
74-
75-
72+
[source,bnf,linenums]
73+
----
74+
include::partial$bnf/grammar.bnf[]
75+
----
7676

7777
== Select Expression
7878

@@ -234,7 +234,7 @@ The following example is used to illustrate the comparisons. The following Asset
234234
}
235235
]
236236
}
237-
],
237+
]
238238
}
239239
----
240240

documentation/IDTA-01002-3/modules/ROOT/pages/grammar.adoc renamed to documentation/IDTA-01002-3/modules/ROOT/partials/bnf/grammar.bnf

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
....
21
<grammar> ::= <query> | <AllAccessPermissionRules>
32

43
<query> ::= <selectStatement>? <logicalExpression>
@@ -24,8 +23,8 @@
2423
<allComparisons> ::= ( "$eq" | "$ne" | "$gt" | "$lt" | "$ge" | "$le" )
2524

2625
<stringComparison> ::=
27-
( ( "$starts-with" | "ends-with" | "$contains" | "$regex") <ws> "(" <ws> <stringOperand> <ws> "," <ws> <stringOperand> <ws> ")" <ws> ) |
28-
( <stringOperand> <ws> <allComparisons> <ws> <stringOperand> <ws> ) |
26+
( ( "$starts-with" | "$ends-with" | "$contains" | "$regex") <ws> "(" <ws> <stringOperand> <ws> "," <ws> <stringOperand> <ws> ")" <ws> ) |
27+
( <stringOperand> <ws> <allComparisons> <ws> <stringOperand> <ws> )
2928
( <stringOperand> <ws> <allComparisons> <ws> <FieldIdentifierString> <ws> ) |
3029
( <FieldIdentifierString> <ws> <allComparisons> <ws> <stringOperand> <ws> )
3130

@@ -201,16 +200,15 @@
201200
<FieldIdentifierSM> ::= "$sm#" ( <SemanticIdClause> | "idShort" | "id" )
202201
<FieldIdentifierSME> ::= "$sme" ( "." <idShortPath> )? "#" ( <SemanticIdClause> | "idShort" | "value" | "valueType" | "language" )
203202
<FieldIdentifierCD> ::= "$cd#" ( "idShort" | "id" ) <ws>
204-
<FieldIdentifierAasDescriptor> ::= "$aasdesc#" ( "idShort" | "id" | "assetKind" | "assetType" | "globalAssetId" | <SpecificAssetIdsClause> | "endpoints" ( "[" ( [0-9]* ) "]" )? "." <EndpointClause> | "submodelDescriptors" ( "[" ( [0-9]* ) "]" )? "." <SmDescriptorClause> )
203+
<FieldIdentifierAasDescriptor> ::= "$aasdesc#" ( "idShort" | "id" | "assetKind" | "assetType" | "globalAssetId" | <SpecificAssetIdsClause> | "endpoints" ( "[" ( [0-9]* ) "]" ) "." <EndpointClause> | "submodelDescriptors" ( "[" ( [0-9]* ) "]" ) "." <SmDescriptorClause> )
205204
<FieldIdentifierSmDescriptor> ::= "$smdesc#" <SmDescriptorClause>
206-
<SmDescriptorClause> ::= ( <SemanticIdClause> | "idShort" | "id" | "endpoints" ( "[" ( [0-9]* ) "]" )? "." <EndpointClause> )
205+
<SmDescriptorClause> ::= ( <SemanticIdClause> | "idShort" | "id" | "endpoints" ( "[" ( [0-9]* ) "]" ) "." <EndpointClause> )
207206
<EndpointClause> ::= "interface" | "protocolinformation.href"
208207

209-
<ReferenceClause> ::= ( "type" | "keys" ( "[" ( [0-9]* ) "]" )? ( ".type" | ".value" ) )
208+
<ReferenceClause> ::= ( "type" | "keys" ( "[" ( [0-9]* ) "]" ) ( ".type" | ".value" ) )
210209
<SemanticIdClause> ::= ( "semanticId" | "semanticId." <ReferenceClause> )
211-
<SpecificAssetIdsClause> ::= ( "specificAssetIds" ( "[" ( [0-9]* ) "]" )? ( ".name" | ".value" | ".externalSubjectId" | ".externalSubjectId." <ReferenceClause> ) )
210+
<SpecificAssetIdsClause> ::= ( "specificAssetIds" ( "[" ( [0-9]* ) "]" ) ( ".name" | ".value" | ".externalSubjectId" | ".externalSubjectId." <ReferenceClause> ) )
212211
<idShortPath> ::= ( <idShort> ("[" ( [0-9]* ) "]" )? ( "." <idShortPath> )* )
213212
<idShort> ::= ( ( [a-z] | [A-Z] ) ( [a-z] | [A-Z] | [0-9] | "_" )* )
214213

215214
<ws> ::= ( " " | "\t" | "\r" | "\n" )*
216-
....

0 commit comments

Comments
 (0)