Re: Very simple program with error

2008-04-05 Thread Hans Aberg
On 5 Apr 2008, at 17:20, Rodrigo Bagni wrote: When I print the "atom" variable at the end of the parser, its content is "Example; end" but I want it to be only "Example" because it is the last identifier I got. Is it something wrong with my rule? Can someone help, please? The Flex generated

Very simple program with error

2008-04-05 Thread Rodrigo Bagni
Hi, I'm trying to write a parser to a simplified version of Pascal. In my parser.y file there is only one rule: %{ /* declarations */ #include #include #include #include "teste.h" %} /* my tokens */ %token DOT %token END %token END_OF_FILE %token IDENTIFIER %token PROGRAM %token SEMICOLON