Move symbols into their own module too
parent
b2611aee1b
commit
60a142f90c
@ -0,0 +1,22 @@
|
|||||||
|
#lang racket/base
|
||||||
|
|
||||||
|
|
||||||
|
(require racket/contract/base)
|
||||||
|
|
||||||
|
|
||||||
|
(provide
|
||||||
|
(struct-out terminal-symbol)
|
||||||
|
(struct-out nonterminal-symbol)
|
||||||
|
(contract-out
|
||||||
|
[grammar-symbol? predicate/c]))
|
||||||
|
|
||||||
|
|
||||||
|
;@----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
(define (grammar-symbol? v)
|
||||||
|
(or (terminal-symbol? v) (nonterminal-symbol? v)))
|
||||||
|
|
||||||
|
|
||||||
|
(struct terminal-symbol (value) #:transparent)
|
||||||
|
(struct nonterminal-symbol (value) #:transparent)
|
Loading…
Reference in New Issue