From: akr Date: Thu, 20 Aug 1998 03:19:17 +0000 (+0000) Subject: * Makefile: Output parse table to ew-parse.out instead of X-Git-Tag: doodle-1_9_2~38 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=955b92b07f71c449e9ff8f2b49b7e12408527cec;p=elisp%2Fflim.git * Makefile: Output parse table to ew-parse.out instead of states.output. * ew-var.el (ew-decode-field-syntax-alist): Keys are now symbols instead of strings. * ew-dec.el (ew-decode-field-no-cache): Ditto. --- diff --git a/ChangeLog b/ChangeLog index 522862d..66e916d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +1998-08-20 Tanaka Akira + + * Makefile: Output parse table to ew-parse.out instead of + states.output. + + * ew-var.el (ew-decode-field-syntax-alist): Keys are now symbols + instead of strings. + + * ew-dec.el (ew-decode-field-no-cache): Ditto. + 1998-08-19 Tanaka Akira * Makefile: Avoid an error about unexisting `scm'. diff --git a/Makefile b/Makefile index e93cd7f..beba984 100644 --- a/Makefile +++ b/Makefile @@ -51,4 +51,4 @@ release: ln -s ../flim/$(PACKAGE)-$(VERSION).tar.gz . ew-parse.el: ew-parse.scm lalr-el.scm - -scm -f lalr-el.scm -f ew-parse.scm > states.output + -scm -f lalr-el.scm -f ew-parse.scm > ew-parse.out diff --git a/ew-dec.el b/ew-dec.el index 46ac4b5..eebda02 100644 --- a/ew-dec.el +++ b/ew-dec.el @@ -49,7 +49,7 @@ instead of its argument." (defun ew-decode-field-no-cache (field-name field-body &optional eword-filter) "No caching version of ew-decode-field." - (let ((tmp (assoc (downcase field-name) ew-decode-field-syntax-alist)) + (let ((tmp (assq (intern (downcase field-name)) ew-decode-field-syntax-alist)) frag-anchor frag1 frag2 decode) (if tmp (setq tmp (cdr tmp)) diff --git a/ew-parse.el b/ew-parse.el index 4808417..b439926 100644 --- a/ew-parse.el +++ b/ew-parse.el @@ -26,34 +26,34 @@ (defconst ew:question 19) (defconst ew:equal 20) (defconst ew:token 21) -(defconst ew:us-texts 22) -(defconst ew:us-wsp 23) -(defconst ew:us-fold 24) -(defconst ew:wsp 25) -(defconst ew:fold 26) -(defconst ew:qs-begin 27) -(defconst ew:qs-end 28) -(defconst ew:qs-texts 29) -(defconst ew:qs-wsp 30) -(defconst ew:qs-fold 31) -(defconst ew:qs-qfold 32) -(defconst ew:qs-qpair 33) -(defconst ew:dl-begin 34) -(defconst ew:dl-end 35) -(defconst ew:dl-texts 36) -(defconst ew:dl-wsp 37) -(defconst ew:dl-fold 38) -(defconst ew:dl-qfold 39) -(defconst ew:dl-qpair 40) -(defconst ew:cm-begin 41) -(defconst ew:cm-end 42) -(defconst ew:cm-nested-begin 43) -(defconst ew:cm-nested-end 44) -(defconst ew:cm-texts 45) -(defconst ew:cm-wsp 46) -(defconst ew:cm-fold 47) -(defconst ew:cm-qfold 48) -(defconst ew:cm-qpair 49) +(defconst ew:qs-begin 22) +(defconst ew:qs-end 23) +(defconst ew:qs-texts 24) +(defconst ew:qs-wsp 25) +(defconst ew:qs-fold 26) +(defconst ew:qs-qfold 27) +(defconst ew:qs-qpair 28) +(defconst ew:dl-begin 29) +(defconst ew:dl-end 30) +(defconst ew:dl-texts 31) +(defconst ew:dl-wsp 32) +(defconst ew:dl-fold 33) +(defconst ew:dl-qfold 34) +(defconst ew:dl-qpair 35) +(defconst ew:cm-begin 36) +(defconst ew:cm-end 37) +(defconst ew:cm-nested-begin 38) +(defconst ew:cm-nested-end 39) +(defconst ew:cm-texts 40) +(defconst ew:cm-wsp 41) +(defconst ew:cm-fold 42) +(defconst ew:cm-qfold 43) +(defconst ew:cm-qpair 44) +(defconst ew:wsp 45) +(defconst ew:fold 46) +(defconst ew:us-texts 47) +(defconst ew:us-wsp 48) +(defconst ew:us-fold 49) (defconst ew:token-defs (list @@ -79,34 +79,34 @@ (cons 19 "question") (cons 20 "equal") (cons 21 "token") - (cons 22 "us-texts") - (cons 23 "us-wsp") - (cons 24 "us-fold") - (cons 25 "wsp") - (cons 26 "fold") - (cons 27 "qs-begin") - (cons 28 "qs-end") - (cons 29 "qs-texts") - (cons 30 "qs-wsp") - (cons 31 "qs-fold") - (cons 32 "qs-qfold") - (cons 33 "qs-qpair") - (cons 34 "dl-begin") - (cons 35 "dl-end") - (cons 36 "dl-texts") - (cons 37 "dl-wsp") - (cons 38 "dl-fold") - (cons 39 "dl-qfold") - (cons 40 "dl-qpair") - (cons 41 "cm-begin") - (cons 42 "cm-end") - (cons 43 "cm-nested-begin") - (cons 44 "cm-nested-end") - (cons 45 "cm-texts") - (cons 46 "cm-wsp") - (cons 47 "cm-fold") - (cons 48 "cm-qfold") - (cons 49 "cm-qpair") + (cons 22 "qs-begin") + (cons 23 "qs-end") + (cons 24 "qs-texts") + (cons 25 "qs-wsp") + (cons 26 "qs-fold") + (cons 27 "qs-qfold") + (cons 28 "qs-qpair") + (cons 29 "dl-begin") + (cons 30 "dl-end") + (cons 31 "dl-texts") + (cons 32 "dl-wsp") + (cons 33 "dl-fold") + (cons 34 "dl-qfold") + (cons 35 "dl-qpair") + (cons 36 "cm-begin") + (cons 37 "cm-end") + (cons 38 "cm-nested-begin") + (cons 39 "cm-nested-end") + (cons 40 "cm-texts") + (cons 41 "cm-wsp") + (cons 42 "cm-fold") + (cons 43 "cm-qfold") + (cons 44 "cm-qpair") + (cons 45 "wsp") + (cons 46 "fold") + (cons 47 "us-texts") + (cons 48 "us-wsp") + (cons 49 "us-fold") )) ; *** Action Table *** @@ -121,18 +121,18 @@ ((default . -61)) ((default . -61)) ((default . *error*) (0 . 16)) - ((default . -51) (17 . 21) (25 . 20) (26 . 19) (27 . 18) (41 . 17)) - ((default . -53) (17 . 21) (25 . 20) (26 . 19) (27 . 18) (41 . 17)) - ((default . *error*) (10 . 34) (17 . 21) (25 . 20) (26 . 19) (27 . 18) (41 . 17)) - ((default . -9) (10 . 34) (17 . 21) (25 . 20) (26 . 19) (27 . 18) (41 . 17)) - ((default . *error*) (10 . 34) (17 . 21) (25 . 20) (26 . 19) (27 . 18) (41 . 17)) - ((default . -30) (10 . 34) (17 . 21) (25 . 20) (26 . 19) (27 . 18) (41 . 17)) - ((default . *error*) (10 . 34) (17 . 21) (25 . 20) (26 . 19) (27 . 18) (41 . 17)) + ((default . -51) (17 . 21) (22 . 20) (36 . 19) (45 . 18) (46 . 17)) + ((default . -53) (17 . 21) (22 . 20) (36 . 19) (45 . 18) (46 . 17)) + ((default . *error*) (10 . 34) (17 . 21) (22 . 20) (36 . 19) (45 . 18) (46 . 17)) + ((default . -9) (10 . 34) (17 . 21) (22 . 20) (36 . 19) (45 . 18) (46 . 17)) + ((default . *error*) (10 . 34) (17 . 21) (22 . 20) (36 . 19) (45 . 18) (46 . 17)) + ((default . -30) (10 . 34) (17 . 21) (22 . 20) (36 . 19) (45 . 18) (46 . 17)) + ((default . *error*) (10 . 34) (17 . 21) (22 . 20) (36 . 19) (45 . 18) (46 . 17)) ((default . -1) (0 . accept)) - ((default . -90)) - ((default . -76)) ((default . -63)) ((default . -62)) + ((default . -90)) + ((default . -76)) ((default . -61)) ((default . -64)) ((default . -61)) @@ -141,7 +141,7 @@ ((default . -8) (10 . 34)) ((default . -57)) ((default . -37)) - ((default . -36) (17 . 21) (27 . 18)) + ((default . -36) (17 . 21) (22 . 20)) ((default . -52)) ((default . -54) (13 . 60)) ((default . -7)) @@ -165,29 +165,29 @@ ((default . -31) (13 . 60)) ((default . -3)) ((default . -2)) - ((default . *error*) (42 . 83) (43 . 82) (44 . 81) (45 . 80) (46 . 79) (47 . 78) (48 . 77) (49 . 76)) - ((default . *error*) (28 . 89) (29 . 88) (30 . 87) (31 . 86) (32 . 85) (33 . 84)) - ((default . -74) (25 . 20) (26 . 19) (41 . 17)) - ((default . -72) (25 . 20) (26 . 19) (41 . 17)) - ((default . *error*) (17 . 21) (27 . 18)) - ((default . -51) (17 . 21) (27 . 18)) + ((default . *error*) (37 . 83) (38 . 82) (39 . 81) (40 . 80) (41 . 79) (42 . 78) (43 . 77) (44 . 76)) + ((default . *error*) (23 . 89) (24 . 88) (25 . 87) (26 . 86) (27 . 85) (28 . 84)) + ((default . -74) (36 . 19) (45 . 18) (46 . 17)) + ((default . -72) (36 . 19) (45 . 18) (46 . 17)) + ((default . *error*) (17 . 21) (22 . 20)) + ((default . -51) (17 . 21) (22 . 20)) ((default . -38)) ((default . -61)) - ((default . *error*) (17 . 21) (27 . 18)) - ((default . -65) (25 . 20) (26 . 19) (41 . 17)) + ((default . *error*) (17 . 21) (22 . 20)) + ((default . -65) (36 . 19) (45 . 18) (46 . 17)) ((default . -61)) - ((default . *error*) (17 . 21) (34 . 96)) - ((default . *error*) (17 . 21) (27 . 18)) + ((default . *error*) (17 . 21) (29 . 96)) + ((default . *error*) (17 . 21) (22 . 20)) ((default . *error*) (13 . 60) (15 . 68)) ((default . -44)) ((default . -61)) - ((default . -30) (10 . 34) (17 . 21) (27 . 18)) + ((default . -30) (10 . 34) (17 . 21) (22 . 20)) ((default . -28)) ((default . -61)) - ((default . *error*) (17 . 21) (27 . 18)) - ((default . *error*) (17 . 21) (34 . 96)) - ((default . *error*) (10 . 34) (17 . 21) (27 . 18)) - ((default . *error*) (10 . 34) (17 . 21) (27 . 18)) + ((default . *error*) (17 . 21) (22 . 20)) + ((default . *error*) (17 . 21) (29 . 96)) + ((default . *error*) (10 . 34) (17 . 21) (22 . 20)) + ((default . *error*) (10 . 34) (17 . 21) (22 . 20)) ((default . -97)) ((default . -96)) ((default . -95)) @@ -205,9 +205,9 @@ ((default . -25)) ((default . *error*) (11 . 113)) ((default . -58)) - ((default . -68) (25 . 20) (26 . 19) (41 . 17)) + ((default . -68) (36 . 19) (45 . 18) (46 . 17)) ((default . -56)) - ((default . -67) (25 . 20) (26 . 19) (41 . 17)) + ((default . -67) (36 . 19) (45 . 18) (46 . 17)) ((default . -83)) ((default . -61)) ((default . -21)) @@ -218,23 +218,23 @@ ((default . *error*) (11 . 113)) ((default . -39)) ((default . *error*) (12 . 63)) - ((default . -70) (25 . 20) (26 . 19) (41 . 17)) + ((default . -70) (36 . 19) (45 . 18) (46 . 17)) ((default . *error*) (14 . 120)) - ((default . -71) (25 . 20) (26 . 19) (41 . 17)) + ((default . -71) (36 . 19) (45 . 18) (46 . 17)) ((default . -26)) ((default . -15) (16 . 71)) ((default . -12)) ((default . -33)) ((default . -61)) ((default . -35)) - ((default . *error*) (35 . 128) (36 . 127) (37 . 126) (38 . 125) (39 . 124) (40 . 123)) - ((default . -73) (25 . 20) (26 . 19) (41 . 17)) - ((default . *error*) (17 . 21) (34 . 96)) + ((default . *error*) (30 . 128) (31 . 127) (32 . 126) (33 . 125) (34 . 124) (35 . 123)) + ((default . -73) (36 . 19) (45 . 18) (46 . 17)) + ((default . *error*) (17 . 21) (29 . 96)) ((default . -42)) - ((default . *error*) (17 . 21) (34 . 96)) + ((default . *error*) (17 . 21) (29 . 96)) ((default . -61)) ((default . -22)) - ((default . -66) (25 . 20) (26 . 19) (41 . 17)) + ((default . -66) (36 . 19) (45 . 18) (46 . 17)) ((default . -88)) ((default . -87)) ((default . -86)) @@ -243,7 +243,7 @@ ((default . -82)) ((default . -20)) ((default . -41) (16 . 71)) - ((default . -69) (25 . 20) (26 . 19) (41 . 17)) + ((default . -69) (36 . 19) (45 . 18) (46 . 17)) ]) ; *** Goto Table *** @@ -266,10 +266,10 @@ ((48 . 22)(44 . 23)(43 . 24)(41 . 25)(34 . 35)(26 . 36)(22 . 37)(19 . 29)(18 . 47)(15 . 50)(14 . 51)(13 . 49)(12 . 40)(5 . 42)) ((48 . 22)(44 . 23)(43 . 24)(41 . 25)(34 . 35)(26 . 36)(22 . 37)(19 . 29)(18 . 47)(13 . 52)(12 . 40)(5 . 42)) () - ((49 . 53)) - ((45 . 54)) () () + ((49 . 53)) + ((45 . 54)) ((33 . 55)) () ((33 . 56)) diff --git a/ew-parse.scm b/ew-parse.scm index d5e9d2c..ddb0074 100644 --- a/ew-parse.scm +++ b/ew-parse.scm @@ -1,4 +1,4 @@ -(define message-grammar +(define field-grammar '( ; Terminal symbols *anchor* @@ -12,53 +12,57 @@ tag-address+ tag-phrase* tag-phrase-msg-id* -lt -gt -at -comma -semicolon -colon +;; S : STD11 structured field +;; M : MIME structured field +;; U : Unstructured field -dot ; for STD11 -atom ; for STD11 +lt ; S/M +gt ; S/M +at ; S/M +comma ; S/M +semicolon ; S/M +colon ; S/M -slash ; for MIME -question ; for MIME -equal ; for MIME -token ; for MIME +dot ; S +atom ; S -us-texts ; for UNSTRUCTURED -us-wsp ; for UNSTRUCTURED -us-fold ; for UNSTRUCTURED +slash ; M +question ; M +equal ; M +token ; M -wsp -fold +qs-begin ; S/M +qs-end ; S/M +qs-texts ; S/M +qs-wsp ; S/M +qs-fold ; S/M +qs-qfold ; S/M +qs-qpair ; S/M -qs-begin -qs-end -qs-texts -qs-wsp -qs-fold -qs-qfold -qs-qpair +dl-begin ; S/M +dl-end ; S/M +dl-texts ; S/M +dl-wsp ; S/M +dl-fold ; S/M +dl-qfold ; S/M +dl-qpair ; S/M -dl-begin -dl-end -dl-texts -dl-wsp -dl-fold -dl-qfold -dl-qpair +cm-begin ; S/M +cm-end ; S/M +cm-nested-begin ; S/M +cm-nested-end ; S/M +cm-texts ; S/M +cm-wsp ; S/M +cm-fold ; S/M +cm-qfold ; S/M +cm-qpair ; S/M -cm-begin -cm-end -cm-nested-begin -cm-nested-end -cm-texts -cm-wsp -cm-fold -cm-qfold -cm-qpair +wsp ; S/M +fold ; S/M + +us-texts ; U +us-wsp ; U +us-fold ; U ; Productions (start (tag-mailbox gap mailbox) : () @@ -160,7 +164,7 @@ cm-qpair )) -(gen-lalr1 message-grammar "ew-parse.el" +(gen-lalr1 field-grammar "ew-parse.el" "(provide 'ew-parse) (require 'ew-data) " diff --git a/ew-var.el b/ew-var.el index 5ffa73e..1d64cc7 100644 --- a/ew-var.el +++ b/ew-var.el @@ -17,35 +17,37 @@ ;;; (defvar ew-decode-field-syntax-alist -'(("from" ew-scan-unibyte-std11 . ew:tag-mailbox+) - ("sender" ew-scan-unibyte-std11 . ew:tag-mailbox) - ("to" ew-scan-unibyte-std11 . ew:tag-address+) - ("resent-to" ew-scan-unibyte-std11 . ew:tag-address+) - ("cc" ew-scan-unibyte-std11 . ew:tag-address+) - ("resent-cc" ew-scan-unibyte-std11 . ew:tag-address+) - ("bcc" ew-scan-unibyte-std11 . ew:tag-address*) - ("resent-bcc" ew-scan-unibyte-std11 . ew:tag-address*) - ("message-id" ew-scan-unibyte-std11) - ("resent-message-id" ew-scan-unibyte-std11) - ("in-reply-to" ew-scan-unibyte-std11 . ew:tag-phrase-msg-id*) - ("references" ew-scan-unibyte-std11 . ew:tag-phrase-msg-id*) - ("keywords" ew-scan-unibyte-std11 . ew:tag-phrase*) - ("subject" ew-scan-unibyte-unstructured) - ("comments" ew-scan-unibyte-unstructured) - ("encrypted" ew-scan-unibyte-std11) - ("date" ew-scan-unibyte-std11) - ("reply-to" ew-scan-unibyte-std11 . ew:tag-address+) - ("received" ew-scan-unibyte-std11) - ("resent-reply-to" ew-scan-unibyte-std11 . ew:tag-address+) - ("resent-from" ew-scan-unibyte-std11 . ew:tag-mailbox+) - ("resent-sender" ew-scan-unibyte-std11 . ew:tag-mailbox) - ("resent-date" ew-scan-unibyte-std11) - ("return-path" ew-scan-unibyte-std11) - ("mime-version" ew-scan-unibyte-std11) - ("content-type" ew-scan-unibyte-mime) - ("content-transfer-encoding" ew-scan-unibyte-mime) - ("content-id" ew-scan-unibyte-mime) - ("content-description" ew-scan-unibyte-unstructured) +'((from ew-scan-unibyte-std11 . ew:tag-mailbox+) + (sender ew-scan-unibyte-std11 . ew:tag-mailbox) + (to ew-scan-unibyte-std11 . ew:tag-address+) + (resent-to ew-scan-unibyte-std11 . ew:tag-address+) + (cc ew-scan-unibyte-std11 . ew:tag-address+) + (resent-cc ew-scan-unibyte-std11 . ew:tag-address+) + (bcc ew-scan-unibyte-std11 . ew:tag-address*) + (resent-bcc ew-scan-unibyte-std11 . ew:tag-address*) + (message-id ew-scan-unibyte-std11) + (resent-message-id ew-scan-unibyte-std11) + (in-reply-to ew-scan-unibyte-std11 . ew:tag-phrase-msg-id*) + (references ew-scan-unibyte-std11 . ew:tag-phrase-msg-id*) + (keywords ew-scan-unibyte-std11 . ew:tag-phrase*) + (subject ew-scan-unibyte-unstructured) + (comments ew-scan-unibyte-unstructured) + (encrypted ew-scan-unibyte-std11) + (date ew-scan-unibyte-std11) + (reply-to ew-scan-unibyte-std11 . ew:tag-address+) + (received ew-scan-unibyte-std11) + (resent-reply-to ew-scan-unibyte-std11 . ew:tag-address+) + (resent-from ew-scan-unibyte-std11 . ew:tag-mailbox+) + (resent-sender ew-scan-unibyte-std11 . ew:tag-mailbox) + (resent-date ew-scan-unibyte-std11) + (return-path ew-scan-unibyte-std11) + (mime-version ew-scan-unibyte-std11) + (content-type ew-scan-unibyte-mime) + (content-transfer-encoding ew-scan-unibyte-mime) + (content-id ew-scan-unibyte-std11) + (content-description ew-scan-unibyte-unstructured) + (content-disposition ew-scan-unibyte-mime) + (approved ew-scan-unibyte-std11 . ew:tag-address+) )) (defvar ew-decode-field-default-syntax '(ew-scan-unibyte-unstructured))