help-bison
[Top][All Lists]
Advanced

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

Re: Passing custom parameter to yylex() via yyparse() using YYPARSE_PARA


From: Jeannot_Langlois
Subject: Re: Passing custom parameter to yylex() via yyparse() using YYPARSE_PARAM and YYLEX_PARAM macros [--SOLVED--]
Date: Mon, 30 Aug 2004 10:19:29 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02

Jeannot_Langlois wrote:

Hi there,


I am actually working at integrating a custom (i.e. NOT flex-based) lexical scanner written in C with a Bison 1.875c-generated C pure (reentrant) parser.

As the custom lexical scanner will be reading from a socket rather than the standard input (i.e., keyboard or pipe redirection), I need to pass the socket number (int) to yyparse() so it can be then passed to yylex() afterwards.

I found out that earlier versions of Bison permitted the use of the YYPARSE_PARAM and YYLEX_PARAM macros which allowed the yyparse() caller to pass a structure to yyparse() and then to yylex(). Unfortunately, these macros now seem disabled in Bison 1.875c.

How can I pass such a parameter to yyparse() and then to yylex() in a similar way in Bison 1.875c now ?

Regards,


Hi there,

Never mind my last message - I found out about the "%parse-param { ... }" and "%lex-param { ... }" instructions which actually do the same (and even better/easier) in the latest versions of Bison.


Thanks still,


--
Jeannot Langlois
B. Sc.  Computer Science / B. Sc.  Informatique
jeannot12 AT linuxmail DOT org


------------------------------------------------------------------------------------------------

Looking for a Software Developer in Ottawa, Gatineau, Hull, Sherbrooke or Quebec city (Canada)?
Look no further.
You've just found what you were looking for.

LINUX... SOFTWARE... PROJECTS...

15 rock-solid years in Computer Science.
Always ready for challenges.
Perseverant.
Team spirit.
Autonomous.

One name:  Jeannot Langlois.


------------------------------------------------------------------------------------------------

Vous cherchez un Programmeur-Analyste pour Ottawa, Gatineau, Hull, Sherbrooke ou la ville de Quebec (Canada)?
Ne cherchez plus.
Vous venez de trouver.

LINUX... LOGICIELS... PROJETS...

15 annees solides en Informatique.
Toujours pret pour les defis.
Perseverant.
Esprit d'equipe.
Autonome.

Un seul nom:  Jeannot Langlois.

------------------------------------------------------------------------------------------------

LINUX_LOGO





reply via email to

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