|
|
@ -265,6 +265,15 @@
|
|
|
|
(syntax-case prod-so ()
|
|
|
|
(syntax-case prod-so ()
|
|
|
|
((prod-rhs-sym ...)
|
|
|
|
((prod-rhs-sym ...)
|
|
|
|
(andmap identifier? (syntax->list prod-so))
|
|
|
|
(andmap identifier? (syntax->list prod-so))
|
|
|
|
|
|
|
|
(begin
|
|
|
|
|
|
|
|
(for-each (lambda (t)
|
|
|
|
|
|
|
|
(if (memq (syntax-object->datum t) end-terms)
|
|
|
|
|
|
|
|
(raise-syntax-error
|
|
|
|
|
|
|
|
'parser-production-rhs
|
|
|
|
|
|
|
|
(format "~a is an end token and cannot be used in a production"
|
|
|
|
|
|
|
|
(syntax-object->datum t))
|
|
|
|
|
|
|
|
t)))
|
|
|
|
|
|
|
|
(syntax->list prod-so))
|
|
|
|
(list->vector
|
|
|
|
(list->vector
|
|
|
|
(map (lambda (s)
|
|
|
|
(map (lambda (s)
|
|
|
|
(hash-table-get
|
|
|
|
(hash-table-get
|
|
|
@ -281,7 +290,7 @@
|
|
|
|
"~a is not declared as a terminal or non-terminal"
|
|
|
|
"~a is not declared as a terminal or non-terminal"
|
|
|
|
(syntax-object->datum s))
|
|
|
|
(syntax-object->datum s))
|
|
|
|
s))))))
|
|
|
|
s))))))
|
|
|
|
(syntax->list prod-so))))
|
|
|
|
(syntax->list prod-so)))))
|
|
|
|
(_
|
|
|
|
(_
|
|
|
|
(raise-syntax-error
|
|
|
|
(raise-syntax-error
|
|
|
|
'parser-production-rhs
|
|
|
|
'parser-production-rhs
|
|
|
|