summaryrefslogtreecommitdiff
path: root/web/yacco2/grammar-testsuite/pager_1.lex
diff options
context:
space:
mode:
Diffstat (limited to 'web/yacco2/grammar-testsuite/pager_1.lex')
-rw-r--r--web/yacco2/grammar-testsuite/pager_1.lex65
1 files changed, 65 insertions, 0 deletions
diff --git a/web/yacco2/grammar-testsuite/pager_1.lex b/web/yacco2/grammar-testsuite/pager_1.lex
new file mode 100644
index 0000000000..c0035e17b0
--- /dev/null
+++ b/web/yacco2/grammar-testsuite/pager_1.lex
@@ -0,0 +1,65 @@
+/*
+Author: Dave Bone
+FILE: pager_1.lex
+Date: 7 mar 2014
+Purpose: 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
+@/
+fsm
+(fsm-id "pager_1.lex",fsm-filename pager_1,fsm-namespace NS_pager_1
+,fsm-class Cpager_1{
+/@
+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.
+@/
+ failed
+ 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;
+***
+}
+,fsm-version "1.0",fsm-date "7 mar 2014",fsm-debug "true"
+,fsm-comments "Test out David Pager LR(1) resolution page 61.")
+@"/usr/local/yacco2/grammar-testsuite/testout_T_includes.T"
+
+rules{
+
+Rs(){
+ -> Re eog
+}
+
+Re(){
+ -> a Rx d
+ -> b Rx c
+ -> a Ry c
+ -> b Ry d
+}
+
+Rx(){
+ -> e Rx
+ -> e
+}
+
+Ry(){
+ -> e Ry
+ -> e
+}
+
+}