Are spaces allowed after the `@` start of declaration in Objective-C?

I look at Objective-C, and I notice, for example, that the declaration of a class class begins with @interface. Great, no problem. Therefore, the text assumes that between @and interfacespace is not allowed. However, when I pass the following simple example to the GCC compiler in a file *.m:

@ interface A
@ end

the compiler accepts the code without complaint. Can someone point Me in the direction of the link, which explicitly states whether or @ interfacealso is acceptable using the Objective-C specification? I did not find anything in the Apple 2008 and 2011 docs to say anyway other than the plain text mentioned earlier in the question.

Thanks in advance.

EDIT . It may be worth noting that Emacs colorizes the text based on whether the identifier is a keyword or not; keywords are blue, not keywords are yellow. Color is @interfaceblue and @ interfacecolor is yellow. Similar behavior is observed in Vim.

+5
source share
1 answer

There is no formal specification for Objective-C (beyond the Objective-C Programming Language ). There is definitely no BNF style for defining conventions. If it compiles, then the nearest we should "legally." This applies to many languages. For example, Perl is best defined as "those lines that the executable perlwill not reject." (At least in my opinion ....)

, @interface . . .

+3

All Articles