1 ;;; test-lr-basics-04.scm --
3 ;;A grammar accepting a sequence of equal tokens of arbitrary length.
4 ;;The return value is the value of the last parsed token.
7 (load "common-test.scm")
9 (define (doit . tokens)
10 (let ((parser (lalr-parser (expect: 0)
16 (parser (make-lexer tokens) error-handler)))
23 ;;Two results because there is a shift/reduce conflict, so two
24 ;;processes are generated.
25 (doit (make-lexical-token 'A #f 1))
29 ;;Two results because there is a shift/reduce conflict, so two
30 ;;processes are generated. Notice that the rules:
34 ;;generate only one conflict when the second "A" comes. The third
35 ;;"A" comes when the state is inside the rule "(e A)", so there is
38 (doit (make-lexical-token 'A #f 1)
39 (make-lexical-token 'A #f 2)
40 (make-lexical-token 'A #f 3))