help-bison
[Top][All Lists]
Advanced

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

Re: Multiple Parsers in the Same Program


From: Patrick Bellasi
Subject: Re: Multiple Parsers in the Same Program
Date: Sat, 4 Sep 2004 14:05:27 +0000
User-agent: KMail/1.6.2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi guys!!!

        I've solved... but I can't explain to myself the reason for the 
solution I've 
found...

> Anyone can suggest to me a skeleton for that pourpose, I need TWO different
> parser functions that invoke THE SAME scanner. For instance:
> first_parse() and second_parse() that use yylex()
this is correct

> Is it correct to wrap yylex() inside each parser definition with the
> corresponding scanner functions? 
this instead doesn't work!!!


> That is: 
>
> first_lex() {
>       return yylex();
> }
>
> and
>
> second_lex() {
>       return yylex();
> }

Precisely I've to RENAME yylex() also! Using the directive:
#define YY_DECL int mylex()
in the scanner source I renamed yylex() as mylex() and use that function in 
the above code... by this way everything work fine!

BUT... where is the difference?!?... I'm unable to understand...
any idea?!?


> Thanks in advance,
>       Patrick
Again thanks to *!
Patrick
- -- 



<---------------------------------------------------------------------------------------------------------->
                                                  DERKLING
                                    LRU 338214 (http://counter.li.org)

  make linux | more > user-firendly 


<---------------------------------------------------------------------------------------------------------->
   Patrick Bellasi <derkling_at_users.sourceforge.net>
   Student (Politecnico di Milano)
       Comp.Sci & Soft.Eng
   
   Contacts:
    - Room +39 02 23952621
    - Home +39 0342 621043 (week-ends)
    - ICQ   344672588
    - MSN   address@hidden
   
   Privacy:
    - PGP   0x72ABC1EE (www.keyserver.net)
      pub  1024D/72ABC1EE 2003-12-04 Patrick Bellasi (PGP key for poste.it) 
<address@hidden>
      Primary key fingerprint: 3958 7B5F 36EC D1F8 C752  9589 C3B7 FD49 72AB 
C1EE
<---------------------------------------------------------------------------------------------------------->
   
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBOcu7eGk3pQ7APA8RAqpSAJ9Crrk/kNTCXZ81RhaLpm8wfwG34wCeLuRQ
AhxTZbtB9+oX9euNUUlts5M=
=Cnqu
-----END PGP SIGNATURE-----




reply via email to

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