Pair(T) ==> Record(first: T, second: T) AST ==> SExpression )abbrev package SPADPRSR SpadParser ++ This package provides a simple minded interface to the SPAD parser. ++ Over time, we will add belts and whistles. SpadParser(): Public == Private where Public == with parse: String -> List AST ++ parse(f) parses the source file f ++ and returns the result as a list of ++ pair of ASTs. The first component ++ of a pair is a parse form, and ++ the second compoenent is the internal AST. ++ Each pair on the list represents a ++ toplevel definition. Private == add spadReaderInitialized : Boolean := false -- guards against multiple parser -- definitions. parse(source: String) : List AST == if not spadReaderInitialized then LOAD("gdr-reader.clisp")$Lisp spadReaderInitialized := true ast : List SExpression := gdrParseSpadFile(source)$Lisp ast