help-bison
[Top][All Lists]
Advanced

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

Re: Can anyone help me ?


From: Hans Aberg
Subject: Re: Can anyone help me ?
Date: Wed, 2 Jun 2004 18:46:20 +0200

At 15:39 +0530 2004/05/27, Mondal, Debashis E (GE Energy) wrote:
>Thursday, May 27, 2004
>
>Let us consider the bison/yacc file is like this :
>
>for_all : FORALL L_BRACKET TABLE PUNCT sql_cond R_BRACKET
>               {
>               section 1 : code for execution
>               }
>               L_BRACE  actn_list R_BRACE
>               {
>               section 2 : some other code to execute.
>               }
>               ;
>
>Now suppose "FORALL L_BRACKET TABLE PUNCT sql_cond R_BRACKET"
>condition has been satisfied and section 1 got executed. Suppose
>it produces 10 results. In the section 2 I will compare these
>results with some condition. Now the bison file satisfied
>"L_BRACE  actn_list R_BRACE" and executed section 2.If the
>condition doesn't match with previous results ( suppose 1st
>out of 10 ) then I will come back to "L_BRACE  actn_list R_BRACE"
>situation and will try to check 2nd condition and if doesn't match
>then 3rd and so on.
>
>What are the necessary steps I should do?

Ten results of what? Are you using a GLR parser? Otherwise, each parsing
only produces at most one successful parse. And there is no going back, as
the parser just constructs the parse tree. If you want to write loops, then
you need to write a "closure", that can be executed later, when the
syntactic loop segment has been left.

  Hans Aberg






reply via email to

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