From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- web/yacco2/qa/lr1_sp5.lex | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 web/yacco2/qa/lr1_sp5.lex (limited to 'web/yacco2/qa/lr1_sp5.lex') diff --git a/web/yacco2/qa/lr1_sp5.lex b/web/yacco2/qa/lr1_sp5.lex new file mode 100644 index 0000000000..c0f870d554 --- /dev/null +++ b/web/yacco2/qa/lr1_sp5.lex @@ -0,0 +1,53 @@ +/* +$echo FILE:{ LR1_sp5.lex +$echo A LR1 GRAMMAR FROM +$echo FULL LR(1) PARSER GENERATION +$echo BY DAVID SPECTOR +$echo P. 62 GRAMMAR G2 +$echo SIGPLAN VOL 16 NO 8 AUG 1981 +$echo Okay +*/ +/@ +@** |lr1_sp5| grammar.\fbreak + A LR1 GRAMMAR FROM + DAVID SPECTOR + SIGPLAN VOL 23 NO 12 DEC/88 +@/ +fsm (fsm-id "lr1_sp5.lex",fsm-filename LR1_sp5,fsm-namespace NS_LR1_sp5 + ,fsm-class Clr1_sp5_fsm + ,fsm-version "1.0",fsm-date "8-oct-96" + ,fsm-debug "true",fsm-comments "test out lr1") +@"/usr/local/yacco2/compiler/grammars/yacco2_T_includes.T" +rules +{ + Rlr1_sp5(){ + -> RS eog + } + + RS(){ + -> a b RA RE + -> a b RB x + -> a RD + -> RA z + -> RB x + } + + RA(){ + -> d + } + + RB(){ + -> d + } + + RD(){ + -> f RA + -> f RB x + -> f a RD + } + + RE(){ + -> + -> z + } +} // end of grammar -- cgit v1.2.3