refactored yacc parsing code to be threadsafe, removed mutex