I missed out on any kind of compiler theory course during my time in academia. Add that to the list of topics I would like to study and comprehend someday (along with 3D graphics and artificial intelligence).
The MultiEx Commander program uses a simple, custom scripting language to interpret game resource archive formats (a.k.a. GRAFs). Why do I care? Because these GRAF files often carry lots of FMV files that I want to separate and study invidually. This is a script that takes apart the BIFF (.bif) GRAF files from Baldur’s Gate:
IDString 0 BIFFV1 ; Get DUMMYL Int 0 ; SavePos FILESTART 0 ; Get FILECNTL Long 0 ; Math FILESTART += 16 ; Do ; GoTo FILESTART 0 ; Get FILEOFF Long 0 ; Get FILESIZE Long 0 ; Math FILESTART += 16 ; Log FILENAME FILEOFF FILESIZE 0 0 ; Math EXTRCNT += 1 ; While EXTRCNT <> FILECNTL ;
That script was taken from the XentaxWiki entry for BIF. Plenty more sample scripts are available on that Wiki.
Who can tell me the best approach to writing a program that can interpret scripts like the one shown above? Something tells me that full-fledged compiler theory is overkill for this type of application. It looks like the language was designed to be parsed in a fairly braindead virtual machine. But that’s just my best, uneducated guess.
Update: I am working on a BMS language spec in the XentaxWiki.

