]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/ebnf-abn.el
(ebrowse-revert-tree-buffer-from-file): Use with-no-warnings.
[gnu-emacs] / lisp / progmodes / ebnf-abn.el
index 9c341c5181ca6e5fe72d6d536a44535ad4d04951..d4d3399dc092273fcc656de561076e69cadb74d0 100644 (file)
@@ -1,12 +1,12 @@
 ;;; ebnf-abn.el --- parser for ABNF (Augmented BNF)
 
-;; Copyright (C) 2004 Free Sofware Foundation, Inc.
+;; Copyright (C) 2004, 2005 Free Sofware Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Time-stamp: <2004/02/28 17:40:41 vinicius>
+;; Time-stamp: <2004/04/03 16:43:57 vinicius>
 ;; Keywords: wp, ebnf, PostScript
-;; Version: 1.0
+;; Version: 1.1
 
 ;; This file is part of GNU Emacs.
 
     (setq token (ebnf-abn-lex))
     (and (eq token 'end-of-input)
         (error "Invalid ABNF file format"))
+    (and (eq token 'end-of-rule)
+        (setq token (ebnf-abn-lex)))
     (while (not (eq token 'end-of-input))
       (ebnf-message-float
        "Parsing...%s%%"
                 term  (cdr term))
       (setq seq (cons term seq)))
     (cons token
-         (if (= (length seq) 1)
-             ;; sequence with only one element
-             (car seq)
-           ;; a real sequence
-           (ebnf-make-sequence (nreverse seq))))))
+         (ebnf-token-sequence seq))))
 
 
 ;;;    repetition     =  [repeat] element
 
 
 (defun ebnf-abn-lex ()
-  "Lexical analyser for ABNF.
+  "Lexical analyzer for ABNF.
 
 Return a lexical token.
 
@@ -520,7 +518,7 @@ See documentation for variable `ebnf-abn-lex'."
        'end-of-input)
        ;; error
        ((eq token 'error)
-       (error "Illegal character"))
+       (error "Invalid character"))
        ;; end of rule
        ((eq token 'end-of-rule)
        'end-of-rule)
@@ -602,7 +600,7 @@ See documentation for variable `ebnf-abn-lex'."
        ((= (following-char) ?\n)
         t)
        (t
-        (error "Illegal character"))
+        (error "Invalid character"))
        ))