#define YY_CParse_h_included

/*  A Bison++ parser, made from ..\src\edir_bis.cpp  */

 /* with Bison++ version bison++ Version 1.21-5, adapted from GNU bison by coetmeur@icdc.fr
  */

/* added by Xavier Billault */

#include "Defines.hpp"

#ifdef D_ED_IR_ACTIVE

/* end added by Xavier Billault*/

/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
/* 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.  */

/* HEADER SECTION */
#ifndef _MSDOS
#ifdef MSDOS
#define _MSDOS
#endif
#endif
/* turboc */
#ifdef __MSDOS__
#ifndef _MSDOS
#define _MSDOS
#endif
#endif

#ifndef alloca
#if defined( __GNUC__)
#define alloca __builtin_alloca

#elif (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc)  || defined (__sgi)
#include <alloca.h>

#elif defined (_MSDOS)
#include <malloc.h>
#ifndef __TURBOC__
/* MS C runtime lib */
#define alloca _alloca
#endif

#elif defined(_AIX)
#include <malloc.h>
#pragma alloca

#elif defined(__hpux)
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */

#endif /* not _AIX  not MSDOS, or __TURBOC__ or _AIX, not sparc.  */
#endif /* alloca not defined.  */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
#ifdef __cplusplus
#ifndef YY_USE_CLASS
#define YY_USE_CLASS
#endif
#else
#ifndef __STDC__
#define const
#endif
#endif
#include <stdio.h>
#define YYBISON 1  

#include "stdafx.h"

#include <malloc.h>
#include <afxwin.h> //for AfxMessageBox

//A SUPPRIMER (pour toupper)
#include <stdlib.h>

#include "EdIRStrg.hpp"

#include "EdIRflx.hpp"

#include "EdIRDVLs.hpp"
#include "EdIRMacL.hpp"
#include "EdIRIRD.hpp"
#include "EdIRBeEn.hpp"
#include "EdIRBeha.hpp"
#include "EdIR2Eng.hpp"
#include "EdIRGlob.hpp"
#include "EdIRIAGl.hpp"

#include "EdIRIAWd.hpp"

#include "acp_base.h"

#include "ITF.h"
#include "IncMEC.h"
#include "incAI.h"

#include "GMT.h"

#include "x:\cpa\main\inc\_EditID.h"
#include "_Ainterf.hpp"	//for g_pclInterface
#include "EDACModl.hpp"

#include "_Actors.hpp"

#undef extern

long gl_MacroAddress;
// SHAITAN => CORRECTION SUBR
//ACP_tdxBool g_bPrevStatementWasAMacroRef = FALSE ;
// SHAITAN => END CORRECTION SUBR

#define YY_USE_CLASS

/*************/
/* Constants */
/*************/

#define C_OPEN_DEPTH	'{'
#define C_CLOSE_DEPTH	'}'

/**********/
/* Macros */
/**********/

#define M_PASS_IN_1PARM(a,b)					(a).csInitial=(b).csInitial

#define M_PASS_IN_2PARMS(a,b,c)				M_PASS_IN_1PARM(a,b);																								\
																			(a).csInitial+=" "+(c).csInitial

#define M_PASS_IN_3PARMS(a,b,c,d)			M_PASS_IN_2PARMS(a,b,c);																						\
																			(a).csInitial+=" "+(d).csInitial

#define M_PASS_IN_4PARMS(a,b,c,d,e)		M_PASS_IN_3PARMS(a,b,c,d);																					\
																			(a).csInitial+=" "+(e).csInitial

#define M_PASS_IN_5PARMS(a,b,c,d,e,f)	M_PASS_IN_4PARMS(a,b,c,d,e);																				\
																			(a).csInitial+=" "+(f).csInitial

#define M_PASS_IN_6PARMS(a,b,c,d,e,\
												 f,g)					M_PASS_IN_5PARMS(a,b,c,d,e,f);																			\
																			(a).csInitial+=" "+(g).csInitial

#define M_PASS_IN_7PARMS(a,b,c,d,e,\
												 f,g,h)				M_PASS_IN_6PARMS(a,b,c,d,e,f,g);																		\
																			(a).csInitial+=" "+(h).csInitial

#define M_PASS_IN_8PARMS(a,b,c,d,e,\
												 f,g,h,i)			M_PASS_IN_7PARMS(a,b,c,d,e,f,g,h);																	\
																			(a).csInitial+=" "+(i).csInitial

#define M_PASS_ALL(a,b)								(a)=(b)

#define M_CONCAT2PARMS(a,b,c)					M_PASS_IN_2PARMS(a,b,c);																						\
																			(a).clIntermediateCodeList=(b).clIntermediateCodeList;							\
																			(a).clIntermediateCodeList.m_fn_vConcat((c).clIntermediateCodeList)

#define M_CREATENODE(a,b,c)						(a).clIntermediateCodeList=																					\
																					new CPA_EdIR_IntermediateCode(g_clLex.m_lIndex,(b),(c))

#define M_CREATEVECTORNODE(a,b,c,d,e)	(a).clIntermediateCodeList=																					\
																					new CPA_EdIR_IntermediateCode(g_clLex.m_lIndex,(b),(c),(d),(e))

#define C_INC_DEPTH										0,eIncDepth,0L
#define C_DEC_DEPTH										0,eDecDepth,0L
#define C_INC_DEPTH_NODE							new CPA_EdIR_IntermediateCode(C_INC_DEPTH)
#define C_DEC_DEPTH_NODE							new CPA_EdIR_IntermediateCode(C_DEC_DEPTH)

#define M_ADD1PARM(a,b)								(a).clIntermediateCodeList.m_fn_vAdd(C_INC_DEPTH_NODE);							\
																			(a).clIntermediateCodeList.m_fn_vConcat((b).clIntermediateCodeList);\
																			(a).clIntermediateCodeList.m_fn_vAdd(C_DEC_DEPTH_NODE)

#define M_PASS1PARM(a,b,c)						(a).clIntermediateCodeList=(b).clIntermediateCodeList;							\
																			M_ADD1PARM(a,c)
																																										
#define M_PASS2PARMS(a,b,c,d)					M_PASS1PARM(a,b,c);																									\
																			M_ADD1PARM(a,d)

#define M_PASS3PARMS(a,b,c,d,e)				M_PASS2PARMS(a,b,c,d);																							\
																			M_ADD1PARM(a,e)

#define M_PASS1PARM4OP(a,b,c,d)				(a).clIntermediateCodeList=																					\
																					new CPA_EdIR_IntermediateCode(g_clLex.m_lIndex,(b),(c));				\
																			M_ADD1PARM(a,d)
																			
#define M_PASS2PARMS4OP(a,b,c,d,e)		(a).clIntermediateCodeList=																					\
																					new CPA_EdIR_IntermediateCode(g_clLex.m_lIndex,(b),(c));				\
																			M_ADD1PARM(a,d);																										\
																			M_ADD1PARM(a,e)

#define M_IFTHEN(a,b,c,d,e,f)					(a).clIntermediateCodeList=(b).clIntermediateCodeList;							\
																			M_ADD1PARM(a,c);																										\
																			(a).clIntermediateCodeList.m_fn_vConcat((d).clIntermediateCodeList);\
																			M_ADD1PARM(a,e);																										\
																			(a).clIntermediateCodeList.m_fn_vConcat((f).clIntermediateCodeList);\
																																										
#define M_IFTHENELSE(a,b,c,d,e,f,g,h)	(a).clIntermediateCodeList=(b).clIntermediateCodeList;							\
																			M_ADD1PARM(a,c);																										\
																			(a).clIntermediateCodeList.m_fn_vConcat((d).clIntermediateCodeList);\
																			M_ADD1PARM(a,e);																										\
																			(a).clIntermediateCodeList.m_fn_vConcat((f).clIntermediateCodeList);\
																			M_ADD1PARM(a,g);																										\
																			(a).clIntermediateCodeList.m_fn_vConcat((h).clIntermediateCodeList);\

#define M_CREATEULTRANODE(a,b,c,d)		stReturn	stOperatorUltra;																					\
																			M_CREATENODE(stOperatorUltra,eOperator,long(eOperator_Ultra));			\
																																																					\
																			stReturn	stUltraNode;																							\
																			M_PASS1PARM(stUltraNode,c,d);																				\
																																																					\
																			M_PASS2PARMS(a,stOperatorUltra,b,stUltraNode)

//Stefan Dumitrean 21-05-98
/*
#define	M_CHECKPARMS(a,b)							CString	csMsgError;																									\
																			if((a).GetLength()<((b).csType).GetLength())												\
																			{																																		\
																				yyerror("There are too many params");															\
																				YYERROR;																													\
																			}																																		\
																			else																																\
																			if((a).GetLength()>((b).csType).GetLength())												\
																			{																																		\
																				yyerror("There are not enough params");														\
																				YYERROR;																													\
																			}																																		\
																			else																																\
																			if(!fn_bIsParmsCompatible((a),&(b),csMsgError))											\
																			{																																		\
																				yyerror(M_MAKECHAR(csMsgError));																	\
																				YYERROR;																													\
																			}																																		\
																			else
*/
#define	M_CHECKPARMS(a,b,c)							CString	csMsgError;																                   \
																			if((a).GetLength()<((b).csType).GetLength())							   \
																			{																		   \
																				csMsgError.Format("There are too many parameters for the %s", c );	   \
																				yyerror(M_MAKECHAR(csMsgError));									   \
																				YYERROR;															   \
																			}																		   \
																			else																	   \
																			if((a).GetLength()>((b).csType).GetLength())							   \
																			{																		   \
																				csMsgError.Format("There are not enough parameters for the %s", c );   \
																				yyerror(M_MAKECHAR(csMsgError));									   \
																				YYERROR;															   \
																			}																		   \
																			else																	   \
																			if(!fn_bIsParmsCompatible((a),&(b),c,csMsgError))						   \
																			{																		   \
																				yyerror(M_MAKECHAR(csMsgError));									   \
																				YYERROR;															   \
																			}																		   \
																			else
//End Stefan Dumitrean 21-05-98

#define M_GETINDEX(a)									(a).clIntermediateCodeList.m_fn_lGetIndex(0)
#define M_SETINDEX(a,b)								(a).clIntermediateCodeList.m_fn_vSetIndex(0,(b))

//In order to put the good model because Flex don't check for dot operation
//Example : if there are two dsgvar "x" in two models M1 and M2
//In M1, we write "Actor2".x (Actor2's model is M2)
//Flex puts M1 model for "x" and this is not good (it is M2 model for "x")
#define M_SETMODEL(a,b)								(a).clIntermediateCodeList.m_fn_vSetModel(0,(b))
#define M_SETMODELFROMPERSO(a,b)																																									\
	{																																																								\
		CPA_Actor	*pclActorInstance=(CPA_Actor *)fn_pclGetReachableObject(lHandleToPerso,C_szActorInstanceTypeName);	\
		CPA_Actor	*pclActorModel=pclActorInstance->m_fn_pclGetModel();																								\
																																																									\
		M_SETMODEL(a,pclActorModel);																																									\
	}



#include "stdafx.h"

#include "EdIRICLs.hpp"

struct stReturn
{
	CString												csInitial;
	CString												csType;
	CString												csSubType;	//for array
	CPA_EdIR_IntermediateCodeList	clIntermediateCodeList;
};

/*********/
/* Enums */
/*********/

typedef enum tdeTypeText_
{
	IntelligenceText,
	ReflexText,
	DsgVarText,
	MacroText,
	// BEGIN ROMTEAM CPA2 Cristi Petrescu 98-04-
	// this is used for the new style of defining macros...
	Macro_2_Text,
	SubrText,
	// END ROMTEAM CPA2 Cristi Petrescu 98-04-
	CRRGeneration,
} tdeTypeText;

/*************/
/* Variables */
/*************/

class CParse;
class CLex;
class CPA_EdIR_DesignerVariableList;
class CPA_EdIR_MacroList;
// BEGIN CPA2 Cristi Petrescu 98-03-
class CPA_EdIR_MainBehaviourList;
// END CPA2 Cristi Petrescu 98-03-
class CPA_Actor;

extern CParse													g_clParse;
extern CLex														g_clLex;
extern CPA_EdIR_DesignerVariableList	g_clDsgVarList;
extern CPA_EdIR_MacroList							g_clMacroList;
// BEGIN CPA2 Cristi Petrescu 98-03-
extern CPA_EdIR_MainBehaviourList		*g_pclListOfSubrs;
// END CPA2 Cristi Petrescu 98-03-
extern CPA_Actor											*g_pclCurrentModel;
extern char gcGenerateOneRule ;
/*************/
/* Functions */
/*************/

//exports fn_bAnalysesText()
//BEGIN ROMTEAM Cristi Petrescu 98-05-
BOOL fn_bAnalysesText(CString,tdeTypeText,long &,CPA_EdIR_IntermediateCodeList *, CString csBehaviourName);
//END ROMTEAM Cristi Petrescu 98-05-

//KeyWord
CString	fn_csGetKeyWordParams(long);
CString	fn_csGetKeyWordType(long);

//MetaAction
CString	fn_csGetMetaActionParams(long);

//Condition
CString	fn_csGetConditionParams(long);
BOOL		fn_bIsConditionUsableWithUltraOperator(long);

//Designer Variable
#define	C_NOT_A_DSG_VAR	-1
void		fn_vGetDesignerVariableType(stReturn *,long);
void		fn_vGetDesignerVariableTypeFromEngineType(stReturn *,long);
void		fn_vGetDesignerVariableTypeForThisModel(stReturn *,CPA_Actor *,long);
long		fn_lIsADsgVarForThisModel(CPA_Actor *,CString);
void		fn_vGetDesignerVariableTypeForThisPerso(stReturn *,long,long);
long		fn_lIsADsgVarForThisPerso(long,CString);

//Field
CString	fn_csGetFieldType(long);

//Type
BOOL		fn_bIsTypeCompatible(CString,stReturn *,long,BOOL bIsOperator=FALSE);
#define C_NOT_COMPATIBLE -1
long		fn_lIsTypeCompatibleForArithmOp(long lIndex,stReturn *st1,stReturn *st2=NULL);
BOOL		fn_bIsTypeCompatibleForBinaryOp(long lIndex,stReturn *st1,stReturn *st2);
BOOL		fn_bIsTypeCompatibleForInitialization(CString,stReturn *);
//Stefan Dumitrean 21-05-98
BOOL		fn_bIsParmsCompatible(CString,stReturn *,CString,CString &);
//End Stefan Dumitrean 21-05-98
BOOL		fn_bIsStringCompatible(CString,CString);
BOOL		fn_bIsStringCompatibleForAffect(CString,CString);

//Function
CString	fn_csGetFunctionParams(long);
CString	fn_csGetFunctionType(long);
BOOL		fn_bIsFunctionUsableWithUltraOperator(long);

//Procedure
CString	fn_csGetProcedureParams(long);
BOOL		fn_bIsProcedureUsableWithUltraOperator(long);

//Operator
CString	fn_csGetOperatorParams(long);
CString fn_csGetOperatorType(long,CString csParm1="",CString csParm2="");

//Perso
long		fn_lGetHandleOfPerso(stReturn *);

//BEGIN ROMTEAM Cristi Petrescu 98-06-
BOOL fn_bIsDsgVarQualifier(CString csQualifier);
//END ROMTEAM Cristi Petrescu 98-06-
#define YY_CParse_STYPE  stReturn
#define YY_CParse_MEMBERS 	CString												m_csMsgError;								\
								BOOL													m_bNoError;									\
								long													m_lIndexError;							\
								BOOL													m_bIsInITRules;							\
								stReturn							* m_pstMyStack;							\
								CPA_EdIR_IntermediateCodeList	m_clIntermediateCodeList;
/* %{ and %header{ and %union, during decl */
#define YY_CParse_BISON 1
#ifndef YY_CParse_COMPATIBILITY
#ifndef YY_USE_CLASS
#define  YY_CParse_COMPATIBILITY 1
#else
#define  YY_CParse_COMPATIBILITY 0
#endif
#endif

#if YY_CParse_COMPATIBILITY != 0
/* backward compatibility */
#ifdef YYLTYPE
#ifndef YY_CParse_LTYPE
#define YY_CParse_LTYPE YYLTYPE
#endif
#endif
#ifdef YYSTYPE
#ifndef YY_CParse_STYPE 
#define YY_CParse_STYPE YYSTYPE
#endif
#endif
#ifdef YYDEBUG
#ifndef YY_CParse_DEBUG
#define  YY_CParse_DEBUG YYDEBUG
#endif
#endif
#ifdef YY_CParse_STYPE
#ifndef yystype
#define yystype YY_CParse_STYPE
#endif
#endif
#endif

#ifndef YY_CParse_PURE
/*  YY_CParse_PURE */
#endif

/* section apres lecture def, avant lecture grammaire S2 */
/* prefix */
#ifndef YY_CParse_DEBUG
#define YY_CParse_DEBUG 1
/* YY_CParse_DEBUG */
#endif


#ifndef YY_CParse_LSP_NEEDED
 /* YY_CParse_LSP_NEEDED*/
#endif



/* DEFAULT LTYPE*/
#ifdef YY_CParse_LSP_NEEDED
#ifndef YY_CParse_LTYPE
typedef
  struct yyltype
    {
      int timestamp;
      int first_line;
      int first_column;
      int last_line;
      int last_column;
      char *text;
   }
  yyltype;

#define YY_CParse_LTYPE yyltype
#endif
#endif
/* DEFAULT STYPE*/
      /* We used to use `unsigned long' as YY_CParse_STYPE on MSDOS,
	 but it seems better to be consistent.
	 Most programs should declare their own type anyway.  */

#ifndef YY_CParse_STYPE
#define YY_CParse_STYPE int
#endif
/* DEFAULT MISCELANEOUS */
#ifndef YY_CParse_PARSE
#define YY_CParse_PARSE yyparse
#endif
#ifndef YY_CParse_LEX
#define YY_CParse_LEX yylex
#endif
#ifndef YY_CParse_LVAL
#define YY_CParse_LVAL yylval
#endif
#ifndef YY_CParse_LLOC
#define YY_CParse_LLOC yylloc
#endif
#ifndef YY_CParse_CHAR
#define YY_CParse_CHAR yychar
#endif
#ifndef YY_CParse_NERRS
#define YY_CParse_NERRS yynerrs
#endif
#ifndef YY_CParse_DEBUG_FLAG
#define YY_CParse_DEBUG_FLAG yydebug
#endif
#ifndef YY_CParse_ERROR
#define YY_CParse_ERROR yyerror
#endif
#ifndef YY_CParse_PARSE_PARAM
#ifndef __STDC__
#ifndef __cplusplus
#ifndef YY_USE_CLASS
#define YY_CParse_PARSE_PARAM
#ifndef YY_CParse_PARSE_PARAM_DEF
#define YY_CParse_PARSE_PARAM_DEF
#endif
#endif
#endif
#endif
#ifndef YY_CParse_PARSE_PARAM
#define YY_CParse_PARSE_PARAM void
#endif
#endif
/* TOKEN C */
#if YY_CParse_COMPATIBILITY != 0
/* backward compatibility */
#ifdef YY_CParse_LTYPE
#ifndef YYLTYPE
#define YYLTYPE YY_CParse_LTYPE
#else
/* WARNING obsolete !!! user defined YYLTYPE not reported into generated header */
#endif
#endif
#ifndef YYSTYPE
#define YYSTYPE YY_CParse_STYPE
#else
/* WARNING obsolete !!! user defined YYSTYPE not reported into generated header */
#endif
#ifdef YY_CParse_PURE
#ifndef YYPURE
#define YYPURE YY_CParse_PURE
#endif
#endif
#ifdef YY_CParse_DEBUG
#ifndef YYDEBUG
#define YYDEBUG YY_CParse_DEBUG 
#endif
#endif
#ifndef YY_CParse_ERROR_VERBOSE
#ifdef YYERROR_VERBOSE
#define YY_CParse_ERROR_VERBOSE YYERROR_VERBOSE
#endif
#endif
#ifndef YY_CParse_LSP_NEEDED
#ifdef YYLSP_NEEDED
#define YY_CParse_LSP_NEEDED YYLSP_NEEDED
#endif
#endif

