* Copyright (c) 1989 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Redistribution and use in source and binary forms are permitted provided
* that: (1) source distributions retain this entire copyright notice and
* comment, and (2) distributions including binaries display the following
* acknowledgement: ``This product includes software developed by the
* University of California, Berkeley and its contributors'' in the
* documentation or other materials provided with the distribution and in
* all advertising materials mentioning features or use of this software.
* Neither the name of the University nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* @(#)defs.h 5.4 (Berkeley) 6/1/90
/* machine dependent definitions */
/* the following definitions are for the VAX */
/* they might have to be changed for other machines */
/* MAXCHAR is the largest character value */
/* MAXSHORT is the largest value of a C short */
/* MINSHORT is the most negative value of a C short */
/* MAXTABLE is the maximum table size */
/* BITS_PER_WORD is the number of bits in a C unsigned */
/* WORDSIZE computes the number of words needed to */
/* BIT returns the value of the n-th bit starting */
/* SETBIT sets the n-th bit starting from r */
#define WORDSIZE(n) (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
#define BIT(r, n) ((((r)[(n) >> 5]) >> ((n) & 31)) & 1)
#define SETBIT(r, n) ((r)[(n) >> 5] |= (1 << ((n) & 31)))
#define NUL '\0' /* the null character */
#define NEWLINE '\n' /* line feed */
#define SP ' ' /* space */
#define BS '\b' /* backspace */
#define HT '\t' /* horizontal tab */
#define VT '\013' /* vertical tab */
#define CR '\r' /* carriage return */
#define FF '\f' /* form feed */
#define QUOTE '\'' /* single quote */
#define DOUBLE_QUOTE '\"' /* double quote */
#define BACKSLASH '\\' /* backslash */
/* defines for constructing filenames */
#define DEFINES_SUFFIX ".tab.h"
#define OUTPUT_SUFFIX ".tab.c"
#define VERBOSE_SUFFIX ".output"
/* the undefined value */
#define IS_IDENT(c) (isalnum(c) || (c) == '_' || (c) == '.' || (c) == '$')
#define IS_OCTAL(c) ((c) >= '0' && (c) <= '7')
#define NUMERIC_VALUE(c) ((c) - '0')
#define ISTOKEN(s) ((s) < start_symbol)
#define ISVAR(s) ((s) >= start_symbol)
/* storage allocation macros */
#define FREE(x) (free((char*)(x)))
#define MALLOC(n) (malloc((unsigned)(n)))
#define NEW(t) ((t*)allocate(sizeof(t)))
#define NEW2(n,t) ((t*)allocate((unsigned)((n)*sizeof(t))))
#define REALLOC(p,n) (realloc((char*)(p),(unsigned)(n)))
/* the structure of a symbol table entry */
typedef struct bucket bucket
;
/* the structure of the LR(0) state machine */
typedef struct core core
;
/* the structure used to record shifts */
typedef struct shifts shifts
;
/* the structure used to store reductions */
typedef struct reductions reductions
;
/* the structure used to represent parser actions */
typedef struct action action
;
extern char *action_file_name
;
extern char *defines_file_name
;
extern char *input_file_name
;
extern char *output_file_name
;
extern char *text_file_name
;
extern char *union_file_name
;
extern char *verbose_file_name
;
extern FILE *action_file
;
extern FILE *defines_file
;
extern FILE *output_file
;
extern FILE *verbose_file
;
extern char line_format
[];
extern char **symbol_name
;
extern short *symbol_value
;
extern short *symbol_prec
;
extern char *symbol_assoc
;
extern bucket
*first_symbol
;
extern bucket
*last_symbol
;
extern core
*first_state
;
extern shifts
*first_shift
;
extern reductions
*first_reduction
;
extern short *accessing_symbol
;
extern core
**state_table
;
extern shifts
**shift_table
;
extern reductions
**reduction_table
;
extern short *lookaheads
;
extern short *from_state
;
extern short *SRconflicts
;
extern short *RRconflicts
;
extern short *rules_used
;
extern short final_state
;
extern bucket
*make_bucket();