Lines Matching refs:exvsp
776 EXSTYPE *exvsp;
819 exvsp = newvs + i;
850 exvsp = exvs;
882 *++exvsp = exlval;
923 *++exvsp = exlval;
935 --exvsp;
964 exval = exvsp[1-exm];
972 if (exvsp[-1].expr && !(expr.program->disc->flags & EX_STRICT))
976 if (exvsp[-1].expr->op == S2B)
980 x = exvsp[-1].expr;
981 exvsp[-1].expr = x->data.operand.left;
986 expr.program->main.value = exnewnode(expr.program, PROCEDURE, 1, exvsp[-1].expr->type, NiL, exvsp[-1].expr);
997 exvsp[-1].id->lex = PROCEDURE;
998 expr.procedure = exvsp[-1].id->value = exnewnode(expr.program, PROCEDURE, 1, exvsp[-1].id->type, NiL, NiL);
1003 if (expr.assigned && !streq(exvsp[-1].id->name, "begin"))
1021 if (exvsp[0].expr && exvsp[0].expr->op == S2B)
1025 x = exvsp[0].expr;
1026 exvsp[0].expr = x->data.operand.left;
1030 exvsp[-3].id->value->data.operand.right = excast(expr.program, exvsp[0].expr, exvsp[-3].id->type, NiL, 0);
1042 if (!exvsp[-1].expr)
1043 exval.expr = exvsp[0].expr;
1044 else if (!exvsp[0].expr)
1045 exval.expr = exvsp[-1].expr;
1046 else if (exvsp[-1].expr->op == CONSTANT)
1048 exfreenode(expr.program, exvsp[-1].expr);
1049 exval.expr = exvsp[0].expr;
1051 else if (exvsp[-1].expr->op == ';')
1053 exval.expr = exvsp[-1].expr;
1054 exvsp[-1].expr->data.operand.last = exvsp[-1].expr->data.operand.last->data.operand.right = exnewnode(expr.program, ';', 1, exvsp[0].expr->type, exvsp[0].expr, NiL);
1058 exval.expr = exnewnode(expr.program, ';', 1, exvsp[-1].expr->type, exvsp[-1].expr, NiL);
1059 exval.expr->data.operand.last = exval.expr->data.operand.right = exnewnode(expr.program, ';', 1, exvsp[0].expr->type, exvsp[0].expr, NiL);
1066 exval.expr = exvsp[-1].expr;
1072 exval.expr = (exvsp[-1].expr && exvsp[-1].expr->type == STRING) ? exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-1].expr, NiL) : exvsp[-1].expr;
1077 {expr.instatic=exvsp[0].integer;}
1081 {expr.declare=exvsp[0].id->type;}
1086 exval.expr = exvsp[-1].expr;
1093 if (exvsp[-3].expr->type == STRING)
1094 exvsp[-3].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-3].expr, NiL);
1095 else if (!INTEGRAL(exvsp[-3].expr->type))
1096 exvsp[-3].expr = excast(expr.program, exvsp[-3].expr, INTEGER, NiL, 0);
1097 exval.expr = exnewnode(expr.program, exvsp[-5].id->index, 1, INTEGER, exvsp[-3].expr, exnewnode(expr.program, ':', 1, exvsp[-1].expr ? exvsp[-1].expr->type : 0, exvsp[-1].expr, exvsp[0].expr));
1104 exval.expr->data.generate.array = exvsp[-2].expr;
1105 if (!exvsp[-2].expr->data.variable.index || exvsp[-2].expr->data.variable.index->op != DYNAMIC)
1107 exval.expr->data.generate.index = exvsp[-2].expr->data.variable.index->data.variable.symbol;
1108 if (exvsp[-2].expr->op == ID && exval.expr->data.generate.index->type != INTEGER)
1110 exfreenode(expr.program, exvsp[-2].expr->data.variable.index);
1111 exvsp[-2].expr->data.variable.index = 0;
1112 exval.expr->data.generate.statement = exvsp[0].expr;
1118 if (!exvsp[-4].expr)
1120 exvsp[-4].expr = exnewnode(expr.program, CONSTANT, 0, INTEGER, NiL, NiL);
1121 exvsp[-4].expr->data.constant.value.integer = 1;
1123 else if (exvsp[-4].expr->type == STRING)
1124 exvsp[-4].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-4].expr, NiL);
1125 else if (!INTEGRAL(exvsp[-4].expr->type))
1126 exvsp[-4].expr = excast(expr.program, exvsp[-4].expr, INTEGER, NiL, 0);
1127 exval.expr = exnewnode(expr.program, exvsp[-8].id->index, 1, INTEGER, exvsp[-4].expr, exnewnode(expr.program, ';', 1, 0, exvsp[-2].expr, exvsp[0].expr));
1128 if (exvsp[-6].expr)
1129 exval.expr = exnewnode(expr.program, ';', 1, INTEGER, exvsp[-6].expr, exval.expr);
1135 if (exvsp[-2].expr->type == STRING)
1136 exvsp[-2].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-2].expr, NiL);
1137 else if (!INTEGRAL(exvsp[-2].expr->type))
1138 exvsp[-2].expr = excast(expr.program, exvsp[-2].expr, INTEGER, NiL, 0);
1139 exval.expr = exnewnode(expr.program, exvsp[-4].id->index, 1, INTEGER, exvsp[-2].expr, exnewnode(expr.program, ';', 1, 0, NiL, exvsp[0].expr));
1144 {expr.declare=exvsp[0].expr->type;}
1151 exval.expr = exnewnode(expr.program, exvsp[-7].id->index, 1, INTEGER, exvsp[-5].expr, exnewnode(expr.program, DEFAULT, 1, 0, sw->defcase, sw->firstcase));
1164 if (!exvsp[-1].expr)
1166 exvsp[-1].expr = exnewnode(expr.program, CONSTANT, 0, INTEGER, NiL, NiL);
1167 exvsp[-1].expr->data.constant.value.integer = 1;
1169 else if (!INTEGRAL(exvsp[-1].expr->type))
1170 exvsp[-1].expr = excast(expr.program, exvsp[-1].expr, INTEGER, NiL, 0);
1171 exval.expr = exnewnode(expr.program, exvsp[-2].id->index, 1, INTEGER, exvsp[-1].expr, NiL);
1183 if (exvsp[-1].expr)
1187 exvsp[-1].expr = excast(expr.program, exvsp[-1].expr, expr.procedure ? expr.procedure->type : INTEGER, NiL, 0);
1189 exval.expr = exnewnode(expr.program, RETURN, 1, exvsp[-1].expr ? exvsp[-1].expr->type : 0, exvsp[-1].expr, NiL);
1231 exval.expr = exnewnode(expr.program, CASE, 1, 0, exvsp[0].expr, NiL);
1253 sw->defcase = exvsp[0].expr;
1275 exvsp[-1].expr = excast(expr.program, exvsp[-1].expr, expr.swstate->type, NiL, 0);
1276 *expr.swstate->cur++ = &(exvsp[-1].expr->data.constant.value);
1301 if (exvsp[0].expr)
1302 exval.expr = exvsp[-2].expr ? exnewnode(expr.program, ',', 1, exvsp[0].expr->type, exvsp[-2].expr, exvsp[0].expr) : exvsp[0].expr;
1307 {expr.id=exvsp[0].id;}
1313 if (!exvsp[-3].id->type || expr.declare)
1314 exvsp[-3].id->type = expr.declare;
1315 if (exvsp[-4].reference)
1317 exvsp[-3].id->index = MEMBER;
1319 exerror("%s: member references not supported", exvsp[-4].reference);
1320 else if (exvsp[0].expr)
1321 exerror("%s: member references cannot be initialized", exvsp[-3].id);
1323 (*expr.program->disc->reff)(expr.program, exval.expr, exvsp[-3].id, exvsp[-4].reference, NiL, EX_SCALAR, expr.program->disc);
1325 else if (exvsp[0].expr && exvsp[0].expr->op == PROCEDURE)
1327 exvsp[-3].id->lex = PROCEDURE;
1328 exvsp[-3].id->value = exvsp[0].expr;
1332 exvsp[-3].id->lex = DYNAMIC;
1333 exvsp[-3].id->value = exnewnode(expr.program, 0, 0, 0, NiL, NiL);
1334 if (exvsp[-1].integer && !exvsp[-3].id->local.pointer)
1341 if (!(exvsp[-3].id->local.pointer = (char*)dtopen(disc, Dtoset)))
1342 exerror("%s: cannot initialize associative array", exvsp[-3].id->name);
1344 if (exvsp[0].expr)
1346 if (exvsp[0].expr->type != exvsp[-3].id->type)
1348 exvsp[0].expr->type = exvsp[-3].id->type;
1349 exvsp[0].expr->data.operand.right = excast(expr.program, exvsp[0].expr->data.operand.right, exvsp[-3].id->type, NiL, 0);
1351 exvsp[0].expr->data.operand.left = exnewnode(expr.program, DYNAMIC, 0, exvsp[-3].id->type, NiL, NiL);
1352 exvsp[0].expr->data.operand.left->data.variable.symbol = exvsp[-3].id;
1353 exval.expr = exvsp[0].expr;
1360 else if (!exvsp[-1].integer)
1361 exvsp[-3].id->value->data.value = exzero(exvsp[-3].id->type);
1374 exval.expr = exvsp[0].expr;
1386 exval.expr = exvsp[-1].expr;
1392 exval.expr = (exvsp[0].expr->type == exvsp[-2].id->type) ? exvsp[0].expr : excast(expr.program, exvsp[0].expr, exvsp[-2].id->type, NiL, 0);
1406 if (!exvsp[-2].expr->type)
1408 if (!exvsp[0].expr->type)
1409 exvsp[-2].expr->type = exvsp[0].expr->type = rel ? STRING : INTEGER;
1411 exvsp[-2].expr->type = exvsp[0].expr->type;
1413 else if (!exvsp[0].expr->type)
1414 exvsp[0].expr->type = exvsp[-2].expr->type;
1415 if (exvsp[-2].expr->type != exvsp[0].expr->type)
1417 if (exvsp[-2].expr->type == STRING)
1418 exvsp[-2].expr = excast(expr.program, exvsp[-2].expr, exvsp[0].expr->type, exvsp[0].expr, 0);
1419 else if (exvsp[0].expr->type == STRING)
1420 exvsp[0].expr = excast(expr.program, exvsp[0].expr, exvsp[-2].expr->type, exvsp[-2].expr, 0);
1421 else if (exvsp[-2].expr->type == FLOATING)
1422 exvsp[0].expr = excast(expr.program, exvsp[0].expr, FLOATING, exvsp[-2].expr, 0);
1423 else if (exvsp[0].expr->type == FLOATING)
1424 exvsp[-2].expr = excast(expr.program, exvsp[-2].expr, FLOATING, exvsp[0].expr, 0);
1427 rel = (exvsp[-2].expr->type == STRING) ? STRING : ((exvsp[-2].expr->type == UNSIGNED) ? UNSIGNED : exvsp[0].expr->type);
1428 exval.expr = exnewnode(expr.program, exvsp[-1].op, 1, rel, exvsp[-2].expr, exvsp[0].expr);
1429 if (!expr.program->errors && exvsp[-2].expr->op == CONSTANT && exvsp[0].expr->op == CONSTANT)
1434 exfreenode(expr.program, exvsp[-2].expr);
1435 exfreenode(expr.program, exvsp[0].expr);
1533 if (exvsp[-2].expr->type == STRING)
1534 exvsp[-2].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-2].expr, NiL);
1535 if (exvsp[0].expr->type == STRING)
1536 exvsp[0].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[0].expr, NiL);
1549 if (exvsp[-2].expr->op == CONSTANT)
1551 exfreenode(expr.program, exvsp[-2].expr);
1552 exval.expr = exvsp[0].expr;
1555 exval.expr = exnewnode(expr.program, ',', 1, exvsp[0].expr->type, exvsp[-2].expr, exvsp[0].expr);
1569 if (!exvsp[-3].expr->type)
1571 if (!exvsp[0].expr->type)
1572 exvsp[-3].expr->type = exvsp[0].expr->type = INTEGER;
1574 exvsp[-3].expr->type = exvsp[0].expr->type;
1576 else if (!exvsp[0].expr->type)
1577 exvsp[0].expr->type = exvsp[-3].expr->type;
1578 if (exvsp[-6].expr->type == STRING)
1579 exvsp[-6].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-6].expr, NiL);
1580 else if (!INTEGRAL(exvsp[-6].expr->type))
1581 exvsp[-6].expr = excast(expr.program, exvsp[-6].expr, INTEGER, NiL, 0);
1582 if (exvsp[-3].expr->type != exvsp[0].expr->type)
1584 if (exvsp[-3].expr->type == STRING || exvsp[0].expr->type == STRING)
1586 else if (exvsp[-3].expr->type == FLOATING)
1587 exvsp[0].expr = excast(expr.program, exvsp[0].expr, FLOATING, NiL, 0);
1588 else if (exvsp[0].expr->type == FLOATING)
1589 exvsp[-3].expr = excast(expr.program, exvsp[-3].expr, FLOATING, NiL, 0);
1591 if (exvsp[-6].expr->op == CONSTANT)
1593 if (exvsp[-6].expr->data.constant.value.integer)
1595 exval.expr = exvsp[-3].expr;
1596 exfreenode(expr.program, exvsp[0].expr);
1600 exval.expr = exvsp[0].expr;
1601 exfreenode(expr.program, exvsp[-3].expr);
1603 exfreenode(expr.program, exvsp[-6].expr);
1606 exval.expr = exnewnode(expr.program, '?', 1, exvsp[-3].expr->type, exvsp[-6].expr, exnewnode(expr.program, ':', 1, exvsp[-3].expr->type, exvsp[-3].expr, exvsp[0].expr));
1613 if (exvsp[0].expr->type == STRING)
1614 exvsp[0].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[0].expr, NiL);
1615 else if (!INTEGRAL(exvsp[0].expr->type))
1616 exvsp[0].expr = excast(expr.program, exvsp[0].expr, INTEGER, NiL, 0);
1618 exval.expr = exnewnode(expr.program, exvsp[-1].op, 1, exvsp[0].expr->type == UNSIGNED ? INTEGER : exvsp[0].expr->type, exvsp[0].expr, NiL);
1619 if (exvsp[0].expr->op == CONSTANT)
1624 exfreenode(expr.program, exvsp[0].expr);
1643 exval.expr = exvsp[0].expr;
1649 exval.expr = exnewnode(expr.program, ADDRESS, 0, T(exvsp[0].expr->type), exvsp[0].expr, NiL);
1655 exval.expr = exnewnode(expr.program, FUNCTION, 1, T(exvsp[-3].id->type), call(exvsp[-4].reference, exvsp[-3].id, exvsp[-1].expr), exvsp[-1].expr);
1659 (*expr.program->disc->reff)(expr.program, exval.expr->data.operand.left, exval.expr->data.operand.left->data.variable.symbol, exvsp[-4].reference, NiL, EX_CALL, expr.program->disc);
1665 if (!INTEGRAL(exvsp[-1].expr->type))
1666 exvsp[-1].expr = excast(expr.program, exvsp[-1].expr, INTEGER, NiL, 0);
1667 exval.expr = exnewnode(expr.program, EXIT, 1, INTEGER, exvsp[-1].expr, NiL);
1673 exval.expr = exnewnode(expr.program, CALL, 1, exvsp[-3].id->type, NiL, exvsp[-1].expr);
1674 exval.expr->data.call.procedure = exvsp[-3].id;
1680 exval.expr = exnewnode(expr.program, exvsp[-3].id->index, 0, exvsp[-3].id->type, NiL, NiL);
1681 if (exvsp[-1].expr && exvsp[-1].expr->data.operand.left->type == INTEGER)
1683 exval.expr->data.print.descriptor = exvsp[-1].expr->data.operand.left;
1684 exvsp[-1].expr = exvsp[-1].expr->data.operand.right;
1687 switch (exvsp[-3].id->index)
1701 exval.expr->data.print.args = preprint(exvsp[-1].expr);
1709 exval.expr = exnewnode(expr.program, exvsp[-3].id->index, 0, exvsp[-3].id->type, NiL, NiL);
1710 if (exvsp[-1].expr && exvsp[-1].expr->data.operand.left->type == INTEGER)
1712 exval.expr->data.scan.descriptor = exvsp[-1].expr->data.operand.left;
1713 exvsp[-1].expr = exvsp[-1].expr->data.operand.right;
1716 switch (exvsp[-3].id->index)
1722 if (exvsp[-1].expr && exvsp[-1].expr->data.operand.left->type == STRING)
1724 exval.expr->data.scan.descriptor = exvsp[-1].expr->data.operand.left;
1725 exvsp[-1].expr = exvsp[-1].expr->data.operand.right;
1728 exerror("%s: string argument expected", exvsp[-3].id->name);
1731 if (!exvsp[-1].expr || !exvsp[-1].expr->data.operand.left || exvsp[-1].expr->data.operand.left->type != STRING)
1732 exerror("%s: format argument expected", exvsp[-3].id->name);
1733 exval.expr->data.scan.format = exvsp[-1].expr->data.operand.left;
1734 for (x = exval.expr->data.scan.args = exvsp[-1].expr->data.operand.right; x; x = x->data.operand.right)
1737 exerror("%s: address argument expected", exvsp[-3].id->name);
1745 exval.expr = exnewnode(expr.program, CONSTANT, 0, exvsp[0].id->type, NiL, NiL);
1747 exerror("%s: qualified identifier references not supported", exvsp[0].id->name);
1750 exval.expr->data.constant.value = (*expr.program->disc->reff)(expr.program, exval.expr, exvsp[0].id, NiL, exvsp[-2].string, EX_SCALAR, expr.program->disc);
1751 exval.expr->data.constant.reference = exvsp[0].id;
1758 if (exvsp[0].expr)
1760 if (exvsp[-1].expr->op == ID && !expr.program->disc->setf)
1761 exerror("%s: variable assignment not supported", exvsp[-1].expr->data.variable.symbol->name);
1764 if (!exvsp[-1].expr->type)
1765 exvsp[-1].expr->type = exvsp[0].expr->type;
1767 else if (exvsp[0].expr->type != exvsp[-1].expr->type && exvsp[-1].expr->type >= 0200)
1769 else if (exvsp[0].expr->type != exvsp[-1].expr->type)
1772 exvsp[0].expr->type = exvsp[-1].expr->type;
1773 exvsp[0].expr->data.operand.right = excast(expr.program, exvsp[0].expr->data.operand.right, exvsp[-1].expr->type, NiL, 0);
1775 exvsp[0].expr->data.operand.left = exvsp[-1].expr;
1776 exval.expr = exvsp[0].expr;
1785 if (exvsp[0].expr->type == STRING)
1787 exval.expr = exnewnode(expr.program, exvsp[-1].op, 0, exvsp[0].expr->type, exvsp[0].expr, NiL);
1795 if (exvsp[-1].expr->type == STRING)
1797 exval.expr = exnewnode(expr.program, exvsp[0].op, 0, exvsp[-1].expr->type, exvsp[-1].expr, NiL);
1816 exval.expr = exnewnode(expr.program, CONSTANT, 0, exvsp[0].id->type, NiL, NiL);
1818 exerror("%s: identifier references not supported", exvsp[0].id->name);
1820 exval.expr->data.constant.value = (*expr.program->disc->reff)(expr.program, exval.expr, exvsp[0].id, NiL, NiL, EX_SCALAR, expr.program->disc);
1827 exval.expr->data.constant.value.floating = exvsp[0].floating;
1834 exval.expr->data.constant.value.integer = exvsp[0].integer;
1841 exval.expr->data.constant.value.string = exvsp[0].string;
1848 exval.expr->data.constant.value.integer = exvsp[0].integer;
1854 exval.expr = exnewnode(expr.program, ID, 0, exvsp[-1].id->type, NiL, NiL);
1855 exval.expr->data.variable.symbol = QUALIFY(exvsp[-2].reference, exvsp[-1].id);
1856 exval.expr->data.variable.reference = exvsp[-2].reference;
1857 if (exvsp[0].expr && !INTEGRAL(exvsp[0].expr->type))
1858 exvsp[0].expr = excast(expr.program, exvsp[0].expr, INTEGER, NiL, 0);
1859 exval.expr->data.variable.index = exvsp[0].expr;
1861 exerror("%s: identifier references not supported", exvsp[-1].id->name);
1863 (*expr.program->disc->reff)(expr.program, exval.expr, exval.expr->data.variable.symbol, exvsp[-2].reference, NiL, exvsp[0].expr ? 0 : EX_SCALAR, expr.program->disc);
1870 exval.expr = exnewnode(expr.program, DYNAMIC, 0, exvsp[-1].id->type, NiL, NiL);
1871 exval.expr->data.variable.symbol = exvsp[-1].id;
1873 if (((exval.expr->data.variable.index = exvsp[0].expr) == 0) != (exvsp[-1].id->local.pointer == 0))
1874 exerror("%s: is%s an array", exvsp[-1].id->name, exvsp[-1].id->local.pointer ? "" : " not");
1881 exval.expr->data.variable.symbol = exvsp[0].id;
1909 exval.expr = exvsp[-1].expr;
1921 exval.expr = exvsp[0].expr->data.operand.left;
1922 exvsp[0].expr->data.operand.left = exvsp[0].expr->data.operand.right = 0;
1923 exfreenode(expr.program, exvsp[0].expr);
1929 exval.expr = exnewnode(expr.program, ';', 1, 0, exnewnode(expr.program, ';', 1, exvsp[0].expr->type, exvsp[0].expr, NiL), NiL);
1936 exvsp[-2].expr->data.operand.right = exvsp[-2].expr->data.operand.right->data.operand.right = exnewnode(expr.program, ',', 1, exvsp[-2].expr->type, exvsp[0].expr, NiL);
1949 if (exvsp[0].id->type)
1956 exval.expr = exnewnode(expr.program, ',', 1, exvsp[0].expr->type, exvsp[0].expr, NiL);
1965 exval.expr = exvsp[-2].expr;
1966 for (x = exvsp[-2].expr; y = x->data.operand.right; x = y);
1967 x->data.operand.right = exnewnode(expr.program, ',', 1, exvsp[0].expr->type, exvsp[0].expr, NiL);
1972 {expr.declare=exvsp[0].id->type;}
1977 exval.expr = exnewnode(expr.program, ID, 0, exvsp[0].id->type, NiL, NiL);
1978 exval.expr->data.variable.symbol = exvsp[0].id;
1979 exvsp[0].id->lex = DYNAMIC;
1980 exvsp[0].id->value = exnewnode(expr.program, 0, 0, 0, NiL, NiL);
1999 r->symbol = QUALIFY(expr.lastref, exvsp[-2].id);
2004 r->symbol = exvsp[-2].id;
2009 r->index = exvsp[-1].expr;
2022 exval.expr = exnewnode(expr.program, '=', 1, exvsp[0].expr->type, NiL, exvsp[0].expr);
2023 exval.expr->subop = exvsp[-1].op;
2067 exval.expr->data.operand.left = exvsp[-5].expr;
2068 exval.expr->data.operand.right = excast(expr.program, exvsp[-1].expr, exval.expr->type, NiL, 0);
2083 exvsp -= exm;
2094 *++exvsp = exval;
2127 *++exvsp = exval;