.fox file parser and generator in PHP