bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: returning a symbol


From: Akim Demaille
Subject: Re: returning a symbol
Date: Wed, 12 Jul 2006 17:48:49 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

>>> "Joel" == Joel E Denny <address@hidden> writes:

 >> >> I've not sort out the details yet, that way ahead, but I'm thinking
 >> >> about something like
 >> >> 
 >> >> return yy_symbol (token-type, token-value, token-location);
 >> 
 >> > What is token-type?
 >> 
 >> The int value returned by yylex, the kind of token that was returned
 >> (BRACED_CODE, INT, etc.).

 > In order to strongly type the token-value parameter in languages like C, 
 > maybe we should create a family of functions something like:

 >   return yy_symbol_BRACED_CODE (token-value, token-location);
 >   return yy_symbol_INT (token-value, token-location);

That's another possibility, agreed.

 > Then again, maybe I'm misunderstanding.  Are you thinking yy_symbol
 > is a function that returns a struct/class containing the three
 > parameters (type, value, and location)?  That's what I was
 > thinking.

I was thinking about a (shame on me) macro to do that.  I don't know
how to do that with functions.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]