2012-02-05 11:35:58 -05:00
|
|
|
/****************************************************************
|
|
|
|
* *
|
2012-03-24 14:06:46 -04:00
|
|
|
* Copyright 2001, 2011 Fidelity Information Services, Inc *
|
2012-02-05 11:35:58 -05:00
|
|
|
* *
|
|
|
|
* 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 "toktyp.h"
|
|
|
|
#include "opcode.h"
|
|
|
|
#include "indir_enum.h"
|
|
|
|
#include "advancewindow.h"
|
|
|
|
#include "cmd.h"
|
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
error_def(ERR_FCHARMAXARGS);
|
2012-02-05 11:35:58 -05:00
|
|
|
|
|
|
|
int m_view(void)
|
|
|
|
{
|
|
|
|
oprtype argv[CHARMAXARGS], *argp;
|
|
|
|
unsigned short count;
|
2012-03-24 14:06:46 -04:00
|
|
|
triple *view, *parm, *parm1;
|
|
|
|
DCL_THREADGBL_ACCESS;
|
2012-02-05 11:35:58 -05:00
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
SETUP_THREADGBL_ACCESS;
|
2012-02-05 11:35:58 -05:00
|
|
|
argp = &argv[0];
|
|
|
|
count = 0;
|
2012-03-24 14:06:46 -04:00
|
|
|
switch (expr(argp, MUMPS_EXPR))
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
|
|
|
case EXPR_FAIL:
|
|
|
|
return FALSE;
|
|
|
|
case EXPR_INDR:
|
2012-03-24 14:06:46 -04:00
|
|
|
if (TK_COLON != TREF(window_token))
|
|
|
|
{
|
|
|
|
make_commarg(argp, indir_view);
|
2012-02-05 11:35:58 -05:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
/* caution: fall through */
|
|
|
|
case EXPR_GOOD:
|
|
|
|
view = maketriple(OC_VIEW);
|
|
|
|
parm = newtriple(OC_PARAMETER);
|
|
|
|
view->operand[1] = put_tref(parm);
|
|
|
|
parm->operand[0] = *argp;
|
|
|
|
count++;
|
|
|
|
argp++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
for (;;)
|
|
|
|
{
|
2012-03-24 14:06:46 -04:00
|
|
|
if (TK_COLON != TREF(window_token))
|
2012-02-05 11:35:58 -05:00
|
|
|
break;
|
|
|
|
advancewindow();
|
2012-03-24 14:06:46 -04:00
|
|
|
if (EXPR_FAIL == expr(argp, MUMPS_EXPR))
|
2012-02-05 11:35:58 -05:00
|
|
|
return FALSE;
|
|
|
|
parm1 = newtriple(OC_PARAMETER);
|
|
|
|
parm->operand[1] = put_tref(parm1);
|
|
|
|
parm1->operand[0] = *argp;
|
|
|
|
parm = parm1;
|
|
|
|
count++;
|
|
|
|
argp++;
|
2012-03-24 14:06:46 -04:00
|
|
|
if (CHARMAXARGS <= count)
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
|
|
|
stx_error(ERR_FCHARMAXARGS);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
view->operand[0] = put_ilit(count);
|
|
|
|
ins_triple(view);
|
|
|
|
return TRUE;
|
|
|
|
}
|