help-bison
[Top][All Lists]
Advanced

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

can't to remove shift/reduce


From: Pavel Stehule
Subject: can't to remove shift/reduce
Date: Thu, 22 Nov 2007 23:50:19 -0800 (PST)

Hello

I have gram file that works. But contains shift/reduce and I cannot to
correct it. What is worst, I don't see what is problem from bison log. 

columnref:      relation_name
                                {
                                }
                        | relation_name indirection
                                {
                                }
                ;

indirection_el:
                        '.' strict_column
                                {
                                }
                        | '.' column_method
                                {
                                }
                        | '.' '*'
                                {
                                }
                        | '[' a_expr ']'
                                {
                                }
                        | '[' a_expr ':' a_expr ']'
                                {
                                }
                ;

column_method:
                        column_method_name
                                {
                                }
                        | column_method_name '(' ')'
                                {
                                }
                        | column_method_name '(' expr_list ')'
                                {
                                }
                ;
                
strict_column:          col_name_keyword                                       
{ $$ = $1; }
                        | reserved_keyword                                      
       
{ $$ = pstrdup($1); }
                ;
                
column_method_name:     IDENT                                                  
{ $$ = $1; }
                        | unreserved_keyword                                    
       
{ $$ = pstrdup($1); }
                        | type_func_name_keyword                                
       
{ $$ = pstrdup($1); }
                ;
                
                
indirection:    
                        indirection_el                                          
       
{ $$ = list_make1($1); }
                        | indirection indirection_el                    { $$
= lappend($1, $2); }
                ;
                
opt_indirection:
                        /*EMPTY*/                                               
               
{ $$ = NIL; }
                        | opt_indirection indirection_el                { $$
= lappend($1, $2); }
                ;

State 1164 conflicts: 1 shift/reduce


Grammar

    0 $accept: stmtblock $end

state 1161

  1379 indirection_el: '.' '*' .

    $default  reduce using rule 1379 (indirection_el)


state 1162

  1378 indirection_el: '.' column_method .

    $default  reduce using rule 1378 (indirection_el)


state 1163

  1377 indirection_el: '.' strict_column .

    $default  reduce using rule 1377 (indirection_el)


state 1164

  1382 column_method: column_method_name .
  1383              | column_method_name . '(' ')'
  1384              | column_method_name . '(' expr_list ')'
    
    '('  shift, and go to state 1661

    '('       [reduce using rule 1382 (column_method)]
    $default  reduce using rule 1382 (column_method)
    
Any help welcome
Pavel Stehule 
-- 
View this message in context: 
http://www.nabble.com/can%27t-to-remove-shift-reduce-tf4858888.html#a13904549
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.





reply via email to

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