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

How to interperet error messages



I would like some help in interpereting the error output.  Specifically, what tips can you give on locating the statments in the input grammar that are causing the reduce/reduce conflict?  

Thanks!

Roger


java.lang.RuntimeException: 

reduce/reduce conflict in state [stack: PName TLPar *] on TComma in {
	[ PActualParamList = * ] followed by TComma (reduce),
	[ PRelational = * ] followed by TComma (reduce)
}

reduce/reduce conflict in state [stack: PName TLPar *] on TRPar in {
	[ PActualParamList = * ] followed by TRPar (reduce),
	[ PRelational = * ] followed by TRPar (reduce)
}
	at org.sablecc.sablecc.GenParser.caseStart(Unknown Source)
	at org.sablecc.sablecc.node.Start.apply(Unknown Source)
	at org.sablecc.sablecc.SableCC.processGrammar(Unknown Source)
	at org.sablecc.sablecc.SableCC.processGrammar(Unknown Source)
	at org.sablecc.sablecc.SableCC.main(Unknown Source)

..............Productions 

    statements
         {-> P.statements  } =

     {single} statement statements 
         {-> New statements.single (statement , statements  )  }   |

     {empty} 
         {-> New statements.empty ( )  }  
     ;

    statement
         {-> P.statement  } =

     {assignment} field_access assignment expression new_line 
         {-> New statement.assignment (field_access , assignment , expression , new_line  )  }   |

     {functioncall} function_application new_line 
         {-> New statement.functioncall (function_application , new_line  )  }  
     ;

    function_application
         {-> P.function_application  } =

     name l_par actual_param_list r_par 
         {-> New function_application (name , l_par , actual_param_list , r_par  )  }  
     ;

    actual_param_list
         {-> P.actual_param_list  } =

     {list} actual_param_list comma expression 
         {-> New actual_param_list.list (actual_param_list , comma , expression  )  }   |

     {exp} expression 
         {-> New actual_param_list.exp (expression  )  }   |

     {empty} 
         {-> New actual_param_list.empty ( )  }  
     ;

    expression
         {-> P.expression  } =

     {boolexp} bool_expression 
         {-> New expression.boolexp (bool_expression  )  }  
     ;

    math_expression
         {-> P.math_expression  } =

     {term} term 
         {-> New math_expression.term (term  )  }   |

     {plus} math_expression plus term 
         {-> New math_expression.plus (math_expression , plus , term  )  }   |

     {minus} math_expression minus term 
         {-> New math_expression.minus (math_expression , minus , term  )  }  
     ;

    term
         {-> P.term  } =

     {unary} unary_exp 
         {-> New term.unary (unary_exp  )  }   |

     {mult} term times unary_exp 
         {-> New term.mult (term , times , unary_exp  )  }   |

     {div} term divide unary_exp 
         {-> New term.div (term , divide , unary_exp  )  }   |

     {mod} term mod unary_exp 
         {-> New term.mod (term , mod , unary_exp  )  }   |

     {power} term power unary_exp 
         {-> New term.power (term , power , unary_exp  )  }  
     ;

    unary_exp
         {-> P.unary_exp  } =

     {minus} minus unary_exp 
         {-> New unary_exp.minus (minus , unary_exp  )  }   |

     {plus} plus unary_exp 
         {-> New unary_exp.plus (plus , unary_exp  )  }   |

     {negate} not unary_exp 
         {-> New unary_exp.negate (not , unary_exp  )  }   |

     {postfix_exp} postfix_exp 
         {-> New unary_exp.postfix_exp (postfix_exp  )  }  
     ;

    postfix_exp
         {-> P.postfix_exp  } =

     {factor} factor 
         {-> New postfix_exp.factor (factor  )  }   |

     {postincr} postincr 
         {-> New postfix_exp.postincr (postincr  )  }   |

     {postdecr} postdecr 
         {-> New postfix_exp.postdecr (postdecr  )  }  
     ;

    postdecr
         {-> P.postdecr  } =

     postfix_exp minusminus 
         {-> New postdecr (postfix_exp , minusminus  )  }  
     ;

    postincr
         {-> P.postincr  } =

     postfix_exp plusplus 
         {-> New postincr (postfix_exp , plusplus  )  }  
     ;

    factor
         {-> P.factor  } =

     {fieldaccess} field_access 
         {-> New factor.fieldaccess (field_access  )  }   |

     {function} function_application 
         {-> New factor.function (function_application  )  }   |

     {number} number 
         {-> New factor.number (number  )  }   |

     {stringliteral} stringliteral 
         {-> New factor.stringliteral (stringliteral  )  }   |

     {charliteral} charliteral 
         {-> New factor.charliteral (charliteral  )  }   |

     {boolliteral} booleanliteral 
         {-> New factor.boolliteral (booleanliteral  )  }   |

     {expression} l_par bool_expression r_par 
         {-> New factor.expression (l_par , bool_expression , r_par  )  }  
     ;

    number
         {-> P.number  } =

     {float1} dot int_num 
         {-> New number.float1 (dot , int_num  )  }   |

     {float2} [f1]: int_num dot [f2]: int_num 
         {-> New number.float2 (f1 , dot , f2  )  }   |

     {float3} int_num dot 
         {-> New number.float3 (int_num , dot  )  }   |

     {float4} int_num 
         {-> New number.float4 (int_num  )  }  
     ;

    booleanliteral
         {-> P.booleanliteral  } =

     {true} true 
         {-> New booleanliteral.true (true  )  }   |

     {false} false 
         {-> New booleanliteral.false (false  )  }  
     ;

    bool_expression
         {-> P.bool_expression  } =

     {term} bool_term 
         {-> New bool_expression.term (bool_term  )  }   |

     {or} bool_expression or bool_term 
         {-> New bool_expression.or (bool_expression , or , bool_term  )  }  
     ;

    bool_term
         {-> P.bool_term  } =

     {equality} equality 
         {-> New bool_term.equality (equality  )  }   |

     {and} bool_term and equality 
         {-> New bool_term.and (bool_term , and , equality  )  }  
     ;

    equality
         {-> P.equality  } =

     {relational} relational 
         {-> New equality.relational (relational  )  }   |

     {eq} equality equals relational 
         {-> New equality.eq (equality , equals , relational  )  }   |

     {neq} equality not_equal relational 
         {-> New equality.neq (equality , not_equal , relational  )  }  
     ;

    relational
         {-> P.relational  } =

     
         {-> New relational ( )  }   |

     {math} math_expression 
         {-> New relational.math (math_expression  )  }   |

     {lt} relational less_than math_expression 
         {-> New relational.lt (relational , less_than , math_expression  )  }   |

     {gt} relational greater_than math_expression 
         {-> New relational.gt (relational , greater_than , math_expression  )  }   |

     {lteq} relational less_than_or_equal math_expression 
         {-> New relational.lteq (relational , less_than_or_equal , math_expression  )  }   |

     {gteq} relational greater_than_or_equal math_expression 
         {-> New relational.gteq (relational , greater_than_or_equal , math_expression  )  }  
     ;

    field_access
         {-> P.field_access  } =

     {array} name P.$array_access 
         {-> New field_access.array (name , [ $array_access.array_access  ] )  }   |

     {scalar} name 
         {-> New field_access.scalar (name  )  }  
     ;

    name
         {-> P.name  } =

     {simple_name} simple_name 
         {-> New name.simple_name (simple_name  )  }   |

     {qualified_name} qualified_name 
         {-> New name.qualified_name (qualified_name  )  }  
     ;

    simple_name
         {-> P.simple_name  } =

     {variable} identifier 
         {-> New simple_name.variable (identifier  )  }   |

     {object} hidden_name 
         {-> New simple_name.object (hidden_name  )  }  
     ;

    qualified_name
         {-> P.qualified_name  } =

     field_access dot identifier 
         {-> New qualified_name (field_access , dot , identifier  )  }  
     ;

    array_access
         {-> P.array_access  } =

     l_bracket math_expression r_bracket 
         {-> New array_access (l_bracket , math_expression , r_bracket  )  }  
     ;

    $array_access
         {-> P.array_access*  } =

     {terminal} P.array_access 
         {-> [ array_access.array_access  ]  }   |

     {non_terminal} P.$array_access P.array_access 
         {-> [ $array_access.array_access array_access.array_access  ]  }  
     ;

