+1998-08-21 Tanaka Akira <akr@jaist.ac.jp>
+
+ * ew-unit.el (ew-eword-p): Use aref instead of substring.
+ (ew-char-decoder): Refined.
+
+ * lalr-el.scm (gen-larl1): New function.
+
1998-08-20 Tanaka Akira <akr@jaist.ac.jp>
* ew-var.el (ew-dynamic-options): The result is now integer instead
(let ((len (length str)))
(and
(<= 3 len)
- (string= (substring str 0 2) "=?")
- (string= (substring str (- len 2) len) "?="))))
+ (eq (aref str 0) ?=)
+ (eq (aref str 1) ??)
+ (eq (aref str (- len 2)) ??)
+ (eq (aref str (1- len)) ?=))))
(defun ew-decode-eword (str &optional eword-filter1 eword-filter2)
(if (string-match ew-anchored-encoded-word-regexp str)
))
(defun ew-char-decoder (charset)
- (catch 'return
- (setq charset (downcase charset))
- (let ((sym (intern charset))
- tmp cs)
- (when (setq tmp (assq sym ew-charset-aliases))
- (setq sym (cdr tmp)))
- (setq cs (intern (concat (symbol-name sym) "-unix")))
- (when (coding-system-p cs)
- (throw 'return
- (closure-make (lambda (str) (decode-coding-string str cs)) cs)))
- nil)))
+ (let ((sym (intern (downcase charset)))
+ tmp cs)
+ (when (setq tmp (assq sym ew-charset-aliases))
+ (setq sym (cdr tmp)))
+ (setq cs (intern (concat (symbol-name sym) "-unix")))
+ (when (coding-system-p cs)
+ (closure-make
+ (lambda (str) (decode-coding-string str cs))
+ cs))))
(define ngotos #f)
(define token-set-size #f)
+(define (gen-larl1 gram output-file header footer . opt)
+ (define (conv-rule-right rr)
+ (if (null? rr)
+ '()
+ (cons (reverse (car rr))
+ (cons (cadr rr)
+ (cons (caddr rr)
+ (conv-rule-right (cdddr rr)))))))
+ (apply gen-lalr1
+ (map
+ (lambda (elt)
+ (if (symbol? elt)
+ elt
+ (cons (car elt) (conv-rule-right (cdr elt)))))
+ gram)
+ output-file
+ header
+ footer
+ opt))
(define (gen-lalr1 gram output-file header footer . opt)
(initialize-all)