mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 20:47:44 +00:00
17 lines
546 B
Common Lisp
17 lines
546 B
Common Lisp
(progn
|
|
(defparameter *trw*
|
|
(generate-world
|
|
"TTR"
|
|
'((grammar test-to-rational-grammar :lalr-1 :start)
|
|
|
|
(production :start () start-none)
|
|
|
|
(define (to-rational (x finite-general-number)) rational
|
|
(case x
|
|
(:select (tag +zero32 +zero64 -zero32 -zero64) (return 0))
|
|
(:narrow (union nonzero-finite-float32 nonzero-finite-float64 long u-long) (return (& value x))))))))
|
|
|
|
(defparameter *trg* (world-grammar *trw* 'test-to-rational-grammar)))
|
|
|
|
(length (grammar-states *trg*))
|