/* $echo FILE: knu1_sick.lex $echo Purpose: Pathological test not lr1 on the gening closure state network $echo variation on knu1.lex grammar $echo Error --- Grammar is not lr1. */ /* FILE: knu1_sick.lex dates: 27 oct 2008 Purpose: test out non lr1 grammar due to a coding mistake on knu1.lex where the closure network being gened never stops. The symptom is this: the gened state is trying to merge into its self and is not lr1. */ /@ @** |knu1_sick| Grammar.\fbreak Test out non lr1 grammar due to a coding mistake on |knu1.lex| grammar. When the closure state network is being gened, it never stops generating states.\fbreak The symptom is this:\fbreak The new gened state is trying to merge into one of its states but this merge makes it non lr1. The run away forever gening' symptom is due to the right recursion with the grammar --- rule `RS'.\fbreak \fbreak Solution: when above detected stop gening lr state network due to not lr1 condition. @/ fsm (fsm-id "knu1_sick.lex",fsm-filename knu1_sick,fsm-namespace NS_knu1_sick ,fsm-class Cknu1_sick ,fsm-version "1.0",fsm-date "23 oct 2008",fsm-debug "true" ,fsm-comments "knuth grammar (24) --- modified as not lr1 on rt recursion cycling") @"/usr/local/yacco2/compiler/grammars/yacco2_T_includes.T" rules{ Rstart(){ -> RS eog } RS (){ -> -> a RA b RS -> b RA a RS // RA should be RB but used to detect run away generation } RA (){ -> -> a RA b RA } RB (){ -> -> b RB a RB } }// end of rules