Beispiel #1
0
void ExpressionList::markParam(int p) {
    ExpressionPtr param = (*this)[p];
    if (param->hasContext(Expression::InvokeArgument)) {
    } else if (!param->hasContext(Expression::RefParameter)) {
        param->setContext(Expression::InvokeArgument);
        param->setContext(Expression::RefValue);
    }
    param->setArgNum(p);
}
Beispiel #2
0
void Expression::setArgNum(int n) {
  m_argNum = n;
  int kc = getKidCount();
  for (int i=0; i < kc; i++) {
    ExpressionPtr kid = getNthExpr(i);
    if (kid) {
      kid->setArgNum(n);
    }
  }
}
void ExpressionList::markParam(int p, bool noRefWrapper) {
  ExpressionPtr param = (*this)[p];
  if (param->hasContext(Expression::InvokeArgument)) {
    if (noRefWrapper) {
      param->setContext(Expression::NoRefWrapper);
    } else {
      param->clearContext(Expression::NoRefWrapper);
    }
  } else if (!param->hasContext(Expression::RefParameter)) {
    param->setContext(Expression::InvokeArgument);
    param->setContext(Expression::RefValue);
    if (noRefWrapper) {
      param->setContext(Expression::NoRefWrapper);
    }
  }
  param->setArgNum(p);
}