small parser from string or file