#define	STRING	258
#define	TEXT	259
#define	BOOLEAN	260
#define	INT	261
#define	REAL	262
#define	PERSO	263
#define	ZDD	264
#define	ZDE	265
#define	ZDM	266
#define	ZDR	267
#define	ACTION	268
#define	WAYPOINT	269
#define	CHANNEL	270
#define	SURFACE	271
#define	ENVIRONMENT	272
#define	SECTOR	273
#define	SUPEROBJECT	274
#define	LIPSYNCHRO	275
#define	OBJECTTABLE	276
#define	FAMILY	277
#define	MODEL	278
#define	SOUNDEVENT	279
#define	GAMEMATERIAL	280
#define	LIGHT	281
#define	CAPS	282
#define	GRAPH	283
#define	MYREFLEX	284
#define	MYBEHAV	285
#define	REFLEX	286
#define	BEHAV	287
#define	KEYBUTTON	288
#define	PARTGEN	289
#define	STATE	290
#define	METAACTION	291
#define	CONDITION	292
#define	DESVAR	293
#define	CONSTANTINT	294
#define	CONSTANTREAL	295
#define	DVTYPE	296
#define	FUNCTION	297
#define	PROCEDURE	298
#define	FIELD	299
#define	DVQUALIFIER	300
#define	SUBRREF	301
#define	OPWITH1PARM	302
#define	OPWITH2PARMS	303
#define	OPCOND	304
#define	OPGETCOMPO	305
#define	VECTOR	306
#define	MASKTYPE	307
#define	CONSTVECTOR	308
#define	POWER	309
#define	MACRO	310
#define	BEGINMACRO	311
#define	ENDMACRO	312
#define	SCHEDULE	313
#define	ITRULES	314
#define	SUBROUTINE	315
#define	IF	316
#define	IF2	317
#define	IF4	318
#define	IF8	319
#define	IF16	320
#define	IFDEBUG	321
#define	IFNOTU64	322
#define	IFNOT	323
#define	THEN	324
#define	ELSE	325
#define	ENDIF	326
#define	ME	327
#define	MAINACTOR	328
#define	NOBODY	329
#define	NOWHERE	330
#define	NOCOMPORT	331
#define	NOACTION	332
#define	EMPTYTEXT	333
#define	NOSUPEROBJECT	334
#define	CAPSNULL	335
#define	NOGRAPH	336
#define	STOPENGINE	337
#define	STOPRULE	338
#define	NONSTOP	339
#define	NOT	340
#define	AND	341
#define	OR	342
#define	XOR	343
#define	SYNTAXERROR	344
#define	NEG	345

 /* #defines tokens */
#else
/* CLASS */
#ifndef YY_CParse_CLASS
#define YY_CParse_CLASS CParse
#endif
#ifndef YY_CParse_INHERIT
#define YY_CParse_INHERIT
#endif
#ifndef YY_CParse_MEMBERS
#define YY_CParse_MEMBERS 
#endif
#ifndef YY_CParse_LEX_BODY
#define YY_CParse_LEX_BODY  
#endif
#ifndef YY_CParse_ERROR_BODY
#define YY_CParse_ERROR_BODY  
#endif
#ifndef YY_CParse_CONSTRUCTOR_PARAM
#define YY_CParse_CONSTRUCTOR_PARAM
#endif
#ifndef YY_CParse_CONSTRUCTOR_CODE
#define YY_CParse_CONSTRUCTOR_CODE
#endif
#ifndef YY_CParse_CONSTRUCTOR_INIT
#define YY_CParse_CONSTRUCTOR_INIT
#endif

class YY_CParse_CLASS YY_CParse_INHERIT
{
public: /* static const int token ... */
static const int STRING;
static const int TEXT;
static const int BOOLEAN;
static const int INT;
static const int REAL;
static const int PERSO;
static const int ZDD;
static const int ZDE;
static const int ZDM;
static const int ZDR;
static const int ACTION;
static const int WAYPOINT;
static const int CHANNEL;
static const int SURFACE;
static const int ENVIRONMENT;
static const int SECTOR;
static const int SUPEROBJECT;
static const int LIPSYNCHRO;
static const int OBJECTTABLE;
static const int FAMILY;
static const int MODEL;
static const int SOUNDEVENT;
static const int GAMEMATERIAL;
static const int LIGHT;
static const int CAPS;
static const int GRAPH;
static const int MYREFLEX;
static const int MYBEHAV;
static const int REFLEX;
static const int BEHAV;
static const int KEYBUTTON;
static const int PARTGEN;
static const int STATE;
static const int METAACTION;
static const int CONDITION;
static const int DESVAR;
static const int CONSTANTINT;
static const int CONSTANTREAL;
static const int DVTYPE;
static const int FUNCTION;
static const int PROCEDURE;
static const int FIELD;
static const int DVQUALIFIER;
static const int SUBRREF;
static const int OPWITH1PARM;
static const int OPWITH2PARMS;
static const int OPCOND;
static const int OPGETCOMPO;
static const int VECTOR;
static const int MASKTYPE;
static const int CONSTVECTOR;
static const int POWER;
static const int MACRO;
static const int BEGINMACRO;
static const int ENDMACRO;
static const int SCHEDULE;
static const int ITRULES;
static const int SUBROUTINE;
static const int IF;
static const int IF2;
static const int IF4;
static const int IF8;
static const int IF16;
static const int IFDEBUG;
static const int IFNOTU64;
static const int IFNOT;
static const int THEN;
static const int ELSE;
static const int ENDIF;
static const int ME;
static const int MAINACTOR;
static const int NOBODY;
static const int NOWHERE;
static const int NOCOMPORT;
static const int NOACTION;
static const int EMPTYTEXT;
static const int NOSUPEROBJECT;
static const int CAPSNULL;
static const int NOGRAPH;
static const int STOPENGINE;
static const int STOPRULE;
static const int NONSTOP;
static const int NOT;
static const int AND;
static const int OR;
static const int XOR;
static const int SYNTAXERROR;
static const int NEG;

 /* decl const */
public:
 int YY_CParse_PARSE (YY_CParse_PARSE_PARAM);
 virtual void YY_CParse_ERROR(char *msg) YY_CParse_ERROR_BODY;
#ifdef YY_CParse_PURE
#ifdef YY_CParse_LSP_NEEDED
 virtual int  YY_CParse_LEX (YY_CParse_STYPE *YY_CParse_LVAL,YY_CParse_LTYPE *YY_CParse_LLOC) YY_CParse_LEX_BODY;
#else
 virtual int  YY_CParse_LEX (YY_CParse_STYPE *YY_CParse_LVAL) YY_CParse_LEX_BODY;
#endif
#else
 virtual int YY_CParse_LEX() YY_CParse_LEX_BODY;
 YY_CParse_STYPE YY_CParse_LVAL;
#ifdef YY_CParse_LSP_NEEDED
 YY_CParse_LTYPE YY_CParse_LLOC;
#endif
 int   YY_CParse_NERRS;
 int    YY_CParse_CHAR;
#endif
#if YY_CParse_DEBUG != 0
 int YY_CParse_DEBUG_FLAG;   /*  nonzero means print parse trace     */
#endif
public:
 YY_CParse_CLASS(YY_CParse_CONSTRUCTOR_PARAM);
public:
 YY_CParse_MEMBERS 
};
/* other declare folow */
const int YY_CParse_CLASS::STRING=258;
const int YY_CParse_CLASS::TEXT=259;
const int YY_CParse_CLASS::BOOLEAN=260;
const int YY_CParse_CLASS::INT=261;
const int YY_CParse_CLASS::REAL=262;
const int YY_CParse_CLASS::PERSO=263;
const int YY_CParse_CLASS::ZDD=264;
const int YY_CParse_CLASS::ZDE=265;
const int YY_CParse_CLASS::ZDM=266;
const int YY_CParse_CLASS::ZDR=267;
const int YY_CParse_CLASS::ACTION=268;
const int YY_CParse_CLASS::WAYPOINT=269;
const int YY_CParse_CLASS::CHANNEL=270;
const int YY_CParse_CLASS::SURFACE=271;
const int YY_CParse_CLASS::ENVIRONMENT=272;
const int YY_CParse_CLASS::SECTOR=273;
const int YY_CParse_CLASS::SUPEROBJECT=274;
const int YY_CParse_CLASS::LIPSYNCHRO=275;
const int YY_CParse_CLASS::OBJECTTABLE=276;
const int YY_CParse_CLASS::FAMILY=277;
const int YY_CParse_CLASS::MODEL=278;
const int YY_CParse_CLASS::SOUNDEVENT=279;
const int YY_CParse_CLASS::GAMEMATERIAL=280;
const int YY_CParse_CLASS::LIGHT=281;
const int YY_CParse_CLASS::CAPS=282;
const int YY_CParse_CLASS::GRAPH=283;
const int YY_CParse_CLASS::MYREFLEX=284;
const int YY_CParse_CLASS::MYBEHAV=285;
const int YY_CParse_CLASS::REFLEX=286;
const int YY_CParse_CLASS::BEHAV=287;
const int YY_CParse_CLASS::KEYBUTTON=288;
const int YY_CParse_CLASS::PARTGEN=289;
const int YY_CParse_CLASS::STATE=290;
const int YY_CParse_CLASS::METAACTION=291;
const int YY_CParse_CLASS::CONDITION=292;
const int YY_CParse_CLASS::DESVAR=293;
const int YY_CParse_CLASS::CONSTANTINT=294;
const int YY_CParse_CLASS::CONSTANTREAL=295;
const int YY_CParse_CLASS::DVTYPE=296;
const int YY_CParse_CLASS::FUNCTION=297;
const int YY_CParse_CLASS::PROCEDURE=298;
const int YY_CParse_CLASS::FIELD=299;
const int YY_CParse_CLASS::DVQUALIFIER=300;
const int YY_CParse_CLASS::SUBRREF=301;
const int YY_CParse_CLASS::OPWITH1PARM=302;
const int YY_CParse_CLASS::OPWITH2PARMS=303;
const int YY_CParse_CLASS::OPCOND=304;
const int YY_CParse_CLASS::OPGETCOMPO=305;
const int YY_CParse_CLASS::VECTOR=306;
const int YY_CParse_CLASS::MASKTYPE=307;
const int YY_CParse_CLASS::CONSTVECTOR=308;
const int YY_CParse_CLASS::POWER=309;
const int YY_CParse_CLASS::MACRO=310;
const int YY_CParse_CLASS::BEGINMACRO=311;
const int YY_CParse_CLASS::ENDMACRO=312;
const int YY_CParse_CLASS::SCHEDULE=313;
const int YY_CParse_CLASS::ITRULES=314;
const int YY_CParse_CLASS::SUBROUTINE=315;
const int YY_CParse_CLASS::IF=316;
const int YY_CParse_CLASS::IF2=317;
const int YY_CParse_CLASS::IF4=318;
const int YY_CParse_CLASS::IF8=319;
const int YY_CParse_CLASS::IF16=320;
const int YY_CParse_CLASS::IFDEBUG=321;
const int YY_CParse_CLASS::IFNOTU64=322;
const int YY_CParse_CLASS::IFNOT=323;
const int YY_CParse_CLASS::THEN=324;
const int YY_CParse_CLASS::ELSE=325;
const int YY_CParse_CLASS::ENDIF=326;
const int YY_CParse_CLASS::ME=327;
const int YY_CParse_CLASS::MAINACTOR=328;
const int YY_CParse_CLASS::NOBODY=329;
const int YY_CParse_CLASS::NOWHERE=330;
const int YY_CParse_CLASS::NOCOMPORT=331;
const int YY_CParse_CLASS::NOACTION=332;
const int YY_CParse_CLASS::EMPTYTEXT=333;
const int YY_CParse_CLASS::NOSUPEROBJECT=334;
const int YY_CParse_CLASS::CAPSNULL=335;
const int YY_CParse_CLASS::NOGRAPH=336;
const int YY_CParse_CLASS::STOPENGINE=337;
const int YY_CParse_CLASS::STOPRULE=338;
const int YY_CParse_CLASS::NONSTOP=339;
const int YY_CParse_CLASS::NOT=340;
const int YY_CParse_CLASS::AND=341;
const int YY_CParse_CLASS::OR=342;
const int YY_CParse_CLASS::XOR=343;
const int YY_CParse_CLASS::SYNTAXERROR=344;
const int YY_CParse_CLASS::NEG=345;

 /* const YY_CParse_CLASS::token */
/*apres const  */
YY_CParse_CLASS::YY_CParse_CLASS(YY_CParse_CONSTRUCTOR_PARAM) YY_CParse_CONSTRUCTOR_INIT
{
#if YY_CParse_DEBUG != 0
YY_CParse_DEBUG_FLAG=0;
#endif
YY_CParse_CONSTRUCTOR_CODE;
};
#endif


#define	YYFINAL		287
#define	YYFLAG		-32768
#define	YYNTBASE	107

#define YYTRANSLATE(x) ((unsigned)(x) <= 345 ? yytranslate[x] : 169)

static const char yytranslate[] = {     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,   105,     2,    96,
    97,    92,    90,    99,    91,    98,    93,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,    95,     2,     2,
     2,     2,   106,   102,     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,
   100,     2,   101,     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,   103,     2,   104,     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,    15,
    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
    36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
    46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
    56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
    66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
    76,    77,    78,    79,    80,    81,    82,    83,    84,    85,
    86,    87,    88,    89,    94
};

#if YY_CParse_DEBUG != 0
static const short yyprhs[] = {     0,
     0,     2,     4,     6,    10,    11,    13,    15,    17,    20,
    25,    27,    29,    31,    34,    40,    42,    44,    46,    48,
    49,    51,    53,    55,    58,    61,    67,    69,    73,    79,
    86,    93,    95,    96,    98,   100,   102,   104,   111,   113,
   115,   117,   119,   123,   127,   130,   132,   134,   136,   138,
   140,   142,   144,   146,   148,   151,   153,   156,   158,   163,
   165,   169,   175,   183,   185,   187,   191,   195,   197,   199,
   201,   203,   205,   207,   211,   216,   221,   228,   235,   239,
   243,   247,   251,   254,   258,   260,   262,   264,   266,   268,
   270,   272,   274,   276,   278,   280,   282,   284,   286,   288,
   290,   292,   294,   296,   298,   300,   302,   304,   306,   308,
   310,   312,   314,   316,   318,   320,   322,   324,   326,   328,
   330,   332,   334,   336,   338,   340,   345,   347,   348,   350,
   354,   356,   358,   362,   364,   366,   367,   369,   373,   375,
   377,   380,   382,   384,   387,   389,   391,   397,   405,   409,
   413,   415,   417,   419,   421,   423,   425,   427,   429,   431,
   433,   435,   440,   447,   454,   457,   462,   468,   474,   477,
   479,   481,   483,   485,   487
};

static const short yyrhs[] = {   120,
     0,   109,     0,   108,     0,    60,    95,   155,     0,     0,
   110,     0,   114,     0,   111,     0,   110,   111,     0,    55,
   112,    95,   113,     0,     3,     0,   155,     0,   115,     0,
   114,   115,     0,   119,   116,   117,    95,   118,     0,    41,
     0,     3,     0,   144,     0,   131,     0,     0,    45,     0,
   121,     0,   153,     0,   121,   153,     0,    58,   155,     0,
   123,   127,    96,   151,    97,     0,   130,     0,   125,   155,
   126,     0,   123,   128,    96,   151,    97,     0,   143,    98,
   128,    96,   151,    97,     0,   135,    98,   128,    96,   151,
    97,     0,   129,     0,     0,   124,     0,    82,     0,    83,
     0,    84,     0,    56,    96,     6,    99,     6,    97,     0,
    57,     0,    36,     0,    43,     0,    46,     0,   132,   138,
   141,     0,   132,   138,   131,     0,   132,   139,     0,    74,
     0,    79,     0,    75,     0,    76,     0,    77,     0,    80,
     0,    81,     0,    78,     0,   136,     0,   136,   140,     0,
   133,     0,   133,   140,     0,   134,     0,   134,   100,   141,
   101,     0,   135,     0,   143,    98,   135,     0,   135,    98,
    23,   102,   135,     0,   143,    98,   135,    98,    23,   102,
   135,     0,    38,     0,   137,     0,   143,    98,   137,     0,
   135,    98,   137,     0,    44,     0,    48,     0,    47,     0,
    50,     0,   132,     0,   144,     0,   103,   164,   104,     0,
   142,    96,   151,    97,     0,   150,    96,   151,    97,     0,
   143,    98,   150,    96,   151,    97,     0,   135,    98,   150,
    96,   151,    97,     0,   141,    90,   141,     0,   141,    91,
   141,     0,   141,    92,   141,     0,   141,    93,   141,     0,
    91,   141,     0,    96,   141,    97,     0,    51,     0,     8,
     0,    72,     0,    73,     0,     6,     0,     7,     0,    39,
     0,    40,     0,   143,     0,     9,     0,    10,     0,    11,
     0,    12,     0,    13,     0,    14,     0,    15,     0,    16,
     0,    17,     0,    18,     0,    19,     0,    20,     0,    21,
     0,    22,     0,    24,     0,    25,     0,    26,     0,    27,
     0,    28,     0,     5,     0,    29,     0,    30,     0,    31,
     0,    32,     0,    33,     0,   148,     0,    54,     0,     3,
     0,     4,     0,    34,     0,    23,     0,    35,     0,   145,
    96,   146,    97,     0,    53,     0,     0,   147,     0,   146,
    99,   147,     0,   144,     0,   149,     0,   148,   105,   149,
     0,    52,     0,    42,     0,     0,   152,     0,   151,    99,
   152,     0,   141,     0,   131,     0,   154,   155,     0,    59,
     0,   156,     0,   155,   156,     0,   122,     0,   157,     0,
   160,   164,   161,   155,   163,     0,   160,   164,   161,   155,
   162,   155,   163,     0,   158,   155,   163,     0,   159,   155,
   163,     0,    66,     0,    67,     0,    61,     0,    62,     0,
    63,     0,    64,     0,    65,     0,    68,     0,    69,     0,
    70,     0,    71,     0,   165,    96,   151,    97,     0,   143,
    98,   165,    96,   151,    97,     0,   135,    98,   165,    96,
   151,    97,     0,   166,   164,     0,   166,    96,   164,    97,
     0,    96,   164,   167,   164,    97,     0,    96,   141,   168,
   141,    97,     0,   106,   152,     0,    37,     0,    85,     0,
    86,     0,    87,     0,    88,     0,    49,     0
};

#endif

