/************************************************************************ * grammer - include/struct.h * Copyright (C) 2002 Marcello Barnaba * * 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 1, 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; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * structure definitions . . . */ #ifndef __STRUCT_H__ #define __STRUCT_H__ typedef struct { unsigned char id; unsigned int n; } Part; typedef struct list { Part *item; struct list *next; } List; typedef struct prod { List *sx; List *dx; struct prod *next; } Prod; typedef struct { List *X; List *V; Part *S; Prod *P; } Grammar; #define OR_SYMBOL '|' #if defined( __GNUC__ ) || defined(__cplusplus) #define __inline inline #else #define __inline #endif #ifndef __cplusplus #define bool char #define true 1 #define false 0 #endif #ifndef MAIN #define EXTERN extern #else #define EXTERN #endif #define VERSION "1.0" #endif