Game Programmer Portfolio
.foo Scripting Language
I wrote a scripting language as part of my fourth-term coursework. I adopted the ".foo" moniker (pronounced "dot-foo") after naming a file containing test code "program.foo." .foo is dynamically and weakly typed, supports function calls, and is syntactically similar to C or C++. This was an interesting assignment in that it was probably the furthest I have strayed from my usual interests (graphics programming, procedural content generation, and so on) in my time at the Guildhall at SMU. Not only was it the first time I had implemented a lexical analyzer, parser, code generator, and virtual machine, but it was also my first serious introduction to these concepts.
Download: Sample .foo code (2.44 KB, .txt format)
Sample .foo program code that performs recursive Fibonacci and factorial calculations. Always include some comments on the language's functionality.Download: Parsed token tree (3.72 KB, .txt format)
This is the tree of tokens that my parser generated from the above source code.Download: Compiled code (readable) (2.22 KB, .txt format)
This is the byte code (actually "long code" to be more accurate) generated by my compiler from the above token tree, outputted to a readable format.Download: Compiled code (functional) (980 bytes, .txt format)
This is the same code as above, but in the format actually used by the virtual machine.Download: .foo grammer (41.5 KB, .doc format)
This is the original grammar I wrote for my scripting language. I ultimately did not implement every feature of this grammar, but I did manage to include most of them.
Copyright © 2005-2007 J. Kyle Pittman and The Guildhall at SMU. All rights reserved.