Hi guys, given that I needed to declare a fun befo...
# announcements
e
Hi guys, given that I needed to declare a fun before referencing it I wondered is the Kotlin grammar LL(k) conformant? Perhaps even LL(1)? in terms of syntax analysis, and is there a grammar reference in some notation available seeing that their isn't a KLS ๐Ÿ™‚ ?
k
Don't know what class it belongs to, I image they went with a handwritten recursive descent parser like many languages.
e
ahhha.. thanks ๐Ÿ™‚ Haven't read BNF since the Algol-60 spec... ๐Ÿ™‚ ๐Ÿ™‚
If it's LL(k) I'd guess a recursive descent parser...
Though you absolutely don't need to define a function before you use it, in fact it's often cleaner to use it before you declare it
Also the grammar wouldn't matter for that, stuff like "is this function defined" doesn't fit in a context-free grammer, that's handled in the semantic analysis later.
e
of course you are correct here.. My bad.. it has been some years since my degree ๐Ÿ™‚
k
I just got all this stuff from Wikipedia ๐Ÿ˜›
e
I might have to delve into the source code ๐Ÿ‘