comparison lisp/international/ccl.el @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 5f47d61ffbdc
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 ;;; ccl.el --- CCL (Code Conversion Language) compiler 1 ;;; ccl.el --- CCL (Code Conversion Language) compiler
2 2
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 3 ;; Copyright (C) 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
4 ;; Licensed to the Free Software Foundation. 4 ;; Copyright (C) 1995, 1998, 1999, 2000
5 ;; Copyright (C) 2002 Free Software Foundation, Inc. 5 ;; National Institute of Advanced Industrial Science and Technology (AIST)
6 ;; Registration Number H14PRO021
6 7
7 ;; Keywords: CCL, mule, multilingual, character set, coding-system 8 ;; Keywords: CCL, mule, multilingual, character set, coding-system
8 9
9 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
10 11
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details. 20 ;; GNU General Public License for more details.
20 21
21 ;; You should have received a copy of the GNU General Public License 22 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02111-1307, USA. 25 ;; Boston, MA 02110-1301, USA.
25 26
26 ;;; Commentary: 27 ;;; Commentary:
27 28
28 ;; CCL (Code Conversion Language) is a simple programming language to 29 ;; CCL (Code Conversion Language) is a simple programming language to
29 ;; be used for various kind of code conversion. A CCL program is 30 ;; be used for various kind of code conversion. A CCL program is
772 (ccl-embed-code 'write-expr-const 0 (ash op 3) left) 773 (ccl-embed-code 'write-expr-const 0 (ash op 3) left)
773 (ccl-embed-data right)) 774 (ccl-embed-data right))
774 (ccl-check-register right rrr) 775 (ccl-check-register right rrr)
775 (ccl-embed-code 'write-expr-register 0 776 (ccl-embed-code 'write-expr-register 0
776 (logior (ash op 3) 777 (logior (ash op 3)
777 (get right 'ccl-register-number)))))) 778 (get right 'ccl-register-number))
779 left))))
778 780
779 (t 781 (t
780 (error "CCL: Invalid argument: %s" cmd)))) 782 (error "CCL: Invalid argument: %s" cmd))))
781 nil) 783 nil)
782 784
1117 1119
1118 (defun ccl-dump-write-register (rrr cc) 1120 (defun ccl-dump-write-register (rrr cc)
1119 (insert (format "write r%d (%d remaining)\n" rrr cc))) 1121 (insert (format "write r%d (%d remaining)\n" rrr cc)))
1120 1122
1121 (defun ccl-dump-call (ignore cc) 1123 (defun ccl-dump-call (ignore cc)
1122 (insert (format "call subroutine #%d\n" cc))) 1124 (let ((subroutine (car (ccl-get-next-code))))
1125 (insert (format "call subroutine `%s'\n" subroutine))))
1123 1126
1124 (defun ccl-dump-write-const-string (rrr cc) 1127 (defun ccl-dump-write-const-string (rrr cc)
1125 (if (= rrr 0) 1128 (if (= rrr 0)
1126 (progn 1129 (progn
1127 (insert "write char") 1130 (insert "write char")
1301 CCL_MAIN_CODE 1304 CCL_MAIN_CODE
1302 [ CCL_EOF_CODE ]) 1305 [ CCL_EOF_CODE ])
1303 1306
1304 BUFFER_MAGNIFICATION is an integer value specifying the approximate 1307 BUFFER_MAGNIFICATION is an integer value specifying the approximate
1305 output buffer magnification size compared with the bytes of input data 1308 output buffer magnification size compared with the bytes of input data
1306 text. If the value is zero, the CCL program can't execute `read' and 1309 text. It is assured that the actual output buffer has 256 bytes
1310 more than the size calculated by BUFFER_MAGNIFICATION.
1311 If the value is zero, the CCL program can't execute `read' and
1307 `write' commands. 1312 `write' commands.
1308 1313
1309 CCL_MAIN_CODE and CCL_EOF_CODE are CCL program codes. CCL_MAIN_CODE 1314 CCL_MAIN_CODE and CCL_EOF_CODE are CCL program codes. CCL_MAIN_CODE
1310 executed at first. If there's no more input data when `read' command 1315 executed at first. If there's no more input data when `read' command
1311 is executed in CCL_MAIN_CODE, CCL_EOF_CODE is executed. If 1316 is executed in CCL_MAIN_CODE, CCL_EOF_CODE is executed. If
1491 | (translate-character SYMBOL REG(charset) REG(codepoint)) 1496 | (translate-character SYMBOL REG(charset) REG(codepoint))
1492 ;; SYMBOL must refer to a table defined by `define-translation-table'. 1497 ;; SYMBOL must refer to a table defined by `define-translation-table'.
1493 LOOKUP := 1498 LOOKUP :=
1494 (lookup-character SYMBOL REG(charset) REG(codepoint)) 1499 (lookup-character SYMBOL REG(charset) REG(codepoint))
1495 | (lookup-integer SYMBOL REG(integer)) 1500 | (lookup-integer SYMBOL REG(integer))
1496 ;; SYMBOL refers to a table defined by `define-hash-translation-table'. 1501 ;; SYMBOL refers to a table defined by `define-translation-hash-table'.
1497 MAP := 1502 MAP :=
1498 (iterate-multiple-map REG REG MAP-IDs) 1503 (iterate-multiple-map REG REG MAP-IDs)
1499 | (map-multiple REG REG (MAP-SET)) 1504 | (map-multiple REG REG (MAP-SET))
1500 | (map-single REG REG MAP-ID) 1505 | (map-single REG REG MAP-ID)
1501 MAP-IDs := MAP-ID ... 1506 MAP-IDs := MAP-ID ...
1537 (ccl-execute ccl-prog reg) 1542 (ccl-execute ccl-prog reg)
1538 reg)) 1543 reg))
1539 1544
1540 (provide 'ccl) 1545 (provide 'ccl)
1541 1546
1547 ;;; arch-tag: 836bcd27-63a1-4a56-b232-1145ecf823fb
1542 ;;; ccl.el ends here 1548 ;;; ccl.el ends here