2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
26 int lf
, rf
; /* temporary spots for left and right fonts */
31 int trans(int, char *);
44 eht
[yyval
] = VERT(EM(1.0, EFFPS(ps
))); /* ht in machine units */
46 eht
[yyval
] = VERT(2); /* 2 half-spaces */
48 lfont
[yyval
] = rfont
[yyval
] = ROM
;
57 else if ((tp
= lookup(restbl
, p1
, NULL
)) != NULL
)
61 for (csp
= psp
= 0; (c
= p1
[psp
++]) != '\0'; ) {
64 lf
= rf
; /* save first */
67 "converted token %.25s... too long"), p1
);
75 printf(".\t%dtext: S%d <- %s; b=%d,h=%d,lf=%c,rf=%c\n",
76 t
, yyval
, p
, ebase
[yyval
], eht
[yyval
], lfont
[yyval
],
78 printf(".ds %d \"%s\n", yyval
, p
);
82 trans(int c
, char *p1
)
87 case '0': case '1': case '2': case '3': case '4':
88 case '5': case '6': case '7': case '8': case '9':
89 case ':': case ';': case '!': case '%':
90 case '(': case '[': case ')': case ']':
105 shim(); roman(c
); shim(); break;
119 if (p1
[psp
] == '=') { /* look ahead for == <= >= */
129 if (p1
[psp
] == '>') {
130 name4('-', '>'); psp
++;
141 shim(); shim(); break;
144 case '\\': /* troff - pass 2 or 3 more chars */
147 cs
[csp
++] = c
; cs
[csp
++] = c
= p1
[psp
++]; cs
[csp
++] = p1
[psp
++];
148 if (c
== '(') cs
[csp
++] = p1
[psp
++];
149 if (c
== '*' && cs
[csp
-1] == '(') {
150 cs
[csp
++] = p1
[psp
++];
151 cs
[csp
++] = p1
[psp
++];
157 cs
[csp
++] = rf
== ITAL
? ITAL
: ROM
;
159 cs
[csp
++] = '\\'; cs
[csp
++] = 'f'; cs
[csp
++] = 'P';
160 f
= rf
== ITAL
? ITAL
: ROM
;
165 cs
[csp
++] = '\\'; cs
[csp
++] = '^';
168 /* trying | instead of ^ */
169 cs
[csp
++] = '\\'; cs
[csp
++] = '|';
178 cs
[csp
++] = '\\'; cs
[csp
++] = '^';
187 f
= ft
== ITAL
? ITAL
: ROM
;
196 cs
[csp
++] = '\\'; cs
[csp
++] = '|';
202 cs
[csp
++] = '\\'; cs
[csp
++] = 'f'; cs
[csp
++] = ROM
;
204 cs
[csp
++] = '\\'; cs
[csp
++] = 'f'; cs
[csp
++] = 'P';
208 name4(int c1
, int c2
)