Examples of EAtom


Examples of erjang.EAtom

    return new EString(ref.toString());
  }
 
  @BIF
  public static EBinary atom_to_binary(EObject obj, EObject enc) {
    EAtom am = obj.testAtom();
    EAtom en = enc.testAtom();
    if (am == null || en == null) {
      throw ERT.badarg(obj, enc);
    }

    byte[] data;
View Full Code Here

Examples of erjang.EAtom

  }

  @BIF
  public static EAtom binary_to_atom(EObject obj, EObject enc) {
    EBinary bi = obj.testBinary();
    EAtom en = enc.testAtom();
    if (bi == null || en == null) {
      throw ERT.badarg(obj, enc);
    }

    byte[] data = bi.getByteArray();
View Full Code Here

Examples of erjang.EAtom

  }

  @BIF
  public static EAtom binary_to_existing_atom(EObject obj, EObject enc) {
    EBinary bi = obj.testBinary();
    EAtom en = enc.testAtom();
    if (bi == null || en == null) {
      throw ERT.badarg(obj, enc);
    }

    String name;
View Full Code Here

Examples of erjang.EAtom

    // BIFs must take EObject as arguments, not more specific
    // types. They should also be public static, so that calls to
    // it can be embedded directly in compiled code.

    // test argument types
    EAtom aname = name.testAtom();
    ESeq opts = options.testSeq();

    if (aname == null || opts == null) {
      // make sure to pass the original arguments to badarg, not
      // the converted ones. Java 'null' values are never allowed
      // in the erjang world except as a return value from type tests
      // and other guard BIFs.
      throw ERT.badarg(name, options);
    }

    // default configuration
    EAtom type = am_set;
    EAtom access = am_protected;
    int keypos = 1;
    boolean write_concurrency = false;
    boolean read_concurrency = false;
    EInternalPID heir_pid = null;
    EObject heir_data = null;
    boolean is_named = false;

    for (; !opts.isNil(); opts = opts.tail()) {
      EObject option = opts.head();

      EAtom atom;
      ETuple2 t2;
      ETuple3 t3;
      if ((atom = option.testAtom()) != null) {
        if (atom == am_bag || atom == am_duplicate_bag
            || atom == am_set || atom == am_ordered_set) {
View Full Code Here

Examples of erjang.EAtom

  /** used internally to resolve a tid|name */
  private static ETable resolve(EProc caller, EObject nameOrTid,
      boolean write_access) {

    EInteger tid = null;
    EAtom name;
    if ((name = nameOrTid.testAtom()) != null) {
      tid = name_to_tid.get(name);
    } else if ((tid = nameOrTid.testInteger()) != null) {
      // ok
    } else {
View Full Code Here

Examples of erjang.EAtom

  }

  private static ETable get_table(EObject nameOrTid) {
    ETable table = null;
    EInteger tid;
    EAtom name;
    if ((tid=nameOrTid.testInteger()) != null) {
      table = tid_to_table.get(tid);
    } else if ((name=nameOrTid.testAtom()) != null) {
      tid = name_to_tid.get(name);
      if (tid != null) {
View Full Code Here

Examples of erjang.EAtom

  //         | {scheme, Scheme=HttpString, HttpString}
  //         | {abs_path, HttpString}
  //         | HttpString

  private EObject load_uri(TCPINet desc, PacketHttpURI uri) {
    EAtom scheme = null;
    switch (uri.type) {
    case URI_STAR:
      return (EAtom)am_star;
    case URI_ABS_PATH:
      return new ETuple2(am_abs_path, load_string(desc, uri.s1_data, uri.s1_ptr, uri.s1_len));
View Full Code Here

Examples of erjang.EAtom

      // argument can be any list, ... turn it into a string
      ESeq es = name.elem2.testString();
      if (es == null) {
        ECons cons;
        EAtom am;
        if ((cons = name.elem2.testCons()) != null) {
          es = EString.make(cons);
        } else if ((am = name.elem2.testAtom()) != null) {
          es = EString.fromString(am.getName());
        } else {
          throw ERT.badarg(name, portSetting);
        }
      }
View Full Code Here

Examples of erjang.EAtom

      ETuple2 t2 = ETuple2.cast(t);
      if (t2 == null) {
        throw ERT.badarg(fun,args);
      }
     
      EAtom mn = t2.elem1.testAtom();
      EAtom fn = t2.elem2.testAtom();
     
      FunID funspec;
      f = EModuleManager.resolve(funspec=new FunID(mn,fn,a.length()));
     
      if (f == null) {
View Full Code Here

Examples of erjang.EAtom

    return new ESmall(size);
  }

  @BIF
  public static EObject apply(EProc proc, EObject one, EObject two, EObject three) throws Pausable {
    EAtom mod = one.testAtom();
    ETuple t = one.testTuple();
    JavaObject jo = one.testJavaObject();
   
    EAtom fun = two.testAtom();
    ESeq  args = three.testSeq();
   
    if ((mod==null && t == null && jo == null)||fun==null||args==null) throw ERT.badarg(one, two, three);
   
    EFun f = ERT.resolve_fun(one, fun, args.length());
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.