help-bison
[Top][All Lists]
Advanced

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

Re: yacc parser


From: Hans Aberg
Subject: Re: yacc parser
Date: Fri, 9 Apr 2004 21:47:48 +0200

At 12:27 -0700 2004/04/09, gavaneh wrote:
>I am working to design an interpreter with
>yacc.

This is the Help-Bison list, and not a Yacc list, even though Bison is
supposed to be Yacc compatible.

>Unfortunately I've faced to a problem with the
>action
>of the following rule.
>
>"repeat  :REPEAT stmt_seq UNTIL exp"
>
>How can I say to repeat stmt_seq if exp is true.
>
>Anyone has any idea?

This suggests that you want the parser to interpretatively step around in
the input text. Not Bison nor Yacc is capable doing that, but reads the
file just once. Thus, you need to build some code that can be executed
after the parse. This results in a faster code, so this is what everybody
is doing. For details, look into books on compiler construction; see for
example the newsgroup comp.compilers, and its FAQ, published there monthly.

  Hans Aberg






reply via email to

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