python thrift lexer/parser using ply