source: projects/punch-card/punch-card-editor/src/text/cardcodes.h @ 52

Last change on this file since 52 was 52, checked in by sven, 14 years ago

Punch Card Editor: Code reordering and class renaming, rewriting.
Now using the namespace QPunchCard everywhere.

Parted the whole application into 5 parts/directories:

  • app: The application core with MainWindow and main() function
  • qpunchcard: Everything directly binary card related (no interpretation): modeling, input/output, view. Most important classes are Card, Deck, FileFormat, Widget
  • text: Everything related to text interpretation of Cards/Card Decks. Having the abstract Codec classes and the Text::Editor, Text::EditorDock
  • deckviewer: Application components like binary card editing central widget (CardEditor) and Navigator (Model View Controller classes)
  • driver: Basis for the driver framework, must be written soon.

Deck now hides the complete Storage to implement frontend methods that
implement versioning (Undo framework). All code was cleaned up, but doesn't
compile right now (still quite some non heavy errors).

-- Sven @ workstation

File size: 5.4 KB
Line 
1#ifndef CARDCODES_H
2#define CARDCODES_H
3
4#include "text/codec.h"
5
6/* cardcode.i
7 *
8 * card code arrays are indexed by 7-bit ASCII code, and
9 * give corresponding 12-bit card codes using the indicated
10 * collating sequence.
11 *
12 * ERROR should be externally defined, either as an illegal
13 * card code (on conversion from ASCII to card codes) or as
14 * a code with a bit set outside the least significant 12.
15 *
16 * author:  Douglas Jones, jones@cs.uiowa.edu
17 * revisions:
18 *          March 5, 1996
19 *          Feb  18, 1997 to add 026 and EBCDIC converstion tables
20 */
21
22/* DEC's version of the IBM 029 kepunch encoding, (thus avoiding IBM's
23   use of non-ASCII punctuation), based on that given in the appendix
24   to Digital's "Small Computer Handbook, 1973", and augmented to
25   translate lower case to upper case.  As a result of this modification,
26   inversion of this table should be done with care! */
27int o29_code[] = {
28                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* control */
29                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* chars   */
30                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* control */
31                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* chars   */
32                00000,02202,00006,00102,02102,01042,04000,00022, /*  !"#$%&' */
33                04022,02022,02042,04012,01102,02000,04102,01400, /* ()*+,-./ */
34                01000,00400,00200,00100,00040,00020,00010,00004, /* 01234567 */
35                00002,00001,00202,02012,04042,00012,01012,01006, /* 89:;<=>? */
36                00042,04400,04200,04100,04040,04020,04010,04004, /* @ABCDEFG */
37                04002,04001,02400,02200,02100,02040,02020,02010, /* HIJKLMNO */
38                02004,02002,02001,01200,01100,01040,01020,01010, /* PQRSTUVW */
39                01004,01002,01001,04202,02006,01202,04006,01022, /* XYZ[\]^_ */
40                ERROR,04400,04200,04100,04040,04020,04010,04004, /* `abcdefg */
41                04002,04001,02400,02200,02100,02040,02020,02010, /* hijklmno */
42                02004,02002,02001,01200,01100,01040,01020,01010, /* pqrstuvw */
43                01004,01002,01001,ERROR,ERROR,ERROR,ERROR,ERROR  /* xyz{|}~  */
44        };
45
46/* Bare bones 026 kepunch encodings */
47int o26_ftn_code[] = {
48                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* control */
49                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* chars   */
50                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* control */
51                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* chars   */
52                00000,ERROR,ERROR,ERROR,02102,ERROR,ERROR,00042, /*  !"#$%&' */
53                01042,04042,02042,04000,01102,02000,04102,01400, /* ()*+,-./ */
54                01000,00400,00200,00100,00040,00020,00010,00004, /* 01234567 */
55                00002,00001,ERROR,ERROR,ERROR,00102,ERROR,ERROR, /* 89:;<=>? */
56                ERROR,04400,04200,04100,04040,04020,04010,04004, /* @ABCDEFG */
57                04002,04001,02400,02200,02100,02040,02020,02010, /* HIJKLMNO */
58                02004,02002,02001,01200,01100,01040,01020,01010, /* PQRSTUVW */
59                01004,01002,01001,ERROR,ERROR,ERROR,ERROR,ERROR, /* XYZ[\]^_ */
60                ERROR,04400,04200,04100,04040,04020,04010,04004, /* `abcdefg */
61                04002,04001,02400,02200,02100,02040,02020,02010, /* hijklmno */
62                02004,02002,02001,01200,01100,01040,01020,01010, /* pqrstuvw */
63                01004,01002,01001,ERROR,ERROR,ERROR,ERROR,ERROR  /* xyz{|}~  */
64        };
65
66int o26_comm_code[] = {
67                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* control */
68                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* chars   */
69                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* control */
70                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* chars   */
71                00000,ERROR,ERROR,00102,02102,01042,04000,ERROR, /*  !"#$%&' */
72                ERROR,ERROR,02042,ERROR,01102,02000,04102,01400, /* ()*+,-./ */
73                01000,00400,00200,00100,00040,00020,00010,00004, /* 01234567 */
74                00002,00001,ERROR,ERROR,04042,ERROR,ERROR,ERROR, /* 89:;<=>? */
75                00042,04400,04200,04100,04040,04020,04010,04004, /* @ABCDEFG */
76                04002,04001,02400,02200,02100,02040,02020,02010, /* HIJKLMNO */
77                02004,02002,02001,01200,01100,01040,01020,01010, /* PQRSTUVW */
78                01004,01002,01001,ERROR,ERROR,ERROR,ERROR,ERROR, /* XYZ[\]^_ */
79                ERROR,04400,04200,04100,04040,04020,04010,04004, /* `abcdefg */
80                04002,04001,02400,02200,02100,02040,02020,02010, /* hijklmno */
81                02004,02002,02001,01200,01100,01040,01020,01010, /* pqrstuvw */
82                01004,01002,01001,ERROR,ERROR,ERROR,ERROR,ERROR  /* xyz{|}~  */
83        };
84
85/* FULL EBCDIC, from Appendix C of System 360 Programming by Alex Thomas,
86   1977, Reinhart Press, San Francisco.  Codes not in that table have been
87   left compatable with DEC's 029 table.  Some control codes have been
88   left out */
89int EBCDIC_code[] = {
90                05403,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* control */
91                02011,04021,01021,ERROR,04041,02021,ERROR,ERROR, /* chars   */
92                ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR,ERROR, /* control */
93                ERROR,ERROR,ERROR,ERROR,01201,ERROR,ERROR,ERROR, /* chars   */
94                00000,02202,00006,00102,02102,01042,04000,00022, /*  !"#$%&' */
95                04022,02022,02042,04012,01102,02000,04102,01400, /* ()*+,-./ */
96                01000,00400,00200,00100,00040,00020,00010,00004, /* 01234567 */
97                00002,00001,00202,02012,04042,00012,01012,01006, /* 89:;<=>? */
98                00042,04400,04200,04100,04040,04020,04010,04004, /* @ABCDEFG */
99                04002,04001,02400,02200,02100,02040,02020,02010, /* HIJKLMNO */
100                02004,02002,02001,01200,01100,01040,01020,01010, /* PQRSTUVW */
101                01004,01002,01001,04202,02006,01202,04006,01022, /* XYZ[\]^_ */
102                ERROR,05400,05200,05100,05040,05020,05010,05004, /* `abcdefg */
103                05002,05001,06400,06200,06100,06040,06020,06010, /* hijklmno */
104                06004,06002,06001,03200,03100,03040,03020,03010, /* pqrstuvw */
105                03004,03002,03001,ERROR,ERROR,ERROR,ERROR,ERROR  /* xyz{|}~  */
106        };
107
108
109
110#endif // CARDCODES_H
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License