help-bison
[Top][All Lists]
Advanced

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

Re: Identifying rule responsible for lookahead


From: Soumitra Kumar
Subject: Re: Identifying rule responsible for lookahead
Date: Wed, 2 Mar 2005 14:12:35 -0800 (PST)

For the grammar:

%token YYID YYDOT
%%
identifier : hier_id
        ;
hier_id : simple_id
        | hier_id opt_select YYDOT simple_id
        ;
opt_select :
        | opt_select '[' expr ']'
        ;

simple_id : YYID ;
expr : hier_id
        | function_call
        ;
function_call : expr YYDOT YYID
        ;

Is it possible to get following output from bison?

state 10

    3 hier_id: hier_id . opt_select YYDOT simple_id
    4 opt_select: .  [YYDOT (3), '[' (5)]
                            ^^^      ^^^
    5           | . opt_select '[' expr ']'
    7 expr: hier_id .  [YYDOT (9), ']' (5)]
                              ^^^      ^^^
    YYDOT     reduce using rule 4 (opt_select)
    YYDOT     [reduce using rule 7 (expr)]

i.e. annotate the rule which is responsible for any
lookahead symbol.

-Soumitra.

--- Henrik Sorensen <address@hidden> wrote:

> On Wednesday 02 March 2005 19.50, Hans Aberg wrote:
> > Please keep the cc to help-bison so that others
> may help.
> could you restate your problem ?
> 



        
                
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/




reply via email to

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