parses str to ast datastructure