struct.ss
#lang scheme
(define-struct parse-position (file line column))
(define-struct parse-results (position base [next* #:mutable] map))
(define-struct parse-result (successful? semantic-value next error))
(define-struct parse-error (position expected messages))
(provide/contract 
 (struct parse-position 
         ([file string?] [line number?] [column number?]))
 (struct parse-result 
         ([successful? boolean?]
          [semantic-value any/c]
          [next (or/c false? parse-results?)]
          [error (or/c false? parse-error?)]))
 (struct parse-results 
         ([position (or/c false? parse-position?)]
          [base any/c]
          [next* (or/c false? parse-results? (-> parse-results?))]
          [map (hash/c symbol? (or/c false? parse-result?))]))
 (struct parse-error
         ([position (or/c parse-position? false?)]
          [expected (or/c false? (listof any/c))]
          [messages (listof string?)])))