dextern.h revision 672986541be54a7a471bb088e60780c37e371d7e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#ifndef _DEXTERN_H
#define _DEXTERN_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <inttypes.h>
#include <ctype.h>
#include <memory.h>
#include <string.h>
#include <malloc.h>
#include <values.h>
#include <widec.h>
#include <unistd.h>
#include <stdlib.h>
#include <wctype.h>
#ifdef __cplusplus
extern "C" {
#endif
/* MANIFEST CONSTANT DEFINITIONS */
#define WORD32
#endif
#include <libintl.h>
/* base of nonterminal internal numbers */
#define NTBASE (10000000)
/* internal codes for error and accept actions */
#define ERRCODE 8190
#define ACCEPTCODE 8191
/* sizes and limits */
#define ACTSIZE 4000
#define MEMSIZE 2000
#define PSTSIZE 1024
#define NSTATES 1000
#define NTERMS 127
#define NPROD 300
#define NNONTERM 600
#define TEMPSIZE 800
#define CNAMSZ 1000
#define LSETSIZE 950
#define WSETSIZE 850
#define NAMESIZE 50
#define NTYPES 1000
#define NMBCHARSZ 100
#define LKFACTOR 5
#ifdef WORD32
/* bit packing macros (may be machine dependent) */
/* number of words needed to hold n+1 bits */
#else
/* bit packing macros (may be machine dependent) */
/* number of words needed to hold n+1 bits */
#endif
/*
* relationships which must hold:
* TBITSET ints must hold NTERMS+1 bits...
* WSETSIZE >= NNONTERM
* LSETSIZE >= NNONTERM
* TEMPSIZE >= NTERMS + NNONTERMs + 1
* TEMPSIZE >= NSTATES
*/
/* associativities */
#define NOASC 0 /* no assoc. */
/* flags for state generation */
#define DONE 0
#define MUSTDO 1
#define MUSTLOOKAHEAD 2
/* flags for a rule having an action, and being reduced */
#define ACTFLAG 04
#define REDFLAG 010
/* output parser flags */
#define YYFLAG1 (-10000000)
/* macros for getting associativity and precedence levels */
#define ASSOC(i) ((i)&07)
/* macros for setting associativity and precedence levels */
#define SETASC(i, j) i |= j
#define SETPLEV(i, j) i |= (j<<4)
#define SETTYPE(i, j) i |= (j<<10)
/* looping macros */
#define WSBUMP(x) ++x
/* I/O descriptors */
/* structure declarations */
typedef struct looksets {
int *lset;
} LOOKSETS;
typedef struct item {
int *pitem;
} ITEM;
typedef struct toksymb {
int value;
} TOKSYMB;
typedef struct mbclit {
int tvalue; /* token issued for the character */
} MBCLIT;
typedef struct ntsymb {
int tvalue;
} NTSYMB;
typedef struct wset {
int *pitem;
int flag;
} WSET;
/* token information */
extern int ntokens; /* number of tokens */
extern int ntoksz;
/*
* multibyte (c > 255) character literals are
* handled as though they were tokens except
* that it generates a separate mapping table.
*/
extern int nmbchars; /* number of mb literals */
extern int nmbcharsz;
/* nonterminal information */
extern int nnonter; /* the number of nonterminals */
extern int nnontersz;
/* grammar rule information */
extern int nprod; /* number of productions */
extern int **prdptr; /* pointers to descriptions of productions */
extern int *levprd; /* contains production levels to break conflicts */
/* state information */
extern int nstate; /* number of states */
extern int *tystate; /* contains type information about the states */
extern int *defact; /* the default action of the state */
extern int size;
/* lookahead set information */
extern int TBITSET;
extern int nolook; /* flag to turn off lookahead computations */
/* working set information */
/* storage for productions */
extern int *mem0;
extern int *mem;
extern int *tracemem;
extern int new_memsize;
/* storage for action table */
extern int *amem;
extern int *memp; /* next free action table position */
extern int *indgo; /* index to the stored goto table */
extern int new_actsize;
/* temporary vector, indexable by states, terms, or ntokens */
extern int *temp1;
extern int lineno; /* current line number */
/* statistics collection variables */
extern int zzgoent;
extern int zzgobest;
extern int zzacent;
extern int zzexcp;
extern int zzrrconf;
extern int zzsrconf;
/* define external functions */
extern void setup(int, char *[]);
extern void closure(int);
extern void output(void);
extern void aryfil(int *, int, int);
extern void error(char *, ...);
extern void warning(int, char *, ...);
extern void go2out(void);
extern void hideprod(void);
extern void callopt(void);
extern void exp_mem(int);
extern void exp_act(int **);
extern int apack(int *, int);
extern int state(int);
/* yaccpar location */
extern char *parser;
/* default settings for a number of macros */
/* name of yacc tempfiles */
#ifndef TEMPNAME
#endif
#ifndef ACTNAME
#define ACTNAME "yacc.acts"
#endif
#ifndef DEBUGNAME
#define DEBUGNAME "yacc.debug"
#endif
/* command to clobber tempfiles after use */
#ifndef ZAPFILE
#endif
#ifndef PARSER
#endif
#ifdef __cplusplus
}
#endif
#endif /* _DEXTERN_H */