On 14 Jan 2012, at 11:28, Luca wrote:

>>> The bison manual has some good basic examples if i recall.
>> ...
>>> Read on here
>>> http://www.gnu.org/software/bison/manual/html_node/Infix-Calc.html#Infix-Calc
>> The C++ example is good, too. It shows how to generate error messages.
>> http://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html
>> 
> Also read on here:
> http://epaperpress.com/lexandyacc/download/LexAndYaccTutorial.pdf
> it is about yacc, but the tutorial is very good and also valid using Bison.

This calculator example is good, because it shows how to do control flow 
('while' and 'if then else'), lacking in the Bison manual examples, but from 
time to time asked here. Also, it computes the AST (abstract syntax tree) 
rather than the parse tree, which is what one normally would be interested in 
in applications.

Hans



_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to