parseString and parseFile functions