Package erjang

Examples of erjang.ETuple.arity()


    EAtom m;
    EAtom f;
    ESeq a;
    ESeq o;
    if ((t=tup.testTuple()) == null
        || t.arity() != 4
        || (m=t.elm(1).testAtom()) == null
        || (f=t.elm(2).testAtom()) == null
        || (a=t.elm(3).testSeq()) == null
        || (o=t.elm(4).testSeq()) == null
        ) throw ERT.badarg(tup);
View Full Code Here


    // case 3: object is {name, node}
    ETuple tup;
    EAtom node;
    if ((tup=object.testTuple()) != null
      && tup.arity()==2
      && (name=tup.elm(1).testAtom()) != null
      && (node=tup.elm(2).testAtom()) != null)
    {
      if (node == ErlDist.node()) {
View Full Code Here

    EAtom name;
    EAtom node;
    if ((h=found.testHandle()) != null) {
      h.remove_monitor(self.self_handle(), r, flush);
    } else if ((tup=found.testTuple()) != null
          && tup.arity()==2
          && (name=tup.elm(1).testAtom()) != null
          && (node=tup.elm(2).testAtom()) != null) {
     
      EAbstractNode n = EAbstractNode.get_or_connect(self, node);
      if (n != null) {
View Full Code Here

    return terms.toArray(new Expr[terms.size()]);
  }

  private static Expr parse_ActionTerm(EObject action, ParseContext ctx) {
    ETuple t = action.testTuple();
    if (t != null && t.arity() >= 1 && ActionFunctions.contains(t.elm(1))) {
      return new ActionCall(t, ctx);
    } else {
      return parse_ConditionExpression(action, ctx);
    }
View Full Code Here

      return parse_ExprMatchVariable(am, ctx);

    }

    ETuple t = expr.testTuple();
    if (t != null && t.arity() >= 1 && GuardFunctions.contains(t.elm(1))) {
      return parse_MatchCondition(t, ctx);
    }

    return parse_TermConstruct(expr, ctx);
  }
View Full Code Here

    ETuple t = expr.testTuple();
    if (t != null) {

      // {const, X}
      if (t.arity() == 2 && t.elm(1) == am_const) {
        return new ConstantExpr(t.elm(2));
      }

      // {{}} | {{ConditionExpression, ...}}
      ETuple inner_t;
View Full Code Here

    return res.toArray(new GuardCall[res.size()]);
  }

  private static GuardCall parse_MatchCondition(EObject expr, ParseContext ctx) {
    ETuple t = expr.testTuple();
    if (t == null || t.arity() < 1 || !GuardFunctions.contains(t.elm(1))) {
      throw ERT.badarg(expr);
    }

    return new GuardCall(t, ctx);
  }
View Full Code Here

          return ep.value;
        }
      } else if (funs[0].head instanceof EqualsPattern) {
        EqualsPattern ep = (EqualsPattern) funs[0].head;
        ETuple tup;
        if ((tup=ep.value.testTuple()) != null && tup.arity() >= keypos1) {
          return tup.elm(keypos1);
        }
      }
    }
View Full Code Here

          newline_any = false;

        } else if (opt == am_bsr_unicode) {
          newline_any = true;

        } else if ((tup = opt.testTuple()) != null && tup.arity() == 2
            && tup.elm(1) == am_newline) {

          newline_cr = false;
          newline_crlf = false;
          newline_lf = false;
View Full Code Here

            newline_any = true;
          } else {
            return false;
          }
         
        } else if (tup != null && tup.arity() == 2 && tup.elm(1) == am_capture) {
          this.capture_spec = tup.elm(2);
          this.capture_type = am_index;

        } else if (tup != null && tup.arity() == 3 && tup.elm(1) == am_capture) {
          this.capture_spec = tup.elm(2);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.