On 31 May 2009, at 05:21, Luis Vital wrote:

I have used Bison sometimes.
Usually, after compiling Bison and Flex files the input come from a file
that we redirect to the executable and the output goes to the screen.
If I want to give the input file as an argument in the command line I can
use 'yyin'.

The Bison generated parser just reads the stream handed down to it from the lexer. The Flex generated lexer can set where it reads, using yyrestart() - see the Flex manual.

And what about the output? How can I send it to a file without having to
redirect it?

And the Bison generated parser just does what is written in the actions of grammar file. So just change this to write to a file or a stream that is defined externally to the parser code.

  Hans




_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to