2012-02-05 11:35:58 -05:00
|
|
|
/****************************************************************
|
|
|
|
* *
|
2024-07-19 11:43:27 -04:00
|
|
|
* Copyright 2001, 2012 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 "opcode.h"
|
|
|
|
#include "toktyp.h"
|
|
|
|
#include "mdq.h"
|
2012-03-24 14:06:46 -04:00
|
|
|
#include "fullbool.h"
|
2012-02-05 11:35:58 -05:00
|
|
|
|
2012-03-24 14:06:46 -04:00
|
|
|
error_def(ERR_VAREXPECTED);
|
2012-02-05 11:35:58 -05:00
|
|
|
|
|
|
|
int glvn(oprtype *a)
|
|
|
|
{
|
2024-07-19 11:43:27 -04:00
|
|
|
triple *oldchain, *ref;
|
|
|
|
oprtype x1;
|
|
|
|
save_se save_state;
|
2012-02-05 11:35:58 -05:00
|
|
|
DCL_THREADGBL_ACCESS;
|
|
|
|
|
|
|
|
SETUP_THREADGBL_ACCESS;
|
2012-03-24 14:06:46 -04:00
|
|
|
switch (TREF(window_token))
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
|
|
|
case TK_IDENT:
|
|
|
|
if (!lvn(a,OC_GETINDX,0))
|
|
|
|
return FALSE;
|
|
|
|
return TRUE;
|
|
|
|
case TK_CIRCUMFLEX:
|
|
|
|
if (!gvn())
|
|
|
|
return FALSE;
|
|
|
|
*a = put_tref(newtriple(OC_GVGET));
|
|
|
|
return TRUE;
|
|
|
|
case TK_ATSIGN:
|
2024-07-19 11:43:27 -04:00
|
|
|
if (SHIFT_SIDE_EFFECTS)
|
2012-02-05 11:35:58 -05:00
|
|
|
{
|
2024-07-19 11:43:27 -04:00
|
|
|
START_GVBIND_CHAIN(&save_state, oldchain);
|
2012-02-05 11:35:58 -05:00
|
|
|
if (!indirection(&x1))
|
|
|
|
{
|
|
|
|
setcurtchain(oldchain);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
ref = newtriple(OC_INDGLVN);
|
2024-07-19 11:43:27 -04:00
|
|
|
PLACE_GVBIND_CHAIN(&save_state, oldchain);
|
2012-02-05 11:35:58 -05:00
|
|
|
} else
|
|
|
|
{
|
|
|
|
if (!indirection(&x1))
|
|
|
|
return FALSE;
|
|
|
|
ref = newtriple(OC_INDGLVN);
|
|
|
|
}
|
2024-07-19 11:43:27 -04:00
|
|
|
if (TREF(expr_depth))
|
|
|
|
(TREF(side_effect_base))[TREF(expr_depth)] = (OLD_SE != TREF(side_effect_handling));
|
2012-02-05 11:35:58 -05:00
|
|
|
ref->operand[0] = x1;
|
|
|
|
*a = put_tref(ref);
|
|
|
|
return TRUE;
|
|
|
|
default:
|
|
|
|
stx_error(ERR_VAREXPECTED);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|