#if YY_CParse_DEBUG != 0
static const short yyrline[] = { 0,
   380,   384,   389,   401,   419,   420,   428,   433,   438,   447,
   464,   467,   471,   472,   476,   579,   586,   589,   590,   593,
   600,   613,   614,   615,   619,   639,   660,   661,   674,   695,
   734,   786,   822,   826,   843,   844,   845,   848,   891,   896,
   899,   903,   906,   919,   932,   946,   950,   954,   958,   962,
   966,   970,   974,   980,   981,   996,   997,  1014,  1015,  1044,
  1060,  1109,  1160,  1273,  1279,  1280,  1302,  1337,  1343,  1349,
  1355,  1361,  1362,  1363,  1368,  1383,  1400,  1439,  1489,  1506,
  1523,  1566,  1583,  1600,  1608,  1618,  1625,  1629,  1639,  1643,
  1647,  1651,  1655,  1656,  1660,  1664,  1668,  1672,  1676,  1680,
  1684,  1688,  1692,  1696,  1700,  1704,  1708,  1712,  1716,  1720,
  1724,  1728,  1732,  1736,  1740,  1744,  1748,  1752,  1756,  1760,
  1764,  1768,  1776,  1780,  1784,  1790,  1818,  1824,  1828,  1829,
  1839,  1842,  1843,  1858,  1869,  1872,  1876,  1877,  1887,  1888,
  1891,  1895,  1907,  1908,  1913,  1941,  1944,  1952,  1962,  1971,
  1982,  1983,  1984,  1984,  1984,  1984,  1984,  1984,  1987,  1990,
  1993,  2016,  2033,  2072,  2122,  2130,  2139,  2149,  2164,  2189,
  2195,  2201,  2205,  2209,  2215
};

static const char * const yytname[] = {   "$","error","$illegal.","STRING","TEXT",
"BOOLEAN","INT","REAL","PERSO","ZDD","ZDE","ZDM","ZDR","ACTION","WAYPOINT","CHANNEL",
"SURFACE","ENVIRONMENT","SECTOR","SUPEROBJECT","LIPSYNCHRO","OBJECTTABLE","FAMILY",
"MODEL","SOUNDEVENT","GAMEMATERIAL","LIGHT","CAPS","GRAPH","MYREFLEX","MYBEHAV",
"REFLEX","BEHAV","KEYBUTTON","PARTGEN","STATE","METAACTION","CONDITION","DESVAR",
"CONSTANTINT","CONSTANTREAL","DVTYPE","FUNCTION","PROCEDURE","FIELD","DVQUALIFIER",
"SUBRREF","OPWITH1PARM","OPWITH2PARMS","OPCOND","OPGETCOMPO","VECTOR","MASKTYPE",
"CONSTVECTOR","POWER","MACRO","BEGINMACRO","ENDMACRO","SCHEDULE","ITRULES","SUBROUTINE",
"IF","IF2","IF4","IF8","IF16","IFDEBUG","IFNOTU64","IFNOT","THEN","ELSE","ENDIF",
"ME","MAINACTOR","NOBODY","NOWHERE","NOCOMPORT","NOACTION","EMPTYTEXT","NOSUPEROBJECT",
"CAPSNULL","NOGRAPH","STOPENGINE","STOPRULE","NONSTOP","NOT","AND","OR","XOR",
"SYNTAXERROR","'+'","'-'","'*'","'/'","NEG","':'","'('","')'","'.'","','","'['",
"']'","'@'","'{'","'}'","'&'","'?'","text","subroutine","declarations","macrodecls",
"macrodecl","macroname","macrodef","dvdecls","dvdecl","dvtype","dvname","dvvalue",
"dvqual","behaviour","schedule","action","metaflag","stopflag","beginmacro",
"endmacro","metaaction","procedure","subrref","affectation","null","lvariable",
"ext2var","extvar","variable","extfield","field","opaffect","opaffect1","opgetcompo",
"exp","vector","perso","constant","constvector","constparms","constparm","masktypes",
"masktype","function","parms","parm","itrules","itrstart","statements","statement",
"condaction","ifdebug","ifnotu64","if","then","else","endif","conditions","condition",
"not","opcond","opbin",""
};
#endif

static const short yyr1[] = {     0,
   107,   107,   107,   108,   109,   109,   109,   110,   110,   111,
   112,   113,   114,   114,   115,   116,   117,   118,   118,   119,
   119,   120,   120,   120,   121,   122,   122,   122,   122,   122,
   122,   122,   123,   123,   124,   124,   124,   125,   126,   127,
   128,   129,   130,   130,   130,   131,   131,   131,   131,   131,
   131,   131,   131,   132,   132,   132,   132,   133,   133,   134,
   134,   134,   134,   135,   136,   136,   136,   137,   138,   139,
   140,   141,   141,   141,   141,   141,   141,   141,   141,   141,
   141,   141,   141,   141,   142,   143,   143,   143,   144,   144,
   144,   144,   144,   144,   144,   144,   144,   144,   144,   144,
   144,   144,   144,   144,   144,   144,   144,   144,   144,   144,
   144,   144,   144,   144,   144,   144,   144,   144,   144,   144,
   144,   144,   144,   144,   144,   144,   145,   146,   146,   146,
   147,   148,   148,   149,   150,   151,   151,   151,   152,   152,
   153,   154,   155,   155,   156,   156,   157,   157,   157,   157,
   158,   159,   160,   160,   160,   160,   160,   160,   161,   162,
   163,   164,   164,   164,   164,   164,   164,   164,   164,   165,
   166,   167,   167,   167,   168
};

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

static const short yydefact[] = {     5,
    21,     0,    33,   142,     0,     3,     2,     6,     8,     7,
    13,     0,     1,    22,    23,    33,    11,     0,    86,    64,
    68,    42,     0,   153,   154,   155,   156,   157,   151,   152,
   158,    87,    88,    35,    36,    37,   145,     0,    34,    33,
    32,    27,     0,    56,    58,    60,    54,    65,     0,    25,
   143,   146,    33,    33,     0,    33,     9,    14,    16,     0,
    24,    33,    33,     0,    40,    41,     0,     0,    33,    70,
    69,     0,    45,    71,    57,     0,     0,    55,     0,   144,
    33,    33,   170,   171,     0,     0,     0,     0,     0,     0,
     0,    33,    17,     0,    10,    12,     0,   136,   136,    39,
    28,   121,   122,   113,    89,    90,    94,    95,    96,    97,
    98,    99,   100,   101,   102,   103,   104,   105,   106,   107,
   124,   108,   109,   110,   111,   112,   114,   115,   116,   117,
   118,   123,   125,    91,    92,   135,    85,   134,   127,   120,
    46,    48,    49,    50,    53,    47,    51,    52,     0,     0,
     0,    44,    72,    60,    43,     0,    93,    73,     0,   119,
   132,     0,     0,     0,     0,    67,     0,    61,    66,   161,
   149,   150,     0,    60,     0,    93,     0,   140,   139,   169,
     0,     0,   159,    33,   136,     0,   165,     0,     0,     0,
   137,     0,    83,     0,     0,     0,     0,     0,     0,     0,
   136,     0,   128,     0,   136,    59,     0,   136,   136,     0,
     0,     0,   175,     0,     0,   172,   173,   174,     0,     0,
     0,    33,     0,     0,    15,    19,    93,    18,     0,    26,
     0,    29,    84,    74,     0,    79,    80,    81,    82,     0,
     0,   131,     0,   129,   133,     0,    62,     0,     0,     0,
     0,     0,   136,   136,   160,    33,   147,   162,   166,    38,
   138,   136,    75,   136,   126,     0,    76,    31,    30,     0,
   168,   167,     0,     0,    33,     0,     0,   130,    63,   164,
   163,   148,    78,    77,     0,     0,     0
};

static const short yydefgoto[] = {   285,
     6,     7,     8,     9,    18,    95,    10,    11,    60,    94,
   225,    12,    13,    14,    37,    38,    39,    40,   101,    67,
    68,    41,    42,   178,   153,    44,    45,   154,    47,    48,
    72,    73,    75,   179,   156,   157,   158,   159,   243,   244,
   160,   161,   162,   190,   191,    15,    16,    50,    51,    52,
    53,    54,    55,   184,   256,   171,   177,    90,    91,   219,
   214
};

static const short yypact[] = {   131,
-32768,    30,   860,-32768,   -59,-32768,-32768,     3,-32768,     1,
-32768,    39,-32768,    28,-32768,   860,-32768,    -5,-32768,-32768,
-32768,-32768,    13,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,   -29,-32768,   860,
-32768,-32768,     7,    49,    16,    26,    49,-32768,    32,   726,
-32768,-32768,   860,   860,   128,   860,-32768,-32768,-32768,   135,
-32768,   584,   860,   137,-32768,-32768,    38,    50,   788,-32768,
-32768,   435,-32768,-32768,-32768,   536,   -12,-32768,    63,-32768,
   829,   829,-32768,-32768,   331,   435,    53,    61,    78,    66,
   150,   597,-32768,    72,-32768,   726,    83,   435,   435,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   536,   536,
   128,-32768,-32768,    73,   140,    89,    76,-32768,   111,   113,
-32768,   125,   -74,    91,   130,-32768,   143,   104,-32768,-32768,
-32768,-32768,   331,   138,   -20,   142,   171,-32768,   140,-32768,
   214,   214,-32768,   860,   435,   331,-32768,   679,   246,   -73,
-32768,    97,-32768,    87,   151,    33,   536,   536,   536,   536,
   435,    75,   942,   213,   435,-32768,   232,   435,   435,   266,
   -28,   -14,-32768,   536,   119,-32768,-32768,-32768,   128,   194,
   195,   757,   106,   123,-32768,-32768,-32768,-32768,   196,-32768,
   435,-32768,-32768,-32768,   198,   -25,   -25,-32768,-32768,   118,
   199,-32768,   146,-32768,-32768,   165,-32768,   169,   172,   190,
   157,   201,   435,   435,-32768,   860,-32768,-32768,-32768,-32768,
-32768,   435,-32768,   435,-32768,   942,-32768,-32768,-32768,   232,
-32768,-32768,   176,   179,   829,   180,   184,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,   296,   299,-32768
};

static const short yypgoto[] = {-32768,
-32768,-32768,-32768,   292,-32768,-32768,-32768,   291,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
   205,-32768,-32768,   -60,    58,-32768,-32768,    -3,-32768,   -71,
-32768,-32768,   256,    88,-32768,    41,  -183,-32768,-32768,    40,
-32768,   100,  -110,   -56,   -76,   294,-32768,   -15,   -47,-32768,
-32768,-32768,-32768,-32768,-32768,   -80,   -51,   -97,-32768,-32768,
-32768
};


#define	YYLAST		1015


static const short yytable[] = {    46,
    62,   172,    80,    89,   228,   166,    65,   169,   164,   180,
   164,   152,    46,    66,    80,   197,   198,   199,   200,   242,
   213,    80,    83,   230,    69,   231,   206,   136,   213,    21,
    66,    21,    17,    80,    80,    56,    46,    81,    82,   187,
    92,   -20,   192,    49,    80,     1,    46,    96,    80,    46,
    46,    87,    46,    70,    71,   164,    49,     2,    46,    46,
    43,   197,   198,   199,   200,    46,   199,   200,   233,   197,
   198,   199,   200,    43,   136,   168,    21,    46,    46,    59,
    49,   174,   242,   220,   221,   235,     4,    87,    46,    63,
    49,   241,    46,    49,    49,    88,    49,    43,    74,   195,
    20,   235,    49,    49,   241,    66,    21,    43,    64,    49,
    43,    43,    20,    43,   220,    76,   136,   221,    21,    43,
    43,    49,    49,    77,   166,   176,    43,   226,   223,    79,
   169,    88,    49,    98,   224,    19,    49,    93,    43,    43,
   166,   257,    97,   169,   240,    99,   183,    87,   246,    43,
   181,   248,   249,    43,   261,    83,    20,    19,   182,   155,
   136,   185,    21,   163,    83,    20,   188,   252,   222,   174,
   196,   -20,   175,   202,    80,     1,   197,   198,   199,   200,
    46,   189,   174,   233,   201,     2,    83,    20,     3,     4,
     5,    88,   207,   232,   282,   231,   273,   274,   168,    32,
    33,   210,   258,   247,   231,   276,   203,   277,   216,   217,
   218,   168,    84,   176,   263,    87,   231,   204,    46,   259,
   205,    32,    33,    85,    49,   208,   176,    80,   227,   197,
   198,   199,   200,    86,    84,   212,   193,   194,   209,   215,
   275,    43,   265,   227,   266,   186,   197,   198,   199,   200,
    83,   229,    46,   271,   234,    86,   216,   217,   218,    88,
   211,   267,    49,   231,   138,   268,   279,   231,   269,    20,
   231,    46,   280,   175,   231,   281,   283,   231,   231,    43,
   284,   165,   231,   167,   236,   237,   238,   239,   250,   253,
   254,   270,   260,   262,   264,   286,    49,   272,   287,    57,
    58,   251,    78,   245,     0,   278,   227,    61,     0,     0,
     0,     0,     0,    43,     0,    49,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,    43,   102,   103,   104,   105,   106,    19,   107,
   108,   109,   110,   111,   112,   113,   114,   115,   116,   117,
   118,   119,   120,   121,   122,   123,   124,   125,   126,   127,
   128,   129,   130,   131,   132,   133,     0,    83,    20,   134,
   135,     0,   136,     0,    21,     0,     0,     0,     0,     0,
     0,   137,   138,   139,   140,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,    32,    33,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,    84,     0,     0,     0,     0,
     0,   149,     0,     0,     0,     0,   173,     0,     0,     0,
     0,     0,     0,   151,     0,     0,    86,   102,   103,   104,
   105,   106,    19,   107,   108,   109,   110,   111,   112,   113,
   114,   115,   116,   117,   118,   119,   120,   121,   122,   123,
   124,   125,   126,   127,   128,   129,   130,   131,   132,   133,
     0,     0,    20,   134,   135,     0,   136,     0,    21,     0,
     0,     0,     0,     0,     0,   137,   138,   139,   140,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,    32,    33,   141,   142,
   143,   144,   145,   146,   147,   148,     0,     0,     0,     0,
     0,     0,     0,     0,     0,   149,     0,     0,     0,     0,
   150,     0,     0,     0,     0,     0,     0,   151,   102,   103,
   104,   105,   106,    19,   107,   108,   109,   110,   111,   112,
   113,   114,   115,   116,   117,   118,   119,   120,   121,   122,
   123,   124,   125,   126,   127,   128,   129,   130,   131,   132,
   133,     0,     0,    20,   134,   135,     0,   136,     0,    21,
     0,     0,     0,  -141,     0,     0,   137,   138,   139,   140,
     0,    19,     0,     0,     0,     0,    -4,     0,     0,     0,
     0,     0,     0,     0,    19,     0,     0,    32,    33,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,    20,     0,     0,     0,     0,   149,    21,     0,    22,
     0,   150,     0,     0,    20,     0,     0,     0,   151,    23,
    21,     0,    22,     0,    24,    25,    26,    27,    28,    29,
    30,    31,    23,     0,     0,    32,    33,    24,    25,    26,
    27,    28,    29,    30,    31,    34,    35,    36,    32,    33,
     0,     0,     0,     0,     0,     0,     0,     0,    34,    35,
    36,   102,   103,   104,   105,   106,    19,   107,   108,   109,
   110,   111,   112,   113,   114,   115,   116,   117,   118,   119,
   120,   121,   122,   123,   124,   125,   126,   127,   128,   129,
   130,   131,   132,   133,     0,     0,     0,   134,   135,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
   138,   139,   140,    19,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    32,    33,   141,   142,   143,   144,   145,   146,   147,   148,
     0,   -33,     0,    20,    19,     0,     0,     0,   -33,    21,
     0,    22,     0,     0,     0,     0,     0,     0,     0,     0,
     0,    23,     0,     0,     0,     0,    24,    25,    26,    27,
    28,    29,    30,    31,    20,    19,     0,    32,    33,     0,
    21,     0,    22,     0,     0,     0,     0,    34,    35,    36,
     0,     0,    23,     0,     0,     0,     0,    24,    25,    26,
    27,    28,    29,    30,    31,    20,   255,   170,    32,    33,
     0,    21,     0,    22,     0,     0,    19,     0,    34,    35,
    36,     0,     0,    23,   100,     0,     0,     0,    24,    25,
    26,    27,    28,    29,    30,    31,     0,     0,     0,    32,
    33,     0,     0,     0,     0,     0,    20,    19,     0,    34,
    35,    36,    21,     0,    22,     0,     0,     0,     0,     0,
     0,     0,     0,     0,    23,     0,     0,     0,     0,    24,
    25,    26,    27,    28,    29,    30,    31,    20,     0,   170,
    32,    33,     0,    21,     0,    22,     0,     0,     0,     0,
    34,    35,    36,     0,     0,    23,     0,     0,     0,     0,
    24,    25,    26,    27,    28,    29,    30,    31,     0,     0,
     0,    32,    33,     0,     0,     0,     0,     0,     0,     0,
     0,    34,    35,    36,   102,   103,   104,   105,   106,    19,
   107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
   117,   118,   119,   120,   121,   122,   123,   124,   125,   126,
   127,   128,   129,   130,   131,   132,   133,     0,     0,     0,
   134,   135,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,   138,   139,   140,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,    32,    33
};

static const short yycheck[] = {     3,
    16,    82,    50,    55,   188,    77,    36,    79,    23,    86,
    23,    72,    16,    43,    62,    90,    91,    92,    93,   203,
    49,    69,    37,    97,    40,    99,   101,    42,    49,    44,
    43,    44,     3,    81,    82,    95,    40,    53,    54,    91,
    56,    41,    99,     3,    92,    45,    50,    63,    96,    53,
    54,    55,    56,    47,    48,    23,    16,    55,    62,    63,
     3,    90,    91,    92,    93,    69,    92,    93,    97,    90,
    91,    92,    93,    16,    42,    79,    44,    81,    82,    41,
    40,    85,   266,   181,   182,   196,    59,    91,    92,    95,
    50,   202,    96,    53,    54,    55,    56,    40,    50,   151,
    38,   212,    62,    63,   215,    43,    44,    50,    96,    69,
    53,    54,    38,    56,   212,   100,    42,   215,    44,    62,
    63,    81,    82,    98,   196,    85,    69,   188,   185,    98,
   202,    91,    92,    96,   186,     8,    96,     3,    81,    82,
   212,   222,     6,   215,   201,    96,    69,   151,   205,    92,
    98,   208,   209,    96,   231,    37,    38,     8,    98,    72,
    42,    96,    44,    76,    37,    38,    95,   219,   184,   173,
    98,    41,    85,    98,   222,    45,    90,    91,    92,    93,
   184,    99,   186,    97,    96,    55,    37,    38,    58,    59,
    60,   151,   102,    97,   275,    99,   253,   254,   202,    72,
    73,    98,    97,   207,    99,   262,    96,   264,    86,    87,
    88,   215,    85,   173,    97,   219,    99,   105,   222,    97,
    96,    72,    73,    96,   184,    96,   186,   275,   188,    90,
    91,    92,    93,   106,    85,    98,   149,   150,    96,    98,
   256,   184,    97,   203,    99,    96,    90,    91,    92,    93,
    37,     6,   256,    97,   104,   106,    86,    87,    88,   219,
   173,    97,   222,    99,    52,    97,   270,    99,    97,    38,
    99,   275,    97,   186,    99,    97,    97,    99,    99,   222,
    97,    77,    99,    79,   197,   198,   199,   200,    23,    96,
    96,   102,    97,    96,    96,     0,   256,    97,     0,     8,
    10,   214,    47,   204,    -1,   266,   266,    14,    -1,    -1,
    -1,    -1,    -1,   256,    -1,   275,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,   275,     3,     4,     5,     6,     7,     8,     9,
    10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
    20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
    30,    31,    32,    33,    34,    35,    -1,    37,    38,    39,
    40,    -1,    42,    -1,    44,    -1,    -1,    -1,    -1,    -1,
    -1,    51,    52,    53,    54,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    72,    73,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    85,    -1,    -1,    -1,    -1,
    -1,    91,    -1,    -1,    -1,    -1,    96,    -1,    -1,    -1,
    -1,    -1,    -1,   103,    -1,    -1,   106,     3,     4,     5,
     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
    -1,    -1,    38,    39,    40,    -1,    42,    -1,    44,    -1,
    -1,    -1,    -1,    -1,    -1,    51,    52,    53,    54,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    72,    73,    74,    75,
    76,    77,    78,    79,    80,    81,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    91,    -1,    -1,    -1,    -1,
    96,    -1,    -1,    -1,    -1,    -1,    -1,   103,     3,     4,
     5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
    35,    -1,    -1,    38,    39,    40,    -1,    42,    -1,    44,
    -1,    -1,    -1,     0,    -1,    -1,    51,    52,    53,    54,
    -1,     8,    -1,    -1,    -1,    -1,     0,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,     8,    -1,    -1,    72,    73,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    38,    -1,    -1,    -1,    -1,    91,    44,    -1,    46,
    -1,    96,    -1,    -1,    38,    -1,    -1,    -1,   103,    56,
    44,    -1,    46,    -1,    61,    62,    63,    64,    65,    66,
    67,    68,    56,    -1,    -1,    72,    73,    61,    62,    63,
    64,    65,    66,    67,    68,    82,    83,    84,    72,    73,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    82,    83,
    84,     3,     4,     5,     6,     7,     8,     9,    10,    11,
    12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
    22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
    32,    33,    34,    35,    -1,    -1,    -1,    39,    40,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    52,    53,    54,     8,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
    -1,    36,    -1,    38,     8,    -1,    -1,    -1,    43,    44,
    -1,    46,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    56,    -1,    -1,    -1,    -1,    61,    62,    63,    64,
    65,    66,    67,    68,    38,     8,    -1,    72,    73,    -1,
    44,    -1,    46,    -1,    -1,    -1,    -1,    82,    83,    84,
    -1,    -1,    56,    -1,    -1,    -1,    -1,    61,    62,    63,
    64,    65,    66,    67,    68,    38,    70,    71,    72,    73,
    -1,    44,    -1,    46,    -1,    -1,     8,    -1,    82,    83,
    84,    -1,    -1,    56,    57,    -1,    -1,    -1,    61,    62,
    63,    64,    65,    66,    67,    68,    -1,    -1,    -1,    72,
    73,    -1,    -1,    -1,    -1,    -1,    38,     8,    -1,    82,
    83,    84,    44,    -1,    46,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    56,    -1,    -1,    -1,    -1,    61,
    62,    63,    64,    65,    66,    67,    68,    38,    -1,    71,
    72,    73,    -1,    44,    -1,    46,    -1,    -1,    -1,    -1,
    82,    83,    84,    -1,    -1,    56,    -1,    -1,    -1,    -1,
    61,    62,    63,    64,    65,    66,    67,    68,    -1,    -1,
    -1,    72,    73,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    82,    83,    84,     3,     4,     5,     6,     7,     8,
     9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
    19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
    29,    30,    31,    32,    33,    34,    35,    -1,    -1,    -1,
    39,    40,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    52,    53,    54,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    72,    73
};
 /* fattrs + tables */