Abstract Syntax Tree
    statements =
     {single} statement statements | 
     {empty} 
     ;

    statement =
     {assignment} field_access assignment expression new_line | 
     {functioncall} function_application new_line 
     ;

    function_application =
     name l_par actual_param_list r_par 
     ;

    actual_param_list =
     {list} actual_param_list comma expression | 
     {exp} expression | 
     {empty} 
     ;

    expression =
     {boolexp} bool_expression 
     ;

    math_expression =
     {term} term | 
     {plus} math_expression plus term | 
     {minus} math_expression minus term 
     ;

    term =
     {unary} unary_exp | 
     {mult} term times unary_exp | 
     {div} term divide unary_exp | 
     {mod} term mod unary_exp | 
     {power} term power unary_exp 
     ;

    unary_exp =
     {minus} minus unary_exp | 
     {plus} plus unary_exp | 
     {negate} not unary_exp | 
     {postfix_exp} postfix_exp 
     ;

    postfix_exp =
     {factor} factor | 
     {postincr} postincr | 
     {postdecr} postdecr 
     ;

    postdecr =
     postfix_exp minusminus 
     ;

    postincr =
     postfix_exp plusplus 
     ;

    factor =
     {fieldaccess} field_access | 
     {function} function_application | 
     {number} number | 
     {stringliteral} stringliteral | 
     {charliteral} charliteral | 
     {boolliteral} booleanliteral | 
     {expression} l_par bool_expression r_par 
     ;

    number =
     {float1} dot int_num | 
     {float2} [f1]: int_num dot [f2]: int_num | 
     {float3} int_num dot | 
     {float4} int_num 
     ;

    booleanliteral =
     {true} true | 
     {false} false 
     ;

    bool_expression =
     {term} bool_term | 
     {or} bool_expression or bool_term 
     ;

    bool_term =
     {equality} equality | 
     {and} bool_term and equality 
     ;

    equality =
     {relational} relational | 
     {eq} equality equals relational | 
     {neq} equality not_equal relational 
     ;

    relational =
     | 
     {math} math_expression | 
     {lt} relational less_than math_expression | 
     {gt} relational greater_than math_expression | 
     {lteq} relational less_than_or_equal math_expression | 
     {gteq} relational greater_than_or_equal math_expression 
     ;

    field_access =
     {array} name array_access* | 
     {scalar} name 
     ;

    name =
     {simple_name} simple_name | 
     {qualified_name} qualified_name 
     ;

    simple_name =
     {variable} identifier | 
     {object} hidden_name 
     ;

    qualified_name =
     field_access dot identifier 
     ;

    array_access =
     l_bracket math_expression r_bracket 
     ;



reduce/reduce conflict in state [stack: PName TLPar *] on TComma in {
	[ PActualParamList = * ] followed by TComma (reduce),
	[ PRelational = * ] followed by TComma (reduce)
}

reduce/reduce conflict in state [stack: PName TLPar *] on TRPar in {
	[ PActualParamList = * ] followed by TRPar (reduce),
	[ PRelational = * ] followed by TRPar (reduce)
}

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm