;;; ebnf-iso.el --- parser for ISO EBNF
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
;; Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Time-stamp: <2004/02/29 18:31:33 vinicius>
+;; Time-stamp: <2004/04/03 16:48:52 vinicius>
;; Keywords: wp, ebnf, PostScript
-;; Version: 1.7
+;; Version: 1.8
;; This file is part of GNU Emacs.
;;
;; ISO EBNF accepts the characters given by <character> production above,
;; HORIZONTAL TAB (^I), VERTICAL TAB (^K), NEWLINE (^J or ^M) and FORM FEED
-;; (^L), any other characters are illegal. But ebnf2ps accepts also the
+;; (^L), any other characters are invalid. But ebnf2ps accepts also the
;; european 8-bit accentuated characters (from \240 to \377) and underscore
;; (_).
;;
(eq token 'catenate))
(setq seq (cons term seq)))
(cons token
- (cond
- ;; null sequence
- ((null seq)
- term)
- ;; sequence with only one element
- ((and (null term) (= (length seq) 1))
- (car seq))
- ;; a real sequence
- (t
- (ebnf-make-sequence (nreverse (cons term seq))))
- ))))
+ (ebnf-token-sequence (if term
+ (cons term seq)
+ seq)))))
;;; term = factor, ['-', exception];
(defun ebnf-iso-lex ()
- "Lexical analyser for ISO EBNF.
+ "Lexical analyzer for ISO EBNF.
Return a lexical token.
'end-of-input)
;; error
((eq token 'error)
- (error "Illegal character"))
+ (error "Invalid character"))
;; integer
((eq token 'integer)
(setq ebnf-iso-lex (ebnf-buffer-substring "0-9"))
(forward-char)
(setq pair (1+ pair))))
(t
- (error "Illegal character"))
+ (error "Invalid character"))
))))