;;; ccl.el --- CCL (Code Conversion Language) compiler
-;; Copyright (C) 1997, 1998, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2001-2013 Free Software Foundation, Inc.
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008
+;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H14PRO021
;;; Code:
-(defgroup ccl nil
- "CCL (Code Conversion Language) compiler."
- :prefix "ccl-"
- :group 'i18n)
+;; Unused.
+;;; (defgroup ccl nil
+;;; "CCL (Code Conversion Language) compiler."
+;;; :prefix "ccl-"
+;;; :group 'i18n)
(defconst ccl-command-table
[if branch loop break repeat write-repeat write-read-repeat
;;;###autoload
(defun ccl-compile (ccl-program)
"Return the compiled code of CCL-PROGRAM as a vector of integers."
- (if (or (null (consp ccl-program))
- (null (integerp (car ccl-program)))
- (null (listp (car (cdr ccl-program)))))
- (error "CCL: Invalid CCL program: %s" ccl-program))
+ (unless (and (consp ccl-program)
+ (integerp (car ccl-program))
+ (listp (car (cdr ccl-program))))
+ (error "CCL: Invalid CCL program: %s" ccl-program))
(if (null (vectorp ccl-program-vector))
(setq ccl-program-vector (make-vector 8192 0)))
(setq ccl-loop-head nil ccl-breaks nil)
(op (get (nth 1 condition) 'ccl-arith-code))
(arg (nth 2 condition)))
(ccl-check-register rrr cmd)
+ (or (integerp op)
+ (error "CCL: invalid operator: %s" (nth 1 condition)))
(if (integerp arg)
(progn
(ccl-embed-code (if read-flag 'read-jump-cond-expr-const
ARG := REG | integer
OPERATOR :=
- ;; Normal arithmethic operators (same meaning as C code).
+ ;; Normal arithmetic operators (same meaning as C code).
+ | - | * | / | %
- ;; Bitwize operators (same meaning as C code)
+ ;; Bitwise operators (same meaning as C code)
| & | `|' | ^
;; Shifting operators (same meaning as C code)
| de-sjis
;; If ARG_0 and ARG_1 are the first and second code point of
- ;; JISX0208 character CHAR, and SJIS is the correponding
+ ;; JISX0208 character CHAR, and SJIS is the corresponding
;; Shift-JIS code,
;; (REG = ARG_0 en-sjis ARG_1) means:
;; ((REG = HIGH)
(provide 'ccl)
-;; arch-tag: 836bcd27-63a1-4a56-b232-1145ecf823fb
;;; ccl.el ends here