xref: /onnv-gate/usr/src/cmd/sgs/lex/common/once.h (revision 4538:844098db2e81)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*4538Sdamico  * Common Development and Distribution License (the "License").
6*4538Sdamico  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*4538Sdamico  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
270Sstevel@tonic-gate /*	All Rights Reserved	*/
280Sstevel@tonic-gate 
29*4538Sdamico #ifndef	_ONCE_H
30*4538Sdamico #define	_ONCE_H
31*4538Sdamico 
320Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
330Sstevel@tonic-gate 
34*4538Sdamico #include "ldefs.h"
350Sstevel@tonic-gate 
360Sstevel@tonic-gate /* once.c */
370Sstevel@tonic-gate 	/* because of external definitions, this code should occur only once */
380Sstevel@tonic-gate int	ctable[2*NCH] = {
390Sstevel@tonic-gate 	0,   1,   2,   3,   4,   5,   6,   7,   8,   9,
400Sstevel@tonic-gate 	10,  11,  12,  13,  14,  15,  16,  17,  18,  19,
410Sstevel@tonic-gate 	20,  21,  22,  23,  24,  25,  26,  27,  28,  29,
420Sstevel@tonic-gate 	30,  31,  32,  33,  34,  35,  36,  37,  38,  39,
430Sstevel@tonic-gate 	40,  41,  42,  43,  44,  45,  46,  47,  48,  49,
440Sstevel@tonic-gate 	50,  51,  52,  53,  54,  55,  56,  57,  58,  59,
450Sstevel@tonic-gate 	60,  61,  62,  63,  64,  65,  66,  67,  68,  69,
460Sstevel@tonic-gate 	70,  71,  72,  73,  74,  75,  76,  77,  78,  79,
470Sstevel@tonic-gate 	80,  81,  82,  83,  84,  85,  86,  87,  88,  89,
480Sstevel@tonic-gate 	90,  91,  92,  93,  94,  95,  96,  97,  98,  99,
490Sstevel@tonic-gate 	100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
500Sstevel@tonic-gate 	110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
510Sstevel@tonic-gate 	120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
520Sstevel@tonic-gate 	130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
530Sstevel@tonic-gate 	140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
540Sstevel@tonic-gate 	150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
550Sstevel@tonic-gate 	160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
560Sstevel@tonic-gate 	170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
570Sstevel@tonic-gate 	180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
580Sstevel@tonic-gate 	190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
590Sstevel@tonic-gate 	200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
600Sstevel@tonic-gate 	210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
610Sstevel@tonic-gate 	220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
620Sstevel@tonic-gate 	230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
630Sstevel@tonic-gate 	240, 241, 242, 243, 244, 245, 246, 247, 248, 249,
640Sstevel@tonic-gate 	250, 251, 252, 253, 254, 255
650Sstevel@tonic-gate };
660Sstevel@tonic-gate 
670Sstevel@tonic-gate int	ZCH = NCH;
680Sstevel@tonic-gate FILE	*fout = NULL, *errorf = {stderr};
690Sstevel@tonic-gate int	sect = DEFSECTION;
700Sstevel@tonic-gate int	prev = '\n';	/* previous input character */
710Sstevel@tonic-gate int	pres = '\n';	/* present input character */
720Sstevel@tonic-gate int	peek = '\n';	/* next input character */
730Sstevel@tonic-gate CHR	*pushptr = pushc;
740Sstevel@tonic-gate CHR	*slptr = slist;
750Sstevel@tonic-gate 
76*4538Sdamico #define	CNAME "/usr/share/lib/ccs/ncform"
77*4538Sdamico #define	RATNAME "/usr/share/lib/ccs/nrform"
78*4538Sdamico #define	EUCNAME "/usr/share/lib/ccs/nceucform"
790Sstevel@tonic-gate 
800Sstevel@tonic-gate int ccount = 1;
810Sstevel@tonic-gate int casecount = 1;
820Sstevel@tonic-gate int aptr = 1;
830Sstevel@tonic-gate int nstates = NSTATES, maxpos = MAXPOS;
840Sstevel@tonic-gate int treesize = TREESIZE, ntrans = NTRANS;
850Sstevel@tonic-gate int yytop;
860Sstevel@tonic-gate int outsize = NOUTPUT;
870Sstevel@tonic-gate int sptr = 1;
880Sstevel@tonic-gate int optim = TRUE;
890Sstevel@tonic-gate int report = 2;
900Sstevel@tonic-gate int debug;		/* 1 = on */
910Sstevel@tonic-gate int charc;
920Sstevel@tonic-gate char *v_stmp = "n";
930Sstevel@tonic-gate int no_input;
940Sstevel@tonic-gate int copy_line;
950Sstevel@tonic-gate int n_error = 0;
960Sstevel@tonic-gate int fatal = 1;
970Sstevel@tonic-gate int sargc;
980Sstevel@tonic-gate char **sargv;
990Sstevel@tonic-gate CHR buf[BUF_SIZ];
1000Sstevel@tonic-gate int ratfor;		/* 1 = ratfor, 0 = C */
1010Sstevel@tonic-gate int yyline;		/* line number of file */
1020Sstevel@tonic-gate int eof;
1030Sstevel@tonic-gate int lgatflg;
1040Sstevel@tonic-gate int divflg;
1050Sstevel@tonic-gate int funcflag;
1060Sstevel@tonic-gate int pflag;
1070Sstevel@tonic-gate int chset;	/* 1 = char set modified */
1080Sstevel@tonic-gate FILE *fin, *fother;
1090Sstevel@tonic-gate int fptr;
1100Sstevel@tonic-gate int *name;
1110Sstevel@tonic-gate int *left;
1120Sstevel@tonic-gate int *right;
1130Sstevel@tonic-gate int *parent;
1140Sstevel@tonic-gate Boolean *nullstr;
1150Sstevel@tonic-gate int tptr;
1160Sstevel@tonic-gate CHR pushc[TOKENSIZE];
1170Sstevel@tonic-gate CHR slist[STARTSIZE];
1180Sstevel@tonic-gate CHR **def, **subs, *dchar;
1190Sstevel@tonic-gate /* XCU4: %x exclusive start */
1200Sstevel@tonic-gate int *exclusive;
1210Sstevel@tonic-gate CHR **sname, *schar;
1220Sstevel@tonic-gate CHR *ccl;
1230Sstevel@tonic-gate CHR *ccptr;
1240Sstevel@tonic-gate CHR *dp, *sp;
1250Sstevel@tonic-gate int dptr;
1260Sstevel@tonic-gate CHR *bptr;		/* store input position */
1270Sstevel@tonic-gate CHR *tmpstat;
1280Sstevel@tonic-gate int count;
1290Sstevel@tonic-gate int **foll;
1300Sstevel@tonic-gate int *nxtpos;
1310Sstevel@tonic-gate int *positions;
1320Sstevel@tonic-gate int *gotof;
1330Sstevel@tonic-gate int *nexts;
1340Sstevel@tonic-gate CHR *nchar;
1350Sstevel@tonic-gate int **state;
1360Sstevel@tonic-gate int *sfall;		/* fallback state num */
1370Sstevel@tonic-gate Boolean *cpackflg;		/* true if state has been character packed */
1380Sstevel@tonic-gate int *atable;
1390Sstevel@tonic-gate int nptr;
1400Sstevel@tonic-gate Boolean symbol[MAXNCG];
1410Sstevel@tonic-gate CHR cindex[MAXNCG];
1420Sstevel@tonic-gate int xstate;
1430Sstevel@tonic-gate int stnum;
1440Sstevel@tonic-gate CHR match[MAXNCG];
1450Sstevel@tonic-gate BYTE extra[NACTIONS];
1460Sstevel@tonic-gate CHR *pchar, *pcptr;
1470Sstevel@tonic-gate int pchlen = TOKENSIZE;
1480Sstevel@tonic-gate long rcount;
1490Sstevel@tonic-gate int *verify, *advance, *stoff;
1500Sstevel@tonic-gate int scon;
1510Sstevel@tonic-gate CHR *psave;
1520Sstevel@tonic-gate 
1530Sstevel@tonic-gate Boolean handleeuc = FALSE;
1540Sstevel@tonic-gate Boolean widecio = FALSE;
1550Sstevel@tonic-gate 
1560Sstevel@tonic-gate int	isArray = 1;	/* XCU4: for %array %pointer */
157*4538Sdamico 
158*4538Sdamico #endif	/* _ONCE_H */
159