----------------->  GNU Sather - compiler configuration file  <----------------
-- Copyright (C) 199x by International Computer Science Institute            --
-- This file is part of the GNU Sather library. It is free software; you may --
-- redistribute  and/or modify it under the terms of the GNU Library General --
-- Public  License (LGPL)  as published  by the  Free  Software  Foundation; --
-- either version 2 of the license, or (at your option) any later version.   --
-- This  library  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 Doc/LGPL for more details.       --
-- The license text is also available from:  Free Software Foundation, Inc., --
-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                     --
-------------->  Please email comments to <bug-sather@gnu.org>  <--------------

#ifndef AVAL_CONFIG
#define AVAL_CONFIG

-- THIS FILE IS WRONG FOR pSather and VALUE TYPES!

#ifdef PP
#undef PP
#endif

#define PP	no_pre,no_post

AVAL_ASIZE:			PP,reads "@0::asize",
				var "@r $$;",exec "$$=VASIZE(@0);" "$$";
AVAL_AGET:		 	PP,reads "@0::[]" "@0::asize",
				var "@r $$;",
				exec "$$=@(r)VARR(@0,$0,$1);" "$$";
AVAL_ASET:			PP,writes "@0::[]",reads "@0::asize",
				var "@r $$;",
				exec "$$=$0;VSARR(@0,$$,$1,@(2)$2);" "$$";
AVAL_ACOPY:			PP,reads "@0::[]" "@0::asize",writes "@0::[]" "@0::asize",
				var "@r $$;",
				exec "$$=$0;AVALACOPY(@0,$$,$1);" "$$";
AVAL_ACOPY_BEG:			PP,reads "@0::[]" "@0::asize",writes "@0::[]" "@0::asize",
				var "@r $$;",
				exec "$$=$0;AVALACOPYB(@0,$$,$1,$2);" "$$";
AVAL_ACOPY_BEG_NUM:		PP,reads "@0::[]" "@0::asize",writes "@0::[]" "@0::asize",
				var "@r $$;",
				exec "$$=$0;AVALACOPYBN(@0,$$,$1,$2,$3);" "$$";
AVAL_ACOPY_BEG_NUM_SRCBEG:	PP,reads "@0::[]" "@0::asize",writes "@0::[]" "@0::asize",
				var "@r $$;",
				exec "$$=$0;AVALACOPYBNS(@0,$$,$1,$2,$3,$4);" "$$";

AVAL_AELTB:			reads "@0::[]" "@0::asize",
				var "INT $$br;",
				init "$$br=VASIZE(@0);",
				break "$$br",
				temp "@r a$$;",
				iter "a$$=VARR(@0,$0,$#);" "a$$";
AVAL_AELT_BEGB:			reads "@0::[]" "@0::asize",
				var  "INT $$c,$$s;",
				temp "@r a$$;",
				init "$$c=$1-1;$$s=VASIZE(@0);",
				iter "if(++$$c>=$$s) @@;"
				     "a$$=VARR(@0,$0,$$c);" "a$$";
AVAL_AELT_BEG_NUMB:		reads "@0::[]" "@0::asize",
				var  "INT $$c,$$m;",
				temp "@r a$$;",
				init "$$c=$1-1;$$m=$1+$2;",
				iter "if(++$$c>=$$m) @@;"
				     "a$$=VARR(@0,$0,$$c);" "a$$";
AVAL_AELT_BEG_NUM_STEPB:	reads "@0::[]" "@0::asize",
				var  "INT $$c,$$m;",
				temp "@r a$$;",
				init "$$c=$1;$$m=$1+$2*$3;",
				iter "if($3>=0&&$$c>=$$m||$3<0&&$$c<=$$m) @@;"
				     "a$$=VARR(@0,$0,$$c);" "$$c+=$3;" "a$$";
AVAL_AINDB:			reads "@0::asize",
				var "INT $$br;",
				init "$$br=VASIZE(@0);",
				break "$$br",
				temp "@r r$$;",
				iter "r$$=$#;" "r$$";

#endif
