Undeclared value type for nonterminals when using multiple value types

View: New views
3 Messages — Rating Filter:   Alert me  

Undeclared value type for nonterminals when using multiple value types

by Rodrigo Dominguez-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

What is the default data type for nonterminals when using multiple data types (%union)? In other words, can I have nonterminals with undefined data types (no %type<..>) when using %union? I have seen some grammars use this, however, I don't see anything on the manual referring to this scenario.

I am using Bison 2.3.

Thank you,

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

Re: Undeclared value type for nonterminals when using multiple value types

by John R. Levine :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>What is the default data type for nonterminals when using multiple data types
> (%union)? In other words can I have nonterminals with undefined data
>types (no %type<..>) when using %union?

There's no default.  So long as you don't attempt to use the values,
you'll be OK.  If you do try to use one, it'll complain.

R's,
John


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

Parent Message unknown Re: Undeclared value type for nonterminals when using multiple value types

by Laurence Finston-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I always just pick one (`int', but it doesn't really matter).  You don't have to set `$$' to a value in a rule.

Laurence Finston


-------- Original-Nachricht --------
> Datum: Mon, 12 Oct 2009 15:05:15 -0400
> Von: Rodrigo Dominguez <roddomi@...>
> An: help-bison@...
> Betreff: Undeclared value type for nonterminals when using multiple value types

>
> Hi,
>
> What is the default data type for nonterminals when using multiple data
> types (%union)? In other words, can I have nonterminals with undefined data
> types (no %type<..>) when using %union? I have seen some grammars use this,
> however, I don't see anything on the manual referring to this scenario.
>
> I am using Bison 2.3.
>
> Thank you,
>
> Rodrigo
>      _______________________________________________
> help-bison@... http://lists.gnu.org/mailman/listinfo/help-bison

--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser


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