simple scanner and parser