/***********************************
  (C) Copyright 1993; dit/upm
   Distributed under the conditions stated in the
   TOPO General Public License (see file LICENSE)
 ***********************************
 * $Log: swbus.h,v $
 * Revision 1.1  1993/09/30  14:30:46  lotos
 * Initial revision
 *
 ***********************************/

#define PUBLIC
#define SHARED  extern
#define PRIVATE static

#ifndef TRUE
# define FALSE 0
# define TRUE  1
#endif

# define nil(type) (type) NULL

SHARED  int     lexdebug;

/*****  Includes  *****/

# include "tbil.hh"
# include "rag.hh"
# include "nodes.h"

/* KJT 18/05/02: defined "yyin", "yyout" as macros to avoid initialisation */
/* was: SHARED  FILE*   yyin; */
/*****  constants  *****/
# include "colours.h"

# define c_tree         71
# define c_troo         72
# define c_ckey         73
# define c_cval         74
# define c_vclrs        75

# define c_keylist	81
# define c_vallist	82


# define BCOMM  -1
# define COMM   -2
# define ECOMM  -3

/*****  exported types  *****/

typedef struct stname {
	int	name;
	int*    line;
	char*	ckey;
	char*	cval;
	} yystype;

typedef struct  {
	int     type;
	yystype yylval;
	} token;


/*****  exported variables  *****/

SHARED	char    sfile[BUFSIZ];
SHARED	int     nfname;

SHARED	char    lfile[BUFSIZ];
SHARED	char    cfile[BUFSIZ];

SHARED	FILE*   sfp;
SHARED	FILE*   lfp;
SHARED	FILE*   cfp;

SHARED  HT      hidtbl;	/* for SymbolTable */
SHARED  IAT*    grnl;

SHARED  int     errorcount;
SHARED  int     fcomm;
SHARED  char*   comm;

/*****  exported functions  *****/

PUBLIC  token*	gtk	();
PUBLIC  int	yyerror	();

PUBLIC	TNODE*	bast	();
PUBLIC	void	putgrn	();
PUBLIC	int	validexc ();
PUBLIC	void	putexc	();

PUBLIC	TNODE*	tv1	();
PUBLIC	TNODE*	tv2	();
PUBLIC	TNODE*	tt1	();
PUBLIC	TNODE*	tt2	();
PUBLIC	TNODE*	tt3	();
PUBLIC	TNODE*	tvl1	();
PUBLIC	TNODE*	simple_eq ();

/*****  *****/
