language.scm 744 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. (define-module (derivative language)
  2. #:use-module (srfi srfi-9)
  3. #:export (<alt>
  4. alt?
  5. alt-this
  6. alt-that
  7. <cat>
  8. cat?
  9. cat-left
  10. cat-right
  11. <rep>
  12. rep?
  13. rep-lang))
  14. ;;; TODO: Explore what it would be like to have a single list
  15. ;;; argument, a list of languages, and treat it appropriately in the
  16. ;;; macros and procedures. Same for <cat>.
  17. (define-record-type <alt>
  18. (make-alt this that)
  19. alt?
  20. (this alt-this)
  21. (that alt-that))
  22. (define-record-type <cat>
  23. (make-cat left right)
  24. cat?
  25. (left cat-left)
  26. (right cat-right))
  27. (define-record-type <rep>
  28. (make-rep lang)
  29. rep?
  30. (lang rep-lang))
  31. ;;; The empty and null languages are simply the symbols 'empty and
  32. ;;; 'epsilon, respectively.