Thread: yacc: type clashes and useless nontermins

  1. #1
    Registered User
    Join Date
    May 2006

    yacc: type clashes and useless nontermins


    Im trying to write a simple compiler and I'm stuck at the parsing/yacc phase. I keep getting many of these errors and warnings:
    • type clash on default action
    • empty rule for typed nonterminal
    • useless rule

    Anyone have any advice on how to tackle these? I attached my lex and yacc output files too incase that helps any.


  2. #2
    Registered User
    Join Date
    Apr 2008
    If you get those errors, the rules described by your grammar are ambiguous and incomplete. You should try a progressive approach, by adding one rule at a time, check it works, and resume. Lex/yacc does not support all grammar classes, this is a complex topic and you have to either use a simple grammar or know well what you're doing...

Popular pages Recent additions subscribe to a feed