
/*  A Bison parser, made from inf.yac  */

#define infBISON 1  /* Identify Bison output.  */

#define	T_END	258
#define	T_MUTEX	259
#define	T_HELP_S	260
#define	T_RENOM	261
#define	T_IN	262
#define	T_INOUT	263
#define	T_OUT	264
#define	T_CMPU	265
#define	T_CMPD	266
#define	T_MUXU	267
#define	T_MUXD	268
#define	T_NAME	269

#line 1 "inf.yac"

#include"head.h"

extern int infParseLine   ;

/*---------------------------+
| DECLARATION DES PROTOTYPES |
+--------------------------*/
static char * infVectName();
static short checkJokName();

/*----------------------------------+
| VARIABLES POUR LES CONNECTEURS    |
+----------------------------------*/
static char DIRECTION ;
locon_list * INF_CONECT = NULL ;

/*--------------------------------+
| VARIABLE POUR HELP_S            |
+-------------------------------*/
chain_list * INF_HELP_S  = NULL ;

/*-------------------------------------------+
| VARIABLES POUR LES MUTUELLES EXCLUSIONS AU |
| BORNES DU CIRCUIT                          |
+-------------------------------------------*/
chain_list * INF_MUXU=NULL;
chain_list * INF_MUXD=NULL;
chain_list * INF_CMPU=NULL;
chain_list * INF_CMPD=NULL;
static chain_list * varChain = NULL;

/*-------------------------------+
| VARIABLES pour D2V            |
+------------------------------*/
chain_list * INF_RENOM = NULL ;

char  INF_LANG ;

#line 41 "inf.yac"
typedef union
    {
    long ival ;
    char istr[80] ;
    } infSTYPE;

#ifndef infLTYPE
typedef
  struct infltype
    {
      int timestamp;
      int first_line;
      int first_column;
      int last_line;
      int last_column;
      char *text;
   }
  infltype;

#define infLTYPE infltype
#endif

#include <stdio.h>

#ifndef __STDC__
#define const
#endif



#define	infFINAL		68
#define	infFLAG		-32768
#define	infNTBASE	20

#define infTRANSLATE(x) ((unsigned)(x) <= 269 ? inftranslate[x] : 38)

static const char inftranslate[] = {     0,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,    19,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,    15,    16,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,    17,     2,    18,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
     6,     7,     8,     9,    10,    11,    12,    13,    14
};

#if infDEBUG != 0
static const short infprhs[] = {     0,
     0,     2,     4,     7,     9,    11,    13,    15,    20,    22,
    25,    28,    30,    32,    34,    38,    40,    43,    48,    52,
    54,    57,    63,    69,    75,    81,    83,    87,    89,    93,
    95,    98
};

#endif

static const short infrhs[] = {    21,
     0,    22,     0,    22,    21,     0,    23,     0,    27,     0,
    30,     0,    35,     0,    26,    15,    24,     3,     0,    25,
     0,    25,    24,     0,    14,    16,     0,     8,     0,     7,
     0,     9,     0,     5,    28,     3,     0,    29,     0,    29,
    28,     0,    14,    15,    14,    16,     0,     4,    31,     3,
     0,    32,     0,    32,    31,     0,    12,    17,    33,    18,
    16,     0,    13,    17,    33,    18,    16,     0,    10,    17,
    33,    18,    16,     0,    11,    17,    33,    18,    16,     0,
    34,     0,    34,    19,    33,     0,    14,     0,     6,    36,
     3,     0,    37,     0,    37,    36,     0,    14,    15,    14,
    16,     0
};

#if infDEBUG != 0
static const short infrline[] = { 0,
    56,    58,    59,    62,    63,    64,    65,    69,    73,    74,
    77,    90,    91,    92,    96,    99,   100,   103,   119,   122,
   123,   126,   132,   138,   144,   152,   153,   156,   163,   166,
   167,   170
};

