Skip to content

Commit 3e7389e

Browse files
committed
move section on signatures in the QL specification
1 parent 6f012d5 commit 3e7389e

File tree

1 file changed

+32
-35
lines changed

1 file changed

+32
-35
lines changed

docs/codeql/ql-language-reference/ql-language-specification.rst

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -334,40 +334,6 @@ Active types
334334

335335
In a QL program, the *active* types are those defined in active modules. In the remainder of this specification, any reference to the types in the program refers only to the active types.
336336

337-
338-
Signatures
339-
----------
340-
341-
Signature definitions
342-
~~~~~~~~~~~~~~~~~~~~~
343-
344-
A QL signature definition has the following syntax:
345-
346-
::
347-
348-
signature ::= predicateSignature | typeSignature | moduleSignature
349-
350-
predicateSignature ::= qldoc? annotations "signature" head ";"
351-
352-
typeSignature ::= qldoc? annotations "signature" "class" classname ("extends" type ("," type)*)? (";" | "{" signaturePredicate* "}")
353-
354-
moduleSignature ::= qldoc? annotation* "signature" "module" moduleSignatureName parameters? "{" moduleSignatureBody "}"
355-
356-
moduleSignatureBody ::= (signaturePredicate | defaultPredicate | signatureType)*
357-
358-
signaturePredicate ::= qldoc? annotations head ";"
359-
360-
defaultPredicate ::= qldoc? annotations "default" head "{" formula "}"
361-
362-
signatureType ::= qldoc? annotations "class" classname ("extends" type ("," type)*)? "{" signaturePredicate* "}"
363-
364-
365-
A predicate signature definition extends the current module's declared predicate signature environment with a mapping from the predicate signature name and arity to the predicate signature definition.
366-
367-
A type signature definition extends the current module's declared type signature environment with a mapping from the type signature name to the type signature definition.
368-
369-
A module signature definition extends the current module's declared module signature environment with a mapping from the module signature name to the module signature definition.
370-
371337
Values
372338
------
373339

@@ -850,7 +816,7 @@ If the query file starts with whitespace followed by a QLDoc comment, then the t
850816
Top-level entities
851817
------------------
852818

853-
Modules include five kinds of top-level entity: predicates, classes, modules, aliases, and select clauses.
819+
Modules include five kinds of top-level entity: predicates, classes, modules, aliases, signatures, and select clauses.
854820

855821
Non-member predicates
856822
~~~~~~~~~~~~~~~~~~~~~
@@ -1004,6 +970,37 @@ A valid field must override another field if it is annotated ``override``.
1004970

1005971
When field ``f`` overrides field ``g`` the type of ``f`` must be a subtype of the type of ``g``. ``f`` may not be a final field.
1006972

973+
974+
Signatures
975+
~~~~~~~~~~
976+
977+
A signature definition has the following syntax:
978+
979+
::
980+
981+
signature ::= predicateSignature | typeSignature | moduleSignature
982+
983+
predicateSignature ::= qldoc? annotations "signature" head ";"
984+
985+
typeSignature ::= qldoc? annotations "signature" "class" classname ("extends" type ("," type)*)? (";" | "{" signaturePredicate* "}")
986+
987+
moduleSignature ::= qldoc? annotation* "signature" "module" moduleSignatureName parameters? "{" moduleSignatureBody "}"
988+
989+
moduleSignatureBody ::= (signaturePredicate | defaultPredicate | signatureType)*
990+
991+
signaturePredicate ::= qldoc? annotations head ";"
992+
993+
defaultPredicate ::= qldoc? annotations "default" head "{" formula "}"
994+
995+
signatureType ::= qldoc? annotations "class" classname ("extends" type ("," type)*)? "{" signaturePredicate* "}"
996+
997+
998+
A predicate signature definition extends the current module's declared predicate signature environment with a mapping from the predicate signature name and arity to the predicate signature definition.
999+
1000+
A type signature definition extends the current module's declared type signature environment with a mapping from the type signature name to the type signature definition.
1001+
1002+
A module signature definition extends the current module's declared module signature environment with a mapping from the module signature name to the module signature definition.
1003+
10071004
Select clauses
10081005
~~~~~~~~~~~~~~
10091006

0 commit comments

Comments
 (0)