Let me simplify the grammar for class-declaration by removing unrelated or optional fields:
class-declaration → class class-name
class-name → identifier
class-body → { class-members opt }
class-members → class-member class-members opt
class-member → declaration | compiler-control-statement
declaration → import-declaration
declaration → constant-declaration
declaration → variable-declaration
declaration → typealias-declaration
declaration → function-declaration
declaration → enum-declaration
declaration → struct-declaration
declaration → class-declaration
declaration → protocol-declaration
... and so on
If we'd take it literally (as far as I understand it) it'd mean that even import-declaration or protocol-declaration is valid in the scope of class-declaration, which is not the case obviously.
I know that "The grammar described here is intended to help you understand the language in more detail, rather than to allow you to directly implement a parser or compiler", but my question is where should I look for a 100% reliable reference?