/* bcdefs.h: The single file to include all constants and type definitions. */
/* This file is part of bc written for MINIX.
Copyright (C) 1991, 1992 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License , or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
You may contact the author by:
us-mail: Philip A. Nelson
Computer Science Department, 9062
Western Washington University
Bellingham, WA 98226-9062
*************************************************************************/
/* Include the configuration file. */
/* Standard includes for all files. */
/* Include the other definitions. */
/* These definitions define all the structures used in
code and data storage. This includes the representation of
labels. The "guiding" principle is to make structures that
take a minimum of space when unused but can be built to contain
/* Labels are first. Labels are generated sequentially in functions
and full code. They just "point" to a single bye in the code. The
"address" is the byte number. The byte number is used to get an
actual character pointer. */
typedef struct bc_label_group
long l_adrs
[ BC_LABEL_GROUP
];
struct bc_label_group
*l_next
;
/* Each function has its own code segments and labels. There can be
no jumps between functions so labels are unique to a function. */
char f_defined
; /* Is this function defined yet. */
char *f_body
[BC_MAX_SEGS
];
/* Variables are "pushable" (auto) and thus we need a stack mechanism.
This is built into the variable record. */
/* bc arrays can also be "auto" variables and thus need the same
kind of stacking mechanisms. */
typedef struct bc_array_node
bc_num n_num
[NODE_SIZE
];
struct bc_array_node
*n_down
[NODE_SIZE
];
typedef struct bc_var_array
struct bc_var_array
*a_next
;
/* For the stacks, execution and function, we need records to allow
typedef struct estack_rec
{
struct estack_rec
*s_next
;
typedef struct fstack_rec
{
struct fstack_rec
*s_next
;
/* The following are for the name tree. */
char *id
; /* The program name. */
/* A name == 0 => nothing assigned yet. */
int a_name
; /* The array variable name (number). */
int f_name
; /* The function name (number). */
int v_name
; /* The variable name (number). */
short balance
; /* For the balanced tree. */
struct id_rec
*left
, *right
; /* Tree pointers. */