|
From: | Hans Aberg |
Subject: | Re: Newbie Dynamic Data Typing Help |
Date: | Mon, 10 Oct 2005 23:31:57 +0200 |
On 10 Oct 2005, at 20:21, Gill,Michael J wrote:
Hans, Thanks for the response. So, I can indicate an error in the actions with YYERROR if the data type of the VAR from the dtype field of the symrec union is wrong. How do you indicate to Bison that this is an error? Do I need to set YYERROR to something (i.e. True)?
Look in the output file. It is just a macro jumping to the error recovery place. There is alos YYABORT, which terminates the parser instead. Look in the Bison manual for details.
Also, Idon't think I really understand the Bison type system is it possible tohave a dynamically typed VAR specified in the grammar only without checking its type in the actions?
No, only statically typed in Bison static type system. Static = compile-time, dynamic = run-time. The grammar actions are executed at parser run-time. If VAR is dynamically typed, it must be checked at run-time.
Hans Aberg
[Prev in Thread] | Current Thread | [Next in Thread] |