Bootstrapping infrastructure set up.
[cl-opossum.git] / entrypoints.lisp
blob5e3a979fa27421fc2cfbea092e74e925257a17ec
1 ;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; -*-
2 ;;;
3 ;;; entrypoints.lisp --- parser generator entry points
5 ;; Copyright (C) 2008 Utz-Uwe Haus <lisp@uuhaus.de>
6 ;; $Id$
7 ;; This code is free software; you can redistribute it and/or modify
8 ;; it under the terms of the version 3 of the GNU General
9 ;; Public License as published by the Free Software Foundation, as
10 ;; clarified by the prequel found in LICENSE.Lisp-GPL-Preface.
12 ;; This code is distributed in the hope that it will be useful, but
13 ;; without any warranty; without even the implied warranty of
14 ;; merchantability or fitness for a particular purpose. See the GNU
15 ;; Lesser General Public License for more details.
17 ;; Version 3 of the GNU General Public License is in the file
18 ;; LICENSE.GPL that was distributed with this file. If it is not
19 ;; present, you can access it from
20 ;; http://www.gnu.org/copyleft/gpl.txt (until superseded by a
21 ;; newer version) or write to the Free Software Foundation, Inc., 59
22 ;; Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 ;; Commentary:
26 ;;
28 ;;; Code:
32 (in-package #:opossum)
36 ;;; parser entry point
37 (defun make-string-parser (grammarfile head &key (dst-package (make-default-dst-package grammarfile)))
38 "Return a function of 1 argument, a string, that parses according to GRAMMARFILE, starting at rule named HEAD. The parser is instantiated in package DST-PACKAGE."
39 (opossum:generate-parser-package grammarfile dst-package head)
40 (let ((*package* dst-package))
41 #'parse-string))
43 (defun make-file-parser (grammarfile head &key (dst-package (make-default-dst-package grammarfile)))
44 "Return a function of 1 argument, a file, that parses according to GRAMMARFILE, starting at rule named HEAD. The parser is instantiated in package DST-PACKAGE."
45 (opossum:generate-parser-package grammarfile dst-package head)
46 (let ((*package* dst-package))
47 #'parse-file))
49 (defun make-stream-parser (grammarfile head &key (dst-package (make-default-dst-package grammarfile)))
50 "Return a function of 1 argument, a file, that parses according to GRAMMARFILE, starting at rule named HEAD. The parser is instantiated in package DST-PACKAGE."
51 (opossum:generate-parser-package grammarfile dst-package head)
52 (let ((*package* dst-package))
53 #'parse-stream))