static const char * const inftname[] = {   "$","error","$illegal.","T_END","T_MUTEX",
"T_HELP_S","T_RENOM","T_IN","T_INOUT","T_OUT","T_CMPU","T_CMPD","T_MUXU","T_MUXD",
"T_NAME","':'","';'","'{'","'}'","','","expr","info_list","info","connect_info",
"connect_list","connect","type","help_s_info","signal_list","signal","mux_info",
"mux_list","mux","mux_name_list","mux_name","renom_info","renom_list","renom",
""
};
#endif

static const short infr1[] = {     0,
    20,    21,    21,    22,    22,    22,    22,    23,    24,    24,
    25,    26,    26,    26,    27,    28,    28,    29,    30,    31,
    31,    32,    32,    32,    32,    33,    33,    34,    35,    36,
    36,    37
};

static const short infr2[] = {     0,
     1,     1,     2,     1,     1,     1,     1,     4,     1,     2,
     2,     1,     1,     1,     3,     1,     2,     4,     3,     1,
     2,     5,     5,     5,     5,     1,     3,     1,     3,     1,
     2,     4
};

static const short infdefact[] = {     0,
     0,     0,     0,    13,    12,    14,     1,     2,     4,     0,
     5,     6,     7,     0,     0,     0,     0,     0,    20,     0,
     0,    16,     0,     0,    30,     3,     0,     0,     0,     0,
     0,    19,    21,     0,    15,    17,     0,    29,    31,     0,
     0,     9,    28,     0,    26,     0,     0,     0,     0,     0,
    11,     8,    10,     0,     0,     0,     0,     0,    18,    32,
    24,    27,    25,    22,    23,     0,     0,     0
};

static const short infdefgoto[] = {    66,
     7,     8,     9,    41,    42,    10,    11,    21,    22,    12,
    18,    19,    44,    45,    13,    24,    25
};

static const short infpact[] = {    -1,
     0,    -5,     1,-32768,-32768,-32768,-32768,    -1,-32768,     2,
-32768,-32768,-32768,    -3,     3,     4,     5,    13,     0,     8,
    15,    -5,     9,    16,     1,-32768,    11,    14,    14,    14,
    14,-32768,-32768,    17,-32768,-32768,    18,-32768,-32768,    19,
    24,    11,-32768,    12,    10,    20,    21,    22,    25,    26,
-32768,-32768,-32768,    27,    14,    28,    29,    30,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,    33,    34,-32768
};

static const short infpgoto[] = {-32768,
    39,-32768,-32768,    -6,-32768,-32768,-32768,    31,-32768,-32768,
    32,-32768,   -29,-32768,-32768,    23,-32768
};


#define	infLAST		53


static const short inftable[] = {    46,
    47,    48,     1,     2,     3,     4,     5,     6,    20,    14,
    15,    16,    17,    28,    23,    32,    27,    35,    38,    29,
    30,    31,    34,    37,    40,    62,    52,    43,    55,    54,
    49,    50,    67,    68,    51,    53,     0,    56,    57,    58,
    59,    60,    61,    63,    64,    65,    26,    39,     0,     0,
    33,     0,    36
};

