;;;; -*- coding:utf-8 -*- ;;;;**************************************************************************** ;;;;FILE: scanner.lisp ;;;;LANGUAGE: Common-Lisp ;;;;SYSTEM: Common-Lisp ;;;;USER-INTERFACE: NONE ;;;;DESCRIPTION ;;;; ;;;; An abstract scanner class. ;;;; ;;;;AUTHORS ;;;; Pascal J. Bourguignon ;;;;MODIFICATIONS ;;;; 2005-09-01 Made use of iso6429. ;;;; 2004-10-10 Created. ;;;;BUGS ;;;;LEGAL ;;;; GPL ;;;; ;;;; Copyright Pascal J. Bourguignon 2004 - 2005 ;;;; ;;;; This program is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU General Public License ;;;; as published by the Free Software Foundation; either version ;;;; 2 of the License, or (at your option) any later version. ;;;; ;;;; This program is distributed in the hope that it will be ;;;; useful, but WITHOUT ANY WARRANTY; without even the implied ;;;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;;;; PURPOSE. See the GNU General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU General Public ;;;; License along with this program; if not, write to the Free ;;;; Software Foundation, Inc., 59 Temple Place, Suite 330, ;;;; Boston, MA 02111-1307 USA ;;;;**************************************************************************** (IN-PACKAGE "COMMON-LISP-USER") (DECLAIM (DECLARATION ALSO-USE-PACKAGES) (ALSO-USE-PACKAGES "COM.INFORMATIMAGO.COMMON-LISP.ECMA048")) (DEFPACKAGE "COM.INFORMATIMAGO.COMMON-LISP.SCANNER" (:USE "COM.INFORMATIMAGO.COMMON-LISP.UTILITY" "COMMON-LISP") (:EXPORT "GET-TOKEN" "SCANNER-SOURCE" "SCANNER" "+SPACES+" "+CRLF+" "+LF+" "+CR+" "+NEWLINE+" "+C+LF+" "+C+CR+") (:DOCUMENTATION "An abstract scanner class. Copyright Pascal J. Bourguignon 2004 - 2005 This package is provided under the GNU General Public License. See the source file for details.")) (IN-PACKAGE "COM.INFORMATIMAGO.COMMON-LISP.SCANNER") (eval-when (:compile-toplevel :load-toplevel :execute) (let ((*compile-verbose* nil)) (ecma048:generate-all-functions-in-ecma048))) (DEFPARAMETER +C+CR+ ecma048:cr) (DEFPARAMETER +C+LF+ ecma048:lf) (DEFPARAMETER +NEWLINE+ (NAME-CHAR "NEWLINE")) (DEFPARAMETER +CR+ (code-char ecma048:cr)) (DEFPARAMETER +LF+ (code-char ecma048:lf)) (DEFPARAMETER +CRLF+ (FORMAT NIL "~C~C" +CR+ +LF+)) (DEFPARAMETER +SPACES+ (FORMAT NIL " ~C~C~C~C" (code-char ecma048:ht) +CR+ +LF+ +NEWLINE+)) (DEFCLASS SCANNER () ((SOURCE :TYPE PEEK-STREAM :INITARG :SOURCE :ACCESSOR SCANNER-SOURCE)) (:DOCUMENTATION "An abstract scanner.")) (DEFGENERIC GET-TOKEN (SCANNER)) (DEFMETHOD PRINT-OBJECT ((SELF SCANNER) OUT) (print-unreadable-object (self out :type t :identity t) (FORMAT OUT " :source ~A" (SCANNER-SOURCE SELF))) SELF) ;;;; scanner.lisp -- -- ;;;;