/* parser code folow  */


/* 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: dollar marks section change
   the next  is replaced by the list of actions, each action
   as one case of the switch.  */ 

#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (YY_CParse_CHAR = YYEMPTY)
#define YYEMPTY         -2
#define YYEOF           0
#define YYACCEPT        return(0)
#define YYABORT         return(1)
#define YYERROR         goto yyerrlab1
/* Like YYERROR except do call yyerror.
   This remains here temporarily to ease the
   transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define YYFAIL          goto yyerrlab
#define YYRECOVERING()  (!!yyerrstatus)
#define YYBACKUP(token, value) \
do                                                              \
  if (YY_CParse_CHAR == YYEMPTY && yylen == 1)                               \
    { YY_CParse_CHAR = (token), YY_CParse_LVAL = (value);                 \
      yychar1 = YYTRANSLATE (YY_CParse_CHAR);                                \
      YYPOPSTACK;                                               \
      goto yybackup;                                            \
    }                                                           \
  else                                                          \
    { YY_CParse_ERROR ("syntax error: cannot back up"); YYERROR; }   \
while (0)

#define YYTERROR        1
#define YYERRCODE       256

#ifndef YY_CParse_PURE
/* UNPURE */
#define YYLEX           YY_CParse_LEX()
#ifndef YY_USE_CLASS
/* If nonreentrant, and not class , generate the variables here */
int     YY_CParse_CHAR;                      /*  the lookahead symbol        */
YY_CParse_STYPE      YY_CParse_LVAL;              /*  the semantic value of the */
				/*  lookahead symbol    */
int YY_CParse_NERRS;                 /*  number of parse errors so far */
#ifdef YY_CParse_LSP_NEEDED
YY_CParse_LTYPE YY_CParse_LLOC;   /*  location data for the lookahead     */
			/*  symbol                              */
#endif
#endif


#else
/* PURE */
#ifdef YY_CParse_LSP_NEEDED
#define YYLEX           YY_CParse_LEX(&YY_CParse_LVAL, &YY_CParse_LLOC)
#else
#define YYLEX           YY_CParse_LEX(&YY_CParse_LVAL)
#endif
#endif
#ifndef YY_USE_CLASS
#if YY_CParse_DEBUG != 0
int YY_CParse_DEBUG_FLAG;                    /*  nonzero means print parse trace     */
/* Since this is uninitialized, it does not stop multiple parsers
   from coexisting.  */
#endif
#endif



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

#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif

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

#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif


#if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
#define __yy_bcopy(FROM,TO,COUNT)       __builtin_memcpy(TO,FROM,COUNT)
#else                           /* not GNU C or C++ */

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */

#ifdef __cplusplus
static void __yy_bcopy (char *from, char *to, int count)
#else
#ifdef __STDC__
static void __yy_bcopy (char *from, char *to, int count)
#else
static void __yy_bcopy (from, to, count)
     char *from;
     char *to;
     int count;
#endif
#endif
{
  register char *f = from;
  register char *t = to;
  register int i = count;

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

int
#ifdef YY_USE_CLASS
 YY_CParse_CLASS::
#endif
     YY_CParse_PARSE(YY_CParse_PARSE_PARAM)
#ifndef __STDC__
#ifndef __cplusplus
#ifndef YY_USE_CLASS
/* parameter definition without protypes */
YY_CParse_PARSE_PARAM_DEF
#endif
#endif
#endif
{
  register int yystate;
  register int yyn;
  register short *yyssp;
  register YY_CParse_STYPE *yyvsp;
  int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
  int yychar1=0;          /*  lookahead token as an internal (translated) token number */

  short yyssa[YYINITDEPTH];     /*  the state stack                     */
  YY_CParse_STYPE yyvsa[YYINITDEPTH];        /*  the semantic value stack            */

  short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
  YY_CParse_STYPE *yyvs = yyvsa;     /*  to allow yyoverflow to reallocate them elsewhere */

#ifdef YY_CParse_LSP_NEEDED
  YY_CParse_LTYPE yylsa[YYINITDEPTH];        /*  the location stack                  */
  YY_CParse_LTYPE *yyls = yylsa;
  YY_CParse_LTYPE *yylsp;

#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK   (yyvsp--, yyssp--)
#endif

  int yystacksize = YYINITDEPTH;

#ifdef YY_CParse_PURE
  int YY_CParse_CHAR;
  YY_CParse_STYPE YY_CParse_LVAL;
  int YY_CParse_NERRS;
#ifdef YY_CParse_LSP_NEEDED
  YY_CParse_LTYPE YY_CParse_LLOC;
#endif
#endif

  YY_CParse_STYPE yyval;             /*  the variable used to return         */
				/*  semantic values from the action     */
				/*  routines                            */

  int yylen;

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

  yystate = 0;
  yyerrstatus = 0;
  YY_CParse_NERRS = 0;
  YY_CParse_CHAR = YYEMPTY;          /* 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.  */

  yyssp = yyss - 1;
  yyvsp = yyvs;
#ifdef YY_CParse_LSP_NEEDED
  yylsp = yyls;
#endif

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

  *++yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 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. */
      YY_CParse_STYPE *yyvs1 = yyvs;
      short *yyss1 = yyss;
#ifdef YY_CParse_LSP_NEEDED
      YY_CParse_LTYPE *yyls1 = yyls;
#endif

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

#ifdef yyoverflow
      /* Each stack pointer address is followed by the size of
	 the data in use in that stack, in bytes.  */
#ifdef YY_CParse_LSP_NEEDED
      /* This used to be a conditional around just the two extra args,
	 but that might be undefined if yyoverflow is a macro.  */
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yyls1, size * sizeof (*yylsp),
		 &yystacksize);
#else
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yystacksize);
#endif

      yyss = yyss1; yyvs = yyvs1;
#ifdef YY_CParse_LSP_NEEDED
      yyls = yyls1;
#endif
#else /* no yyoverflow */
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
	{
	  YY_CParse_ERROR("parser stack overflow");
	  return 2;
	}
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
	yystacksize = YYMAXDEPTH;
      yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
      __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
// BEGIN ROMTEAM Cristi Petrescu 98-09-
/*
      yyvs = (YY_CParse_STYPE *) alloca (yystacksize * sizeof (*yyvsp));
      __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
*/
	yyvs = new YY_CParse_STYPE [yystacksize];													\
	/* copy */																				\
	for (int i = 0; i < size; i++)															\
		yyvs [i] = yyvs1 [i];																\
	/* clean up */																			\
	if (m_pstMyStack)																		\
		delete [] m_pstMyStack;																\
	m_pstMyStack = yyvs;	
// END ROMTEAM Cristi Petrescu 98-09-

#ifdef YY_CParse_LSP_NEEDED
      yyls = (YY_CParse_LTYPE *) alloca (yystacksize * sizeof (*yylsp));
      __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */

      yyssp = yyss + size - 1;
      yyvsp = yyvs + size - 1;
#ifdef YY_CParse_LSP_NEEDED
      yylsp = yyls + size - 1;
#endif

#if YY_CParse_DEBUG != 0
      if (YY_CParse_DEBUG_FLAG)
	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif

      if (yyssp >= yyss + yystacksize - 1)
	YYABORT;
    }

#if YY_CParse_DEBUG != 0
  if (YY_CParse_DEBUG_FLAG)
    fprintf(stderr, "Entering state %d\n", yystate);
#endif

  goto yybackup;
 yybackup:

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

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

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yydefault;

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

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (YY_CParse_CHAR == YYEMPTY)
    {
#if YY_CParse_DEBUG != 0
      if (YY_CParse_DEBUG_FLAG)
	fprintf(stderr, "Reading a token: ");
#endif
      YY_CParse_CHAR = YYLEX;
    }

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

  if (YY_CParse_CHAR <= 0)           /* This means end of input. */
    {
      yychar1 = 0;
      YY_CParse_CHAR = YYEOF;                /* Don't call YYLEX any more */

#if YY_CParse_DEBUG != 0
      if (YY_CParse_DEBUG_FLAG)
	fprintf(stderr, "Now at end of input.\n");
#endif
    }
  else
    {
      yychar1 = YYTRANSLATE(YY_CParse_CHAR);

#if YY_CParse_DEBUG != 0
      if (YY_CParse_DEBUG_FLAG)
	{
	  fprintf (stderr, "Next token is %d (%s", YY_CParse_CHAR, yytname[yychar1]);
	  /* Give the individual parser a way to print the precise meaning
	     of a token, for further debugging info.  */
#ifdef YYPRINT
	  YYPRINT (stderr, YY_CParse_CHAR, YY_CParse_LVAL);
#endif
	  fprintf (stderr, ")\n");
	}
#endif
    }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    goto yydefault;

  yyn = yytable[yyn];

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

  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrlab;

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */

#if YY_CParse_DEBUG != 0
  if (YY_CParse_DEBUG_FLAG)
    fprintf(stderr, "Shifting token %d (%s), ", YY_CParse_CHAR, yytname[yychar1]);
#endif

  /* Discard the token being shifted unless it is eof.  */
  if (YY_CParse_CHAR != YYEOF)
    YY_CParse_CHAR = YYEMPTY;

  *++yyvsp = YY_CParse_LVAL;
#ifdef YY_CParse_LSP_NEEDED
  *++yylsp = YY_CParse_LLOC;
#endif

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

  yystate = yyn;
  goto yynewstate;

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

  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;

/* Do a reduction.  yyn is the number of a rule to reduce with.  */
yyreduce:
  yylen = yyr2[yyn];
  if (yylen > 0)
    yyval = yyvsp[1-yylen]; /* implement default value of the action */

