fis-gtm/sr_port/f_translate.c

52 lines
1.2 KiB
C

/****************************************************************
* *
* Copyright 2001, 2006 Fidelity Information Services, Inc *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
* under a license. If you do not know the terms of *
* the license, please stop and do not read further. *
* *
****************************************************************/
#include "mdef.h"
#include "compiler.h"
#include "opcode.h"
#include "toktyp.h"
#include "advancewindow.h"
GBLREF char window_token;
LITREF mval literal_null ;
int f_translate( oprtype *a, opctype op)
{
triple *args[3];
int i;
bool more_args;
args[0] = maketriple(op);
if (!expr(&(args[0]->operand[0])))
return FALSE;
for (i = 1 , more_args = TRUE ; i < 3 ; i++)
{
args[i] = newtriple(OC_PARAMETER);
if (more_args)
{
if (window_token != TK_COMMA)
more_args = FALSE;
else
{
advancewindow();
if (!expr(&(args[i]->operand[0])))
return FALSE;
}
}
if (!more_args)
args[i]->operand[0] = put_lit((mval *)&literal_null);
args[i - 1]->operand[1] = put_tref(args[i]);
}
ins_triple(args[0]);
*a = put_tref(args[0]);
return TRUE;
}