Update licensing information.
[cl-opossum.git] / entrypoints.lisp
bloba270d0e91540d19d69cd99e71f4c4f4d9a1b8bcc
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 ;;
8 ;; This code is free software; you can redistribute it and/or modify
9 ;; it under the terms of the version 2.1 of the GNU Lesser General
10 ;; Public License as published by the Free Software Foundation, as
11 ;; clarified by the lisp prequel found in LICENSE.
13 ;; This code is distributed in the hope that it will be useful, but
14 ;; without any warranty; without even the implied warranty of
15 ;; merchantability or fitness for a particular purpose. See the GNU
16 ;; Lesser General Public License for more details.
18 ;; Version 2.1 of the GNU General Public License is in the file
19 ;; LICENSE that was distributed with this file. If it is not
20 ;; present, you can access it from
21 ;; http://www.gnu.org/copyleft/lgpl.txt (until superseded by a
22 ;; newer version) or write to the Free Software Foundation, Inc., 59
23 ;; Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 ;; Commentary:
27 ;; This file contains code for the opossum package that depends on
28 ;; the parser part already being compiled to avoid undefined symbol warnings
30 ;;; Code:
34 (in-package #:opossum)
38 ;;; parser entry point
39 (defun make-string-parser (grammarfile head &key (dst-package (make-default-dst-package grammarfile)))
40 "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."
41 (opossum:generate-parser-package grammarfile dst-package head)
42 (let ((*package* dst-package))
43 #'parse-string))
45 (defun make-file-parser (grammarfile head &key (dst-package (make-default-dst-package grammarfile)))
46 "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."
47 (opossum:generate-parser-package grammarfile dst-package head)
48 (let ((*package* dst-package))
49 #'parse-file))
51 (defun make-stream-parser (grammarfile head &key (dst-package (make-default-dst-package grammarfile)))
52 "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."
53 (opossum:generate-parser-package grammarfile dst-package head)
54 (let ((*package* dst-package))
55 #'parse-stream))