lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hello All,

I can't figure out what  "enterlevel" function is doing here. I am  aware that the below has implicit stack. I am also aware that "nCcalls" is the number of  of nested calls.

static BinOpr subexpr (LexState *ls, expdesc *v, int limit) {
  BinOpr op;
  UnOpr uop;
  uop = getunopr(ls->t.token);
  if (uop != OPR_NOUNOPR) {
    int line = ls->linenumber;
    subexpr(ls, v, UNARY_PRIORITY);
    luaK_prefix(ls->fs, uop, v, line);
  else simpleexp(ls, v);
  /* expand while operators have priorities higher than `limit' */
  op = getbinopr(ls->t.token);
  while (op != OPR_NOBINOPR && priority[op].left > limit) {
    expdesc v2;
    BinOpr nextop;
    int line = ls->linenumber;
    luaK_infix(ls->fs, op, v);
    /* read sub-_expression_ with higher priority */
    nextop = subexpr(ls, &v2, priority[op].right);
    luaK_posfix(ls->fs, op, v, &v2, line);
    op = nextop;
  return op;  /* return first untreated operator */

Regards, Emeka
P.S Please join our groups:
 or  These are platforms for learning and sharing  of knowledge.                                                                             | Satajanus  Nig. Ltd