diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /web/yacco2/grammar-testsuite/pager_1.w |
Initial commit
Diffstat (limited to 'web/yacco2/grammar-testsuite/pager_1.w')
-rw-r--r-- | web/yacco2/grammar-testsuite/pager_1.w | 687 |
1 files changed, 687 insertions, 0 deletions
diff --git a/web/yacco2/grammar-testsuite/pager_1.w b/web/yacco2/grammar-testsuite/pager_1.w new file mode 100644 index 0000000000..e15a6a08db --- /dev/null +++ b/web/yacco2/grammar-testsuite/pager_1.w @@ -0,0 +1,687 @@ +% file: pager_1.w - cweb grammar +%Date: Sun Jun 15 15:01:27 2014 +\input "supp-pdf" +\input "/yacco2/diagrams+etc/o2mac.tex" +\GRAMMARtitle{pager\_1} +{pager\_1.lex}{NS\_pager\_1} +{1.0}{true} +{Test out David Pager LR(1) resolution page 61.} + + +@** David Pager Grammar.\fbreak +David Pager\fbreak +The Lane Table Method Of Constructing LR(1) Parsers.\fbreak + +@*2 Fsm Cpager\_1 class. + +@*3 Cpager\_1 failed directive. + +The |RSVP_FSM| macro is used +to pass back an error to the calling grammar +in its ``Accept queue''! +Here the error is within the monolithic grammar so place it +directly into the ``Error queue''. +Please read ``wlibrary.pdf'' or ``o2book.pdf'' on the differences between:\fbreak +|RSVP| and |RSVP_FSM| and their contextes to place a T into the ``Accept queue'' +whereas + |ADD_TOKEN_TO_ERROR_QUEUE| and |ADD_TOKEN_TO_ERROR_QUEUE_FSM| +macros +store the T into the ``Error queue''. +\fbreak +{\bf{Note}}: Reference to |current_token| +to fetch its token stream gps. + +@<Cpager\_1 failed directive@>= + + CAbs_lr1_sym* sym = new Err_bad_T_inputted; + sym->set_rc(*parser__->current_token__,__FILE__,__LINE__); + ADD_TOKEN_TO_ERROR_QUEUE_FSM(*sym); + return true; + +@*2 |@!Rs| rule.\fbreak +\fbreak +\convertMPtoPDF{pager_1.1}{1}{1} +@.Re@> +@.eog@> +@*2 |@!Re| rule.\fbreak +\fbreak +\convertMPtoPDF{pager_1.3}{1}{1} +@.Rx@> +@.Rx@> +@.Ry@> +@.Ry@> +@*2 |@!Rx| rule.\fbreak +\fbreak +\convertMPtoPDF{pager_1.8}{1}{1} +@.Rx@> +@*2 |@!Ry| rule.\fbreak +\fbreak +\convertMPtoPDF{pager_1.11}{1}{1} +@.Ry@> +@** First Set Language for \Olinker.\fbreak +\openin 1 = "/yacco2/grammar-testsuite/pager_1.fsc" +\ifeof 1 true + \closein 1 +\else + \closein 1 + \listing{"/yacco2/grammar-testsuite/pager_1.fsc"}\fi +@** Lr1 State Network.\fbreak +\statecolumnspace +\stateno{1} {} {\Shiftonly} +\halign{ +\span\statetemplate +\statetitle +{c}& +{Re}& +{2\hss}& +{3\hss}& +{1\hss}& +{{a} +}& +{1\hss}& +{2\hss}& +{6\hss}& +{\hss}\cr +{c}& +{Re}& +{2\hss}& +{1\hss}& +{1\hss}& +{{a} +}& +{1\hss}& +{2\hss}& +{4\hss}& +{\hss}\cr +{c}& +{Re}& +{2\hss}& +{2\hss}& +{1\hss}& +{{b} +}& +{1\hss}& +{7\hss}& +{9\hss}& +{\hss}\cr +{c}& +{Re}& +{2\hss}& +{4\hss}& +{1\hss}& +{{b} +}& +{1\hss}& +{7\hss}& +{11\hss}& +{\hss}\cr +{c}& +{Rs}& +{1\hss}& +{1\hss}& +{1\hss}& +{{Re} +{$\underline{eog}$} +}& +{1\hss}& +{12\hss}& +{13\hss}& +{\hss}\cr +} +\stateno{2} {a} {\Shiftonly} +\halign{ +\span\statetemplate +\statetitle +{c}& +{Rx}& +{3\hss}& +{1\hss}& +{1\hss}& +{{e} +}& +{2\hss}& +{14\hss}& +{15\hss}& +{\hss}\cr +{c}& +{Rx}& +{3\hss}& +{2\hss}& +{1\hss}& +{{e} +}& +{2\hss}& +{14\hss}& +{14\hss}& +{\hss}\cr +{c}& +{Ry}& +{4\hss}& +{1\hss}& +{1\hss}& +{{e} +}& +{2\hss}& +{14\hss}& +{16\hss}& +{\hss}\cr +{c}& +{Ry}& +{4\hss}& +{2\hss}& +{1\hss}& +{{e} +}& +{2\hss}& +{14\hss}& +{14\hss}& +{\hss}\cr +{t}& +{Re}& +{2\hss}& +{1\hss}& +{2\hss}& +{{Rx} +{$\underline{d}$} +}& +{1\hss}& +{3\hss}& +{4\hss}& +{\hss}\cr +{t}& +{Re}& +{2\hss}& +{3\hss}& +{2\hss}& +{{Ry} +{$\underline{c}$} +}& +{1\hss}& +{5\hss}& +{6\hss}& +{\hss}\cr +} +\stateno{3} {Rx} {\Shiftonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Re}& +{2\hss}& +{1\hss}& +{3\hss}& +{{d} +}& +{1\hss}& +{4\hss}& +{4\hss}& +{\hss}\cr +} +\stateno{4} {d} {\Reduceonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Re}& +{2\hss}& +{1\hss}& +{4\hss}& +{{} +}& +{1\hss}& +{0\hss}& +{4\hss}& +{1\hss}\cr +} +\stateno{5} {Ry} {\Shiftonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Re}& +{2\hss}& +{3\hss}& +{3\hss}& +{{c} +}& +{1\hss}& +{6\hss}& +{6\hss}& +{\hss}\cr +} +\stateno{6} {c} {\Reduceonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Re}& +{2\hss}& +{3\hss}& +{4\hss}& +{{} +}& +{1\hss}& +{0\hss}& +{6\hss}& +{1\hss}\cr +} +\stateno{7} {b} {\Shiftonly} +\halign{ +\span\statetemplate +\statetitle +{c}& +{Rx}& +{3\hss}& +{1\hss}& +{1\hss}& +{{e} +}& +{7\hss}& +{17\hss}& +{18\hss}& +{\hss}\cr +{c}& +{Rx}& +{3\hss}& +{2\hss}& +{1\hss}& +{{e} +}& +{7\hss}& +{17\hss}& +{17\hss}& +{\hss}\cr +{c}& +{Ry}& +{4\hss}& +{1\hss}& +{1\hss}& +{{e} +}& +{7\hss}& +{17\hss}& +{19\hss}& +{\hss}\cr +{c}& +{Ry}& +{4\hss}& +{2\hss}& +{1\hss}& +{{e} +}& +{7\hss}& +{17\hss}& +{17\hss}& +{\hss}\cr +{t}& +{Re}& +{2\hss}& +{2\hss}& +{2\hss}& +{{Rx} +{$\underline{c}$} +}& +{1\hss}& +{8\hss}& +{9\hss}& +{\hss}\cr +{t}& +{Re}& +{2\hss}& +{4\hss}& +{2\hss}& +{{Ry} +{$\underline{d}$} +}& +{1\hss}& +{10\hss}& +{11\hss}& +{\hss}\cr +} +\stateno{8} {Rx} {\Shiftonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Re}& +{2\hss}& +{2\hss}& +{3\hss}& +{{c} +}& +{1\hss}& +{9\hss}& +{9\hss}& +{\hss}\cr +} +\stateno{9} {c} {\Reduceonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Re}& +{2\hss}& +{2\hss}& +{4\hss}& +{{} +}& +{1\hss}& +{0\hss}& +{9\hss}& +{1\hss}\cr +} +\stateno{10} {Ry} {\Shiftonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Re}& +{2\hss}& +{4\hss}& +{3\hss}& +{{d} +}& +{1\hss}& +{11\hss}& +{11\hss}& +{\hss}\cr +} +\stateno{11} {d} {\Reduceonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Re}& +{2\hss}& +{4\hss}& +{4\hss}& +{{} +}& +{1\hss}& +{0\hss}& +{11\hss}& +{1\hss}\cr +} +\stateno{12} {Re} {\Shiftonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Rs}& +{1\hss}& +{1\hss}& +{2\hss}& +{{eog} +}& +{1\hss}& +{13\hss}& +{13\hss}& +{\hss}\cr +} +\stateno{13} {eog} {\Reduceonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Rs}& +{1\hss}& +{1\hss}& +{3\hss}& +{{} +}& +{1\hss}& +{0\hss}& +{13\hss}& +{2\hss}\cr +} +\stateno{14} {e} {\ShiftandMultipleReduces} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Rx}& +{3\hss}& +{2\hss}& +{2\hss}& +{{} +}& +{2\hss}& +{0\hss}& +{14\hss}& +{3\hss}\cr +{t}& +{Ry}& +{4\hss}& +{2\hss}& +{2\hss}& +{{} +}& +{2\hss}& +{0\hss}& +{14\hss}& +{4\hss}\cr +{c}& +{Rx}& +{3\hss}& +{1\hss}& +{1\hss}& +{{e} +}& +{14\hss}& +{14\hss}& +{15\hss}& +{\hss}\cr +{c}& +{Rx}& +{3\hss}& +{2\hss}& +{1\hss}& +{{e} +}& +{14\hss}& +{14\hss}& +{14\hss}& +{\hss}\cr +{c}& +{Ry}& +{4\hss}& +{1\hss}& +{1\hss}& +{{e} +}& +{14\hss}& +{14\hss}& +{16\hss}& +{\hss}\cr +{c}& +{Ry}& +{4\hss}& +{2\hss}& +{1\hss}& +{{e} +}& +{14\hss}& +{14\hss}& +{14\hss}& +{\hss}\cr +{t}& +{Rx}& +{3\hss}& +{1\hss}& +{2\hss}& +{{Rx} +}& +{2\hss}& +{15\hss}& +{15\hss}& +{\hss}\cr +{t}& +{Ry}& +{4\hss}& +{1\hss}& +{2\hss}& +{{Ry} +}& +{2\hss}& +{16\hss}& +{16\hss}& +{\hss}\cr +} +\stateno{15} {Rx} {\Reduceonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Rx}& +{3\hss}& +{1\hss}& +{3\hss}& +{{} +}& +{2\hss}& +{0\hss}& +{15\hss}& +{3\hss}\cr +} +\stateno{16} {Ry} {\Reduceonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Ry}& +{4\hss}& +{1\hss}& +{3\hss}& +{{} +}& +{2\hss}& +{0\hss}& +{16\hss}& +{4\hss}\cr +} +\stateno{17} {e} {\ShiftandMultipleReduces} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Rx}& +{3\hss}& +{2\hss}& +{2\hss}& +{{} +}& +{7\hss}& +{0\hss}& +{17\hss}& +{4\hss}\cr +{t}& +{Ry}& +{4\hss}& +{2\hss}& +{2\hss}& +{{} +}& +{7\hss}& +{0\hss}& +{17\hss}& +{3\hss}\cr +{c}& +{Rx}& +{3\hss}& +{1\hss}& +{1\hss}& +{{e} +}& +{17\hss}& +{17\hss}& +{18\hss}& +{\hss}\cr +{c}& +{Rx}& +{3\hss}& +{2\hss}& +{1\hss}& +{{e} +}& +{17\hss}& +{17\hss}& +{17\hss}& +{\hss}\cr +{c}& +{Ry}& +{4\hss}& +{1\hss}& +{1\hss}& +{{e} +}& +{17\hss}& +{17\hss}& +{19\hss}& +{\hss}\cr +{c}& +{Ry}& +{4\hss}& +{2\hss}& +{1\hss}& +{{e} +}& +{17\hss}& +{17\hss}& +{17\hss}& +{\hss}\cr +{t}& +{Rx}& +{3\hss}& +{1\hss}& +{2\hss}& +{{Rx} +}& +{7\hss}& +{18\hss}& +{18\hss}& +{\hss}\cr +{t}& +{Ry}& +{4\hss}& +{1\hss}& +{2\hss}& +{{Ry} +}& +{7\hss}& +{19\hss}& +{19\hss}& +{\hss}\cr +} +\stateno{18} {Rx} {\Reduceonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Rx}& +{3\hss}& +{1\hss}& +{3\hss}& +{{} +}& +{7\hss}& +{0\hss}& +{18\hss}& +{4\hss}\cr +} +\stateno{19} {Ry} {\Reduceonly} +\halign{ +\span\statetemplate +\statetitle +{t}& +{Ry}& +{4\hss}& +{1\hss}& +{3\hss}& +{{} +}& +{7\hss}& +{0\hss}& +{19\hss}& +{3\hss}\cr +} +@** Index. |