#if YY_CParse_DEBUG != 0
  if (YY_CParse_DEBUG_FLAG)
    {
      int i;

      fprintf (stderr, "Reducing via rule %d (line %d), ",
	       yyn, yyrline[yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif


  switch (yyn) {

case 1:
{
																M_PASS_ALL(yyval,yyvsp[0]);
																m_clIntermediateCodeList=yyval.clIntermediateCodeList
															;
    break;}
case 2:
{
																M_PASS_ALL(yyval,yyvsp[0]);
																m_clIntermediateCodeList=yyval.clIntermediateCodeList
															;
    break;}
case 3:
{
																M_PASS_ALL(yyval,yyvsp[0]);
																m_clIntermediateCodeList=yyval.clIntermediateCodeList
															;
    break;}
case 4:
{
													yyval.clIntermediateCodeList=new CPA_EdIR_IntermediateCode(g_clLex.m_lIndex,eCreateSubr,0L);
													yyval.clIntermediateCodeList.m_fn_vConcat(yyvsp[0].clIntermediateCodeList);
													//$$.clIntermediateCodeList = $3.clIntermediateCodeList;
													M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
												;
    break;}
case 6:
{
																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyval.csInitial=yyval.csType="";
																yyval.clIntermediateCodeList.m_fn_vMakeEmpty();
																//M_PASS_ALL($$,$1)
																yyvsp[0].clIntermediateCodeList.m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
															;
    break;}
case 7:
{
																M_PASS_ALL(yyval,yyvsp[0])
													;
    break;}
case 8:
{
									// BEGIN ROMTEAM Cristi Petrescu 98-09-
									M_PASS_ALL(yyval,yyvsp[0])
									// END ROMTEAM Cristi Petrescu 98-09-
								;
    break;}
case 9:
{
									// BEGIN ROMTEAM Cristi Petrescu 98-09-
									M_CONCAT2PARMS(yyval,yyvsp[-1],yyvsp[0])
									// END ROMTEAM Cristi Petrescu 98-09-
								;
    break;}
case 10:
{
																CPA_EdIR_Macro	*pclMacro;

																pclMacro=new CPA_EdIR_Macro(yyvsp[-2].csInitial,
																														yyvsp[0].csInitial);

																g_clMacroList.AddTail(pclMacro);
																
																// to pass the tree up, otherwise this is unused...
																// if you don't do this, the result of parsing is lost... -> memory leaks
																M_CONCAT2PARMS (yyval, yyvsp[-2], yyvsp[0]);
													;
    break;}
case 11:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 12:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 13:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 14:
{M_CONCAT2PARMS(yyval,yyvsp[-1],yyvsp[0]);
    break;}
case 15:
{
																//BEGIN ROMTEAM Cristi Petrescu 98-06-
																if(!g_clDsgVarList.m_fn_bIsADesignerVariable(yyvsp[-2].csInitial))
																{
																	if(fn_bIsTypeCompatibleForInitialization(yyvsp[-3].csType,&(yyvsp[0])))
																	{
																		CString		csInitial;
																		POSITION	pos;
																		if(!yyvsp[0].clIntermediateCodeList.IsEmpty())
																		{
																			if(yyvsp[-3].csType==C_ADDR_LIST_PARAM)
																			{
																				long	lInitValue=atoi(yyvsp[0].csInitial);
																				if(lInitValue<1 || lInitValue>30)
																				{
																					yyerror("You must specify a number between 1 and 30 for a list");
																					YYERROR;
																				}
																			}
																			if(yyvsp[-3].csType==C_ADDR_ARRAY_PARAM)
																			{
																				long	lInitValue=atoi(yyvsp[0].csInitial);
																				if(lInitValue<C_ucSizeOfMinimalArray || lInitValue>C_ucSizeOfMaximalArray)
																				{
																					yyerror("You must specify a number between 2 and 255 for an array");
																					YYERROR;
																				}
																			}

																			if(yyvsp[0].csType!=C_VECTOR_PARAM)
																			{
																				//First node is the initial value
																				pos=yyvsp[0].clIntermediateCodeList.FindIndex(0);
																			}
																			else
																			{
																				//First node is the vector node
																				//Second node is the inc depth node
																				//Third node is the initial value
																				pos=yyvsp[0].clIntermediateCodeList.FindIndex(2);
																			}

																			if(pos!=NULL)
																			{
																				csInitial=yyvsp[0].clIntermediateCodeList.GetAt(pos)->m_fn_csGetValue();

																				CPA_EdIR_DesignerVariable	*pclDsgVar;
																				CStringList								cslValues;
																				cslValues.AddTail(csInitial);
																				pclDsgVar=new CPA_EdIR_DesignerVariable(yyvsp[-2].csInitial,
																																								yyvsp[-3].csInitial,
																																								&cslValues,
																																								yyvsp[-4].csInitial.CompareNoCase("private") == 0);

																				g_clDsgVarList.AddTail(pclDsgVar);

																				//Gets initial value from $4 node
																				stReturn									stInitialValue;
																				CPA_EdIR_IntermediateCode	*pclInitialValue;

																				pclInitialValue=new CPA_EdIR_IntermediateCode(yyvsp[0].clIntermediateCodeList.GetAt(pos));

																				stInitialValue.clIntermediateCodeList.AddTail(pclInitialValue);

																				M_PASS2PARMS(yyval,yyvsp[-3],yyvsp[-2],stInitialValue);

																				// BEGIN ROMTEAM Cristi Petrescu 98-09-
																				yyvsp[0].clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																				// END ROMTEAM Cristi Petrescu 98-09-
																			}
																			else
																			{
																				yyerror("[DEV] Try to get initial value for a dsg var (parse) but pos is NULL");
																				yyerror("[DEV] Please contact Xavier Billault (53-74)");
																				YYERROR;
																			}
																		}
																		else
																		{
																			yyerror("[DEV] Try to get initial value for a dsg var (parse) but the IC list is empty");
																			yyerror("[DEV] Please contact Xavier Billault (53-74)");
																			YYERROR;
																		}
																	}
																	else
																	{
																		yyerror("Init value and dsg var have not the same type");
																		YYERROR;
																	}
																}
																else
																{
																	yyerror(M_MAKECHAR("The dsgvar "+yyvsp[-2].csInitial+" already exists !!"));
																	YYERROR;
																}
																//END ROMTEAM Cristi Petrescu 98-06-
															;
    break;}
case 16:
{
																long	lIndex=M_GETINDEX(yyvsp[0]);
																fn_vGetDesignerVariableTypeFromEngineType(&yyval,lIndex);
																M_PASS_IN_1PARM(yyval,yyvsp[0])
															;
    break;}
case 17:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 18:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 19:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 20:
{
													//BEGIN ROMTEAM Cristi Petrescu 98-06-
													yyval.csInitial = "public";
													yyval.csType="";
													yyval.clIntermediateCodeList.m_fn_vMakeEmpty();
													//END ROMTEAM Cristi Petrescu 98-06-
												;
    break;}
case 21:
{
													//BEGIN ROMTEAM Cristi Petrescu 98-06-
													M_PASS_ALL(yyval,yyvsp[0]);
													if (! fn_bIsDsgVarQualifier (yyval.csInitial))
													{
														yyerror (M_MAKECHAR("The dsgvar qualifier "+yyval.csInitial+" in invalid"));
														YYERROR;
													}
													//END ROMTEAM Cristi Petrescu 98-06-
												;
    break;}
case 22:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 23:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 24:
{M_CONCAT2PARMS(yyval,yyvsp[-1],yyvsp[0]);
    break;}
case 25:
{
																yyval.clIntermediateCodeList=new CPA_EdIR_IntermediateCode(g_clLex.m_lIndex,eCreateSchedule,0L);
																yyval.clIntermediateCodeList.m_fn_vConcat(yyvsp[0].clIntermediateCodeList);
																M_PASS_IN_2PARMS(yyval,yyvsp[-1],yyvsp[0]) ;
																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyvsp[-1] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
															;
    break;}
case 26:
{
																CString	csType;
																long	lIndex=M_GETINDEX(yyvsp[-3]);
																csType=fn_csGetMetaActionParams(lIndex);
//Stefan Dumitrean 21-05-98
																CString csMetaName = "metaaction "+yyvsp[-3].csInitial;
																M_CHECKPARMS(csType,yyvsp[-1],csMetaName)
//End Stefan Dumitrean 21-05-98
																{
																	yyval.csType="";
																}
																M_PASS1PARM(yyval,yyvsp[-3],yyvsp[-1]);
																CPA_EdIR_IntermediateCodeList	clIntermediateCodeList=yyvsp[-4].clIntermediateCodeList;
																clIntermediateCodeList.m_fn_vConcat(yyval.clIntermediateCodeList);
																yyval.clIntermediateCodeList=clIntermediateCodeList;
																M_PASS_IN_5PARMS(yyval,yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 27:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 28:
{
//																$$.clIntermediateCodeList = $2.clIntermediateCodeList;
																yyval.clIntermediateCodeList = yyvsp[-2].clIntermediateCodeList;
                                /* jawaka : need for CFast, DON'T COMMENT IT AGAIN !! */
																M_SETINDEX(yyval, gl_MacroAddress);
                                /* end jawaka */
																yyval.clIntermediateCodeList.m_fn_vConcat(yyvsp[-1].clIntermediateCodeList);
																yyval.clIntermediateCodeList.m_fn_vConcat(yyvsp[0].clIntermediateCodeList);
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 29:
{
																CString	csType;
																long	lIndex=M_GETINDEX(yyvsp[-3]);
																csType=fn_csGetProcedureParams(lIndex);
//Stefan Dumitrean 21-05-98
																CString csProcName = "procedure "+yyvsp[-3].csInitial;
																M_CHECKPARMS(csType,yyvsp[-1],csProcName)
//End Stefan Dumitrean 21-05-98
																{
																	yyval.csType="";
																}
																M_PASS1PARM(yyval,yyvsp[-3],yyvsp[-1]);
																CPA_EdIR_IntermediateCodeList	clIntermediateCodeList=yyvsp[-4].clIntermediateCodeList;
																clIntermediateCodeList.m_fn_vConcat(yyval.clIntermediateCodeList);
																yyval.clIntermediateCodeList=clIntermediateCodeList;
																M_PASS_IN_5PARMS(yyval,yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 30:
{
																long	lIndex=M_GETINDEX(yyvsp[-3]);
																if(fn_bIsProcedureUsableWithUltraOperator(lIndex))
																{
																	CString	csType;
																	csType=fn_csGetProcedureParams(lIndex);
//Stefan Dumitrean 21-05-98
																	CString csProcName = "procedure "+yyvsp[-3].csInitial;
																	M_CHECKPARMS(csType,yyvsp[-1],csProcName)
//End Stefan Dumitrean 21-05-98
																	{
																		yyval.csType="";
																	}

																	if(fn_lGetKeyWordIdFromEditorName(yyvsp[-5].csInitial)==eKeyWord_Me)
																	{
																		M_PASS1PARM(yyval,yyvsp[-3],yyvsp[-1]);
																		// BEGIN ROMTEAM Cristi Petrescu 98-09-
																		yyvsp[-5] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																		// END ROMTEAM Cristi Petrescu 98-09-													
																	}
																	else
																	{
																		M_CREATEULTRANODE(yyval,yyvsp[-5],yyvsp[-3],yyvsp[-1]);
																	}

																	M_PASS_IN_6PARMS(yyval,yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
																}
																else
																{
																	yyerror(M_MAKECHAR("Can't use <character>.<procedure> for the procedure "+yyvsp[-3].csInitial));
																	YYERROR;
																}
															;
    break;}
case 31:
{
																long	lRes=fn_lIsADsgVarForThisModel(g_pclCurrentModel,yyvsp[-5].csInitial);
																if(lRes!=C_NOT_A_DSG_VAR)
																{
																	M_SETINDEX(yyvsp[-5],lRes);
																	M_SETMODEL(yyvsp[-5],g_pclCurrentModel);

																	fn_vGetDesignerVariableTypeForThisModel(&yyvsp[-5],g_pclCurrentModel,lRes);
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[-5].csInitial+" is not a valid variable for this model"));
																	YYERROR;
																}

																if(yyvsp[-5].csType==C_ADDR_PERSO_PARAM)
																{
																	long	lIndex=M_GETINDEX(yyvsp[-3]);
																	if(fn_bIsProcedureUsableWithUltraOperator(lIndex))
																	{
																		CString	csType;
																		csType=fn_csGetProcedureParams(lIndex);
//Stefan Dumitrean 21-05-98
																		CString csProcName = "procedure "+yyvsp[-3].csInitial;
																		M_CHECKPARMS(csType,yyvsp[-1],csProcName)
//End Stefan Dumitrean 21-05-98
																		{
																			yyval.csType="";
																		}

																		M_CREATEULTRANODE(yyval,yyvsp[-5],yyvsp[-3],yyvsp[-1]);
																		M_PASS_IN_6PARMS(yyval,yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
																	}
																	else
																	{
																		yyerror(M_MAKECHAR("Can't use <character>.<procedure> for the procedure "+yyvsp[-3].csInitial));
																		YYERROR;
																	}
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[-5].csInitial+" is not a character"));
																	YYERROR;
																}
															;
    break;}
case 32:
{
																//$$.clIntermediateCodeList = new CPA_EdIR_IntermediateCode(g_clLex.m_lIndex,eSubrRef,$1.csInitial);
																M_PASS_ALL(yyval,yyvsp[0]);
															;
    break;}
case 33:
{
																yyval.csInitial=yyval.csType="";
																yyval.clIntermediateCodeList.m_fn_vMakeEmpty();
															;
    break;}
case 34:
{
																stReturn	stProcedure;
																M_CREATENODE(stProcedure,eProcedure,(long)(eProc_SetActionReturn));

																stReturn	stConstant;
																long	lIndex=M_GETINDEX(yyvsp[0]);
																M_CREATENODE(stConstant,eConstant,lIndex);
																
																M_PASS1PARM(yyval,stProcedure,stConstant);
																M_PASS_IN_1PARM(yyval,yyvsp[0]);

																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyvsp[0] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
															;
    break;}
case 35:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 36:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 37:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 38:
{
// BEGIN ROMTEAM Cristi Petrescu 98-08-
// this is anyway shitty, because does not keep good record of code.
// see new fn_vPostProcessIA for better treatment
																//long	lLen;

																//Begin macro	name length
																//lLen=$1.csInitial.GetLength();
//Stefan Dumitrean 14-05-98  these must not be added because m_bIsInMacro becomes TRUE
//immediately after BEGINMACRO and g_clLex.m_lIndex is not incremented until ENDMACRO
//is ecountered
																//'(' length
																//lLen+=1;
																//INT length
																//lLen+=$3.csInitial.GetLength();
																//')' length
																//lLen+=1;
//End Stefan Dumitrean
																//Macro name length
																//lLen-=M_GETINDEX($3);

																//g_clLex.m_lOldMacroIndex=g_clLex.m_lIndex-lLen;
																//M_SETINDEX($1, M_GETINDEX($5));
																yyval.clIntermediateCodeList = yyvsp[-5].clIntermediateCodeList;

                                /* jawaka : need for CFast, DON'T COMMENT IT AGAIN !! */
                                gl_MacroAddress = M_GETINDEX(yyvsp[-1]);
                                /* end jawaka */

																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyvsp[-3] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																yyvsp[-1] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
// END ROMTEAM Cristi Petrescu 98-08-

															;
    break;}
case 39:
{
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 40:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 41:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 42:
{ M_PASS_ALL(yyval,yyvsp[0]) ;
    break;}
case 43:
{
																long	lRes=fn_lIsTypeCompatibleForArithmOp(M_GETINDEX(yyvsp[-1]),&(yyvsp[-2]),&(yyvsp[0]));
																if(lRes==C_NOT_COMPATIBLE)
																{
																	yyerror("Can't assign two expressions with different types");
																	YYERROR;
																}
																M_SETINDEX(yyvsp[-1],lRes);
																M_PASS2PARMS(yyval,yyvsp[-1],yyvsp[-2],yyvsp[0]);
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 44:
{
																long	lRes=fn_lIsTypeCompatibleForArithmOp(M_GETINDEX(yyvsp[-1]),&(yyvsp[-2]),&(yyvsp[0]));
																if(lRes==C_NOT_COMPATIBLE)
																{
																	yyerror("Can't assign two expressions with different types");
																	YYERROR;
																}
																M_SETINDEX(yyvsp[-1],lRes);
																M_PASS2PARMS(yyval,yyvsp[-1],yyvsp[-2],yyvsp[0]);
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 45:
{
																long	lRes=fn_lIsTypeCompatibleForArithmOp(M_GETINDEX(yyvsp[0]),&(yyvsp[-1]));
																if(lRes==C_NOT_COMPATIBLE)
																{
																	yyerror(M_MAKECHAR("Can't use "+yyvsp[0].csInitial+" with "+yyvsp[-1].csInitial));
																	YYERROR;
																}
																M_SETINDEX(yyvsp[0],lRes);
																M_PASS1PARM(yyval,yyvsp[0],yyvsp[-1]);
																M_PASS_IN_2PARMS(yyval,yyvsp[-1],yyvsp[0])
															;
    break;}
case 46:
{
																yyvsp[0].csType=C_PERSO_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 47:
{
																yyvsp[0].csType=C_SUPEROBJECT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 48:
{
																yyvsp[0].csType=C_WAYPOINT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 49:
{
																yyvsp[0].csType=C_COMPORT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 50:
{
																yyvsp[0].csType=C_ACTION_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 51:
{
																yyvsp[0].csType=C_CAPS_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 52:
{
																yyvsp[0].csType=C_GRAPH_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
							;
    break;}
case 53:
{
																yyvsp[0].csType=C_TEXT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
							;
    break;}
case 54:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 55:
{
																if(yyvsp[-1].csType==C_ADDR_VECTOR_PARAM)
																{
																	M_PASS1PARM(yyval,yyvsp[0],yyvsp[-1]);
																	yyval.csType=fn_csGetOperatorType(M_GETINDEX(yyvsp[0]));

																	M_PASS_IN_2PARMS(yyval,yyvsp[-1],yyvsp[0]);
																}
																else
																{
																	yyerror(M_MAKECHAR("Can't use "+yyvsp[0].csInitial+" because the field "+yyvsp[-1].csInitial+" is not a vector"));
																	YYERROR;
																}
															;
    break;}
case 56:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 57:
{
																if(yyvsp[-1].csType==C_ADDR_VECTOR_PARAM)
																{
																	M_PASS1PARM(yyval,yyvsp[0],yyvsp[-1]);
																	yyval.csType=fn_csGetOperatorType(M_GETINDEX(yyvsp[0]));

																	M_PASS_IN_2PARMS(yyval,yyvsp[-1],yyvsp[0]);
																}
																else
																{
																	yyerror(M_MAKECHAR("Can't use "+yyvsp[0].csInitial+" because the dsgvar "+yyvsp[-1].csInitial+" is not a vector"));
																	YYERROR;
																}
															;
    break;}
case 58:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 59:
{
																//Checks $1 dsg var
																if(yyvsp[-3].csType!=C_ADDR_ARRAY_PARAM)
																{
																	yyerror(M_MAKECHAR("The dsgvar "+yyvsp[-3].csInitial+" is not an array"));
																	YYERROR;
																}

																//Checks $3 expression
																long	lIndex=fn_lGetOperatorIdFromEditorName("[");
																long	lRes=fn_lIsTypeCompatibleForArithmOp(lIndex,&yyvsp[-3],&yyvsp[-1]);
																if(lRes==C_NOT_COMPATIBLE)
																{
																	yyerror(M_MAKECHAR(yyvsp[-1].csInitial+" has not the good type !!"));
																	YYERROR;
																}
																else
																{
																	M_PASS2PARMS4OP(yyval,eOperator,long(eOperator_Array),yyvsp[-3],yyvsp[-1]);
																	yyval.csType=yyvsp[-3].csSubType;

																	M_PASS_IN_4PARMS(yyval,yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
																}
															;
    break;}
case 60:
{
																long	lRes=fn_lIsADsgVarForThisModel(g_pclCurrentModel,yyvsp[0].csInitial);
																if(lRes!=C_NOT_A_DSG_VAR)
																{
																	M_SETINDEX(yyvsp[0],lRes);
																	M_SETMODEL(yyvsp[0],g_pclCurrentModel);

																	M_PASS_ALL(yyval,yyvsp[0]);
																	fn_vGetDesignerVariableTypeForThisModel(&yyval,g_pclCurrentModel,lRes);
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[0].csInitial+" is not a valid variable for this model"));
																	YYERROR;
																}
															;
    break;}
case 61:
{
																if(fn_lGetKeyWordIdFromEditorName(yyvsp[-2].csInitial)==eKeyWord_Me)
																{
																	long	lRes=fn_lIsADsgVarForThisModel(g_pclCurrentModel,yyvsp[0].csInitial);
																	if(lRes!=C_NOT_A_DSG_VAR)
																	{
																		M_SETINDEX(yyvsp[0],lRes);
																		M_SETMODEL(yyvsp[0],g_pclCurrentModel);

																		M_PASS_ALL(yyval,yyvsp[0]);
																		fn_vGetDesignerVariableTypeForThisModel(&yyval,g_pclCurrentModel,lRes);

																		// BEGIN ROMTEAM Cristi Petrescu 98-09-
																		yyvsp[-2] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																		// END ROMTEAM Cristi Petrescu 98-09-
																	}
																	else
																	{
																		yyerror(M_MAKECHAR(yyvsp[-2].csInitial+" is not a valid variable for this model"));
																		YYERROR;
																	}
																}
																else
																{
																	long lIndex;
																	lIndex=fn_lGetOperatorIdFromEditorName(".");

																	long	lHandleToPerso=fn_lGetHandleOfPerso(&yyvsp[-2]);

																	long	lRes=fn_lIsADsgVarForThisPerso(lHandleToPerso,yyvsp[0].csInitial);
																	if(lRes!=C_NOT_A_DSG_VAR)
																	{
																		M_SETINDEX(yyvsp[0],lRes);
																		M_SETMODELFROMPERSO(yyvsp[0],lHandleToPerso);

																		M_PASS2PARMS4OP(yyval,eOperator,lIndex,yyvsp[-2],yyvsp[0]);
																		fn_vGetDesignerVariableTypeForThisPerso(&yyval,lHandleToPerso,lRes);
																	}
																	else
																	{
																		yyerror(M_MAKECHAR(yyvsp[0].csInitial+" is not a valid variable for the character "+yyvsp[-2].csInitial));
																		YYERROR;
																	}
																}

																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0]);
															;
    break;}
case 62:
{
																//Checks $1 dsg var
																long	lRes=fn_lIsADsgVarForThisModel(g_pclCurrentModel,yyvsp[-4].csInitial);
																if(lRes!=C_NOT_A_DSG_VAR)
																{
																	M_SETINDEX(yyvsp[-4],lRes);
																	M_SETMODEL(yyvsp[-4],g_pclCurrentModel);

																	fn_vGetDesignerVariableTypeForThisModel(&yyvsp[-4],g_pclCurrentModel,lRes);
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[-4].csInitial+" is not a valid variable for this model"));
																	YYERROR;
																}

																if(yyvsp[-4].csType!=C_ADDR_PERSO_PARAM)
																{
																	yyerror(M_MAKECHAR("Can't use \'.\' because the dsgvar "+yyvsp[-4].csInitial+" is not a character"));
																	YYERROR;
																}

																//Checks $5 dsg var
																CPA_Actor	*pclModel=(CPA_Actor *)M_GETINDEX(yyvsp[-2]);
																lRes=fn_lIsADsgVarForThisModel(pclModel,yyvsp[0].csInitial);
																if(lRes!=C_NOT_A_DSG_VAR)
																{
																	M_SETINDEX(yyvsp[0],lRes);
																	M_SETMODEL(yyvsp[0],pclModel);

																	fn_vGetDesignerVariableTypeForThisModel(&yyvsp[0],pclModel,lRes);
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[0].csInitial+" is not a valid variable for the model "+yyvsp[-2].csInitial));
																	YYERROR;
																}

																//Builds intermediate code list
																stReturn	stCastNode;
																M_PASS2PARMS4OP(stCastNode,eOperator,long(eOperator_ModelCast),yyvsp[-2],yyvsp[-4]);

																M_PASS2PARMS4OP(yyval,eOperator,long(eOperator_Dot),stCastNode,yyvsp[0]);
																yyval.csType=yyvsp[0].csType;

																M_PASS_IN_5PARMS(yyval,yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 63:
{
																if(fn_lGetKeyWordIdFromEditorName(yyvsp[-6].csInitial)==eKeyWord_Me)
																{
																	//Checks $3 dsg var
																	long	lRes=fn_lIsADsgVarForThisModel(g_pclCurrentModel,yyvsp[-4].csInitial);
																	if(lRes!=C_NOT_A_DSG_VAR)
																	{
																		M_SETINDEX(yyvsp[-4],lRes);
																		M_SETMODEL(yyvsp[-4],g_pclCurrentModel);

																		fn_vGetDesignerVariableTypeForThisModel(&yyvsp[-4],g_pclCurrentModel,lRes);
																	}
																	else
																	{
																		yyerror(M_MAKECHAR(yyvsp[-4].csInitial+" is not a valid variable for this model"));
																		YYERROR;
																	}

																	if(yyvsp[-4].csType!=C_ADDR_PERSO_PARAM)
																	{
																		yyerror(M_MAKECHAR("Can't use \'.\' because the dsgvar "+yyvsp[-4].csInitial+" is not a character"));
																		YYERROR;
																	}

																	//Checks $7 dsg var
																	CPA_Actor	*pclModel=(CPA_Actor *)M_GETINDEX(yyvsp[-2]);
																	lRes=fn_lIsADsgVarForThisModel(pclModel,yyvsp[0].csInitial);
																	if(lRes!=C_NOT_A_DSG_VAR)
																	{
																		M_SETINDEX(yyvsp[0],lRes);
																		M_SETMODEL(yyvsp[0],pclModel);

																		fn_vGetDesignerVariableTypeForThisModel(&yyvsp[0],pclModel,lRes);
																	}
																	else
																	{
																		yyerror(M_MAKECHAR(yyvsp[0].csInitial+" is not a valid variable for the model "+yyvsp[-2].csInitial));
																		YYERROR;
																	}

																	//Builds intermediate code list
																	stReturn	stCastNode;
																	M_PASS2PARMS4OP(stCastNode,eOperator,long(eOperator_ModelCast),yyvsp[-2],yyvsp[-4]);

																	M_PASS2PARMS4OP(yyval,eOperator,long(eOperator_Dot),stCastNode,yyvsp[0]);
																	yyval.csType=yyvsp[0].csType;

																	// BEGIN ROMTEAM Cristi Petrescu 98-09-
																	yyvsp[-6] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																	// END ROMTEAM Cristi Petrescu 98-09-
																}
																else
																{
																	//Checks $3 dsg var
																	long	lHandleToPerso=fn_lGetHandleOfPerso(&yyvsp[-6]);

																	long	lRes=fn_lIsADsgVarForThisPerso(lHandleToPerso,yyvsp[-4].csInitial);
																	if(lRes!=C_NOT_A_DSG_VAR)
																	{
																		M_SETINDEX(yyvsp[-4],lRes);
																		M_SETMODELFROMPERSO(yyvsp[-4],lHandleToPerso);

																		fn_vGetDesignerVariableTypeForThisPerso(&yyvsp[-4],lHandleToPerso,lRes);
																	}
																	else
																	{
																		yyerror(M_MAKECHAR(yyvsp[-4].csInitial+" is not a valid variable for the character "+yyvsp[-6].csInitial));
																		YYERROR;
																	}

																	if(yyvsp[-4].csType!=C_ADDR_PERSO_PARAM)
																	{
																		yyerror(M_MAKECHAR("Can't use \'.\' because the dsgvar "+yyvsp[-4].csInitial+" is not a character"));
																		YYERROR;
																	}

																	//Checks $7 dsg var
																	CPA_Actor	*pclModel=(CPA_Actor *)M_GETINDEX(yyvsp[-2]);
																	lRes=fn_lIsADsgVarForThisModel(pclModel,yyvsp[0].csInitial);
																	if(lRes!=C_NOT_A_DSG_VAR)
																	{
																		M_SETINDEX(yyvsp[0],lRes);
																		M_SETMODEL(yyvsp[0],pclModel);

																		fn_vGetDesignerVariableTypeForThisModel(&yyvsp[0],pclModel,lRes);
																	}
																	else
																	{
																		yyerror(M_MAKECHAR(yyvsp[0].csInitial+" is not a valid variable for the model "+yyvsp[-2].csInitial));
																		YYERROR;
																	}

																	//Builds intermediate code list
																	stReturn	stCastNode;
																	M_PASS2PARMS4OP(stCastNode,eOperator,long(eOperator_ModelCast),yyvsp[-2],yyvsp[-4]);

																	stReturn	stDotNode;
																	M_PASS2PARMS4OP(stDotNode,eOperator,long(eOperator_Dot),yyvsp[-6],stCastNode);

																	M_PASS2PARMS4OP(yyval,eOperator,long(eOperator_Dot),stDotNode,yyvsp[0]);
																	yyval.csType=yyvsp[0].csType;
																}

																M_PASS_IN_7PARMS(yyval,yyvsp[-6],yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
															;
    break;}
case 64:
{
																fn_vGetDesignerVariableType(&yyvsp[0],M_GETINDEX(yyvsp[0]));
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 65:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 66:
{
																if(fn_lGetKeyWordIdFromEditorName(yyvsp[-2].csInitial)==eKeyWord_Me)
																{
																	M_PASS_ALL(yyval,yyvsp[0]);
																	// BEGIN ROMTEAM Cristi Petrescu 98-09-
																	yyvsp[-2] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																	// END ROMTEAM Cristi Petrescu 98-09-
																}
																else
																{
																	long lIndex;
																	lIndex=fn_lGetOperatorIdFromEditorName(".");

																	M_PASS2PARMS4OP(yyval,eOperator,lIndex,yyvsp[-2],yyvsp[0]);
																	yyval.csType=yyvsp[0].csType;
																}

																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 67:
{
																long	lRes=fn_lIsADsgVarForThisModel(g_pclCurrentModel,yyvsp[-2].csInitial);
																if(lRes!=C_NOT_A_DSG_VAR)
																{
																	M_SETINDEX(yyvsp[-2],lRes);
																	M_SETMODEL(yyvsp[-2],g_pclCurrentModel);

																	fn_vGetDesignerVariableTypeForThisModel(&yyvsp[-2],g_pclCurrentModel,lRes);
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[-2].csInitial+" is not a valid variable for this model"));
																	YYERROR;
																}

																if(yyvsp[-2].csType==C_ADDR_PERSO_PARAM)
																{
																	long lIndex;
																	lIndex=fn_lGetOperatorIdFromEditorName(".");

																	M_PASS2PARMS4OP(yyval,eOperator,lIndex,yyvsp[-2],yyvsp[0]);
																	yyval.csType=yyvsp[0].csType;

																	M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0]);
																}
																else
																{
																	yyerror(M_MAKECHAR("Can't use \'.\' because the dsgvar "+yyvsp[-2].csInitial+" is not a character"));
																	YYERROR;
																}
															;
    break;}
case 68:
{
																yyvsp[0].csType=fn_csGetFieldType(M_GETINDEX(yyvsp[0]));
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 69:
{
																yyvsp[0].csType=fn_csGetOperatorParams(M_GETINDEX(yyvsp[0]));
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 70:
{
																yyvsp[0].csType=fn_csGetOperatorParams(M_GETINDEX(yyvsp[0]));
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 71:
{
																yyvsp[0].csType=fn_csGetOperatorParams(M_GETINDEX(yyvsp[0]));
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 72:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 73:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 74:
{
                                yyval.csType = yyvsp[-1].csType;
                                M_PASS_ALL(yyval,yyvsp[-1]);                
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0]);
                                ;
    break;}
case 75:
{
																long	lIndex=M_GETINDEX(yyvsp[-3]);
//Stefan Dumitrean 21-05-98
																CString csVectName = "vector "+yyvsp[-3].csInitial;
																M_CHECKPARMS(yyvsp[-3].csType,yyvsp[-1],csVectName)
//End Stefan Dumitrean 21-05-98
																{
																	yyval.csType=fn_csGetKeyWordType(lIndex);
																}
																M_PASS1PARM(yyval,yyvsp[-3],yyvsp[-1]);
																M_PASS_IN_4PARMS(yyval,yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 76:
{
																CString	csType;
																long		lIndex=M_GETINDEX(yyvsp[-3]);
																csType=fn_csGetFunctionParams(lIndex);
//Stefan Dumitrean 21-05-98
																CString csFuncName = "function "+yyvsp[-3].csInitial;
																M_CHECKPARMS(csType,yyvsp[-1],csFuncName)
//End Stefan Dumitrean 21-05-98
																{
																	yyval.csType=fn_csGetFunctionType(lIndex);
																}
																M_PASS1PARM(yyval,yyvsp[-3],yyvsp[-1]);
																M_PASS_IN_4PARMS(yyval,yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 77:
{
																long	lIndex=M_GETINDEX(yyvsp[-3]);
																if(fn_bIsFunctionUsableWithUltraOperator(lIndex))
																{
																	CString	csType;
																	csType=fn_csGetFunctionParams(lIndex);
//Stefan Dumitrean 21-05-98
																	CString csFuncName = "function "+yyvsp[-3].csInitial;
																	M_CHECKPARMS(csType,yyvsp[-1],csFuncName)
//End Stefan Dumitrean 21-05-98
																	{
																		yyval.csType=fn_csGetFunctionType(lIndex);
																	}

																	if(fn_lGetKeyWordIdFromEditorName(yyvsp[-5].csInitial)==eKeyWord_Me)
																	{
																		M_PASS1PARM(yyval,yyvsp[-3],yyvsp[-1]);
																		// BEGIN ROMTEAM Cristi Petrescu 98-09-
																		yyvsp[-5] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																		// END ROMTEAM Cristi Petrescu 98-09-
																	}
																	else
																	{
																		M_CREATEULTRANODE(yyval,yyvsp[-5],yyvsp[-3],yyvsp[-1]);
																	}

																	M_PASS_IN_6PARMS(yyval,yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
																}
																else
																{
																	yyerror(M_MAKECHAR("Can't use <character>.<function> for the function "+yyvsp[-3].csInitial));
																	YYERROR;
																}
															;
    break;}
case 78:
{
																long	lRes=fn_lIsADsgVarForThisModel(g_pclCurrentModel,yyvsp[-5].csInitial);
																if(lRes!=C_NOT_A_DSG_VAR)
																{
																	M_SETINDEX(yyvsp[-5],lRes);
																	M_SETMODEL(yyvsp[-5],g_pclCurrentModel);

																	fn_vGetDesignerVariableTypeForThisModel(&yyvsp[-5],g_pclCurrentModel,lRes);
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[-5].csInitial+" is not a valid variable for this model"));
																	YYERROR;
																}

																if(yyvsp[-5].csType==C_ADDR_PERSO_PARAM)
																{
																	long	lIndex=M_GETINDEX(yyvsp[-3]);
																	if(fn_bIsFunctionUsableWithUltraOperator(lIndex))
																	{
																		CString	csType;
																		csType=fn_csGetFunctionParams(lIndex);
//Stefan Dumitrean 21-05-98
																		CString csFuncName = "function "+ yyvsp[-3].csInitial;
																		M_CHECKPARMS(csType,yyvsp[-1],csFuncName)
//End Stefan Dumitrean 21-05-98
																		{
																			yyval.csType=fn_csGetFunctionType(lIndex);
																		}

																		M_CREATEULTRANODE(yyval,yyvsp[-5],yyvsp[-3],yyvsp[-1]);
																		M_PASS_IN_6PARMS(yyval,yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
																	}
																	else
																	{
																		yyerror(M_MAKECHAR("Can't use <character>.<function> for the function "+yyvsp[-3].csInitial));
																		YYERROR;
																	}
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[-5].csInitial+" is not a character"));
																	YYERROR;
																}
															;
    break;}
case 79:
{
																long	lIndex=fn_lGetOperatorIdFromEditorName("+");
																long	lRes=fn_lIsTypeCompatibleForArithmOp(lIndex,&(yyvsp[-2]),&(yyvsp[0]));
																if(lRes==C_NOT_COMPATIBLE)
																{
																	yyerror("Can't add two expressions with different types");
																	YYERROR;
																}
																else
																{
																	yyval.csType=fn_csGetOperatorType(lRes,yyvsp[-2].csType,yyvsp[0].csType);
																}
																M_PASS2PARMS4OP(yyval,eOperator,lRes,yyvsp[-2],yyvsp[0]);
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 80:
{
																long	lIndex=fn_lGetOperatorIdFromEditorName("-");
																long	lRes=fn_lIsTypeCompatibleForArithmOp(lIndex,&(yyvsp[-2]),&(yyvsp[0]));
																if(lRes==C_NOT_COMPATIBLE)
																{
																	yyerror("Can't substract two expressions with different types");
																	YYERROR;
																}
																else
																{
																	yyval.csType=fn_csGetOperatorType(lRes,yyvsp[-2].csType,yyvsp[0].csType);
																}
																M_PASS2PARMS4OP(yyval,eOperator,lRes,yyvsp[-2],yyvsp[0]);
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 81:
{
																long	lIndex=fn_lGetOperatorIdFromEditorName("*");
																long	lRes=fn_lIsTypeCompatibleForArithmOp(lIndex,&(yyvsp[-2]),&(yyvsp[0]));
																// BEGIN ROMTEAM Cristi Petrescu 99-1 debug
																if(lRes==C_NOT_COMPATIBLE)
																{
																	// try reverse
																	lRes = fn_lIsTypeCompatibleForArithmOp(lIndex,&(yyvsp[0]),&(yyvsp[-2]));

																	if (lRes == C_NOT_COMPATIBLE)
																	{
																		yyerror("Can't multiply two expressions with different types");
																		YYERROR;
																	}
																	else
																	{	
																		if (yyvsp[0].csType == C_ADDR_VECTOR_PARAM)
																		{
																			yyval.csType=fn_csGetOperatorType(lRes,yyvsp[0].csType,yyvsp[-2].csType);

																			M_PASS2PARMS4OP(yyval,eOperator,lRes,yyvsp[0],yyvsp[-2]);
																			M_PASS_IN_3PARMS(yyval,yyvsp[0],yyvsp[-1],yyvsp[-2]);
																		}
																		else
																		{
																			yyval.csType=fn_csGetOperatorType(lRes,yyvsp[-2].csType,yyvsp[0].csType);
																		
																			M_PASS2PARMS4OP(yyval,eOperator,lRes,yyvsp[-2],yyvsp[0]);
																			M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0]);
																		}
																	}
																}
																else
																{
																	yyval.csType=fn_csGetOperatorType(lRes,yyvsp[-2].csType,yyvsp[0].csType);
																
																	M_PASS2PARMS4OP(yyval,eOperator,lRes,yyvsp[-2],yyvsp[0]);
																	M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0]);
																}
																// END ROMTEAM Cristi Petrescu 99-1 debug
															;
    break;}
case 82:
{
																long	lIndex=fn_lGetOperatorIdFromEditorName("/");
																long	lRes=fn_lIsTypeCompatibleForArithmOp(lIndex,&(yyvsp[-2]),&(yyvsp[0]));
																if(lRes==C_NOT_COMPATIBLE)
																{
																	yyerror("Can't divide two expressions with different types");
																	YYERROR;
																}
																else
																{
																	yyval.csType=fn_csGetOperatorType(lRes,yyvsp[-2].csType,yyvsp[0].csType);
																}
																M_PASS2PARMS4OP(yyval,eOperator,lRes,yyvsp[-2],yyvsp[0]);
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 83:
{
																long	lIndex=fn_lGetOperatorIdFromEditorName("_");
																long	lRes=fn_lIsTypeCompatibleForArithmOp(lIndex,&(yyvsp[0]));
																if(lRes==C_NOT_COMPATIBLE)
																{
																	yyerror("Can't use unary minus operator with this type");
																	YYERROR;
																}
																else
																{
																	yyval.csType=yyvsp[0].csType;
																}
																M_PASS1PARM4OP(yyval,eOperator,lRes,yyvsp[0]);
																M_PASS_IN_2PARMS(yyval,yyvsp[-1],yyvsp[0])
															;
    break;}
case 84:
{
																M_PASS_ALL(yyval,yyvsp[-1]);
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 85:
{
																yyval.csType=fn_csGetKeyWordParams(M_GETINDEX(yyvsp[0]));
																M_CREATENODE(yyval,eVector,M_GETINDEX(yyvsp[0]));
																M_PASS_IN_1PARM(yyval,yyvsp[0]);
																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyvsp[0] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
															;
    break;}
case 86:
{
																if(fn_ucIsAnAlwaysModel((tdstEngineObject *)(M_GETINDEX(yyvsp[0]))))
																	yyvsp[0].csType=C_ALWAYS_PARAM;
																else
																	yyvsp[0].csType=C_PERSO_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 87:
{
																yyvsp[0].csType=C_PERSO_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 88:
{
																yyvsp[0].csType=C_PERSO_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 89:
{
																yyvsp[0].csType=C_LONG_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 90:
{
																yyvsp[0].csType=C_REAL_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 91:
{
																yyvsp[0].csType=C_LONG_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 92:
{
																yyvsp[0].csType=C_REAL_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 93:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 94:
{
																yyvsp[0].csType=C_ZDD_PERSO_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 95:
{
																yyvsp[0].csType=C_ZDE_PERSO_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 96:
{
																yyvsp[0].csType=C_ZDM_PERSO_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 97:
{
																yyvsp[0].csType=C_ZDR_PERSO_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 98:
{
																yyvsp[0].csType=C_ACTION_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 99:
{
																yyvsp[0].csType=C_WAYPOINT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 100:
{
																yyvsp[0].csType=C_CHANNEL_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 101:
{
																yyvsp[0].csType=C_SURFACE_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 102:
{
																yyvsp[0].csType=C_ENV_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 103:
{
																yyvsp[0].csType=C_SECTOR_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 104:
{
																yyvsp[0].csType=C_SUPEROBJECT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 105:
{
																yyvsp[0].csType=C_LIPSYNCHRO_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 106:
{
																yyvsp[0].csType=C_OBJECTTABLE_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 107:
{
																yyvsp[0].csType=C_FAMILY_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 108:
{
																yyvsp[0].csType=C_SOUNDEVENT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 109:
{
																yyvsp[0].csType=C_GMT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 110:
{
																yyvsp[0].csType=C_LIGHT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 111:
{
																yyvsp[0].csType=C_CAPS_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 112:
{
																yyvsp[0].csType=C_GRAPH_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 113:
{
																yyvsp[0].csType=C_BOOLEAN_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 114:
{
																yyvsp[0].csType=C_MY_REFLEX_COMPORT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 115:
{
																yyvsp[0].csType=C_MY_INTELL_COMPORT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 116:
{
																yyvsp[0].csType=C_REFLEX_COMPORT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 117:
{
																yyvsp[0].csType=C_INTELL_COMPORT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 118:
{
																yyvsp[0].csType=C_BUTTON_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 119:
{
																yyvsp[0].csType=C_MASK_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 120:
{
																yyvsp[0].csType=C_POWER_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 121:
{
																yyvsp[0].csType=C_STRING_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 122:
{
																yyvsp[0].csType=C_TEXT_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 123:
{
																yyvsp[0].csType=C_PARTICLEGENERATOR_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 124:
{	
																yyvsp[0].csType=C_MODEL_PARAM;
																M_PASS_ALL(yyval,yyvsp[0])
																;
    break;}
case 125:
{
																//$1.csType=C_STATE_PARAM;
																M_PASS_ALL(yyval,yyvsp[0]);
																yyerror("State are not known by the AI Engine !!");
																YYERROR;
															;
    break;}
case 126:
{
																long	lIndex=M_GETINDEX(yyvsp[-3]);
//Stefan Dumitrean 21-05-98
																CString csVectName = "vector "+yyvsp[-3].csInitial;
																M_CHECKPARMS(yyvsp[-3].csType,yyvsp[-1],csVectName)
//End Stefan Dumitrean 21-05-98
																{
																	yyval.csType=fn_csGetKeyWordType(lIndex);
																}

																stReturn	stVector;
																double		dfX=yyvsp[-1].clIntermediateCodeList.m_fn_dfGetValue(0);
																double		dfY=yyvsp[-1].clIntermediateCodeList.m_fn_dfGetValue(1);
																double		dfZ=yyvsp[-1].clIntermediateCodeList.m_fn_dfGetValue(2);
																M_CREATEVECTORNODE(stVector,eVectorConstant,dfX,dfY,dfZ);

																M_PASS1PARM(yyval,yyvsp[-3],stVector);
																M_PASS_IN_4PARMS(yyval,yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);

																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyvsp[-1] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
															;
    break;}
case 127:
{
																yyvsp[0].csType=fn_csGetKeyWordParams(M_GETINDEX(yyvsp[0]));
																M_PASS_ALL(yyval,yyvsp[0])
															;
    break;}
case 128:
{
																yyval.csInitial=yyval.csType="";
																yyval.clIntermediateCodeList.m_fn_vMakeEmpty();
															;
    break;}
case 129:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 130:
{
																yyval.clIntermediateCodeList=yyvsp[-2].clIntermediateCodeList;
																yyval.clIntermediateCodeList.m_fn_vConcat(yyvsp[0].clIntermediateCodeList);
																yyval.csType=yyvsp[-2].csType+yyvsp[0].csType;
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 131:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 132:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 133:
{
																long	lIndex=GMT_fn_xCombineMask((GMT_tdxMask)(M_GETINDEX(yyvsp[-2])),
																																(GMT_tdxMask)(M_GETINDEX(yyvsp[0])));

																M_CREATENODE(yyval,eMaskType,lIndex);
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0]);
																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyvsp[-2] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																yyvsp[0] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
															;
    break;}
case 134:
{
																long	lIndex=(1<<(M_GETINDEX(yyvsp[0])));

																M_CREATENODE(yyval,eMaskType,lIndex);
																M_PASS_IN_1PARM(yyval,yyvsp[0]);
																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyvsp[0] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
															;
    break;}
case 135:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 136:
{
																yyval.csInitial=yyval.csType="";
																yyval.clIntermediateCodeList.m_fn_vMakeEmpty();
															;
    break;}
case 137:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 138:
{
																yyval.clIntermediateCodeList=yyvsp[-2].clIntermediateCodeList;
																yyval.clIntermediateCodeList.m_fn_vConcat(yyvsp[0].clIntermediateCodeList);
																yyval.csType=yyvsp[-2].csType+yyvsp[0].csType;
																M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 139:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 140:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 141:
{M_CONCAT2PARMS(yyval,yyvsp[-1],yyvsp[0]);
    break;}
case 142:
{
																M_CREATENODE(yyval,eCreateRule,0L);
																m_bIsInITRules=TRUE;
// SHAITAN => CORRECTION SUBR
//																g_bPrevStatementWasAMacroRef = FALSE ;
// SHAITAN => END CORRECTION SUBR
																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyvsp[0] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
															;
    break;}
case 143:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 144:
{M_CONCAT2PARMS(yyval,yyvsp[-1],yyvsp[0]);
    break;}
case 145:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 146:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 147:
{
																M_IFTHEN(yyval,yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
																M_PASS_IN_5PARMS(yyval,yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 148:
{
																M_IFTHENELSE(yyval,yyvsp[-6],yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
																M_PASS_IN_7PARMS(yyval,yyvsp[-6],yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 149:
{
																			yyval.clIntermediateCodeList=yyvsp[-2].clIntermediateCodeList;\
																			M_ADD1PARM(yyval,yyvsp[-1]);\
																			yyval.clIntermediateCodeList.m_fn_vConcat(yyvsp[0].clIntermediateCodeList);\
																			M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])

															;
    break;}
case 150:
{
																			yyval.clIntermediateCodeList=yyvsp[-2].clIntermediateCodeList;\
																			M_ADD1PARM(yyval,yyvsp[-1]);\
																			yyval.clIntermediateCodeList.m_fn_vConcat(yyvsp[0].clIntermediateCodeList);\
																			M_PASS_IN_3PARMS(yyval,yyvsp[-2],yyvsp[-1],yyvsp[0])

															;
    break;}
case 151:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 152:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 158:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 159:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 160:
{M_PASS_ALL(yyval,yyvsp[0]);
    break;}
case 161:
{
																if ( gcGenerateOneRule )
																{
																	yyval.clIntermediateCodeList.m_fn_vMakeEmpty();
																}
																else
																{
																	if(m_bIsInITRules)
																	{
																		M_CREATENODE(yyval,eCreateRule,M_GETINDEX(yyvsp[0]));
																	}
																	else
																	{
																		yyval.clIntermediateCodeList.m_fn_vMakeEmpty();
																	}
																	M_PASS_IN_1PARM(yyval,yyvsp[0]);
																	// BEGIN ROMTEAM Cristi Petrescu 98-09-
																	yyvsp[0] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																	// END ROMTEAM Cristi Petrescu 98-09-
																}
															;
    break;}
case 162:
{
																CString	csType;
																long	lIndex=M_GETINDEX(yyvsp[-3]);
																csType=fn_csGetConditionParams(lIndex);
//Stefan Dumitrean 21-05-98
																CString csCondName = "condition "+yyvsp[-3].csInitial;
																M_CHECKPARMS(csType,yyvsp[-1],csCondName)
//End Stefan Dumitrean 21-05-98
																{
																	yyval.csType=C_BOOLEAN_PARAM;
																}
																M_PASS1PARM(yyval,yyvsp[-3],yyvsp[-1]);
																M_PASS_IN_4PARMS(yyval,yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 163:
{
																long	lIndex=M_GETINDEX(yyvsp[-3]);
																if(fn_bIsConditionUsableWithUltraOperator(lIndex))
																{
																	CString	csType;
																	csType=fn_csGetConditionParams(lIndex);
//Stefan Dumitrean 21-05-98								
																	CString csCondName = "condition "+yyvsp[-3].csInitial;
																	M_CHECKPARMS(csType,yyvsp[-1],csCondName)
//End Stefan Dumitrean 21-05-98
																	{
																		yyval.csType=C_BOOLEAN_PARAM;
																	}

																	if(fn_lGetKeyWordIdFromEditorName(yyvsp[-5].csInitial)==eKeyWord_Me)
																	{
																		M_PASS1PARM(yyval,yyvsp[-3],yyvsp[-1]);
																		// BEGIN ROMTEAM Cristi Petrescu 98-09-
																		yyvsp[-5] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																		// END ROMTEAM Cristi Petrescu 98-09-
																	}
																	else
																	{
																		M_CREATEULTRANODE(yyval,yyvsp[-5],yyvsp[-3],yyvsp[-1]);
																	}

																	M_PASS_IN_6PARMS(yyval,yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
																}
																else
																{
																	yyerror(M_MAKECHAR("Can't use <character>.<condition> for the condition "+yyvsp[-3].csInitial));
																	YYERROR;
																}
															;
    break;}
case 164:
{
																long	lRes=fn_lIsADsgVarForThisModel(g_pclCurrentModel,yyvsp[-5].csInitial);
																if(lRes!=C_NOT_A_DSG_VAR)
																{
																	M_SETINDEX(yyvsp[-5],lRes);
																	M_SETMODEL(yyvsp[-5],g_pclCurrentModel);

																	fn_vGetDesignerVariableTypeForThisModel(&yyvsp[-5],g_pclCurrentModel,lRes);
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[-5].csInitial+" is not a valid variable for this model"));
																	YYERROR;
																}

																if(yyvsp[-5].csType==C_ADDR_PERSO_PARAM)
																{
																	long	lIndex=M_GETINDEX(yyvsp[-3]);
																	if(fn_bIsConditionUsableWithUltraOperator(lIndex))
																	{
																		CString	csType;
																		csType=fn_csGetConditionParams(lIndex);
//Stefan Dumitrean 21-05-98
																		CString csCondName = "condition "+yyvsp[-3].csInitial;
																		M_CHECKPARMS(csType,yyvsp[-1],csCondName)
//End Stefan Dumitrean 21-05-98
																		{
																			yyval.csType=C_BOOLEAN_PARAM;
																		}

																		M_CREATEULTRANODE(yyval,yyvsp[-5],yyvsp[-3],yyvsp[-1]);
																		M_PASS_IN_6PARMS(yyval,yyvsp[-5],yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0]);
																	}
																	else
																	{
																		yyerror(M_MAKECHAR("Can't use <character>.<condition> for the condition "+yyvsp[-3].csInitial));
																		YYERROR;
																	}
																}
																else
																{
																	yyerror(M_MAKECHAR(yyvsp[-5].csInitial+" is not a character"));
																	YYERROR;
																}
															;
    break;}
case 165:
{
                                //the type of the expression is the type of the operator
																yyval.csType=yyvsp[-1].csType;
																M_PASS1PARM(yyval,yyvsp[-1],yyvsp[0]);
																M_PASS_IN_2PARMS(yyval,yyvsp[-1],yyvsp[0])
															;
    break;}
case 166:
{
                                //the type of the expression is the type of the operator
																yyval.csType=yyvsp[-3].csType;
																M_PASS1PARM(yyval,yyvsp[-3],yyvsp[-1]);
																M_PASS_IN_4PARMS(yyval,yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 167:
{
                                //the type of the expression is the type of the operator
																yyval.csType=yyvsp[-2].csType;
																M_PASS2PARMS(yyval,yyvsp[-2],yyvsp[-3],yyvsp[-1]);
																M_PASS_IN_5PARMS(yyval,yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 168:
{
																if(!fn_bIsTypeCompatibleForBinaryOp(M_GETINDEX(yyvsp[-2]),&(yyvsp[-3]),&(yyvsp[-1])))
																{
																	yyerror("Can't make a test between two expressions with different types");
																	YYERROR;
																}
                                //the type of the expression is the type of the operator
																yyval.csType=yyvsp[-2].csType;
																M_PASS2PARMS(yyval,yyvsp[-2],yyvsp[-3],yyvsp[-1]);
																M_PASS_IN_5PARMS(yyval,yyvsp[-4],yyvsp[-3],yyvsp[-2],yyvsp[-1],yyvsp[0])
															;
    break;}
case 169:
{
																if
																( // accept only integer, real, boolean or mask values!!!
																	   (yyvsp[0].csType == C_BOOLEAN_PARAM)
																	|| (yyvsp[0].csType == C_ADDR_BOOLEAN_PARAM)
																	|| (yyvsp[0].csType == C_MASK_PARAM)
																	|| (yyvsp[0].csType == C_LONG_PARAM)
																	|| (yyvsp[0].csType == C_ADDR_LONG_PARAM)
																	|| (yyvsp[0].csType == C_REAL_PARAM)
																	|| (yyvsp[0].csType == C_ADDR_REAL_PARAM)
																)
																{
                                  //if we are here, everything is fine...
   																yyval.csType=C_BOOLEAN_PARAM; //fake a boolean value
                                  M_PASS_ALL(yyval,yyvsp[0]);
  																M_PASS_IN_2PARMS(yyval,yyvsp[-1],yyvsp[0]);
                                }
                                else
                                {
																	yyerror(M_MAKECHAR("the '?' operator cannot be used on " + yyvsp[0].csInitial + " because it is not numeric"));
																	YYERROR;
																}
                              ;
    break;}
case 170:
{
                                M_PASS_ALL(yyval,yyvsp[0]);
 																yyval.csType=C_BOOLEAN_PARAM;
                              ;
    break;}
case 171:
{
                                M_PASS_ALL(yyval,yyvsp[0]);
 																yyval.csType=C_BOOLEAN_PARAM;
                              ;
    break;}
case 172:
{
                                M_PASS_ALL(yyval,yyvsp[0]);
  															yyval.csType=C_BOOLEAN_PARAM;
                              ;
    break;}
case 173:
{
                                M_PASS_ALL(yyval,yyvsp[0]);
  															yyval.csType=C_BOOLEAN_PARAM;
                              ;
    break;}
case 174:
{
                                M_PASS_ALL(yyval,yyvsp[0]);
  															yyval.csType=C_BOOLEAN_PARAM;
                              ;
    break;}
case 175:
{
																M_CREATENODE(yyval,eCondition,M_GETINDEX(yyvsp[0]));
																M_PASS_IN_1PARM(yyval,yyvsp[0]);
																yyval.csType=C_BOOLEAN_PARAM;
																// BEGIN ROMTEAM Cristi Petrescu 98-09-
																yyvsp[0] . clIntermediateCodeList . m_fn_vDestroyAndRemoveAllEntries ();
																// END ROMTEAM Cristi Petrescu 98-09-
															;
    break;}
}
   /* the action file gets copied in in place of this dollarsign  */
  yyvsp -= yylen;
  yyssp -= yylen;
#ifdef YY_CParse_LSP_NEEDED
  yylsp -= yylen;
#endif

#if YY_CParse_DEBUG != 0
  if (YY_CParse_DEBUG_FLAG)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;

#ifdef YY_CParse_LSP_NEEDED
  yylsp++;
  if (yylen == 0)
    {
      yylsp->first_line = YY_CParse_LLOC.first_line;
      yylsp->first_column = YY_CParse_LLOC.first_column;
      yylsp->last_line = (yylsp-1)->last_line;
      yylsp->last_column = (yylsp-1)->last_column;
      yylsp->text = 0;
    }
  else
    {
      yylsp->last_line = (yylsp+yylen-1)->last_line;
      yylsp->last_column = (yylsp+yylen-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.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  goto yynewstate;

yyerrlab:   /* here on detecting error */

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

#ifdef YY_CParse_ERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
	{
	  int size = 0;
	  char *msg;
	  int x, count;

	  count = 0;
	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
	  for (x = (yyn < 0 ? -yyn : 0);
	       x < (sizeof(yytname) / sizeof(char *)); x++)
	    if (yycheck[x + yyn] == x)
	      size += strlen(yytname[x]) + 15, count++;
	  msg = (char *) malloc(size + 15);
	  if (msg != 0)
	    {
	      strcpy(msg, "parse error");

	      if (count < 5)
		{
		  count = 0;
		  for (x = (yyn < 0 ? -yyn : 0);
		       x < (sizeof(yytname) / sizeof(char *)); x++)
		    if (yycheck[x + yyn] == x)
		      {
			strcat(msg, count == 0 ? ", expecting `" : " or `");
			strcat(msg, yytname[x]);
			strcat(msg, "'");
			count++;
		      }
		}
	      YY_CParse_ERROR(msg);
	      free(msg);
	    }
	  else
	    YY_CParse_ERROR ("parse error; also virtual memory exceeded");
	}
      else
#endif /* YY_CParse_ERROR_VERBOSE */
	YY_CParse_ERROR("parse error");
    }

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

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

      /* return failure if at end of input */
      if (YY_CParse_CHAR == YYEOF)
	YYABORT;

#if YY_CParse_DEBUG != 0
      if (YY_CParse_DEBUG_FLAG)
	fprintf(stderr, "Discarding token %d (%s).\n", YY_CParse_CHAR, yytname[yychar1]);
#endif

      YY_CParse_CHAR = YYEMPTY;
    }

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

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

  goto yyerrhandle;

yyerrdefault:  /* 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.  */
  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  if (yyn) goto yydefault;
#endif

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

  if (yyssp == yyss) YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#ifdef YY_CParse_LSP_NEEDED
  yylsp--;
#endif

#if YY_CParse_DEBUG != 0
  if (YY_CParse_DEBUG_FLAG)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "Error: state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

yyerrhandle:

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yyerrdefault;

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    goto yyerrdefault;

  yyn = yytable[yyn];
  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrpop;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

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

  *++yyvsp = YY_CParse_LVAL;
#ifdef YY_CParse_LSP_NEEDED
  *++yylsp = YY_CParse_LLOC;
#endif

  yystate = yyn;
  goto yynewstate;
}

/* END */


/*************/
/* Variables */
/*************/

CParse												g_clParse;
CLex													g_clLex;
CPA_EdIR_DesignerVariableList	g_clDsgVarList;
CPA_EdIR_MacroList						g_clMacroList;
// BEGIN CPA2 Cristi Petrescu 98-03-
// this is pointer to the m_clistOfMacros of the current Brain
CPA_EdIR_MainBehaviourList		*g_pclListOfSubrs;
//CPA_EdIR_MacroList						g_clTempMacroList;
// END CPA2 Cristi Petrescu 98-03-
CPA_Actor											*g_pclCurrentModel=NULL;

/**********/
/* Macros */
/**********/

#define M_KEYWORDID(a)			((tdeKeyWordId)(a))
#define M_METAACTID(a)			((tdeMetaActionId)(a))
#define M_CONDITIONID(a)		((tdeCondId)(a))
#define M_FUNCTIONID(a)			((tdeFuncId)(a))
#define M_PROCEDUREID(a)		((tdeProcedureId)(a))
#define M_OPERATORID(a)			((tdeOperatorId)(a))
#define M_FIELDID(a)				((tdeFieldId)(a))
#define M_DSGVARID(a)				((tdeDsgVarTypeId)(a))

/*************/
/* Functions */
/*************/

//KeyWord (for Vector)
/****************************************************************************/
CString fn_csGetKeyWordParams(long lIndex)
{
	return szGetKeyWordTypeInParamFromId(M_KEYWORDID(lIndex));
}

/****************************************************************************/
CString fn_csGetKeyWordType(long lIndex)
{
	return szGetKeyWordTypeOutParamFromId(M_KEYWORDID(lIndex));
}

//MetaAction
/****************************************************************************/
CString fn_csGetMetaActionParams(long lIndex)
{
	return szGetMetaActionTypeInParamFromId(M_METAACTID(lIndex));
}

//Condition
/****************************************************************************/
CString fn_csGetConditionParams(long lIndex)
{
	return szGetConditionTypeInParamFromId(M_CONDITIONID(lIndex));
}

/****************************************************************************/
BOOL fn_bIsConditionUsableWithUltraOperator(long lIndex)
{
	return fn_ucGetConditionUltraOperator(M_CONDITIONID(lIndex))==1;
}

//Designer Variable
/****************************************************************************/
void fn_vGetDesignerVariableType(stReturn *pstReturn,long lIndex)
{
	CString csType=g_clDsgVarList.m_fn_csGetTypeOfADesignerVariable(lIndex);
	long lDsgVarIndex=fn_lGetDsgVarTypeIdFromEditorName(csType);

	fn_vGetDesignerVariableTypeFromEngineType(pstReturn,M_DSGVARID(lDsgVarIndex));
}

/****************************************************************************/
void fn_vGetDesignerVariableTypeFromEngineType(stReturn *pstReturn,long lIndex)
{
	pstReturn->csType=fn_szFindStringTypeFromDsgVarType(M_DSGVARID(lIndex));
	if(pstReturn->csType==C_ADDR_ARRAY_PARAM)
	{
		pstReturn->csSubType=fn_szFindStringSubTypeFromDsgVarType(M_DSGVARID(lIndex));
	}
}

/****************************************************************************/
void fn_vGetDesignerVariableTypeForThisModel(stReturn *pstReturn,CPA_Actor *pclActorModel,long lIndex)
{
	if(pclActorModel==g_pclCurrentModel)
	{
		//Looks in current dsg var list
		CString	csType=g_clDsgVarList.m_fn_csGetTypeOfADesignerVariable(lIndex);

		long lDsgVarTypeIndex=fn_lGetDsgVarTypeIdFromEditorName(csType);

		fn_vGetDesignerVariableTypeFromEngineType(pstReturn,M_DSGVARID(lDsgVarTypeIndex));
	}
	else
	{
		CPA_EdIR_Brain	*pclBrain=((EdActors_EditorActorModel *)pclActorModel->m_fn_pclGetEditorActor())->m_pclBrain;

		CString	csType;
		if(!pclBrain->m_clListOfDeclarations.IsEmpty())
		{
			//Gets Designer Variable MainBehaviour (first element in the list)
			CPA_EdIR_MainBehaviour *pclMainBehaviour=pclBrain->m_clListOfDeclarations.GetHead();

			//Gets text declaraition
			CString	csIn;
			if(pclMainBehaviour->m_pclBehaviour!=NULL)
				csIn=pclMainBehaviour->m_pclBehaviour->m_fn_csGetRules();
			else
				csIn=pclMainBehaviour->m_csText;

			csIn=fn_csGetCodeWithoutComments(csIn);

			//Looks for dsg var in this text
			long		lCurrentIndex=0;
			long		lNoDsgVar=0;
			CString	csWord=fn_csGetNextWord(csIn,lCurrentIndex);
			csType=csWord;
			while(!csWord.IsEmpty() && lNoDsgVar<lIndex)
			{
				// skip private & public
				if (fn_bIsDsgVarQualifier(csWord))
					csWord=fn_csGetNextWord(csIn,lCurrentIndex);

				//Gets Type
				tdeDsgVarTypeId	eDsgVarTypeId=(tdeDsgVarTypeId)fn_lGetDsgVarTypeIdFromEditorName(csWord);

				//Gets Name
				csWord=fn_csGetNextWord(csIn,lCurrentIndex);

				//Skips Value
				fn_csGetNextWord(csIn,lCurrentIndex);

				if(eDsgVarTypeId==eDsgVarType_Vector)
				{
					//Skips x,y,z components
					fn_csGetNextWord(csIn,lCurrentIndex);
					fn_csGetNextWord(csIn,lCurrentIndex);
					fn_csGetNextWord(csIn,lCurrentIndex);
				}

				//Skips type
				csWord=fn_csGetNextWord(csIn,lCurrentIndex);
				csType=csWord;

				lNoDsgVar++;
			}
		}

		long lDsgVarTypeIndex=fn_lGetDsgVarTypeIdFromEditorName(csType);

		fn_vGetDesignerVariableTypeFromEngineType(pstReturn,M_DSGVARID(lDsgVarTypeIndex));
	}
}

/****************************************************************************/
long fn_lIsADsgVarForThisModel(CPA_Actor *pclActorModel,CString csDsgVarName)
{
	long	lRes=0;

	if(pclActorModel==g_pclCurrentModel)
	{
		//Looks in current dsg var list
//ANNECY CB
		lRes = g_clDsgVarList.m_fn_bIsADesignerVariable(csDsgVarName) - 1;
//		if(g_clDsgVarList.m_fn_bIsADesignerVariable(csDsgVarName))
		if(lRes >= 0)
			return lRes;
/*		{
			lRes=g_clDsgVarList.m_fn_lGetIndexOfADesignerVariable(csDsgVarName);

			return lRes;
		}*/
//END
		else
			return C_NOT_A_DSG_VAR;
	}
	else
	{
		CPA_EdIR_Brain	*pclBrain=((EdActors_EditorActorModel *)pclActorModel->m_fn_pclGetEditorActor())->m_pclBrain;

		long		lNoDsgVar=0;
		BOOL		bFound=FALSE;
		if(!pclBrain->m_clListOfDeclarations.IsEmpty())
		{
			//Gets Designer Variable MainBehaviour (first element in the list)
			CPA_EdIR_MainBehaviour *pclMainBehaviour=pclBrain->m_clListOfDeclarations.GetHead();

			//Gets text declaraition
			CString	csIn;
			if(pclMainBehaviour->m_pclBehaviour!=NULL)
				csIn=pclMainBehaviour->m_pclBehaviour->m_fn_csGetRules();
			else
				csIn=pclMainBehaviour->m_csText;

			csIn=fn_csGetCodeWithoutComments(csIn);

			//Looks for dsg var in this text
			long		lCurrentIndex=0;
			CString	csWord=fn_csGetNextWord(csIn,lCurrentIndex);
			while(!csWord.IsEmpty() && !bFound)
			{
				BOOL bPublic = TRUE;
				
				// skip private & public
				if (fn_bIsDsgVarQualifier(csWord))
				{
					bPublic = csWord.CompareNoCase("private");
					csWord=fn_csGetNextWord(csIn,lCurrentIndex);
				}
				
				//Gets Type
				tdeDsgVarTypeId	eDsgVarTypeId=(tdeDsgVarTypeId)fn_lGetDsgVarTypeIdFromEditorName(csWord);

				//Gets Name
				csWord=fn_csGetNextWord(csIn,lCurrentIndex);

				if(csWord.CompareNoCase(csDsgVarName)==0)
					bFound=TRUE;
				else
				{
					//Skips Value
					fn_csGetNextWord(csIn,lCurrentIndex);

					if(eDsgVarTypeId==eDsgVarType_Vector)
					{
						//Skips x,y,z components
						fn_csGetNextWord(csIn,lCurrentIndex);
						fn_csGetNextWord(csIn,lCurrentIndex);
						fn_csGetNextWord(csIn,lCurrentIndex);
					}

					//Skips type
					csWord=fn_csGetNextWord(csIn,lCurrentIndex);

					lNoDsgVar++;
				}
			}
		}

		lRes=lNoDsgVar;

		if(bFound)
		{
			return lRes;
		}
		else
			return C_NOT_A_DSG_VAR;
	}
}

/****************************************************************************/
void fn_vGetDesignerVariableTypeForThisPerso(stReturn *pstReturn,long lHandleToPerso,long lIndex)
{
	CPA_Actor	*pclActorInstance=(CPA_Actor *)fn_pclGetReachableObject(lHandleToPerso,C_szActorInstanceTypeName);
	CPA_Actor	*pclActorModel=pclActorInstance->m_fn_pclGetModel();

	fn_vGetDesignerVariableTypeForThisModel(pstReturn,pclActorModel,lIndex);
}

/****************************************************************************/
long fn_lIsADsgVarForThisPerso(long lHandleToPerso,CString csDsgVarName)
{
	CPA_Actor	*pclActorInstance=(CPA_Actor *)fn_pclGetReachableObject(lHandleToPerso,C_szActorInstanceTypeName);
	CPA_Actor	*pclActorModel=pclActorInstance->m_fn_pclGetModel();

	return fn_lIsADsgVarForThisModel(pclActorModel,csDsgVarName);
}

//Field
/****************************************************************************/
CString	fn_csGetFieldType(long lIndex)
{
	return fn_szFindStringTypeFromVariableType(fn_eGetFieldType(M_FIELDID(lIndex)));
}

//Type
/****************************************************************************/
BOOL fn_bIsTypeCompatible(CString csType1,stReturn *pclParms2,long lIndex,BOOL bIsOperator)
{
	BOOL	bRes=fn_bIsCompatibleType(csType1[0],pclParms2->csType[(int)lIndex]);

	if(bRes)
	{
		//Changes constant node to float node if needed
		if((csType1[0]==C_REAL_PARAM[0]) &&
			 (pclParms2->csType[(int)lIndex]==C_LONG_PARAM[0]) &&
			 !bIsOperator)
		{
			POSITION	pos=pclParms2->clIntermediateCodeList.FindIndex(lIndex);
			if(pos!=NULL)
			{
				//Checks if node is a constant node or a dsgvar node
				if(pclParms2->clIntermediateCodeList.GetAt(pos)->m_fn_tdeGetNodeType()==eConstant)
				{
					//Converts lIndex th node to a float node
					long	lValue=pclParms2->clIntermediateCodeList.GetAt(pos)->m_fn_lGetIndex();

					pclParms2->clIntermediateCodeList.GetAt(pos)->m_fn_vSetNodeType(eReal);
					pclParms2->clIntermediateCodeList.GetAt(pos)->m_fn_vSetValue(double(lValue));
				}
			}
		}
	}

	return bRes;
}

/****************************************************************************/
BOOL fn_bIsStringCompatible(CString csType1,CString csType2)
{
	return fn_bIsCompatibleStringType(M_MAKECHAR(csType1),M_MAKECHAR(csType2));
}

/****************************************************************************/
BOOL fn_bIsStringCompatibleForAffect(CString csType1,CString csType2)
{
	return fn_bIsCompatibleStringTypeForAffect(M_MAKECHAR(csType1),M_MAKECHAR(csType2));
}

/****************************************************************************/
long fn_lIsTypeCompatibleForArithmOp(long lIndex,
																		 stReturn *pclParms1,
																		 stReturn *pclParms2)
{
	long	lRes=lIndex;

	//for vector operations
	CString	csType;
	switch(lRes)
	{
		case eOperator_ScalarPlusScalar:
			{
				csType=pclParms1->csType+pclParms2->csType;
				if(fn_bIsStringCompatible(fn_csGetOperatorParams(eOperator_VectorPlusVector),csType))
					lRes=eOperator_VectorPlusVector;
			}
			break;

		case eOperator_ScalarMinusScalar:
			{
				csType=pclParms1->csType+pclParms2->csType;
				if(fn_bIsStringCompatible(fn_csGetOperatorParams(eOperator_VectorMinusVector),csType))
					lRes=eOperator_VectorMinusVector;
			}
			break;

		case eOperator_ScalarMulScalar:
			{
				csType=pclParms1->csType+pclParms2->csType;
				if(fn_bIsStringCompatible(fn_csGetOperatorParams(eOperator_VectorMulScalar),csType))
					lRes=eOperator_VectorMulScalar;
			}
			break;

		case eOperator_ScalarDivScalar:
			{
				csType=pclParms1->csType+pclParms2->csType;
				if(fn_bIsStringCompatible(fn_csGetOperatorParams(eOperator_VectorDivScalar),csType))
					lRes=eOperator_VectorDivScalar;
			}
			break;

		case eOperator_ScalarUnaryMinus:
			{
				csType=pclParms1->csType;
				if(fn_bIsStringCompatible(fn_csGetOperatorParams(eOperator_VectorUnaryMinus),csType))
					lRes=eOperator_VectorUnaryMinus;
			}
			break;
	}

	if(lRes==eOperator_Affect)
	{
		if(fn_bIsCompatibleTypeForAffect(pclParms1->csType[0],pclParms2->csType[0]))
			return lRes;
		else
			return C_NOT_COMPATIBLE;
	}
	else
	if(lRes==eOperator_PlusPlusAffect		||
		 lRes==eOperator_MinusMinusAffect ||
		 lRes==eOperator_ScalarUnaryMinus ||
		 lRes==eOperator_VectorUnaryMinus)
	{
		CString	csType=fn_csGetOperatorParams(lRes);

		if(fn_bIsTypeCompatible(csType[0],pclParms1,0,TRUE))
			return lRes;
		else
			return C_NOT_COMPATIBLE;
	}
	else
	if(lRes==eOperator_PlusAffect	||
		 lRes==eOperator_MinusAffect)
	{
		//For vector
		if(
				(pclParms1->csType==C_ADDR_VECTOR_PARAM)
				&&
				(fn_cConvertFromADDRType(pclParms2->csType[0])==C_VECTOR_PARAM[0])
			)
		{
			return lRes;
		}
		else
		//For scalar
		{
			CString	csType=fn_csGetOperatorParams(lRes);

			if(fn_bIsTypeCompatible(csType[0],pclParms1,0,TRUE) &&
				 fn_bIsTypeCompatible(csType[1],pclParms2,0,TRUE))
				return lRes;
			else
				return C_NOT_COMPATIBLE;
		}
	}
	else
	if(lRes==eOperator_MulAffect	||
		 lRes==eOperator_DivAffect)
	{
		char	cType=fn_cConvertFromADDRType(pclParms2->csType[0]);

		//For vector
		if(
				(pclParms1->csType==C_ADDR_VECTOR_PARAM)
				&&
				(
					(cType==C_LONG_PARAM[0])
					||
					(cType==C_REAL_PARAM[0])
				)
			)
		{
			return lRes;
		}
		else
		//For scalar
		{
			CString	csType=fn_csGetOperatorParams(lRes);

			if(fn_bIsTypeCompatible(csType[0],pclParms1,0,TRUE) &&
				 fn_bIsTypeCompatible(csType[1],pclParms2,0,TRUE))
				return lRes;
			else
				return C_NOT_COMPATIBLE;
		}
	}
	else
	{
		CString	csType=fn_csGetOperatorParams(lRes);

		if(fn_bIsTypeCompatible(csType[0],pclParms1,0,TRUE) &&
			 fn_bIsTypeCompatible(csType[1],pclParms2,0,TRUE))
			return lRes;
		else
			return C_NOT_COMPATIBLE;
	}
}

/****************************************************************************/
BOOL fn_bIsTypeCompatibleForBinaryOp(long lIndex,
																		 stReturn *pclParms1,
																		 stReturn *pclParms2)
{
	if((lIndex==eCond_Equal) || (lIndex==eCond_Different))
	{
		if(IsADDRType(pclParms1->csType[0]))
		{
			//Changes node type
			pclParms1->csType.SetAt(0,toupper(pclParms1->csType[0]));
		}

		if(IsADDRType(pclParms2->csType[0]))
		{
			//Changes node type
			pclParms2->csType.SetAt(0,toupper(pclParms2->csType[0]));
		}

		return fn_bIsTypeCompatible(pclParms1->csType,pclParms2,0);
	}
	else
	{
		CString	csType=fn_csGetConditionParams(lIndex);

		if(!(IsADDRType(csType[0])) && IsADDRType(pclParms1->csType[0]))
		{
			//Changes node type
			pclParms1->csType.SetAt(0,toupper(pclParms1->csType[0]));
		}

		if(!(IsADDRType(csType[1])) && IsADDRType(pclParms2->csType[0]))
		{
			//Changes node type
			pclParms2->csType.SetAt(0,toupper(pclParms2->csType[0]));
		}
				
		return (fn_bIsTypeCompatible(csType[0],pclParms1,0) &&
						fn_bIsTypeCompatible(csType[1],pclParms2,0));
	}
}

/****************************************************************************/
BOOL fn_bIsTypeCompatibleForInitialization(CString csType1,stReturn *pclParms2)
{
	//Special treatment for list
	if(csType1==C_ADDR_LIST_PARAM[0] && pclParms2->csType==C_LONG_PARAM[0])
		return TRUE;
	else
	if(csType1==C_ADDR_ARRAY_PARAM[0] && pclParms2->csType==C_LONG_PARAM[0])
		return TRUE;
	else
	{
		//Changes constant node to float node if needed
		if(csType1==C_ADDR_REAL_PARAM[0] && pclParms2->csType==C_LONG_PARAM[0])
		{
			ASSERT(pclParms2->clIntermediateCodeList.GetCount()==1);

			//Checks if node is a constant node or a dsgvar node
			if(pclParms2->clIntermediateCodeList.GetHead()->m_fn_tdeGetNodeType()==eConstant)
			{
				//Converts lIndex th node to a float node
				long	lValue=pclParms2->clIntermediateCodeList.GetHead()->m_fn_lGetIndex();

				pclParms2->clIntermediateCodeList.GetHead()->m_fn_vSetNodeType(eReal);
				pclParms2->clIntermediateCodeList.GetHead()->m_fn_vSetValue(double(lValue));
			}
		}
		
		return fn_bIsCompatibleTypeForAffect(csType1[0],pclParms2->csType[0]);
	}
}

/****************************************************************************/
//Stefan Dumitrean 21-05-98
void fn_vDeleteSpacesFrom(CString &csString)
{
	CString csRet = "";
	for( int i = 0; i < csString.GetLength(); i++ )
		if( csString[i] != ' ' )
			csRet = csRet + csString[i];
	csString = csRet;
}

BOOL fn_bIsParmsCompatible(CString csParms1,stReturn *pclParms2,CString csFunctionName,
													 CString &csMsgError)
{
	CString csStrParam = pclParms2->csInitial + ',', csCurrentParam;
	int iPos;
//End Stefan Dumitrean 21-05-98
	BOOL	bRes=TRUE;
	for(int i=0;bRes && i<csParms1.GetLength();i++)
	{
		bRes=fn_bIsTypeCompatible(csParms1[i],pclParms2,i);
//Stefan Dumitrean 21-05-98
		csStrParam.TrimLeft();
		iPos = csStrParam.Find( ',' );
		if( iPos > 0 )
		{	
			csCurrentParam = csStrParam.Left( iPos );
			fn_vDeleteSpacesFrom( csCurrentParam );
			csStrParam = csStrParam.Right( csStrParam.GetLength() - iPos - 1);
		}
		else csCurrentParam = "";
//End Stefan Dumitrean 21-05-98
	}

	if(!bRes)
	{
//Stefan Dumitrean 21-05-98
		csMsgError.Format("parameter %s must be of type ",csCurrentParam );
		csMsgError+=fn_csGetParamTypeInEnglish(csParms1[i-1])+" not "+
					fn_csGetParamTypeInEnglish(pclParms2->csType[i-1]) +
					" in " + csFunctionName;
//End Stefan Dumitrean 21-05-98
	}

	return bRes;
}


//Function
/****************************************************************************/
CString fn_csGetFunctionParams(long lIndex)
{
	return szGetFunctionTypeInParamFromId(M_FUNCTIONID(lIndex));
}

/****************************************************************************/
CString fn_csGetFunctionType(long lIndex)
{
	return szGetFunctionTypeOutParamFromId(M_FUNCTIONID(lIndex));
}

/****************************************************************************/
BOOL fn_bIsFunctionUsableWithUltraOperator(long lIndex)
{
	return fn_ucGetFunctionUltraOperator(M_FUNCTIONID(lIndex))==1;
}

//Procedure
/****************************************************************************/
CString fn_csGetProcedureParams(long lIndex)
{
	return szGetProcedureTypeInParamFromId(M_PROCEDUREID(lIndex));
}

/****************************************************************************/
BOOL fn_bIsProcedureUsableWithUltraOperator(long lIndex)
{
	return fn_ucGetProcedureUltraOperator(M_PROCEDUREID(lIndex))==1;
}

//Operator
/****************************************************************************/
CString fn_csGetOperatorParams(long lIndex)
{
	return szGetOperatorTypeInParamFromId(M_OPERATORID(lIndex));
}

/****************************************************************************/
CString fn_csGetOperatorType(long lIndex,CString csParm1,CString csParm2)
{
	//A CHANGER !!!
	if((csParm1==C_LONG_PARAM || csParm1==C_ADDR_LONG_PARAM) && 
		 (csParm2==C_LONG_PARAM || csParm2==C_ADDR_LONG_PARAM))
		return C_LONG_PARAM;
	else
		return szGetOperatorTypeOutParamFromId(M_OPERATORID(lIndex));
}

//Perso
/****************************************************************************/
long fn_lGetHandleOfPerso(stReturn *pstPerso)
{
	if(M_GETINDEX(*pstPerso)==eKeyWord_MainActor)
		return (long)fn_pstGetMainActor();
	else
	/*if(M_GETINDEX(*pstPerso)==eKeyWord_World)
		return (long)fn_pstGetWorld();
	else*/
		return M_GETINDEX(*pstPerso);
}

//qualifier
//****************************************************************************
BOOL fn_bIsDsgVarQualifier(CString csQualifier)
{
	return ( !csQualifier.CompareNoCase("public") || !csQualifier.CompareNoCase("private") );
}

/****************************************************************************/
void CParse::yyerror(char *msg)
{
#if 0
	CString	csMsg;
//	sprintf(sz,"error %s (i=%ld)= %s\n",
	csMsg.Format("error %s (%s): %s",
								(char *)LPCTSTR(m_csMsgError),
								g_clLex.yytext,
//							g_clLex.m_lOldIndex,
								msg);

	AfxMessageBox(csMsg);
#endif
	m_csMsgError = msg;
	m_bNoError=FALSE;
	m_lIndexError=g_clLex.m_lOldIndex;
}

/****************************************************************************/
int	CParse::yylex()
{
	return g_clLex.yylex();
}

/****************************************************************************/
//BEGIN ROMTEAM Cristi Petrescu 98-05-
BOOL fn_bAnalysesText(CString csStringToParse,tdeTypeText eTypeText,
											long &lIndexError,CPA_EdIR_IntermediateCodeList *pclIntermediateCodeList, CString csBehaviourName)
//END ROMTEAM Cristi Petrescu 98-05-
{
	g_clParse.m_bNoError=TRUE;
	g_clParse.m_bIsInITRules=FALSE;
	g_clParse.m_clIntermediateCodeList.m_fn_vDestroyAndRemoveAllEntries();
	g_clParse.yydebug=0;

	// BEGIN ROMTEAM Cristi Petrescu 98-09-
	g_clParse . m_pstMyStack = NULL;
	// END ROMTEAM Cristi Petrescu 98-09-

	char	*szStringToParse=new char[csStringToParse.GetLength()+1];
	strcpy(szStringToParse,(char *)LPCTSTR(csStringToParse));
	g_clLex.yyinit(szStringToParse,eTypeText);

	g_clParse.yyparse();

	delete[] szStringToParse;

	// BEGIN ROMTEAM Cristi Petrescu 98-09-
	if (g_clParse . m_pstMyStack)
		delete[] g_clParse . m_pstMyStack;
	// END ROMTEAM Cristi Petrescu 98-09-

	//Computes depth
	POSITION			pos=g_clParse.m_clIntermediateCodeList.GetHeadPosition();
	unsigned char	ucDepth=1;
	while(pos!=NULL)
	{
		CPA_EdIR_IntermediateCode	*pclIntermediateCode=g_clParse.m_clIntermediateCodeList.GetNext(pos);

		if(pclIntermediateCode->m_fn_tdeGetNodeType()==eIncDepth)
		{
			ucDepth++;
		}
		else
		if(pclIntermediateCode->m_fn_tdeGetNodeType()==eDecDepth)
		{
			ucDepth--;
		}
		else
		{
			pclIntermediateCode->m_fn_vSetDepth(ucDepth);
			pclIntermediateCodeList->AddTail(new CPA_EdIR_IntermediateCode(pclIntermediateCode));
		}
	}

	g_clParse.m_clIntermediateCodeList.m_fn_vDestroyAndRemoveAllEntries();

	lIndexError=g_clParse.m_lIndexError;

	return g_clParse.m_bNoError;
}

#endif //D_ED_IR_ACTIVE
