help-bison
[Top][All Lists]
Advanced

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

changing lex rules from yacc


From: bvermaut . cs
Subject: changing lex rules from yacc
Date: Thu, 19 Apr 2001 08:27:53 +0200

        Hi everyone,


        Is it possible to change the lex rules (via the starts) through
yacc.

        I explain:

        Let say, I have:

        toto.lex
        -------

        a {BEGIN AA;return A}}
        b {return B;}
        <AA>[^ab$]* {BEGIN 0; return T;}
        [^abd]* {return T;}

        toto.yacc
        ---------
        %token A B T
        %start message
        %%
        message : expr;
        expr    :       ABT | BT;



        Isn't it possible to change it to something like:
> toto.lex
> -------
> 
> a {return A}}
> b {return B;}
> <AA>[^ab$]* {return T;}
> [^abd]* {return T;}
> 
> toto.yacc
> ---------
> %token A B T
> %start message
> %%
> message : expr;
> expr  :       A{BEGIN AA;}BT{BEGIN 0;} | BT;
> 
> 
????

Thanks

Bertrand



Visit us at http://www.clearstream.com           
Check out current job vacancies at 
http://www.clearstream.com/public/english/e_vacs.htm
                                                          
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream International 
does not
accept legal responsibility for the contents of this message.

The information contained in this e-mail is confidential and may be legally 
privileged. It is
intended solely for the addressee. If you are not the intended recipient, any 
disclosure,
copying, distribution or any action taken or omitted to be taken in reliance on 
it, is
prohibited and may be unlawful. Any views expressed in this e-mail are those of 
the
individual sender, except where the sender specifically states them to be the 
views of
Clearstream International or of any of its affiliates or subsidiaries.

END OF DISCLAIMER



reply via email to

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