Annotation of Amaya/amaya/HTMLTT.T, revision 1.22
1.15 cvs 1: {HTMLTT -> HTML to Text translator rules}
2: {(c) COPYRIGHT MIT and INRIA, 1996. }
3: {Please first read the full copyright statement in file COPYRIGHT.}
4: { Authors: J. Kahan/V. Quint 1996 }
5:
1.1 cvs 6: TRANSLATION HTML;
7:
8: LINELENGTH 78;
9:
10: COUNTERS
11: ItemCounter : Rank of List_Item;
1.12 cvs 12: AnchorCounter;
1.5 cvs 13:
1.3 cvs 14: CONST
1.5 cvs 15: DoubleQuote = '"';
1.10 cvs 16: DashLine = '--------------------------------------------------------------';
1.3 cvs 17: VAR
1.12 cvs 18: OUT_AnchorCounter : '[' Value(AnchorCounter) ']';
1.14 cvs 19: TmpFile : '/tmp/amaya.tmp';
1.1 cvs 20:
21: RULES
22:
23: HTML : BEGIN
1.5 cvs 24: Create '\12' After;
1.1 cvs 25: END;
26:
27: HEAD: BEGIN
1.15 cvs 28: Create In TmpFile '\12' After;
1.1 cvs 29: END;
30:
31: Document_URL:
32: BEGIN
1.15 cvs 33: NoLineBreak;
34: Create In TmpFile 'Document''s URL: ';
1.8 cvs 35: Create In TmpFile Content;
1.5 cvs 36: Create In TmpFile '\12' After;
37: Remove;
1.1 cvs 38: END;
39:
40: TITLE: BEGIN
1.15 cvs 41: Create 'Document''s Title: ';
42: Create '\12\12' After;
1.1 cvs 43: END;
44:
45: ISINDEX: BEGIN
46: Remove;
47: END;
48:
49: BASE: BEGIN
1.15 cvs 50: NoLineBreak;
1.16 cvs 51: Create IN TmpFile 'Document''s BASE: ';
52: Create Attributes;
53: Create IN TmpFile '\12' After;
1.1 cvs 54: END;
55:
56: Styles:BEGIN
1.7 cvs 57: Remove;
1.1 cvs 58: END;
59:
60: StyleRule:
61: BEGIN
1.7 cvs 62: Remove;
1.1 cvs 63: END;
64:
65: SCRIPT: BEGIN
1.7 cvs 66: Remove;
1.1 cvs 67: END;
68:
69: META: BEGIN
70: Remove;
71: END;
72:
73: LINK: BEGIN
74: Remove;
75: END;
76:
1.5 cvs 77:
1.1 cvs 78: BODY: BEGIN
1.12 cvs 79: Set AnchorCounter 0;
1.8 cvs 80: Indent +4;
81: Indent -4 After;
1.10 cvs 82: { --- print the List of References ---}
1.3 cvs 83: Create '\12\12' After;
1.10 cvs 84: Create (DashLine) After;
85: Create '\12' After;
1.5 cvs 86: Create 'List of References\12\12' After;
1.11 cvs 87: Include '/tmp/amaya.tmp' After;
1.14 cvs 88: RemoveFile TmpFile After;
1.1 cvs 89: END;
90:
91: H1: BEGIN
1.8 cvs 92: Indent -4;
93: Indent +4 After;
1.15 cvs 94: Create '\12\12' After;
1.1 cvs 95: END;
96:
97: H2: BEGIN
1.8 cvs 98: Indent -2;
99: Indent +2 After;
1.15 cvs 100: Create '\12\12' After;
1.1 cvs 101: END;
102:
103: H3: BEGIN
1.15 cvs 104: Create '\12\12' After;
1.1 cvs 105: END;
106:
107: H4: BEGIN
1.8 cvs 108: Indent +2;
109: Indent -2 After;
1.15 cvs 110: Create '\12\12' After;
1.1 cvs 111: END;
112:
113: H5: BEGIN
1.8 cvs 114: Indent +4;
115: Indent -4 After;
1.15 cvs 116: Create '\12\12' After;
1.1 cvs 117: END;
118:
119: H6: BEGIN
1.8 cvs 120: Indent +6;
121: Indent -6 After;
1.15 cvs 122: Create '\12\12' After;
1.1 cvs 123: END;
124:
125: BaseFont:
126: BEGIN
127: Remove;
128: END;
129:
130: BR: BEGIN
1.13 cvs 131: If Within 1 BR
132: Remove;
133: If Last
134: Remove;
1.16 cvs 135: END;
1.5 cvs 136:
1.1 cvs 137: Italic_text:
138: BEGIN
139: END;
140: Bold_text:
141: BEGIN
142: END;
143: Teletype_text:
144: BEGIN
145: END;
146: Underlined_text:
147: BEGIN
148: END;
149: Struck_text:
150: BEGIN
151: END;
152: Big_text:
153: BEGIN
154: END;
155: Small_text:
156: BEGIN
157: END;
158: Subscript:
159: BEGIN
160: END;
161: Superscript:
162: BEGIN
163: END;
164:
165: Emphasis:
166: BEGIN
167: END;
168: Strong:
169: BEGIN
170: END;
171: Def:
172: BEGIN
173: END;
174: Code:
175: BEGIN
176: END;
177: Sample:
178: BEGIN
179: END;
180: Keyboard:
181: BEGIN
182: END;
183: Variable:
184: BEGIN
185: END;
186: Cite:
187: BEGIN
1.5 cvs 188: Create DoubleQuote;
1.16 cvs 189: Create DoubleQuote After;
1.1 cvs 190: END;
191:
192: Font_: BEGIN
193: END;
194:
195: Applet: BEGIN
1.5 cvs 196: Create Attributes;
197: Remove;
1.1 cvs 198: END;
199:
200: Parameter: BEGIN
201: Remove;
202: END;
203:
204: #ifdef COUGAR
1.5 cvs 205: Object: BEGIN
206: Create Attributes;
207: Remove;
1.1 cvs 208: END;
209: #endif
1.21 cvs 210: #ifdef MATHML
211: Math: BEGIN
1.22 ! cvs 212: Create '[math]';
1.21 cvs 213: Remove;
214: END;
215: MathDisp: BEGIN
1.22 ! cvs 216: Create '\12[math]\12';
1.21 cvs 217: Remove;
218: END;
219: #endif
1.10 cvs 220: Paragraph:
221: BEGIN
1.15 cvs 222: Create '\12\12' After;
1.1 cvs 223: END;
224:
1.10 cvs 225: Pseudo_paragraph:
226: BEGIN
1.19 cvs 227: Create '\12' After;
228: if not within List_Item
229: Create '\12' After;
1.16 cvs 230: END;
1.1 cvs 231:
232: TEXT_UNIT: BEGIN
233: IF Within Text_Area
234: Remove;
235: IF Within Text_Input
236: Remove;
1.16 cvs 237: IF Within HEAD and not Within TITLE
238: Remove;
239: IF Within STYLE
240: Remove;
1.1 cvs 241: END;
242:
243: Definition_List: BEGIN
244: END;
245:
246: Term: BEGIN
1.13 cvs 247: Create '\12' After;
1.1 cvs 248: END;
249:
250: Definition: BEGIN
251: Indent +5;
252: Indent -5 After;
253: END;
254:
255: Unnumbered_List: BEGIN
1.7 cvs 256: Indent +3;
1.5 cvs 257: Indent -3 After;
1.1 cvs 258: END;
259:
260: Numbered_List: BEGIN
1.7 cvs 261: Indent +3;
1.5 cvs 262: Indent -3 After;
1.1 cvs 263: END;
264:
265: Address: BEGIN
1.5 cvs 266: Create Attributes;
1.15 cvs 267: Create '\12\12' After;
1.1 cvs 268: END;
269:
270: Menu: BEGIN
1.7 cvs 271: Indent +3;
272: Indent -3 After;
1.1 cvs 273: END;
274:
275: Directory: BEGIN
1.7 cvs 276: Indent +3;
277: Indent -3 After;
1.1 cvs 278: END;
279:
280: List_Item: BEGIN
281: Create Attributes;
282: Indent +3;
1.7 cvs 283: Indent -3 after;
1.1 cvs 284: END;
285:
286: Preformatted: BEGIN
287: NoLineBreak;
1.5 cvs 288: Create Attributes;
1.15 cvs 289: Create '\12\12' After;
1.1 cvs 290: END;
291:
292: Horizontal_Rule: BEGIN
1.10 cvs 293: Create (DashLine) After;
1.15 cvs 294: Create '\12\12' After;
1.5 cvs 295: Remove;
1.1 cvs 296: END;
297:
298: Form: BEGIN
299: END;
300:
301: Option_Menu: BEGIN
302: END;
303:
304: Option: BEGIN
1.15 cvs 305: If Selected = Yes_
306: Create Content;
1.6 cvs 307: Remove;
1.1 cvs 308: END;
309:
310: Toggle_Menu: BEGIN
311: END;
312:
313: Toggle_Item: BEGIN
1.16 cvs 314: If NOT Selected
315: Remove;
1.15 cvs 316: Create Content;
317: Remove;
1.1 cvs 318: END;
319:
320: Radio_Menu: BEGIN
321: END;
322:
323: Radio_Item: BEGIN
1.15 cvs 324: If NOT Selected
1.16 cvs 325: Remove;
326: Create Content;
327: Remove;
1.1 cvs 328: END;
329:
330: Text_Input_Line: BEGIN
1.16 cvs 331: If Empty
1.10 cvs 332: Remove;
1.1 cvs 333: END;
334:
335: Command_Line: BEGIN
336: END;
337:
338: Text_Area: BEGIN
1.10 cvs 339: Create Content;
1.6 cvs 340: Remove;
1.1 cvs 341: END;
342:
343: Checkbox_Input: BEGIN
1.10 cvs 344: If Checked = Yes_
345: Create '[x] ';
346: If Checked = No_
1.16 cvs 347: Create '[ ] ';
1.1 cvs 348: END;
349:
350: Radio_Input: BEGIN
1.15 cvs 351: If Checked = Yes_
352: Create '(x)';
353: If Checked = No_
1.16 cvs 354: Create '( )';
1.1 cvs 355: Remove;
356: END;
357:
358: Text_Input: BEGIN
1.10 cvs 359: Create Content;
1.1 cvs 360: Remove;
361: END;
362:
363: Hidden_Input: BEGIN
364: Remove;
365: END;
366:
367: Password_Input: BEGIN
368: Remove;
369: END;
370:
371: File_Input: BEGIN
1.10 cvs 372: Create Content;
1.1 cvs 373: Remove;
374: END;
375:
376: Reset_Input: BEGIN
1.15 cvs 377: Create '<<';
1.10 cvs 378: Create Value_;
1.15 cvs 379: Create '>>';
1.10 cvs 380: If Last
381: Create '\12';
1.1 cvs 382: Remove;
383: END;
384:
385: Submit_Input: BEGIN
1.15 cvs 386: Create '<<';
1.10 cvs 387: Create Value_;
1.15 cvs 388: Create '>>';
1.10 cvs 389: If Last
390: Create '\12';
1.5 cvs 391: Remove;
1.10 cvs 392:
1.1 cvs 393: END;
394:
395: Block_Quote: BEGIN
1.3 cvs 396: Indent +5;
397: Indent -5 After;
1.1 cvs 398: END;
399:
400: PICTURE_UNIT: BEGIN
401: #ifdef COUGAR
1.10 cvs 402: If Immediately within Object
1.1 cvs 403: Remove;
1.10 cvs 404: If NOT Immediately within Object BEGIN
1.5 cvs 405: Create Attributes;
406: END;
1.1 cvs 407: #else
408: Create Attributes;
409: #endif
1.10 cvs 410: If NOT ALT
1.8 cvs 411: Create '[Image]';
1.1 cvs 412: END;
413:
1.8 cvs 414:
1.1 cvs 415: Anchor: BEGIN
1.10 cvs 416: If HREF_ AND NOT InternalLink
1.8 cvs 417: BEGIN
1.12 cvs 418: Add AnchorCounter 1;
1.8 cvs 419: Create In TmpFile OUT_AnchorCounter;
1.15 cvs 420: Create In TmpFile ' ';
1.8 cvs 421: Create Attributes;
422: Create IN TmpFile '\12' After;
1.5 cvs 423: #ifdef ANCHOR_PREFIX
1.8 cvs 424: Create OUT_AnchorCounter;
1.10 cvs 425: Create Content;
426: Remove;
1.5 cvs 427: #else
1.8 cvs 428: Create OUT_AnchorCounter After;
1.5 cvs 429: #endif
1.16 cvs 430: END;
1.1 cvs 431: END;
432:
433: MAP:
434: BEGIN
1.3 cvs 435: Remove;
1.1 cvs 436: END;
437:
438: AREA:
439: BEGIN
440: Remove;
441: END;
442:
443: { ---- Tables ---- }
444:
445: Table:
446: BEGIN
1.5 cvs 447: Indent +3;
1.1 cvs 448: Create Attributes;
1.5 cvs 449: Indent -3 After;
1.1 cvs 450: END;
451:
452: CAPTION:
453: BEGIN
1.5 cvs 454: Indent -3;
455: Indent +3 After;
1.1 cvs 456: END;
457:
458: Table_head:
459: Remove;
460:
461: #ifdef COUGAR
462: thead:
463: BEGIN
464: END;
465:
466: tfoot:
467: BEGIN
468: END;
469: tbody:
470: BEGIN
471: END;
472: #endif
473:
474: Table_body:
1.16 cvs 475: BEGIN
476: END;
1.1 cvs 477:
478: Table_row:
1.10 cvs 479: If Empty
480: Remove;
1.1 cvs 481:
482: Data_cell:
1.10 cvs 483: If Empty
484: Remove;
1.1 cvs 485:
486: Heading_cell:
1.10 cvs 487: If Empty
488: Remove;
1.13 cvs 489:
490: Table_cell_ghost:
491: Remove;
1.1 cvs 492:
493: Table_foot:
1.16 cvs 494: Remove;
1.1 cvs 495:
1.10 cvs 496: Division:
497: If Empty
498: Remove;
1.1 cvs 499:
1.10 cvs 500: Center:
501: If Empty
502: Remove;
1.1 cvs 503:
504: Invalid_element:
1.10 cvs 505: If Error_type = BadPosition
1.5 cvs 506: Remove;
1.1 cvs 507:
508: Comment\240: BEGIN
1.4 cvs 509: Remove;
1.1 cvs 510: END;
511:
512: Comment_line: BEGIN
1.4 cvs 513: Remove;
1.1 cvs 514: END;
515:
516: ATTRIBUTES
517:
518: http_equiv: BEGIN
1.7 cvs 519: Remove;
1.1 cvs 520: END;
521:
522: meta_name: BEGIN
1.7 cvs 523: Remove;
1.1 cvs 524: END;
525:
526: meta_content: BEGIN
1.7 cvs 527: Remove;
1.1 cvs 528: END;
529:
530: REL: BEGIN
1.7 cvs 531: Remove;
1.1 cvs 532: END;
533:
534: REV: BEGIN
1.7 cvs 535: Remove;
1.1 cvs 536: END;
537:
538: HREF_ :
539: BEGIN
1.8 cvs 540: If NOT Within LINK AND NOT InternalLink
1.16 cvs 541: Create IN TmpFile HREF_;
1.1 cvs 542: END;
543:
544: background_ :
545: BEGIN
546: END;
547:
548: BackgroundColor :
549: BEGIN
550: END;
551:
552: TextColor :
553: BEGIN
554: END;
555:
556: LinkColor :
557: BEGIN
558: END;
559:
560: VisitedLinkColor :
561: BEGIN
562: END;
563:
564: ActiveLinkColor :
565: BEGIN
566: END;
567:
568: BaseFontSize:
569: BEGIN
570: END;
571:
572: Font_size :
1.5 cvs 573: BEGIN
1.1 cvs 574: END;
575:
576: color :
577: BEGIN
578: END;
579:
580: Clear = Left_:
581: BEGIN
582: END;
583:
1.7 cvs 584: Clear = Right_:
1.1 cvs 585: BEGIN
586: END;
587: Clear = All_:
588: BEGIN
589: END;
590: Clear = None:
591: BEGIN
592: END;
593:
594: Align = left_:
595: BEGIN
596: END;
597: Align = center_:
598: BEGIN
599: END;
600: Align = right_:
601: BEGIN
602: END;
603:
604: NoShade:
1.5 cvs 605: BEGIN
1.1 cvs 606: END;
607:
608: Size_: BEGIN
609: END;
610:
611: Width__: BEGIN
612: END;
613:
614: codebase: BEGIN
615: END;
616:
617: code: BEGIN
618: END;
619:
620: applet_name: BEGIN
621: END;
622:
623: Param_name: BEGIN
624: END;
625:
626: Param_value: BEGIN
627: END;
628: #ifdef COUGAR
629: classid: BEGIN
630: END;
631:
632: data: BEGIN
633: END;
634:
635: Object_type: BEGIN
636: END;
637:
638: codetype: BEGIN
639: END;
640: #endif
641: Title : BEGIN
642: NoTranslation;
643: END;
644:
645: Class: BEGIN
1.15 cvs 646: If Empty
647: Remove;
1.1 cvs 648: END;
649:
650: Style\240: BEGIN
651: END;
652:
653: COMPACT: BEGIN
654: END;
655:
656: IntItemStyle = disc:
657: Create '* ';
658: IntItemStyle = square :
659: Create '+ ';
660: IntItemStyle = circle :
661: Create 'o ';
662: IntItemStyle = Arabic_ :
663: Create (Value(ItemCounter, Arabic) '. ');
664: IntItemStyle = LowerAlpha :
665: Create (Value(ItemCounter, Lowercase) '. ');
666: IntItemStyle = UpperAlpha :
667: Create (Value(ItemCounter, Uppercase) '. ');
668: IntItemStyle = LowerRoman :
669: Create (Value(ItemCounter, LRoman) '. ');
670: IntItemStyle = UpperRoman :
671: Create (Value(ItemCounter, URoman) '. ');
672:
673: Start: BEGIN
674: END;
675:
676: ItemValue: BEGIN
677: END;
678:
679: WidthElement: BEGIN
680: END;
681:
682: Script_URL: BEGIN
683: END;
684:
685: METHOD=Post_:
1.5 cvs 686: BEGIN
687: END;
1.1 cvs 688:
689: METHOD=Get_:
1.5 cvs 690: BEGIN
691: END;
1.1 cvs 692:
693: ENCTYPE: BEGIN
694: END;
695:
696: NAME: BEGIN
697: END;
698:
699: Multiple:
1.5 cvs 700: BEGIN
701: END;
1.1 cvs 702:
703: MenuSize: BEGIN
704: END;
705:
1.10 cvs 706: Selected: BEGIN
707: END;
1.1 cvs 708:
709: Value_: BEGIN
710: END;
711:
712: Rows: BEGIN
713: END;
714:
715: Columns: BEGIN
716: END;
717:
1.10 cvs 718: Checked = Yes_: BEGIN
719: END;
1.1 cvs 720:
721: Area_Size: BEGIN
722: END;
723:
724: MaxLength: BEGIN
725: END;
726:
727: SRC: BEGIN
1.3 cvs 728: Remove;
1.1 cvs 729: END;
730:
731: ALT: BEGIN
732: Create ALT;
733: END;
734:
735: Alignment = Top_:
1.5 cvs 736: BEGIN
737: END;
1.1 cvs 738: Alignment = Middle_:
1.5 cvs 739: BEGIN
740: END;
1.1 cvs 741: Alignment = Bottom_:
1.5 cvs 742: BEGIN
743: END;
1.1 cvs 744: Alignment = Left_:
1.5 cvs 745: BEGIN
746: END;
1.1 cvs 747: Alignment = Right_:
1.5 cvs 748: BEGIN
749: END;
1.1 cvs 750:
751: Height_: BEGIN
752: END;
753:
754: Width_: BEGIN
755: END;
756:
757: Img_border: BEGIN
758: END;
759:
760: hspace: BEGIN
761: END;
762:
763: vspace: BEGIN
764: END;
765:
766: ISMAP:
1.5 cvs 767: BEGIN
768: END;
1.1 cvs 769:
770: USEMAP: BEGIN
771: END;
772:
773: nohref:
1.5 cvs 774: BEGIN
775: END;
1.1 cvs 776:
777: shape = rectangle:
1.5 cvs 778: BEGIN
779: END;
1.1 cvs 780: shape = circle:
1.5 cvs 781: BEGIN
782: END;
1.1 cvs 783: shape = polygon:
1.5 cvs 784: BEGIN
785: END;
1.1 cvs 786:
787: coords: BEGIN
788: END;
789:
790: Border: BEGIN
791: END;
792:
793: cellspacing: BEGIN
794: END;
795:
1.5 cvs 796: cellpadding:
797: BEGIN
1.1 cvs 798: END;
799:
800: Position = Position_top:
1.5 cvs 801: BEGIN
802: END;
1.1 cvs 803: Position = Position_bottom:
1.5 cvs 804: BEGIN
805: END;
1.1 cvs 806:
807: Row_align = Row_left:
1.5 cvs 808: BEGIN
809: END;
1.1 cvs 810: Row_align = Row_center:
1.5 cvs 811: BEGIN
812: END;
1.1 cvs 813: Row_align = Row_right:
1.5 cvs 814: BEGIN
815: END;
1.1 cvs 816: Row_valign = Row_top:
1.5 cvs 817: BEGIN
818: END;
1.1 cvs 819: Row_valign = Row_middle:
1.5 cvs 820: BEGIN
821: END;
1.1 cvs 822: Row_valign = Row_bottom:
1.5 cvs 823: BEGIN
824: END;
1.1 cvs 825:
826: colspan: BEGIN
827: END;
828:
829: rowspan: BEGIN
830: END;
831:
832: Cell_align = Cell_left:
1.5 cvs 833: BEGIN
834: END;
1.1 cvs 835: Cell_align = Cell_center:
1.5 cvs 836: BEGIN
837: END;
1.1 cvs 838: Cell_align = Cell_right:
1.5 cvs 839: BEGIN
840: END;
1.1 cvs 841:
842: Cell_valign = Cell_top:
1.5 cvs 843: BEGIN
844: END;
1.1 cvs 845: Cell_valign = Cell_middle:
1.5 cvs 846: BEGIN
847: END;
1.1 cvs 848: Cell_valign = Cell_bottom:
1.5 cvs 849: BEGIN
850: END;
1.1 cvs 851:
852: Cell_width: BEGIN
853: END;
854:
855: Cell_height: BEGIN
856: END;
857:
1.17 cvs 858: No_wrap = no_wrap:
1.5 cvs 859: BEGIN
860: END;
1.1 cvs 861:
862: Invalid_attribute:
1.5 cvs 863: BEGIN
864: END;
865:
866: TextTRANSLATE
867: BEGIN
868: '\240' -> ' '; { }
869: '\212' -> '\12'; { &CTLrc; }
870: END;
1.1 cvs 871:
872: GraphTRANSLATE
873: BEGIN
874: 'c' -> 'circle';
875: 'Q' -> 'circle';
876: 'R' -> 'rect';
877: 'C' -> 'rect';
878: ' ' -> 'rect';
879: 'P' -> 'rect';
880: 'p' -> 'polygon';
881: 'B' -> 'polygon';
882: END;
883:
884: END
1.3 cvs 885:
Webmaster