|
From: | Hans Aberg |
Subject: | Re: Bison Output |
Date: | Sun, 31 May 2009 10:04:00 +0200 |
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 filethat 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 canuse '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 toredirect 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
[Prev in Thread] | Current Thread | [Next in Thread] |