Delete mmgeneric.el.
[elisp/flim.git] / ew-parse.scm
1 (define field-grammar
2 '(
3 ; Terminal symbols
4 *anchor*
5 *err*
6
7 tag-mailbox
8 tag-mailbox*
9 tag-mailbox+
10 tag-address*
11 tag-address+
12 tag-phrase*
13 tag-phrase-msg-id*
14
15 ;; S : STD11 structured field
16 ;; M : MIME structured field
17 ;; U : Unstructured field
18 ;; N : Non-scanning field
19
20 lt              ; S/M
21 gt              ; S/M
22 at              ; S/M
23 comma           ; S/M
24 semicolon       ; S/M
25 colon           ; S/M
26
27 dot             ; S
28 atom            ; S
29
30 slash           ; M
31 question        ; M
32 equal           ; M
33 token           ; M
34
35 qs-begin        ; S/M
36 qs-end          ; S/M
37 qs-texts        ; S/M
38 qs-wsp          ; S/M
39 qs-fold         ; S/M
40 qs-qfold        ; S/M
41 qs-qpair        ; S/M
42
43 dl-begin        ; S/M
44 dl-end          ; S/M
45 dl-texts        ; S/M
46 dl-wsp          ; S/M
47 dl-fold         ; S/M
48 dl-qfold        ; S/M
49 dl-qpair        ; S/M
50
51 cm-begin        ; S/M
52 cm-end          ; S/M
53 cm-nested-begin ; S/M
54 cm-nested-end   ; S/M
55 cm-texts        ; S/M
56 cm-wsp          ; S/M
57 cm-fold         ; S/M
58 cm-qfold        ; S/M
59 cm-qpair        ; S/M
60
61 wsp             ; S/M
62 fold            ; S/M
63
64 us-texts        ; U
65 us-wsp          ; U
66 us-fold         ; U
67
68 n-body          ; N
69
70 ; Productions
71 (start (tag-mailbox gap mailbox)                  : ()
72   (tag-mailbox* gap mailbox*)                     : ()
73   (tag-mailbox+ gap mailbox+)                     : ()
74   (tag-address* gap address*)                     : ()
75   (tag-address+ gap address+)                     : ()
76   (tag-phrase* gap phrase*)                       : ()
77   (tag-phrase-msg-id* gap phrase-msg-id*)         : ())
78 (address* ()                                      : ()
79   (address+)                                      : ())
80 (address+ (address)                               : ()
81   (address+ comma-gap address)                    : ())
82 (address (mailbox)                                : ()
83   (group)                                         : ())
84 (addr-spec (local-part at-gap domain)             : ())
85 (date (atom-gap atom-gap atom-gap)                : ())
86 (date-time (atom-gap comma-gap date time)         : ()
87   (date time)                                     : ())
88 (domain (sub-domain)                              : ()
89   (domain dot-gap sub-domain)                     : ())
90 (domain-ref (atom-gap)                            : ())
91 (group (phrase colon-gap mailbox* semicolon-gap)  : ())
92 (hour (atom-gap colon-gap atom-gap)               : ()
93   (atom-gap colon-gap atom-gap colon-gap atom-gap): ())
94 (local-part (word)                                : ()
95   (local-part dot-gap word)                       : ())
96 (mailbox (addr-spec)                              : ()
97   (phrase route-addr)                             : ()
98   (route-addr)                                    : ())
99 (mailbox* ()                                      : ()
100   (mailbox+)                                      : ())
101 (mailbox+ (mailbox)                               : ()
102   (mailbox+ comma-gap mailbox)                    : ())
103 (month (atom-gap)                                 : ())
104 (msg-id (lt-gap addr-spec gt-gap)                 : ())
105 (phrase (phrase-c)                                : (ew-mark-phrase $1 $look))
106 (phrase-c (word)                                  : $1
107   (phrase-c word)                                 : $1)
108 (route (at-domain+ colon-gap)                     : ())
109 (at-domain+ (at-gap domain)                       : ()
110   (at-domain+ comma-gap at-gap domain)            : ())
111 (route-addr (lt-gap route/ addr-spec gt-gap)      : ())
112 (route/ ()                                        : ()
113   (route)                                         : ())
114 (sub-domain (domain-ref)                          : ()
115   (domain-literal-gap)                            : ())
116 (time (hour zone)                                 : ())
117 (word (atom-gap)                                  : $1
118   (quoted-string-gap)                             : $1)
119 (zone (atom-gap)                                  : ())
120 (phrase/ ()                                       : ()
121   (phrase)                                        : ())
122 (phrase* ()                                       : ()
123   (phrase+)                                       : ())
124 (phrase+ (phrase)                                 : ()
125   (phrase+ comma-gap phrase)                      : ())
126 (phrase-msg-id* (phrase/)                         : ()
127   (phrase-msg-id* msg-id phrase/)                 : ())
128 (word1or2 (word)                                  : ()
129   (word comma-gap word)                           : ())
130 (gap ()                                           : ()
131   (gap wsp)                                       : ()
132   (gap fold)                                      : ()
133   (gap comment)                                   : ())
134 (lt-gap (lt gap)                                  : ())
135 (gt-gap (gt gap)                                  : ())
136 (at-gap (at gap)                                  : ())
137 (comma-gap (comma gap)                            : ())
138 (semicolon-gap (semicolon gap)                    : ())
139 (colon-gap (colon gap)                            : ())
140 (dot-gap (dot gap)                                : ())
141 (quoted-string-gap (quoted-string gap)            : $1)
142 (domain-literal-gap (domain-literal gap)          : ())
143 (atom-gap (atom gap)                              : $1)
144 (quoted-string (qs-begin qs qs-end)               : $1)
145 (qs ()                                            : ()
146   (qs qs-texts)                                   : ()
147   (qs qs-wsp)                                     : ()
148   (qs qs-fold)                                    : ()
149   (qs qs-qfold)                                   : ()
150   (qs qs-qpair)                                   : ())
151 (domain-literal (dl-begin dl dl-end)              : ())
152 (dl ()                                            : ()
153   (dl dl-texts)                                   : ()
154   (dl dl-wsp)                                     : ()
155   (dl dl-fold)                                    : ()
156   (dl dl-qfold)                                   : ()
157   (dl dl-qpair)                                   : ())
158 (comment (cm-begin cm cm-end)                     : ())
159 (cm ()                                            : ()
160   (cm cm-nested-begin)                            : ()
161   (cm cm-nested-end)                              : ()
162   (cm cm-texts)                                   : ()
163   (cm cm-wsp)                                     : ()
164   (cm cm-fold)                                    : ()
165   (cm cm-qfold)                                   : ()
166   (cm cm-qpair)                                   : ())
167
168 ))
169
170 (gen-lalr1 field-grammar "ew-parse.el"
171 "(provide 'ew-parse)
172 (require 'ew-data)
173 "
174 "(put 'ew:cm-texts 'decode 'ew-decode-comment)
175 (put 'ew:cm-wsp 'decode 'ew-decode-comment)
176 (put 'ew:cm-fold 'decode 'ew-decode-comment)
177 (put 'ew:cm-qfold 'decode 'ew-decode-comment)
178 (put 'ew:cm-qpair 'decode 'ew-decode-comment)
179 (put 'ew:us-texts 'decode 'ew-decode-unstructured)
180 (put 'ew:us-wsp 'decode 'ew-decode-unstructured)
181 (put 'ew:us-fold 'decode 'ew-decode-unstructured)
182 "
183 'ew)
184
185 (print-states)