static const short infcheck[] = {    29,
    30,    31,     4,     5,     6,     7,     8,     9,    14,    10,
    11,    12,    13,    17,    14,     3,    15,     3,     3,    17,
    17,    17,    15,    15,    14,    55,     3,    14,    19,    18,
    14,    14,     0,     0,    16,    42,    -1,    18,    18,    18,
    16,    16,    16,    16,    16,    16,     8,    25,    -1,    -1,
    19,    -1,    22
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/labo/gnu/lib/bison.simple"

/* Skeleton output parser for bison,
   Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman

   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.  */


#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C.  */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
 #pragma alloca
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc.  */
#endif /* not GNU C.  */
#endif /* alloca not defined.  */

/* This is the parser code that is written into each bison parser
  when the %semantic_parser declaration is not specified in the grammar.
  It was written by Richard Stallman by simplifying the hairy parser
  used when %semantic_parser is specified.  */

/* Note: there must be only one dollar sign in this file.
   It is replaced by the list of actions, each action
   as one case of the switch.  */

#define inferrok		(inferrstatus = 0)
#define infclearin	(infchar = infEMPTY)
#define infEMPTY		-2
#define infEOF		0
#define infACCEPT	return(0)
#define infABORT 	return(1)
#define infERROR		goto inferrlab1
/* Like infERROR except do call inferror.
   This remains here temporarily to ease the
   transition to the new meaning of infERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define infFAIL		goto inferrlab
#define infRECOVERING()  (!!inferrstatus)
#define infBACKUP(token, value) \
do								\
  if (infchar == infEMPTY && inflen == 1)				\
    { infchar = (token), inflval = (value);			\
      infchar1 = infTRANSLATE (infchar);				\
      infPOPSTACK;						\
      goto infbackup;						\
    }								\
  else								\
    { inferror ("syntax error: cannot back up"); infERROR; }	\
while (0)

#define infTERROR	1
#define infERRCODE	256

#ifndef infPURE
#define infLEX		inflex()
#endif

#ifdef infPURE
#ifdef infLSP_NEEDED
#define infLEX		inflex(&inflval, &inflloc)
#else
#define infLEX		inflex(&inflval)
#endif
#endif

/* If nonreentrant, generate the variables here */

#ifndef infPURE

int	infchar;			/*  the lookahead symbol		*/
infSTYPE	inflval;			/*  the semantic value of the		*/
				/*  lookahead symbol			*/

#ifdef infLSP_NEEDED
infLTYPE inflloc;			/*  location data for the lookahead	*/
				/*  symbol				*/
#endif

int infnerrs;			/*  number of parse errors so far       */
#endif  /* not infPURE */

#if infDEBUG != 0
int infdebug;			/*  nonzero means print parse trace	*/
/* Since this is uninitialized, it does not stop multiple parsers
   from coexisting.  */
#endif

/*  infINITDEPTH indicates the initial size of the parser's stacks	*/

#ifndef	infINITDEPTH
#define infINITDEPTH 200
#endif

/*  infMAXDEPTH is the maximum size the stacks can grow to
    (effective only if the built-in stack extension method is used).  */

#if infMAXDEPTH == 0
#undef infMAXDEPTH
#endif

#ifndef infMAXDEPTH
#define infMAXDEPTH 10000
#endif

#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
#define __inf_bcopy(FROM,TO,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
#else				/* not GNU C or C++ */
#ifndef __cplusplus

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__inf_bcopy (from, to, count)
     char *from;
     char *to;
     int count;
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#else /* __cplusplus */

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__inf_bcopy (char *from, char *to, int count)
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#endif
#endif

#line 169 "/labo/gnu/lib/bison.simple"
int
infparse()
{
  register int infstate;
  register int infn;
  register short *infssp;
  register infSTYPE *infvsp;
  int inferrstatus;	/*  number of tokens to shift before error messages enabled */
  int infchar1;		/*  lookahead token as an internal (translated) token number */

  short	infssa[infINITDEPTH];	/*  the state stack			*/
  infSTYPE infvsa[infINITDEPTH];	/*  the semantic value stack		*/

  short *infss = infssa;		/*  refer to the stacks thru separate pointers */
  infSTYPE *infvs = infvsa;	/*  to allow infoverflow to reallocate them elsewhere */

#ifdef infLSP_NEEDED
  infLTYPE inflsa[infINITDEPTH];	/*  the location stack			*/
  infLTYPE *infls = inflsa;
  infLTYPE *inflsp;

#define infPOPSTACK   (infvsp--, infssp--, inflsp--)
#else
#define infPOPSTACK   (infvsp--, infssp--)
#endif

  int infstacksize = infINITDEPTH;

#ifdef infPURE
  int infchar;
  infSTYPE inflval;
  int infnerrs;
#ifdef infLSP_NEEDED
  infLTYPE inflloc;
#endif
#endif

  infSTYPE infval;		/*  the variable used to return		*/
				/*  semantic values from the action	*/
				/*  routines				*/

  int inflen;

#if infDEBUG != 0
  if (infdebug)
    fprintf(stderr, "Starting parse\n");
#endif

  infstate = 0;
  inferrstatus = 0;
  infnerrs = 0;
  infchar = infEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  infssp = infss - 1;
  infvsp = infvs;
#ifdef infLSP_NEEDED
  inflsp = infls;
#endif

/* Push a new state, which is found in  infstate  .  */
/* In all cases, when you get here, the value and location stacks
   have just been pushed. so pushing a state here evens the stacks.  */
infnewstate:

  *++infssp = infstate;

  if (infssp >= infss + infstacksize - 1)
    {
      /* Give user a chance to reallocate the stack */
      /* Use copies of these so that the &'s don't force the real ones into memory. */
      infSTYPE *infvs1 = infvs;
      short *infss1 = infss;
#ifdef infLSP_NEEDED
      infLTYPE *infls1 = infls;
#endif

      /* Get the current used size of the three stacks, in elements.  */
      int size = infssp - infss + 1;

#ifdef infoverflow
      /* Each stack pointer address is followed by the size of
	 the data in use in that stack, in bytes.  */
      infoverflow("parser stack overflow",
		 &infss1, size * sizeof (*infssp),
		 &infvs1, size * sizeof (*infvsp),
#ifdef infLSP_NEEDED
		 &infls1, size * sizeof (*inflsp),
#endif
		 &infstacksize);

      infss = infss1; infvs = infvs1;
#ifdef infLSP_NEEDED
      infls = infls1;
#endif
#else /* no infoverflow */
      /* Extend the stack our own way.  */
      if (infstacksize >= infMAXDEPTH)
	{
	  inferror("parser stack overflow");
	  return 2;
	}
      infstacksize *= 2;
      if (infstacksize > infMAXDEPTH)
	infstacksize = infMAXDEPTH;
      infss = (short *) alloca (infstacksize * sizeof (*infssp));
      __inf_bcopy ((char *)infss1, (char *)infss, size * sizeof (*infssp));
      infvs = (infSTYPE *) alloca (infstacksize * sizeof (*infvsp));
      __inf_bcopy ((char *)infvs1, (char *)infvs, size * sizeof (*infvsp));
#ifdef infLSP_NEEDED
      infls = (infLTYPE *) alloca (infstacksize * sizeof (*inflsp));
      __inf_bcopy ((char *)infls1, (char *)infls, size * sizeof (*inflsp));
#endif
#endif /* no infoverflow */

      infssp = infss + size - 1;
      infvsp = infvs + size - 1;
#ifdef infLSP_NEEDED
      inflsp = infls + size - 1;
#endif

#if infDEBUG != 0
      if (infdebug)
	fprintf(stderr, "Stack size increased to %d\n", infstacksize);
#endif

      if (infssp >= infss + infstacksize - 1)
	infABORT;
    }

#if infDEBUG != 0
  if (infdebug)
    fprintf(stderr, "Entering state %d\n", infstate);
#endif

  goto infbackup;
 infbackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* infresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  infn = infpact[infstate];
  if (infn == infFLAG)
    goto infdefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* infchar is either infEMPTY or infEOF
     or a valid token in external form.  */

  if (infchar == infEMPTY)
    {
#if infDEBUG != 0
      if (infdebug)
	fprintf(stderr, "Reading a token: ");
#endif
      infchar = infLEX;
    }

  /* Convert token to internal form (in infchar1) for indexing tables with */

  if (infchar <= 0)		/* This means end of input. */
    {
      infchar1 = 0;
      infchar = infEOF;		/* Don't call infLEX any more */

#if infDEBUG != 0
      if (infdebug)
	fprintf(stderr, "Now at end of input.\n");
#endif
    }
  else
    {
      infchar1 = infTRANSLATE(infchar);

#if infDEBUG != 0
      if (infdebug)
	{
	  fprintf (stderr, "Next token is %d (%s", infchar, inftname[infchar1]);
	  /* Give the individual parser a way to print the precise meaning
	     of a token, for further debugging info.  */
#ifdef infPRINT
	  infPRINT (stderr, infchar, inflval);
#endif
	  fprintf (stderr, ")\n");
	}
#endif
    }

  infn += infchar1;
  if (infn < 0 || infn > infLAST || infcheck[infn] != infchar1)
    goto infdefault;

  infn = inftable[infn];

  /* infn is what to do for this token type in this state.
     Negative => reduce, -infn is rule number.
     Positive => shift, infn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (infn < 0)
    {
      if (infn == infFLAG)
	goto inferrlab;
      infn = -infn;
      goto infreduce;
    }
  else if (infn == 0)
    goto inferrlab;

  if (infn == infFINAL)
    infACCEPT;

  /* Shift the lookahead token.  */

#if infDEBUG != 0
  if (infdebug)
    fprintf(stderr, "Shifting token %d (%s), ", infchar, inftname[infchar1]);
#endif

  /* Discard the token being shifted unless it is eof.  */
  if (infchar != infEOF)
    infchar = infEMPTY;

  *++infvsp = inflval;
#ifdef infLSP_NEEDED
  *++inflsp = inflloc;
#endif

  /* count tokens shifted since error; after three, turn off error status.  */
  if (inferrstatus) inferrstatus--;

  infstate = infn;
  goto infnewstate;

/* Do the default action for the current state.  */
infdefault:

  infn = infdefact[infstate];
  if (infn == 0)
    goto inferrlab;

/* Do a reduction.  infn is the number of a rule to reduce with.  */
infreduce:
  inflen = infr2[infn];
  infval = infvsp[1-inflen]; /* implement default value of the action */

#if infDEBUG != 0
  if (infdebug)
    {
      int i;

      fprintf (stderr, "Reducing via rule %d (line %d), ",
	       infn, infrline[infn]);

      /* Print the symbols being reduced, and their result.  */
      for (i = infprhs[infn]; infrhs[i] > 0; i++)
	fprintf (stderr, "%s ", inftname[infrhs[i]]);
      fprintf (stderr, " -> %s\n", inftname[infr1[infn]]);
    }
#endif


  switch (infn) {

case 11:
#line 78 "inf.yac"
{
		locon_list * conect ;
		conect=(locon_list*)mbkalloc(sizeof(locon_list));
		conect->DIRECTION=DIRECTION;
		conect->NAME=namealloc(infvsp[-1].istr);
		conect->NEXT=INF_CONECT;
		conect->TYPE = 'E';
		conect->ROOT=NULL;
		conect->USER=NULL;
		conect->SIG =NULL;
          ;
    break;}
case 12:
#line 90 "inf.yac"
{ DIRECTION = 'X';;
    break;}
case 13:
#line 91 "inf.yac"
{DIRECTION = 'I';;
    break;}
case 14:
#line 92 "inf.yac"
{DIRECTION = 'O';;
    break;}
case 18:
#line 104 "inf.yac"
{
         chain_list  * nomdesb;
         char * buf ;

         buf=(char*)mbkalloc(strlen(infvsp[-1].istr)+15);
         strcpy(buf,"..............");
         strcat(buf,infvsp[-1].istr);

         nomdesb=addchain(NULL,namealloc(infVectName(buf)));
         nomdesb=addchain(nomdesb,namealloc(infVectName(infvsp[-3].istr)));
         INF_HELP_S=addchain(INF_HELP_S,(char*)nomdesb);
         ;
    break;}
case 22:
#line 127 "inf.yac"
{
        INF_MUXU=addchain(INF_MUXU,(void*)varChain);
        varChain=NULL;
	;
    break;}
case 23:
#line 133 "inf.yac"
{
        INF_MUXD=addchain(INF_MUXD,(void*)varChain);
        varChain=NULL;
	;
    break;}
case 24:
#line 139 "inf.yac"
{
        INF_CMPU=addchain(INF_CMPU,(void*)varChain);
        varChain=NULL;
	;
    break;}
case 25:
#line 145 "inf.yac"
{
        INF_CMPD=addchain(INF_CMPD,(void*)varChain);
        varChain=NULL;
	;
    break;}
case 28:
#line 157 "inf.yac"
{
		varChain=addchain(varChain,(void*)namealloc(infVectName(infvsp[0].istr)));
		;
    break;}
case 32:
#line 171 "inf.yac"
{
		chain_list * chain = NULL;
		chain = addchain(chain,(char*)namealloc(infvsp[-1].istr));
		chain = addchain(chain,(char*)namealloc(infvsp[-3].istr));
                checkJokName(infvsp[-1].istr,infvsp[-3].istr);
		INF_RENOM=addchain(INF_RENOM,(char*)chain);
		;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */
#line 442 "/labo/gnu/lib/bison.simple"

  infvsp -= inflen;
  infssp -= inflen;
#ifdef infLSP_NEEDED
  inflsp -= inflen;
#endif

#if infDEBUG != 0
  if (infdebug)
    {
      short *ssp1 = infss - 1;
      fprintf (stderr, "state stack now");
      while (ssp1 != infssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

  *++infvsp = infval;

#ifdef infLSP_NEEDED
  inflsp++;
  if (inflen == 0)
    {
      inflsp->first_line = inflloc.first_line;
      inflsp->first_column = inflloc.first_column;
      inflsp->last_line = (inflsp-1)->last_line;
      inflsp->last_column = (inflsp-1)->last_column;
      inflsp->text = 0;
    }
  else
    {
      inflsp->last_line = (inflsp+inflen-1)->last_line;
      inflsp->last_column = (inflsp+inflen-1)->last_column;
    }
#endif

  /* Now "shift" the result of the reduction.
     Determine what state that goes to,
     based on the state we popped back to
     and the rule number reduced by.  */

  infn = infr1[infn];

  infstate = infpgoto[infn - infNTBASE] + *infssp;
  if (infstate >= 0 && infstate <= infLAST && infcheck[infstate] == *infssp)
    infstate = inftable[infstate];
  else
    infstate = infdefgoto[infn - infNTBASE];

  goto infnewstate;

inferrlab:   /* here on detecting error */

  if (! inferrstatus)
    /* If not already recovering from an error, report this error.  */
    {
      ++infnerrs;

#ifdef infERROR_VERBOSE
      infn = infpact[infstate];

      if (infn > infFLAG && infn < infLAST)
	{
	  int size = 0;
	  char *msg;
	  int x, count;

	  count = 0;
	  for (x = 0; x < (sizeof(inftname) / sizeof(char *)); x++)
	    if (infcheck[x + infn] == x)
	      size += strlen(inftname[x]) + 15, count++;
	  msg = (char *) malloc(size + 15);
	  if (msg != 0)
	    {
	      strcpy(msg, "parse error");

	      if (count < 5)
		{
		  count = 0;
		  for (x = 0; x < (sizeof(inftname) / sizeof(char *)); x++)
		    if (infcheck[x + infn] == x)
		      {
			strcat(msg, count == 0 ? ", expecting `" : " or `");
			strcat(msg, inftname[x]);
			strcat(msg, "'");
			count++;
		      }
		}
	      inferror(msg);
	      free(msg);
	    }
	  else
	    inferror ("parse error; also virtual memory exceeded");
	}
      else
#endif /* infERROR_VERBOSE */
	inferror("parse error");
    }

  goto inferrlab1;
inferrlab1:   /* here on error raised explicitly by an action */

  if (inferrstatus == 3)
    {
      /* if just tried and failed to reuse lookahead token after an error, discard it.  */

      /* return failure if at end of input */
      if (infchar == infEOF)
	infABORT;

#if infDEBUG != 0
      if (infdebug)
	fprintf(stderr, "Discarding token %d (%s).\n", infchar, inftname[infchar1]);
#endif

      infchar = infEMPTY;
    }

  /* Else will try to reuse lookahead token
     after shifting the error token.  */

  inferrstatus = 3;		/* Each real token shifted decrements this */

  goto inferrhandle;

inferrdefault:  /* current state does not do anything special for the error token. */

#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */
  infn = infdefact[infstate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  if (infn) goto infdefault;
#endif

inferrpop:   /* pop the current state because it cannot handle the error token */

  if (infssp == infss) infABORT;
  infvsp--;
  infstate = *--infssp;
#ifdef infLSP_NEEDED
  inflsp--;
#endif

#if infDEBUG != 0
  if (infdebug)
    {
      short *ssp1 = infss - 1;
      fprintf (stderr, "Error: state stack now");
      while (ssp1 != infssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

inferrhandle:

  infn = infpact[infstate];
  if (infn == infFLAG)
    goto inferrdefault;

  infn += infTERROR;
  if (infn < 0 || infn > infLAST || infcheck[infn] != infTERROR)
    goto inferrdefault;

  infn = inftable[infn];
  if (infn < 0)
    {
      if (infn == infFLAG)
	goto inferrpop;
      infn = -infn;
      goto infreduce;
    }
  else if (infn == 0)
    goto inferrpop;

  if (infn == infFINAL)
    infACCEPT;

#if infDEBUG != 0
  if (infdebug)
    fprintf(stderr, "Shifting error token, ");
#endif

  *++infvsp = inflval;
#ifdef infLSP_NEEDED
  *++inflsp = inflloc;
#endif

  infstate = infn;
  goto infnewstate;
}
#line 179 "inf.yac"

inferror ()
{
   if(INF_LANG == 'E')
   fprintf(stderr,"[FATAL ERR] Syntax error line %d \n",infParseLine);
   else if(INF_LANG=='F')
   fprintf(stderr,"[FATAL ERR] Syntax error ligne %d \n",infParseLine);

fflush(stdout);
exit(-1);
}

/***********************************************************************
 *                         fonction infVectName();                     *
 **********************************************************************/
 /*--------------------------------------------------------------------+
 | Remplace un nom contenant des crochet par son equivalent valide MBK |
 | ex 'toto[0]' => 'toto 0'                                            |
 +--------------------------------------------------------------------*/
static char * infVectName(name)
char * name;
{
char buff[200];
char * res ;
char * car=name ;
int i = 0 ;
 
   while(*car != '\0')
   {
      if(i>190)
      { 
         if(INF_LANG=='E')
         fprintf(stderr,"[FATAL ERR] Executing infVectane : buff error\n");
         else if(INF_LANG=='F')
         fprintf(stderr,"[FATAL ERR] Fonction infVectname : buff error\n");
      fflush(stderr);
      exit(-1);
      }
 
      if (*car != '[')
      {
      buff[i++] = *car++ ;
      }
      else
      {   
      buff[i++]=' ';
      car++;
         while( (*car>='0')&&(*car<='9') )
         {
         buff[i++] = *car++;
         }
      break ;
      }
   }   
 
buff[i]='\0';
res=(char*)mbkalloc(strlen(buff)+1);
strcpy(res,buff);
return(res);
}

/***********************************************************************
 *                         fonction checkJokName();                    *
 **********************************************************************/
static short checkJokName(motif,name)
char * motif ;
char * name ;
{
short i=0 ;
char * pt = motif ;
   while(*pt!='\0')
   {
      if(*pt==INF_JOK) i++;
   pt++;
   }
pt=name ;
   while(*pt!='\0')
   {
      if(*pt==INF_JOK) i--;
   pt++;
   }
   if(i!=0)  
   {
      if(INF_LANG == 'E')
      fprintf(stderr,"[FATAL ERR] Syntax error in regular expression in 'inf' file line %d\n",infParseLine);
      if(INF_LANG=='F')
      fprintf(stderr,"[FATAL ERR] Erreur de syntax dans l'expression du renomage avec joker ligne %d \n",infParseLine);
   fflush(stdout);
   exit(-1);
   }
}
   
