@@ -176,7 +176,11 @@ A QL module definition has the following syntax:
176
176
177
177
::
178
178
179
- module ::= annotation* "module" modulename "{" moduleBody "}"
179
+ module ::= annotation* "module" modulename parameters? implements? "{" moduleBody "}"
180
+
181
+ parameters ::= "<" signatureExpr simpleId ("," signatureExpr simpleId)* ">"
182
+
183
+ implements ::= "implements" moduleSignatureExpr ("," moduleSignatureExpr)*
180
184
181
185
moduleBody ::= (import | predicate | class | module | alias | select)*
182
186
@@ -212,8 +216,11 @@ An import directive refers to a module identifier:
212
216
213
217
qualId ::= simpleId | qualId "." simpleId
214
218
215
- importModuleExpr ::= qualId
216
- | importModuleExpr "::" simpleId
219
+ importModuleExpr ::= qualId | importModuleExpr "::" simpleId arguments?
220
+
221
+ arguments ::= "<" argument ("," argument)* ">"
222
+
223
+ argument ::= moduleExpr | type | predicateRef "/" int
217
224
218
225
An import directive may optionally name the imported module using an ``as `` declaration. If a name is defined, then the import directive adds to the declared module environment of the current module a mapping from the name to the declaration of the imported module. Otherwise, the current module *directly imports * the imported module.
219
226
@@ -282,7 +289,7 @@ With the exception of class domain types and character types (which cannot be re
282
289
283
290
type ::= (moduleExpr "::")? classname | dbasetype | "boolean" | "date" | "float" | "int" | "string"
284
291
285
- moduleExpr ::= simpleId | moduleExpr "::" simpleId
292
+ moduleExpr ::= simpleId arguments? | moduleExpr "::" simpleId arguments?
286
293
287
294
A type reference is resolved to a type as follows:
288
295
@@ -2064,16 +2071,23 @@ The complete grammar for QL is as follows:
2064
2071
2065
2072
ql ::= qldoc? moduleBody
2066
2073
2067
- module ::= annotation* "module" modulename "{" moduleBody "}"
2074
+ module ::= annotation* "module" modulename parameters? implements? "{" moduleBody "}"
2075
+
2076
+ parameters ::= "<" signatureExpr simpleId ("," signatureExpr simpleId)* ">"
2077
+
2078
+ implements ::= "implements" moduleSignatureExpr ("," moduleSignatureExpr)*
2068
2079
2069
2080
moduleBody ::= (import | predicate | class | module | alias | select)*
2070
2081
2071
2082
import ::= annotations "import" importModuleExpr ("as" modulename)?
2072
2083
2073
2084
qualId ::= simpleId | qualId "." simpleId
2074
2085
2075
- importModuleExpr ::= qualId
2076
- | importModuleExpr "::" simpleId
2086
+ importModuleExpr ::= qualId | importModuleExpr "::" simpleId arguments?
2087
+
2088
+ arguments ::= "<" argument ("," argument)* ">"
2089
+
2090
+ argument ::= moduleExpr | type | predicateRef "/" int
2077
2091
2078
2092
select ::= ("from" var_decls)? ("where" formula)? "select" as_exprs ("order" "by" orderbys)?
2079
2093
@@ -2120,7 +2134,11 @@ The complete grammar for QL is as follows:
2120
2134
2121
2135
field ::= qldoc? annotations var_decl ";"
2122
2136
2123
- moduleExpr ::= simpleId | moduleExpr "::" simpleId
2137
+ moduleExpr ::= simpleId arguments? | moduleExpr "::" simpleId arguments?
2138
+
2139
+ moduleSignatureExpr ::= (moduleExpr "::")? upperId arguments?
2140
+
2141
+ signatureExpr : (moduleExpr "::")? simpleId ("/" Integer | arguments)?;
2124
2142
2125
2143
type ::= (moduleExpr "::")? classname | dbasetype | "boolean" | "date" | "float" | "int" | "string"
2126
2144
0 commit comments