]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/ebnf-yac.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / progmodes / ebnf-yac.el
index ff097b5195d078ea13ea8538aa6624187a6cee64..5defea14d500d49184948701848b137b7e6974e6 100644 (file)
@@ -1,13 +1,12 @@
 ;;; ebnf-yac.el --- parser for Yacc/Bison
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
-;; Free Sofware Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;;   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 20:23:29 vinicius>
 ;; Keywords: wp, ebnf, PostScript
-;; Version: 1.2.1
+;; Version: 1.3
 
 ;; This file is part of GNU Emacs.
 
@@ -23,8 +22,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
                 factor (ebnf-yac-factor token))
       (setq seq (cons factor seq)))
     (cons token
-         (cond
-          ;; ignore error recovery
-          ((and ebnf-yac-ignore-error-recovery ebnf-yac-error)
-           nil)
-          ;; null sequence
-          ((null seq)
-           (ebnf-make-empty))
-          ;; sequence with only one element
-          ((= (length seq) 1)
-           (car seq))
-          ;; a real sequence
-          (t
-           (ebnf-make-sequence (nreverse seq)))
-          ))))
+         (if (and ebnf-yac-ignore-error-recovery ebnf-yac-error)
+             ;; ignore error recovery
+             nil
+           (ebnf-token-sequence seq)))))
 
 
 ;;; Factor = Name
 
 
 (defun ebnf-yac-lex ()
-  "Lexical analyser for Yacc/Bison.
+  "Lexical analyzer for Yacc/Bison.
 
 Return a lexical token.
 
@@ -356,7 +345,7 @@ See documentation for variable `ebnf-yac-lex'."
        'end-of-input)
        ;; error
        ((eq token 'error)
-       (error "Illegal character"))
+       (error "Invalid character"))
        ;; "string"
        ((eq token 'string)
        (setq ebnf-yac-lex (ebnf-get-string))
@@ -435,7 +424,7 @@ See documentation for variable `ebnf-yac-lex'."
        ((= (following-char) ?\')
        (ebnf-string " -&(-~" ?\' "character"))
        (t
-       (error "Illegal character"))
+       (error "Invalid character"))
        )))
   (ebnf-yac-skip-spaces))
 
@@ -486,7 +475,7 @@ See documentation for variable `ebnf-yac-lex'."
               (forward-char)
               (setq not-end nil)))
            (t
-            (error "Illegal character"))
+            (error "Invalid character"))
            ))))