Smalltalk grammar
Return to home page
Comments Loading...
2009-01-14

Late last night I feverishly entered the Smalltalk BNF as a PEG in to my shiny new parser tech to try it out. The BNF does not include any whitespace, since it assumes whitespace between tokens. PEG requires that you specify the whitespace.

As a result, my parser works but does not expect any whitespace, which forced me to conjure up some peculiar looking, but completely valid, smalltalk methods. I found them mildly amusing, so I thought I'd share them with you:

he||0

smalltalk#klatllams

eulav[]value

smalltalk[||]klatllams

self^self