modified parser scanner and entities to generate a proper syntax tree